From 0806954e5efa9b2dd41f764fe78b750e72ac6da9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 22:05:30 +0000 Subject: [PATCH 01/51] feat(api): api update --- .stats.yml | 4 +- .../instructions/PositionInstruction.kt | 54 +++---------------- ...onCancelPositionInstructionResponseTest.kt | 9 ++-- ...tionGetPositionInstructionsResponseTest.kt | 9 ++-- ...nSubmitPositionInstructionsResponseTest.kt | 9 ++-- .../instructions/PositionInstructionTest.kt | 9 ++-- 6 files changed, 21 insertions(+), 73 deletions(-) diff --git a/.stats.yml b/.stats.yml index d96dfeb4..1765c8b3 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 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-5bf5655a3a4979ebda280ff88c4b5c0f8eeb09b23a1930959369c4752649097b.yml +openapi_spec_hash: e000330610efb4e0c660233058d6d7a9 config_hash: f2e1d4767745a6f044519331a7cbfd79 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstruction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstruction.kt index 24b3747c..8e1a7ae6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstruction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstruction.kt @@ -30,7 +30,6 @@ private constructor( private val instructionId: JsonField, private val instructionType: JsonField, private val instrumentId: JsonField, - private val osi: JsonField, private val quantity: JsonField, private val status: JsonField, private val symbol: JsonField, @@ -55,7 +54,6 @@ private constructor( @JsonProperty("instrument_id") @ExcludeMissing instrumentId: JsonField = JsonMissing.of(), - @JsonProperty("osi") @ExcludeMissing osi: JsonField = JsonMissing.of(), @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing @@ -80,7 +78,6 @@ private constructor( instructionId, instructionType, instrumentId, - osi, quantity, status, symbol, @@ -134,15 +131,6 @@ private constructor( */ fun instrumentId(): String = instrumentId.getRequired("instrument_id") - /** - * OSI option symbol (e.g. `AAPL 280121C00195000`). Display-only; resolved from the instrument - * cache. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun osi(): String = osi.getRequired("osi") - /** * Quantity of contracts. * @@ -160,8 +148,9 @@ private constructor( fun status(): PositionInstructionStatus = status.getRequired("status") /** - * Trading symbol resolved from the instrument cache. Empty if the instrument cannot be resolved - * (e.g. expired option). + * Trading symbol resolved from the instrument cache (OSI for options, since exercises are + * options-only). Empty if the instrument cannot be resolved (e.g. expired option). + * Display-only. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -249,13 +238,6 @@ private constructor( @ExcludeMissing fun _instrumentId(): JsonField = instrumentId - /** - * Returns the raw JSON value of [osi]. - * - * Unlike [osi], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("osi") @ExcludeMissing fun _osi(): JsonField = osi - /** * Returns the raw JSON value of [quantity]. * @@ -347,7 +329,6 @@ private constructor( * .instructionId() * .instructionType() * .instrumentId() - * .osi() * .quantity() * .status() * .symbol() @@ -364,7 +345,6 @@ private constructor( private var instructionId: JsonField? = null private var instructionType: JsonField? = null private var instrumentId: JsonField? = null - private var osi: JsonField? = null private var quantity: JsonField? = null private var status: JsonField? = null private var symbol: JsonField? = null @@ -382,7 +362,6 @@ private constructor( instructionId = positionInstruction.instructionId instructionType = positionInstruction.instructionType instrumentId = positionInstruction.instrumentId - osi = positionInstruction.osi quantity = positionInstruction.quantity status = positionInstruction.status symbol = positionInstruction.symbol @@ -465,20 +444,6 @@ private constructor( this.instrumentId = instrumentId } - /** - * OSI option symbol (e.g. `AAPL 280121C00195000`). Display-only; resolved from the - * instrument cache. - */ - fun osi(osi: String) = osi(JsonField.of(osi)) - - /** - * Sets [Builder.osi] to an arbitrary JSON value. - * - * You should usually call [Builder.osi] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun osi(osi: JsonField) = apply { this.osi = osi } - /** Quantity of contracts. */ fun quantity(quantity: String) = quantity(JsonField.of(quantity)) @@ -503,8 +468,9 @@ private constructor( fun status(status: JsonField) = apply { this.status = status } /** - * Trading symbol resolved from the instrument cache. Empty if the instrument cannot be - * resolved (e.g. expired option). + * Trading symbol resolved from the instrument cache (OSI for options, since exercises are + * options-only). Empty if the instrument cannot be resolved (e.g. expired option). + * Display-only. */ fun symbol(symbol: String) = symbol(JsonField.of(symbol)) @@ -629,7 +595,6 @@ private constructor( * .instructionId() * .instructionType() * .instrumentId() - * .osi() * .quantity() * .status() * .symbol() @@ -644,7 +609,6 @@ private constructor( checkRequired("instructionId", instructionId), checkRequired("instructionType", instructionType), checkRequired("instrumentId", instrumentId), - checkRequired("osi", osi), checkRequired("quantity", quantity), checkRequired("status", status), checkRequired("symbol", symbol), @@ -677,7 +641,6 @@ private constructor( instructionId() instructionType().validate() instrumentId() - osi() quantity() status().validate() symbol() @@ -709,7 +672,6 @@ private constructor( (if (instructionId.asKnown().isPresent) 1 else 0) + (instructionType.asKnown().getOrNull()?.validity() ?: 0) + (if (instrumentId.asKnown().isPresent) 1 else 0) + - (if (osi.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (symbol.asKnown().isPresent) 1 else 0) + @@ -730,7 +692,6 @@ private constructor( instructionId == other.instructionId && instructionType == other.instructionType && instrumentId == other.instrumentId && - osi == other.osi && quantity == other.quantity && status == other.status && symbol == other.symbol && @@ -749,7 +710,6 @@ private constructor( instructionId, instructionType, instrumentId, - osi, quantity, status, symbol, @@ -765,5 +725,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PositionInstruction{id=$id, accountId=$accountId, instructionId=$instructionId, instructionType=$instructionType, instrumentId=$instrumentId, osi=$osi, quantity=$quantity, status=$status, symbol=$symbol, acceptedQuantity=$acceptedQuantity, createdAt=$createdAt, error=$error, rejectionReason=$rejectionReason, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "PositionInstruction{id=$id, accountId=$accountId, instructionId=$instructionId, instructionType=$instructionType, instrumentId=$instrumentId, quantity=$quantity, status=$status, symbol=$symbol, acceptedQuantity=$acceptedQuantity, createdAt=$createdAt, error=$error, rejectionReason=$rejectionReason, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponseTest.kt index f10a8eb3..85ef87f7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponseTest.kt @@ -45,10 +45,9 @@ internal class InstructionCancelPositionInstructionResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") @@ -89,10 +88,9 @@ internal class InstructionCancelPositionInstructionResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") @@ -135,10 +133,9 @@ internal class InstructionCancelPositionInstructionResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponseTest.kt index c74dfb0d..7a405418 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponseTest.kt @@ -45,10 +45,9 @@ internal class InstructionGetPositionInstructionsResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") @@ -89,10 +88,9 @@ internal class InstructionGetPositionInstructionsResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") @@ -135,10 +133,9 @@ internal class InstructionGetPositionInstructionsResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponseTest.kt index 3067f70c..3063d076 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponseTest.kt @@ -45,10 +45,9 @@ internal class InstructionSubmitPositionInstructionsResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") @@ -89,10 +88,9 @@ internal class InstructionSubmitPositionInstructionsResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") @@ -135,10 +133,9 @@ internal class InstructionSubmitPositionInstructionsResponseTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionTest.kt index d88a0804..ed985330 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionTest.kt @@ -19,10 +19,9 @@ internal class PositionInstructionTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") @@ -37,10 +36,9 @@ internal class PositionInstructionTest { .isEqualTo(PositionInstructionType.EXERCISE) assertThat(positionInstruction.instrumentId()) .isEqualTo("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - assertThat(positionInstruction.osi()).isEqualTo("AAPL 280121C00195000") assertThat(positionInstruction.quantity()).isEqualTo("1") assertThat(positionInstruction.status()).isEqualTo(PositionInstructionStatus.SENT) - assertThat(positionInstruction.symbol()).isEqualTo("AAPL") + assertThat(positionInstruction.symbol()).isEqualTo("AAPL 280121C00195000") assertThat(positionInstruction.acceptedQuantity()).isEmpty assertThat(positionInstruction.createdAt()) .contains(OffsetDateTime.parse("2026-04-24T14:30:00Z")) @@ -60,10 +58,9 @@ internal class PositionInstructionTest { .instructionId("ui-20260424-001") .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .osi("AAPL 280121C00195000") .quantity("1") .status(PositionInstructionStatus.SENT) - .symbol("AAPL") + .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .error("error") From 892ec8e866a3b146366e8625a51eaec09b7a1bb1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 03:09:15 +0000 Subject: [PATCH 02/51] chore: redact api-key headers in debug logs --- .../com/clear_street/api/core/http/LoggingHttpClient.kt | 7 ++++--- .../clear_street/api/core/http/LoggingHttpClientTest.kt | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/LoggingHttpClient.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/LoggingHttpClient.kt index 6f121ae3..17ad6ca3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/LoggingHttpClient.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/LoggingHttpClient.kt @@ -31,7 +31,7 @@ private constructor( /** * Sensitive headers to redact from logs. * - * Defaults to `Set.of("Authorization")`. + * Defaults to `Set.of("authorization", "api-key", "x-api-key", "cookie", "set-cookie")`. */ @get:JvmName("redactedHeaders") val redactedHeaders: SortedSet, /** @@ -192,7 +192,8 @@ private constructor( class Builder internal constructor() { private var httpClient: HttpClient? = null - private var redactedHeaders: Set = setOf("Authorization") + private var redactedHeaders: Set = + setOf("authorization", "api-key", "x-api-key", "cookie", "set-cookie") private var clock: Clock = Clock.systemUTC() private var level: LogLevel? = null @@ -210,7 +211,7 @@ private constructor( /** * Sensitive headers to redact from logs. * - * Defaults to `Set.of("Authorization")`. + * Defaults to `Set.of("authorization", "api-key", "x-api-key", "cookie", "set-cookie")`. */ fun redactedHeaders(redactedHeaders: Set) = apply { this.redactedHeaders = redactedHeaders diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/LoggingHttpClientTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/LoggingHttpClientTest.kt index bf4603b2..16f6dbb9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/LoggingHttpClientTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/LoggingHttpClientTest.kt @@ -870,7 +870,8 @@ internal class LoggingHttpClientTest { httpClient: HttpClient, level: LogLevel, clock: Clock = clockFrom(Instant.parse("1998-04-21T00:00:00Z")), - redactedHeaders: Set = setOf("Authorization"), + redactedHeaders: Set = + setOf("authorization", "api-key", "x-api-key", "cookie", "set-cookie"), ): LoggingHttpClient = LoggingHttpClient.builder() .httpClient(httpClient) From 59fb6e1f85cdf39f51457aae50bcdf1f0c9721c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 14:58:53 +0000 Subject: [PATCH 03/51] feat(api): api update --- .stats.yml | 6 +- README.md | 4 +- .../api/client/ClearStreetClient.kt | 2 - .../api/client/ClearStreetClientAsync.kt | 2 - .../api/client/ClearStreetClientAsyncImpl.kt | 2 - .../api/client/ClearStreetClientImpl.kt | 2 - .../{balances => }/AccountBalances.kt | 2 +- .../{balances => }/AccountBalancesSod.kt | 2 +- ....kt => AccountGetAccountBalancesParams.kt} | 30 +- ...t => AccountGetAccountBalancesResponse.kt} | 30 +- ...kt => AccountGetPortfolioHistoryParams.kt} | 38 +- ... => AccountGetPortfolioHistoryResponse.kt} | 37 +- .../accounts/{balances => }/MarginDetails.kt | 2 +- .../{balances => }/MarginDetailsUsage.kt | 2 +- .../{balances => }/MarginTopContributor.kt | 2 +- .../v1/accounts/{balances => }/MarginType.kt | 2 +- .../PortfolioHistoryResponse.kt | 2 +- .../PortfolioHistorySegment.kt | 2 +- .../ApiVersionGetVersionParams.kt} | 28 +- .../ApiVersionGetVersionResponse.kt} | 30 +- .../v1/{version => apiversion}/Version.kt | 2 +- .../CalendarGetClockParams.kt} | 26 +- .../CalendarGetClockResponse.kt} | 30 +- .../CalendarGetMarketHoursCalendarParams.kt} | 28 +- ...CalendarGetMarketHoursCalendarResponse.kt} | 30 +- .../v1/{clock => calendar}/ClockDetail.kt | 2 +- .../markethours => calendar}/DayType.kt | 2 +- .../MarketHoursDetail.kt | 2 +- .../MarketSessionType.kt | 2 +- .../markethours => calendar}/MarketStatus.kt | 2 +- .../markethours => calendar}/MarketType.kt | 2 +- .../SessionSchedule.kt | 2 +- .../TradingSessions.kt | 2 +- .../AllEventsEventType.kt | 2 +- .../AnalystDistribution.kt | 2 +- .../AnalystRating.kt | 2 +- .../FiscalPeriodType.kt | 2 +- .../InstrumentAllEventsData.kt | 2 +- .../InstrumentAnalystConsensus.kt | 3 +- .../InstrumentBalanceSheetStatement.kt | 3 +- .../InstrumentCashFlowStatement.kt | 3 +- ...rumentDataGetAllInstrumentEventsParams.kt} | 43 +- ...mentDataGetAllInstrumentEventsResponse.kt} | 31 +- ...ataGetInstrumentAnalystConsensusParams.kt} | 36 +- ...aGetInstrumentAnalystConsensusResponse.kt} | 32 +- ...InstrumentBalanceSheetStatementsParams.kt} | 40 +- ...strumentBalanceSheetStatementsResponse.kt} | 32 +- ...aGetInstrumentCashFlowStatementsParams.kt} | 39 +- ...etInstrumentCashFlowStatementsResponse.kt} | 33 +- ...nstrumentDataGetInstrumentEventsParams.kt} | 36 +- ...trumentDataGetInstrumentEventsResponse.kt} | 37 +- ...entDataGetInstrumentFundamentalsParams.kt} | 29 +- ...tDataGetInstrumentFundamentalsResponse.kt} | 32 +- ...ataGetInstrumentIncomeStatementsParams.kt} | 39 +- ...aGetInstrumentIncomeStatementsResponse.kt} | 32 +- .../InstrumentDividendEvent.kt | 2 +- .../InstrumentEarnings.kt | 2 +- .../InstrumentEventEnvelope.kt | 3 +- .../InstrumentEventIpoItem.kt | 2 +- .../InstrumentEventsByDate.kt | 2 +- .../InstrumentEventsData.kt | 3 +- .../InstrumentFundamentals.kt | 2 +- .../InstrumentIncomeStatement.kt | 3 +- .../InstrumentSplitEvent.kt | 2 +- .../PriceTarget.kt | 2 +- .../marketdata}/DailySummary.kt | 2 +- .../MarketDataGetDailySummariesParams.kt} | 33 +- .../MarketDataGetDailySummariesResponse.kt} | 30 +- .../MarketDataGetSnapshotsParams.kt} | 28 +- .../MarketDataGetSnapshotsResponse.kt} | 32 +- .../marketdata}/MarketDataSnapshot.kt | 2 +- .../marketdata}/SnapshotLastTrade.kt | 2 +- .../marketdata}/SnapshotQuote.kt | 2 +- .../marketdata}/SnapshotSession.kt | 2 +- .../news/NewsGetNewsParams.kt | 2 +- .../news/NewsGetNewsResponse.kt | 2 +- .../news/NewsInstrument.kt | 2 +- .../v1/{ => instrumentdata}/news/NewsItem.kt | 2 +- .../v1/{ => instrumentdata}/news/NewsType.kt | 2 +- ... => InstrumentGetOptionContractsParams.kt} | 43 +- ...> InstrumentGetOptionContractsResponse.kt} | 38 +- .../v1/omniai/OpenEntitlementConsentAction.kt | 2 + .../v1/omniai/PrefillCancelOrderAction.kt | 2 +- .../models/v1/omniai/PrefillNewOrderAction.kt | 2 +- .../models/v1/omniai/PrefillOrderAction.kt | 4 +- .../EntitlementAgreementKey.kt | 2 +- .../EntitlementAgreementResource.kt | 4 +- .../{ => entitlements}/EntitlementCode.kt | 2 +- .../EntitlementCreateEntitlementsParams.kt | 1 - ...itlementGetEntitlementAgreementsParams.kt} | 28 +- ...lementGetEntitlementAgreementsResponse.kt} | 33 +- .../entitlements/EntitlementResource.kt | 1 - .../{ => messages}/CreateFeedbackResponse.kt | 2 +- .../messages/MessageGetMessageByIdResponse.kt | 2 +- .../messages/MessageSubmitFeedbackResponse.kt | 1 - .../{ => responses}/CancelResponsePayload.kt | 2 +- .../v1/omniai/{ => responses}/ErrorStatus.kt | 2 +- .../v1/omniai/{ => responses}/Response.kt | 2 +- .../ResponseCancelResponseResponse.kt | 1 - .../omniai/{ => responses}/ResponseContent.kt | 2 +- .../{ => responses}/ResponseContentPart.kt | 11 +- .../ResponseGetResponseByIdResponse.kt | 1 - .../omniai/{ => responses}/ResponseStatus.kt | 2 +- .../{ => threads}/CreateMessageResponse.kt | 2 +- .../{ => threads}/CreateThreadResponse.kt | 2 +- .../models/v1/omniai/{ => threads}/Message.kt | 3 +- .../v1/omniai/{ => threads}/MessageContent.kt | 2 +- .../{ => threads}/MessageContentPart.kt | 10 +- .../v1/omniai/{ => threads}/MessageOutcome.kt | 2 +- .../v1/omniai/{ => threads}/MessageRole.kt | 2 +- .../models/v1/omniai/{ => threads}/Thread.kt | 2 +- ...Params.kt => ThreadCreateMessageParams.kt} | 28 +- ...onse.kt => ThreadCreateMessageResponse.kt} | 31 +- .../threads/ThreadCreateThreadResponse.kt | 1 - ...esParams.kt => ThreadGetMessagesParams.kt} | 32 +- ...sponse.kt => ThreadGetMessagesResponse.kt} | 31 +- .../threads/ThreadGetThreadByIdResponse.kt | 1 - .../ThreadGetThreadResponseResponse.kt | 2 +- .../threads/ThreadGetThreadsResponse.kt | 1 - .../orders/CancelOrderRequest.kt | 2 +- .../{accounts => }/orders/NewOrderRequest.kt | 2 +- .../models/v1/{accounts => }/orders/Order.kt | 2 +- .../orders/OrderCancelAllOpenOrdersParams.kt | 2 +- .../OrderCancelAllOpenOrdersResponse.kt | 2 +- .../orders/OrderCancelOpenOrderParams.kt | 2 +- .../orders/OrderCancelOpenOrderResponse.kt | 2 +- .../orders/OrderGetOrderByIdParams.kt | 2 +- .../orders/OrderGetOrderByIdResponse.kt | 2 +- .../orders/OrderGetOrdersParams.kt | 2 +- .../orders/OrderGetOrdersResponse.kt | 2 +- .../orders/OrderReplaceOrderParams.kt | 2 +- .../orders/OrderReplaceOrderResponse.kt | 2 +- .../v1/{accounts => }/orders/OrderStatus.kt | 2 +- .../orders/OrderSubmitOrdersParams.kt | 2 +- .../orders/OrderSubmitOrdersResponse.kt | 2 +- .../v1/{accounts => }/orders/OrderType.kt | 2 +- .../{accounts => }/orders/PositionEffect.kt | 2 +- .../v1/{accounts => }/orders/QueueState.kt | 2 +- .../{accounts => }/orders/RequestOrderType.kt | 2 +- .../orders/RequestTimeInForce.kt | 2 +- .../models/v1/{accounts => }/orders/Side.kt | 2 +- .../v1/{accounts => }/orders/TimeInForce.kt | 2 +- .../orders/TrailingOffsetType.kt | 2 +- .../v1/{accounts => }/positions/Position.kt | 2 +- ...ositionCancelPositionInstructionParams.kt} | 30 +- ...itionCancelPositionInstructionResponse.kt} | 31 +- .../positions/PositionClosePositionParams.kt | 2 +- .../PositionClosePositionResponse.kt | 4 +- .../positions/PositionClosePositionsParams.kt | 2 +- .../PositionClosePositionsResponse.kt | 4 +- .../PositionGetPositionInstructionsParams.kt} | 31 +- ...ositionGetPositionInstructionsResponse.kt} | 31 +- .../positions/PositionGetPositionsParams.kt | 2 +- .../positions/PositionGetPositionsResponse.kt | 2 +- .../PositionInstruction.kt | 2 +- .../PositionInstructionStatus.kt | 2 +- .../PositionInstructionType.kt | 2 +- ...sitionSubmitPositionInstructionsParams.kt} | 28 +- ...tionSubmitPositionInstructionsResponse.kt} | 30 +- .../{accounts => }/positions/PositionType.kt | 2 +- .../AddWatchlistItemData.kt | 2 +- .../WatchlistAddWatchlistItemParams.kt} | 33 +- .../WatchlistAddWatchlistItemResponse.kt} | 35 +- .../WatchlistCreateWatchlistParams.kt | 2 +- .../WatchlistCreateWatchlistResponse.kt | 2 +- .../WatchlistDeleteWatchlistItemParams.kt} | 36 +- .../WatchlistDeleteWatchlistItemResponse.kt} | 31 +- .../WatchlistDeleteWatchlistParams.kt | 2 +- .../WatchlistDeleteWatchlistResponse.kt | 2 +- .../WatchlistDetail.kt | 2 +- .../WatchlistEntry.kt | 2 +- .../WatchlistGetWatchlistByIdParams.kt | 2 +- .../WatchlistGetWatchlistByIdResponse.kt | 2 +- .../WatchlistGetWatchlistsParams.kt | 2 +- .../WatchlistGetWatchlistsResponse.kt | 2 +- .../WatchlistItemEntry.kt | 2 +- .../WebsocketWebsocketHandlerParams.kt} | 36 +- .../api/services/async/V1ServiceAsync.kt | 109 +-- .../api/services/async/V1ServiceAsyncImpl.kt | 176 ++-- .../services/async/v1/AccountServiceAsync.kt | 154 +++- .../async/v1/AccountServiceAsyncImpl.kt | 137 +-- ...viceAsync.kt => ApiVersionServiceAsync.kt} | 49 +- ...cImpl.kt => ApiVersionServiceAsyncImpl.kt} | 34 +- .../services/async/v1/CalendarServiceAsync.kt | 85 +- .../async/v1/CalendarServiceAsyncImpl.kt | 104 ++- .../services/async/v1/ClockServiceAsync.kt | 83 -- .../async/v1/InstrumentDataServiceAsync.kt | 809 +++++++++++++++++ .../v1/InstrumentDataServiceAsyncImpl.kt | 402 +++++++++ .../async/v1/InstrumentServiceAsync.kt | 106 +-- .../async/v1/InstrumentServiceAsyncImpl.kt | 152 +--- .../async/v1/MarketDataServiceAsync.kt | 51 -- .../async/v1/MarketDataServiceAsyncImpl.kt | 60 -- .../services/async/v1/OmniAiServiceAsync.kt | 17 - .../async/v1/OmniAiServiceAsyncImpl.kt | 28 - .../v1/{accounts => }/OrderServiceAsync.kt | 26 +- .../{accounts => }/OrderServiceAsyncImpl.kt | 26 +- .../services/async/v1/PositionServiceAsync.kt | 508 +++++++++++ .../PositionServiceAsyncImpl.kt | 180 +++- .../async/v1/WatchlistServiceAsync.kt | 137 ++- .../async/v1/WatchlistServiceAsyncImpl.kt | 118 ++- .../async/v1/WebsocketServiceAsync.kt | 82 ++ ...ncImpl.kt => WebsocketServiceAsyncImpl.kt} | 55 +- .../async/v1/accounts/BalanceServiceAsync.kt | 123 --- .../v1/accounts/BalanceServiceAsyncImpl.kt | 90 -- .../accounts/PortfolioHistoryServiceAsync.kt | 100 --- .../PortfolioHistoryServiceAsyncImpl.kt | 93 -- .../async/v1/accounts/PositionServiceAsync.kt | 280 ------ .../positions/InstructionServiceAsync.kt | 277 ------ .../positions/InstructionServiceAsyncImpl.kt | 201 ----- .../v1/calendars/MarketHourServiceAsync.kt | 73 -- .../calendars/MarketHourServiceAsyncImpl.kt | 86 -- .../instrumentdata/MarketDataServiceAsync.kt | 132 +++ .../MarketDataServiceAsyncImpl.kt} | 83 +- .../{ => instrumentdata}/NewsServiceAsync.kt | 8 +- .../NewsServiceAsyncImpl.kt | 8 +- .../AnalystReportingServiceAsync.kt | 159 ---- .../AnalystReportingServiceAsyncImpl.kt | 99 --- .../instruments/BalanceSheetServiceAsync.kt | 169 ---- .../BalanceSheetServiceAsyncImpl.kt | 97 -- .../CashFlowStatementServiceAsync.kt | 166 ---- .../CashFlowStatementServiceAsyncImpl.kt | 104 --- .../async/v1/instruments/EventServiceAsync.kt | 187 ---- .../v1/instruments/FundamentalServiceAsync.kt | 147 ---- .../FundamentalServiceAsyncImpl.kt | 91 -- .../IncomeStatementServiceAsync.kt | 165 ---- .../IncomeStatementServiceAsyncImpl.kt | 99 --- .../v1/instruments/OptionServiceAsync.kt | 95 -- .../v1/instruments/OptionServiceAsyncImpl.kt | 85 -- .../v1/marketdata/DailySummaryServiceAsync.kt | 83 -- .../DailySummaryServiceAsyncImpl.kt | 85 -- .../v1/marketdata/SnapshotServiceAsync.kt | 88 -- .../v1/marketdata/SnapshotServiceAsyncImpl.kt | 85 -- .../EntitlementAgreementServiceAsync.kt | 111 --- .../EntitlementAgreementServiceAsyncImpl.kt | 100 --- .../v1/omniai/EntitlementServiceAsync.kt | 57 ++ .../v1/omniai/EntitlementServiceAsyncImpl.kt | 40 + .../async/v1/omniai/ThreadServiceAsync.kt | 139 ++- .../async/v1/omniai/ThreadServiceAsyncImpl.kt | 105 ++- .../v1/omniai/threads/MessageServiceAsync.kt | 181 ---- .../omniai/threads/MessageServiceAsyncImpl.kt | 139 --- .../async/v1/watchlists/ItemServiceAsync.kt | 154 ---- .../v1/watchlists/ItemServiceAsyncImpl.kt | 141 --- .../api/services/blocking/V1Service.kt | 110 +-- .../api/services/blocking/V1ServiceImpl.kt | 167 ++-- .../services/blocking/v1/AccountService.kt | 162 +++- .../blocking/v1/AccountServiceImpl.kt | 130 +-- .../services/blocking/v1/ApiVersionService.kt | 86 ++ ...erviceImpl.kt => ApiVersionServiceImpl.kt} | 34 +- .../services/blocking/v1/CalendarService.kt | 87 +- .../blocking/v1/CalendarServiceImpl.kt | 95 +- .../api/services/blocking/v1/ClockService.kt | 81 -- .../blocking/v1/InstrumentDataService.kt | 827 ++++++++++++++++++ .../blocking/v1/InstrumentDataServiceImpl.kt | 364 ++++++++ .../services/blocking/v1/InstrumentService.kt | 106 +-- .../blocking/v1/InstrumentServiceImpl.kt | 145 +-- .../services/blocking/v1/MarketDataService.kt | 48 - .../blocking/v1/MarketDataServiceImpl.kt | 58 -- .../api/services/blocking/v1/OmniAiService.kt | 17 - .../services/blocking/v1/OmniAiServiceImpl.kt | 27 - .../v1/{accounts => }/OrderService.kt | 26 +- .../v1/{accounts => }/OrderServiceImpl.kt | 26 +- .../services/blocking/v1/PositionService.kt | 520 +++++++++++ .../blocking/v1/PositionServiceImpl.kt | 314 +++++++ .../services/blocking/v1/VersionService.kt | 82 -- .../services/blocking/v1/WatchlistService.kt | 143 ++- .../blocking/v1/WatchlistServiceImpl.kt | 112 ++- .../services/blocking/v1/WebsocketService.kt | 81 ++ ...ServiceImpl.kt => WebsocketServiceImpl.kt} | 56 +- .../blocking/v1/accounts/BalanceService.kt | 124 --- .../v1/accounts/BalanceServiceImpl.kt | 86 -- .../v1/accounts/PortfolioHistoryService.kt | 104 --- .../accounts/PortfolioHistoryServiceImpl.kt | 87 -- .../blocking/v1/accounts/PositionService.kt | 280 ------ .../v1/accounts/PositionServiceImpl.kt | 187 ---- .../accounts/positions/InstructionService.kt | 288 ------ .../positions/InstructionServiceImpl.kt | 189 ---- .../v1/calendars/MarketHourService.kt | 72 -- .../v1/calendars/MarketHourServiceImpl.kt | 82 -- .../v1/instrumentdata/MarketDataService.kt | 131 +++ .../MarketDataServiceImpl.kt} | 83 +- .../v1/{ => instrumentdata}/NewsService.kt | 8 +- .../{ => instrumentdata}/NewsServiceImpl.kt | 8 +- .../v1/instruments/AnalystReportingService.kt | 156 ---- .../AnalystReportingServiceImpl.kt | 89 -- .../v1/instruments/BalanceSheetService.kt | 164 ---- .../v1/instruments/BalanceSheetServiceImpl.kt | 89 -- .../instruments/CashFlowStatementService.kt | 162 ---- .../CashFlowStatementServiceImpl.kt | 94 -- .../blocking/v1/instruments/EventService.kt | 190 ---- .../v1/instruments/FundamentalService.kt | 152 ---- .../v1/instruments/FundamentalServiceImpl.kt | 87 -- .../v1/instruments/IncomeStatementService.kt | 163 ---- .../instruments/IncomeStatementServiceImpl.kt | 89 -- .../blocking/v1/instruments/OptionService.kt | 91 -- .../v1/instruments/OptionServiceImpl.kt | 81 -- .../v1/marketdata/DailySummaryService.kt | 83 -- .../v1/marketdata/DailySummaryServiceImpl.kt | 81 -- .../blocking/v1/marketdata/SnapshotService.kt | 86 -- .../v1/marketdata/SnapshotServiceImpl.kt | 81 -- .../v1/omniai/EntitlementAgreementService.kt | 110 --- .../omniai/EntitlementAgreementServiceImpl.kt | 91 -- .../blocking/v1/omniai/EntitlementService.kt | 61 ++ .../v1/omniai/EntitlementServiceImpl.kt | 37 + .../blocking/v1/omniai/ThreadService.kt | 141 ++- .../blocking/v1/omniai/ThreadServiceImpl.kt | 99 ++- .../v1/omniai/threads/MessageService.kt | 179 ---- .../v1/omniai/threads/MessageServiceImpl.kt | 132 --- .../blocking/v1/watchlists/ItemService.kt | 157 ---- .../blocking/v1/watchlists/ItemServiceImpl.kt | 133 --- .../models/v1/V1WebsocketHandlerParamsTest.kt | 13 - .../{balances => }/AccountBalancesSodTest.kt | 2 +- .../{balances => }/AccountBalancesTest.kt | 2 +- ...=> AccountGetAccountBalancesParamsTest.kt} | 12 +- ... AccountGetAccountBalancesResponseTest.kt} | 28 +- ...> AccountGetPortfolioHistoryParamsTest.kt} | 12 +- ...AccountGetPortfolioHistoryResponseTest.kt} | 28 +- .../{balances => }/MarginDetailsTest.kt | 2 +- .../{balances => }/MarginDetailsUsageTest.kt | 2 +- .../MarginTopContributorTest.kt | 2 +- .../PortfolioHistoryResponseTest.kt | 2 +- .../PortfolioHistorySegmentTest.kt | 2 +- .../ApiVersionGetVersionParamsTest.kt | 13 + .../ApiVersionGetVersionResponseTest.kt} | 26 +- .../v1/{version => apiversion}/VersionTest.kt | 2 +- .../v1/calendar/CalendarGetClockParamsTest.kt | 13 + .../CalendarGetClockResponseTest.kt} | 26 +- ...lendarGetMarketHoursCalendarParamsTest.kt} | 10 +- ...ndarGetMarketHoursCalendarResponseTest.kt} | 28 +- .../v1/{clock => calendar}/ClockDetailTest.kt | 2 +- .../MarketHoursDetailTest.kt | 2 +- .../MarketStatusTest.kt | 2 +- .../SessionScheduleTest.kt | 2 +- .../TradingSessionsTest.kt | 2 +- .../v1/clock/ClockGetClockParamsTest.kt | 13 - .../AnalystDistributionTest.kt | 2 +- .../InstrumentAllEventsDataTest.kt | 3 +- .../InstrumentAnalystConsensusTest.kt | 3 +- .../InstrumentBalanceSheetStatementTest.kt | 3 +- .../InstrumentCashFlowStatementTest.kt | 3 +- ...ntDataGetAllInstrumentEventsParamsTest.kt} | 10 +- ...DataGetAllInstrumentEventsResponseTest.kt} | 29 +- ...etInstrumentAnalystConsensusParamsTest.kt} | 12 +- ...InstrumentAnalystConsensusResponseTest.kt} | 31 +- ...rumentBalanceSheetStatementsParamsTest.kt} | 12 +- ...mentBalanceSheetStatementsResponseTest.kt} | 29 +- ...InstrumentCashFlowStatementsParamsTest.kt} | 12 +- ...strumentCashFlowStatementsResponseTest.kt} | 29 +- ...umentDataGetInstrumentEventsParamsTest.kt} | 12 +- ...entDataGetInstrumentEventsResponseTest.kt} | 29 +- ...ataGetInstrumentFundamentalsParamsTest.kt} | 8 +- ...aGetInstrumentFundamentalsResponseTest.kt} | 28 +- ...etInstrumentIncomeStatementsParamsTest.kt} | 12 +- ...InstrumentIncomeStatementsResponseTest.kt} | 29 +- .../InstrumentDividendEventTest.kt | 2 +- .../InstrumentEarningsTest.kt | 2 +- .../InstrumentEventEnvelopeTest.kt | 3 +- .../InstrumentEventIpoItemTest.kt | 2 +- .../InstrumentEventsByDateTest.kt | 3 +- .../InstrumentEventsDataTest.kt | 3 +- .../InstrumentFundamentalsTest.kt | 2 +- .../InstrumentIncomeStatementTest.kt | 3 +- .../InstrumentSplitEventTest.kt | 2 +- .../PriceTargetTest.kt | 2 +- .../marketdata}/DailySummaryTest.kt | 2 +- .../MarketDataGetDailySummariesParamsTest.kt} | 8 +- ...arketDataGetDailySummariesResponseTest.kt} | 28 +- .../MarketDataGetSnapshotsParamsTest.kt} | 10 +- .../MarketDataGetSnapshotsResponseTest.kt} | 27 +- .../marketdata}/MarketDataSnapshotTest.kt | 2 +- .../marketdata}/SnapshotLastTradeTest.kt | 2 +- .../marketdata}/SnapshotQuoteTest.kt | 2 +- .../marketdata}/SnapshotSessionTest.kt | 2 +- .../news/NewsGetNewsParamsTest.kt | 2 +- .../news/NewsGetNewsResponseTest.kt | 2 +- .../news/NewsInstrumentTest.kt | 2 +- .../{ => instrumentdata}/news/NewsItemTest.kt | 2 +- ...InstrumentGetOptionContractsParamsTest.kt} | 11 +- ...strumentGetOptionContractsResponseTest.kt} | 32 +- .../ContentPartStructuredActionPayloadTest.kt | 12 +- .../OpenEntitlementConsentActionTest.kt | 2 + .../v1/omniai/PrefillCancelOrderActionTest.kt | 2 +- .../v1/omniai/PrefillNewOrderActionTest.kt | 12 +- .../v1/omniai/PrefillOrderActionTest.kt | 14 +- .../models/v1/omniai/StructuredActionTest.kt | 14 +- ...ementGetEntitlementAgreementsParamsTest.kt | 13 - .../EntitlementAgreementResourceTest.kt | 4 +- ...EntitlementCreateEntitlementsParamsTest.kt | 1 - ...titlementCreateEntitlementsResponseTest.kt | 1 - ...ementGetEntitlementAgreementsParamsTest.kt | 13 + ...ntGetEntitlementAgreementsResponseTest.kt} | 30 +- .../EntitlementGetEntitlementsResponseTest.kt | 1 - .../entitlements/EntitlementResourceTest.kt | 1 - .../CreateFeedbackResponseTest.kt | 2 +- .../MessageGetMessageByIdResponseTest.kt | 12 +- .../MessageSubmitFeedbackResponseTest.kt | 1 - .../CancelResponsePayloadTest.kt | 2 +- .../omniai/{ => responses}/ErrorStatusTest.kt | 2 +- .../ResponseCancelResponseResponseTest.kt | 1 - .../ResponseContentPartTest.kt | 25 +- .../{ => responses}/ResponseContentTest.kt | 2 +- .../ResponseGetResponseByIdResponseTest.kt | 5 - .../v1/omniai/{ => responses}/ResponseTest.kt | 2 +- .../CreateMessageResponseTest.kt | 2 +- .../{ => threads}/CreateThreadResponseTest.kt | 2 +- .../{ => threads}/MessageContentPartTest.kt | 25 +- .../{ => threads}/MessageContentTest.kt | 2 +- .../v1/omniai/{ => threads}/MessageTest.kt | 3 +- ...st.kt => ThreadCreateMessageParamsTest.kt} | 18 +- ....kt => ThreadCreateMessageResponseTest.kt} | 27 +- .../threads/ThreadCreateThreadResponseTest.kt | 1 - ...Test.kt => ThreadGetMessagesParamsTest.kt} | 12 +- ...st.kt => ThreadGetMessagesResponseTest.kt} | 33 +- .../ThreadGetThreadByIdResponseTest.kt | 1 - .../ThreadGetThreadResponseResponseTest.kt | 10 +- .../threads/ThreadGetThreadsResponseTest.kt | 1 - .../v1/omniai/{ => threads}/ThreadTest.kt | 2 +- .../orders/CancelOrderRequestTest.kt | 2 +- .../orders/NewOrderRequestTest.kt | 2 +- .../OrderCancelAllOpenOrdersParamsTest.kt | 2 +- .../OrderCancelAllOpenOrdersResponseTest.kt | 2 +- .../orders/OrderCancelOpenOrderParamsTest.kt | 2 +- .../OrderCancelOpenOrderResponseTest.kt | 2 +- .../orders/OrderGetOrderByIdParamsTest.kt | 2 +- .../orders/OrderGetOrderByIdResponseTest.kt | 2 +- .../orders/OrderGetOrdersParamsTest.kt | 2 +- .../orders/OrderGetOrdersResponseTest.kt | 2 +- .../orders/OrderReplaceOrderParamsTest.kt | 2 +- .../orders/OrderReplaceOrderResponseTest.kt | 2 +- .../orders/OrderSubmitOrdersParamsTest.kt | 2 +- .../orders/OrderSubmitOrdersResponseTest.kt | 2 +- .../v1/{accounts => }/orders/OrderTest.kt | 2 +- ...ionCancelPositionInstructionParamsTest.kt} | 8 +- ...nCancelPositionInstructionResponseTest.kt} | 28 +- .../PositionClosePositionParamsTest.kt | 2 +- .../PositionClosePositionResponseTest.kt | 16 +- .../PositionClosePositionsParamsTest.kt | 2 +- .../PositionClosePositionsResponseTest.kt | 16 +- ...itionGetPositionInstructionsParamsTest.kt} | 12 +- ...ionGetPositionInstructionsResponseTest.kt} | 28 +- .../PositionGetPositionsParamsTest.kt | 2 +- .../PositionGetPositionsResponseTest.kt | 2 +- .../PositionInstructionTest.kt | 2 +- ...onSubmitPositionInstructionsParamsTest.kt} | 24 +- ...SubmitPositionInstructionsResponseTest.kt} | 28 +- .../{accounts => }/positions/PositionTest.kt | 2 +- .../v1/version/VersionGetVersionParamsTest.kt | 13 - .../AddWatchlistItemDataTest.kt | 2 +- .../WatchlistAddWatchlistItemParamsTest.kt} | 10 +- .../WatchlistAddWatchlistItemResponseTest.kt} | 27 +- .../WatchlistCreateWatchlistParamsTest.kt | 2 +- .../WatchlistCreateWatchlistResponseTest.kt | 2 +- ...WatchlistDeleteWatchlistItemParamsTest.kt} | 8 +- ...atchlistDeleteWatchlistItemResponseTest.kt | 33 + .../WatchlistDeleteWatchlistParamsTest.kt | 2 +- .../WatchlistDeleteWatchlistResponseTest.kt | 2 +- .../WatchlistDetailTest.kt | 2 +- .../WatchlistEntryTest.kt | 2 +- .../WatchlistGetWatchlistByIdParamsTest.kt | 2 +- .../WatchlistGetWatchlistByIdResponseTest.kt | 2 +- .../WatchlistGetWatchlistsParamsTest.kt | 2 +- .../WatchlistGetWatchlistsResponseTest.kt | 2 +- .../WatchlistItemEntryTest.kt | 2 +- .../ItemDeleteWatchlistItemResponseTest.kt | 31 - .../WebsocketWebsocketHandlerParamsTest.kt | 13 + .../async/v1/AccountServiceAsyncTest.kt | 40 + ...cTest.kt => ApiVersionServiceAsyncTest.kt} | 6 +- .../async/v1/CalendarServiceAsyncTest.kt | 42 + .../async/v1/ClockServiceAsyncTest.kt | 22 - .../v1/InstrumentDataServiceAsyncTest.kt | 154 ++++ .../async/v1/InstrumentServiceAsyncTest.kt | 25 + .../{accounts => }/OrderServiceAsyncTest.kt | 34 +- .../async/v1/PositionServiceAsyncTest.kt | 134 +++ .../async/v1/WatchlistServiceAsyncTest.kt | 50 +- .../WebsocketServiceAsyncTest.kt} | 8 +- .../v1/accounts/BalanceServiceAsyncTest.kt | 29 - .../PortfolioHistoryServiceAsyncTest.kt | 31 - .../v1/accounts/PositionServiceAsyncTest.kt | 69 -- .../positions/InstructionServiceAsyncTest.kt | 75 -- .../calendars/MarketHourServiceAsyncTest.kt | 30 - .../MarketDataServiceAsyncTest.kt | 44 + .../NewsServiceAsyncTest.kt | 6 +- .../AnalystReportingServiceAsyncTest.kt | 31 - .../BalanceSheetServiceAsyncTest.kt | 32 - .../CashFlowStatementServiceAsyncTest.kt | 32 - .../v1/instruments/EventServiceAsyncTest.kt | 52 -- .../FundamentalServiceAsyncTest.kt | 25 - .../IncomeStatementServiceAsyncTest.kt | 32 - .../v1/instruments/OptionServiceAsyncTest.kt | 35 - .../DailySummaryServiceAsyncTest.kt | 28 - .../v1/marketdata/SnapshotServiceAsyncTest.kt | 28 - .../EntitlementAgreementServiceAsyncTest.kt | 22 - .../v1/omniai/EntitlementServiceAsyncTest.kt | 14 +- .../async/v1/omniai/ThreadServiceAsyncTest.kt | 42 + .../omniai/threads/MessageServiceAsyncTest.kt | 52 -- .../v1/watchlists/ItemServiceAsyncTest.kt | 48 - .../api/services/blocking/V1ServiceTest.kt | 19 - .../blocking/v1/AccountServiceTest.kt | 38 + ...erviceTest.kt => ApiVersionServiceTest.kt} | 6 +- .../blocking/v1/CalendarServiceTest.kt | 40 + .../blocking/v1/InstrumentDataServiceTest.kt | 145 +++ .../blocking/v1/InstrumentServiceTest.kt | 24 + .../v1/{accounts => }/OrderServiceTest.kt | 34 +- .../blocking/v1/PositionServiceTest.kt | 128 +++ .../blocking/v1/WatchlistServiceTest.kt | 48 +- ...ServiceTest.kt => WebsocketServiceTest.kt} | 10 +- .../v1/accounts/BalanceServiceTest.kt | 28 - .../accounts/PortfolioHistoryServiceTest.kt | 30 - .../v1/accounts/PositionServiceTest.kt | 66 -- .../positions/InstructionServiceTest.kt | 72 -- .../v1/calendars/MarketHourServiceTest.kt | 29 - .../instrumentdata/MarketDataServiceTest.kt | 42 + .../{ => instrumentdata}/NewsServiceTest.kt | 6 +- .../AnalystReportingServiceTest.kt | 30 - .../v1/instruments/BalanceSheetServiceTest.kt | 31 - .../CashFlowStatementServiceTest.kt | 31 - .../v1/instruments/EventServiceTest.kt | 50 -- .../v1/instruments/FundamentalServiceTest.kt | 22 - .../instruments/IncomeStatementServiceTest.kt | 31 - .../v1/instruments/OptionServiceTest.kt | 34 - .../v1/marketdata/DailySummaryServiceTest.kt | 27 - .../v1/marketdata/SnapshotServiceTest.kt | 27 - .../omniai/EntitlementAgreementServiceTest.kt | 21 - .../v1/omniai/EntitlementServiceTest.kt | 13 +- .../blocking/v1/omniai/ThreadServiceTest.kt | 40 + .../v1/omniai/threads/MessageServiceTest.kt | 50 -- .../blocking/v1/watchlists/ItemServiceTest.kt | 46 - .../api/proguard/ProGuardCompatibilityTest.kt | 49 +- 527 files changed, 9645 insertions(+), 13221 deletions(-) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/AccountBalances.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/AccountBalancesSod.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{balances/BalanceGetAccountBalancesParams.kt => AccountGetAccountBalancesParams.kt} (90%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{balances/BalanceGetAccountBalancesResponse.kt => AccountGetAccountBalancesResponse.kt} (91%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{portfoliohistory/PortfolioHistoryGetPortfolioHistoryParams.kt => AccountGetPortfolioHistoryParams.kt} (85%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{portfoliohistory/PortfolioHistoryGetPortfolioHistoryResponse.kt => AccountGetPortfolioHistoryResponse.kt} (87%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/MarginDetails.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/MarginDetailsUsage.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/MarginTopContributor.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/MarginType.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{portfoliohistory => }/PortfolioHistoryResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/{portfoliohistory => }/PortfolioHistorySegment.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{version/VersionGetVersionParams.kt => apiversion/ApiVersionGetVersionParams.kt} (84%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{version/VersionGetVersionResponse.kt => apiversion/ApiVersionGetVersionResponse.kt} (90%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{version => apiversion}/Version.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{clock/ClockGetClockParams.kt => calendar/CalendarGetClockParams.kt} (86%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{clock/ClockGetClockResponse.kt => calendar/CalendarGetClockResponse.kt} (91%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours/MarketHourGetMarketHoursCalendarParams.kt => calendar/CalendarGetMarketHoursCalendarParams.kt} (87%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours/MarketHourGetMarketHoursCalendarResponse.kt => calendar/CalendarGetMarketHoursCalendarResponse.kt} (89%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{clock => calendar}/ClockDetail.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/DayType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/MarketHoursDetail.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/MarketSessionType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/MarketStatus.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/MarketType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/SessionSchedule.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/TradingSessions.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/AllEventsEventType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting => instrumentdata}/AnalystDistribution.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments => instrumentdata}/AnalystRating.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments => instrumentdata}/FiscalPeriodType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentAllEventsData.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting => instrumentdata}/InstrumentAnalystConsensus.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/balancesheets => instrumentdata}/InstrumentBalanceSheetStatement.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/cashflowstatements => instrumentdata}/InstrumentCashFlowStatement.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events/EventGetAllInstrumentEventsParams.kt => instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt} (86%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events/EventGetAllInstrumentEventsResponse.kt => instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt} (88%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusParams.kt => instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt} (84%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusResponse.kt => instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt} (87%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsParams.kt => instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt} (84%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsResponse.kt => instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt} (88%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsParams.kt => instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt} (85%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsResponse.kt => instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt} (87%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events/EventGetInstrumentEventsParams.kt => instrumentdata/InstrumentDataGetInstrumentEventsParams.kt} (85%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events/EventGetInstrumentEventsResponse.kt => instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt} (88%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/fundamentals/FundamentalGetInstrumentFundamentalsParams.kt => instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt} (84%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/fundamentals/FundamentalGetInstrumentFundamentalsResponse.kt => instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt} (88%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsParams.kt => instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt} (85%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsResponse.kt => instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt} (88%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentDividendEvent.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments => instrumentdata}/InstrumentEarnings.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentEventEnvelope.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentEventIpoItem.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentEventsByDate.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentEventsData.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/fundamentals => instrumentdata}/InstrumentFundamentals.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/incomestatements => instrumentdata}/InstrumentIncomeStatement.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentSplitEvent.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting => instrumentdata}/PriceTarget.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/dailysummary => instrumentdata/marketdata}/DailySummary.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/dailysummary/DailySummaryGetDailySummariesParams.kt => instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt} (87%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/dailysummary/DailySummaryGetDailySummariesResponse.kt => instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt} (89%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot/SnapshotGetSnapshotsParams.kt => instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt} (87%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot/SnapshotGetSnapshotsResponse.kt => instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt} (90%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot => instrumentdata/marketdata}/MarketDataSnapshot.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot => instrumentdata/marketdata}/SnapshotLastTrade.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot => instrumentdata/marketdata}/SnapshotQuote.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot => instrumentdata/marketdata}/SnapshotSession.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsGetNewsParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsGetNewsResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsInstrument.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsItem.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/{options/OptionGetOptionContractsParams.kt => InstrumentGetOptionContractsParams.kt} (86%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/{options/OptionGetOptionContractsResponse.kt => InstrumentGetOptionContractsResponse.kt} (89%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => entitlements}/EntitlementAgreementKey.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{entitlementagreements => entitlements}/EntitlementAgreementResource.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => entitlements}/EntitlementCode.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{entitlementagreements/EntitlementAgreementGetEntitlementAgreementsParams.kt => entitlements/EntitlementGetEntitlementAgreementsParams.kt} (83%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{entitlementagreements/EntitlementAgreementGetEntitlementAgreementsResponse.kt => entitlements/EntitlementGetEntitlementAgreementsResponse.kt} (87%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => messages}/CreateFeedbackResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/CancelResponsePayload.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/ErrorStatus.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/Response.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/ResponseContent.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/ResponseContentPart.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/ResponseStatus.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/CreateMessageResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/CreateThreadResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/Message.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/MessageContent.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/MessageContentPart.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/MessageOutcome.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/MessageRole.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/Thread.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/{messages/MessageCreateMessageParams.kt => ThreadCreateMessageParams.kt} (96%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/{messages/MessageCreateMessageResponse.kt => ThreadCreateMessageResponse.kt} (89%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/{messages/MessageGetMessagesParams.kt => ThreadGetMessagesParams.kt} (89%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/{messages/MessageGetMessagesResponse.kt => ThreadGetMessagesResponse.kt} (90%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/CancelOrderRequest.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/NewOrderRequest.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/Order.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderCancelAllOpenOrdersParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderCancelAllOpenOrdersResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderCancelOpenOrderParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderCancelOpenOrderResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderGetOrderByIdParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderGetOrderByIdResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderGetOrdersParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderGetOrdersResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderReplaceOrderParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderReplaceOrderResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderStatus.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderSubmitOrdersParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderSubmitOrdersResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderType.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/PositionEffect.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/QueueState.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/RequestOrderType.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/RequestTimeInForce.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/Side.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/TimeInForce.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/TrailingOffsetType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/Position.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionCancelPositionInstructionParams.kt => positions/PositionCancelPositionInstructionParams.kt} (87%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionCancelPositionInstructionResponse.kt => positions/PositionCancelPositionInstructionResponse.kt} (88%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionClosePositionParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionClosePositionResponse.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionClosePositionsParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionClosePositionsResponse.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionGetPositionInstructionsParams.kt => positions/PositionGetPositionInstructionsParams.kt} (85%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionSubmitPositionInstructionsResponse.kt => positions/PositionGetPositionInstructionsResponse.kt} (88%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionGetPositionsParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionGetPositionsResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions => positions}/PositionInstruction.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions => positions}/PositionInstructionStatus.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions => positions}/PositionInstructionType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionSubmitPositionInstructionsParams.kt => positions/PositionSubmitPositionInstructionsParams.kt} (94%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionGetPositionInstructionsResponse.kt => positions/PositionSubmitPositionInstructionsResponse.kt} (91%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionType.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists/items => watchlist}/AddWatchlistItemData.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists/items/ItemAddWatchlistItemParams.kt => watchlist/WatchlistAddWatchlistItemParams.kt} (93%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists/items/ItemAddWatchlistItemResponse.kt => watchlist/WatchlistAddWatchlistItemResponse.kt} (89%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistCreateWatchlistParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistCreateWatchlistResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists/items/ItemDeleteWatchlistItemParams.kt => watchlist/WatchlistDeleteWatchlistItemParams.kt} (86%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists/items/ItemDeleteWatchlistItemResponse.kt => watchlist/WatchlistDeleteWatchlistItemResponse.kt} (78%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistDeleteWatchlistParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistDeleteWatchlistResponse.kt (98%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistDetail.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistEntry.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistGetWatchlistByIdParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistGetWatchlistByIdResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistGetWatchlistsParams.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistGetWatchlistsResponse.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistItemEntry.kt (99%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{V1WebsocketHandlerParams.kt => websocket/WebsocketWebsocketHandlerParams.kt} (82%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{VersionServiceAsync.kt => ApiVersionServiceAsync.kt} (51%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{VersionServiceAsyncImpl.kt => ApiVersionServiceAsyncImpl.kt} (69%) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsync.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsync.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/MarketDataServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/MarketDataServiceAsyncImpl.kt rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{accounts => }/OrderServiceAsync.kt (94%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{accounts => }/OrderServiceAsyncImpl.kt (93%) create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{accounts => }/PositionServiceAsyncImpl.kt (50%) create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsync.kt rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{ClockServiceAsyncImpl.kt => WebsocketServiceAsyncImpl.kt} (52%) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsyncImpl.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{instruments/EventServiceAsyncImpl.kt => instrumentdata/MarketDataServiceAsyncImpl.kt} (52%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{ => instrumentdata}/NewsServiceAsync.kt (90%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/{ => instrumentdata}/NewsServiceAsyncImpl.kt (91%) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsyncImpl.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionService.kt rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/{VersionServiceImpl.kt => ApiVersionServiceImpl.kt} (69%) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ClockService.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataService.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/MarketDataService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/MarketDataServiceImpl.kt rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/{accounts => }/OrderService.kt (94%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/{accounts => }/OrderServiceImpl.kt (92%) create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/VersionService.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketService.kt rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/{ClockServiceImpl.kt => WebsocketServiceImpl.kt} (52%) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourServiceImpl.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataService.kt rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/{instruments/EventServiceImpl.kt => instrumentdata/MarketDataServiceImpl.kt} (51%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/{ => instrumentdata}/NewsService.kt (90%) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/{ => instrumentdata}/NewsServiceImpl.kt (90%) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageServiceImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemServiceImpl.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/V1WebsocketHandlerParamsTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/AccountBalancesSodTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/AccountBalancesTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{balances/BalanceGetAccountBalancesParamsTest.kt => AccountGetAccountBalancesParamsTest.kt} (75%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{balances/BalanceGetAccountBalancesResponseTest.kt => AccountGetAccountBalancesResponseTest.kt} (94%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{portfoliohistory/PortfolioHistoryGetPortfolioHistoryParamsTest.kt => AccountGetPortfolioHistoryParamsTest.kt} (81%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{portfoliohistory/PortfolioHistoryGetPortfolioHistoryResponseTest.kt => AccountGetPortfolioHistoryResponseTest.kt} (85%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/MarginDetailsTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/MarginDetailsUsageTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{balances => }/MarginTopContributorTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{portfoliohistory => }/PortfolioHistoryResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/{portfoliohistory => }/PortfolioHistorySegmentTest.kt (97%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{version/VersionGetVersionResponseTest.kt => apiversion/ApiVersionGetVersionResponseTest.kt} (81%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{version => apiversion}/VersionTest.kt (93%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParamsTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{clock/ClockGetClockResponseTest.kt => calendar/CalendarGetClockResponseTest.kt} (84%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{calendars/markethours/MarketHourGetMarketHoursCalendarParamsTest.kt => calendar/CalendarGetMarketHoursCalendarParamsTest.kt} (73%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{calendars/markethours/MarketHourGetMarketHoursCalendarResponseTest.kt => calendar/CalendarGetMarketHoursCalendarResponseTest.kt} (94%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{clock => calendar}/ClockDetailTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/MarketHoursDetailTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/MarketStatusTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/SessionScheduleTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{calendars/markethours => calendar}/TradingSessionsTest.kt (98%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockParamsTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting => instrumentdata}/AnalystDistributionTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentAllEventsDataTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting => instrumentdata}/InstrumentAnalystConsensusTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/balancesheets => instrumentdata}/InstrumentBalanceSheetStatementTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/cashflowstatements => instrumentdata}/InstrumentCashFlowStatementTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events/EventGetAllInstrumentEventsParamsTest.kt => instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt} (80%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events/EventGetAllInstrumentEventsResponseTest.kt => instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt} (93%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusParamsTest.kt => instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt} (78%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusResponseTest.kt => instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt} (83%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsParamsTest.kt => instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt} (79%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest.kt => instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt} (92%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsParamsTest.kt => instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt} (80%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsResponseTest.kt => instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt} (91%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events/EventGetInstrumentEventsParamsTest.kt => instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt} (81%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events/EventGetInstrumentEventsResponseTest.kt => instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt} (90%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/fundamentals/FundamentalGetInstrumentFundamentalsParamsTest.kt => instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt} (70%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/fundamentals/FundamentalGetInstrumentFundamentalsResponseTest.kt => instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt} (85%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsParamsTest.kt => instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt} (80%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsResponseTest.kt => instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt} (89%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentDividendEventTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments => instrumentdata}/InstrumentEarningsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentEventEnvelopeTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentEventIpoItemTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentEventsByDateTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentEventsDataTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/fundamentals => instrumentdata}/InstrumentFundamentalsTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/incomestatements => instrumentdata}/InstrumentIncomeStatementTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/events => instrumentdata}/InstrumentSplitEventTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{instruments/analystreporting => instrumentdata}/PriceTargetTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/dailysummary => instrumentdata/marketdata}/DailySummaryTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/dailysummary/DailySummaryGetDailySummariesParamsTest.kt => instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt} (59%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/dailysummary/DailySummaryGetDailySummariesResponseTest.kt => instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt} (83%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot/SnapshotGetSnapshotsParamsTest.kt => instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt} (76%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot/SnapshotGetSnapshotsResponseTest.kt => instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt} (88%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot => instrumentdata/marketdata}/MarketDataSnapshotTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot => instrumentdata/marketdata}/SnapshotLastTradeTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot => instrumentdata/marketdata}/SnapshotQuoteTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{marketdata/snapshot => instrumentdata/marketdata}/SnapshotSessionTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsGetNewsParamsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsGetNewsResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsInstrumentTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{ => instrumentdata}/news/NewsItemTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/{options/OptionGetOptionContractsParamsTest.kt => InstrumentGetOptionContractsParamsTest.kt} (82%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/{options/OptionGetOptionContractsResponseTest.kt => InstrumentGetOptionContractsResponseTest.kt} (85%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsParamsTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{entitlementagreements => entitlements}/EntitlementAgreementResourceTest.kt (92%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{entitlementagreements/EntitlementAgreementGetEntitlementAgreementsResponseTest.kt => entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt} (79%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => messages}/CreateFeedbackResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/CancelResponsePayloadTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/ErrorStatusTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/ResponseContentPartTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/ResponseContentTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => responses}/ResponseTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/CreateMessageResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/CreateThreadResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/MessageContentPartTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/MessageContentTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/MessageTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/{messages/MessageCreateMessageParamsTest.kt => ThreadCreateMessageParamsTest.kt} (74%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/{messages/MessageCreateMessageResponseTest.kt => ThreadCreateMessageResponseTest.kt} (83%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/{messages/MessageGetMessagesParamsTest.kt => ThreadGetMessagesParamsTest.kt} (85%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/{messages/MessageGetMessagesResponseTest.kt => ThreadGetMessagesResponseTest.kt} (86%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/{ => threads}/ThreadTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/CancelOrderRequestTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/NewOrderRequestTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderCancelAllOpenOrdersParamsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderCancelAllOpenOrdersResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderCancelOpenOrderParamsTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderCancelOpenOrderResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderGetOrderByIdParamsTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderGetOrderByIdResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderGetOrdersParamsTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderGetOrdersResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderReplaceOrderParamsTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderReplaceOrderResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderSubmitOrdersParamsTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderSubmitOrdersResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/orders/OrderTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionCancelPositionInstructionParamsTest.kt => positions/PositionCancelPositionInstructionParamsTest.kt} (73%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionCancelPositionInstructionResponseTest.kt => positions/PositionCancelPositionInstructionResponseTest.kt} (85%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionClosePositionParamsTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionClosePositionResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionClosePositionsParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionClosePositionsResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionGetPositionInstructionsParamsTest.kt => positions/PositionGetPositionInstructionsParamsTest.kt} (72%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionSubmitPositionInstructionsResponseTest.kt => positions/PositionGetPositionInstructionsResponseTest.kt} (85%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionGetPositionsParamsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionGetPositionsResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions => positions}/PositionInstructionTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionSubmitPositionInstructionsParamsTest.kt => positions/PositionSubmitPositionInstructionsParamsTest.kt} (74%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts/positions/instructions/InstructionGetPositionInstructionsResponseTest.kt => positions/PositionSubmitPositionInstructionsResponseTest.kt} (87%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{accounts => }/positions/PositionTest.kt (98%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionParamsTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists/items => watchlist}/AddWatchlistItemDataTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists/items/ItemAddWatchlistItemParamsTest.kt => watchlist/WatchlistAddWatchlistItemParamsTest.kt} (80%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists/items/ItemAddWatchlistItemResponseTest.kt => watchlist/WatchlistAddWatchlistItemResponseTest.kt} (81%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistCreateWatchlistParamsTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistCreateWatchlistResponseTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists/items/ItemDeleteWatchlistItemParamsTest.kt => watchlist/WatchlistDeleteWatchlistItemParamsTest.kt} (79%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistDeleteWatchlistParamsTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistDeleteWatchlistResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistDetailTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistEntryTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistGetWatchlistByIdParamsTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistGetWatchlistByIdResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistGetWatchlistsParamsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistGetWatchlistsResponseTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{watchlists => watchlist}/WatchlistItemEntryTest.kt (99%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemResponseTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/{VersionServiceAsyncTest.kt => ApiVersionServiceAsyncTest.kt} (74%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsyncTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/{accounts => }/OrderServiceAsyncTest.kt (84%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/{V1ServiceAsyncTest.kt => v1/WebsocketServiceAsyncTest.kt} (66%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsyncTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/{ => instrumentdata}/NewsServiceAsyncTest.kt (84%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/V1ServiceTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/{VersionServiceTest.kt => ApiVersionServiceTest.kt} (74%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/{accounts => }/OrderServiceTest.kt (84%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/{ClockServiceTest.kt => WebsocketServiceTest.kt} (69%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourServiceTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/{ => instrumentdata}/NewsServiceTest.kt (84%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageServiceTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemServiceTest.kt diff --git a/.stats.yml b/.stats.yml index 1765c8b3..7ddeb65a 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-5bf5655a3a4979ebda280ff88c4b5c0f8eeb09b23a1930959369c4752649097b.yml -openapi_spec_hash: e000330610efb4e0c660233058d6d7a9 -config_hash: f2e1d4767745a6f044519331a7cbfd79 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-d4ce44176b84cd692b9f5e0223be418b98dbf0ba519c38f68553e78a11a50443.yml +openapi_spec_hash: 8d8961f1645fc8921b32ff8bb53fc333 +config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/README.md b/README.md index a0ac307a..ccea62ea 100644 --- a/README.md +++ b/README.md @@ -558,10 +558,10 @@ To forcibly omit a required parameter or property, pass [`JsonMissing`](clear-st ```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.AccountGetAccountBalancesParams; import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams; -AccountGetAccountsParams params = AccountGetAccountByIdParams.builder() +AccountGetAccountsParams params = AccountGetAccountBalancesParams.builder() .accountId(JsonMissing.of()) .build(); ``` diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClient.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClient.kt index 41609fd8..2aaac9e1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClient.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClient.kt @@ -42,7 +42,6 @@ interface ClearStreetClient { */ fun withOptions(modifier: Consumer): ClearStreetClient - /** Active Websocket. */ fun v1(): V1Service /** @@ -70,7 +69,6 @@ interface ClearStreetClient { modifier: Consumer ): ClearStreetClient.WithRawResponse - /** Active Websocket. */ fun v1(): V1Service.WithRawResponse } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsync.kt index dc89f753..c79b37bf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsync.kt @@ -42,7 +42,6 @@ interface ClearStreetClientAsync { */ fun withOptions(modifier: Consumer): ClearStreetClientAsync - /** Active Websocket. */ fun v1(): V1ServiceAsync /** @@ -73,7 +72,6 @@ interface ClearStreetClientAsync { modifier: Consumer ): ClearStreetClientAsync.WithRawResponse - /** Active Websocket. */ fun v1(): V1ServiceAsync.WithRawResponse } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt index 65521371..2681c9ba 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt @@ -35,7 +35,6 @@ class ClearStreetClientAsyncImpl(private val clientOptions: ClientOptions) : override fun withOptions(modifier: Consumer): ClearStreetClientAsync = ClearStreetClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Active Websocket. */ override fun v1(): V1ServiceAsync = v1 override fun close() = clientOptions.close() @@ -54,7 +53,6 @@ class ClearStreetClientAsyncImpl(private val clientOptions: ClientOptions) : clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Active Websocket. */ override fun v1(): V1ServiceAsync.WithRawResponse = v1 } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt index 6c40cd1a..87df0a40 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt @@ -34,7 +34,6 @@ class ClearStreetClientImpl(private val clientOptions: ClientOptions) : ClearStr override fun withOptions(modifier: Consumer): ClearStreetClient = ClearStreetClientImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Active Websocket. */ override fun v1(): V1Service = v1 override fun close() = clientOptions.close() @@ -53,7 +52,6 @@ class ClearStreetClientImpl(private val clientOptions: ClientOptions) : ClearStr clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Active Websocket. */ override fun v1(): V1Service.WithRawResponse = v1 } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalances.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalances.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalances.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalances.kt index cbb8c479..d695c002 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalances.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalances.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesSod.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSod.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesSod.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSod.kt index 43c7d56b..67b6fc47 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesSod.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSod.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParams.kt similarity index 90% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParams.kt index f3f18e31..7dfe28fb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -10,7 +10,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** Fetch account balance information */ -class BalanceGetAccountBalancesParams +class AccountGetAccountBalancesParams private constructor( private val accountId: Long?, private val topMarginContributorsLimit: Int?, @@ -34,16 +34,16 @@ private constructor( companion object { - @JvmStatic fun none(): BalanceGetAccountBalancesParams = builder().build() + @JvmStatic fun none(): AccountGetAccountBalancesParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [BalanceGetAccountBalancesParams]. + * [AccountGetAccountBalancesParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [BalanceGetAccountBalancesParams]. */ + /** A builder for [AccountGetAccountBalancesParams]. */ class Builder internal constructor() { private var accountId: Long? = null @@ -52,14 +52,14 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(balanceGetAccountBalancesParams: BalanceGetAccountBalancesParams) = + internal fun from(accountGetAccountBalancesParams: AccountGetAccountBalancesParams) = apply { - accountId = balanceGetAccountBalancesParams.accountId + accountId = accountGetAccountBalancesParams.accountId topMarginContributorsLimit = - balanceGetAccountBalancesParams.topMarginContributorsLimit - additionalHeaders = balanceGetAccountBalancesParams.additionalHeaders.toBuilder() + accountGetAccountBalancesParams.topMarginContributorsLimit + additionalHeaders = accountGetAccountBalancesParams.additionalHeaders.toBuilder() additionalQueryParams = - balanceGetAccountBalancesParams.additionalQueryParams.toBuilder() + accountGetAccountBalancesParams.additionalQueryParams.toBuilder() } fun accountId(accountId: Long?) = apply { this.accountId = accountId } @@ -193,12 +193,12 @@ private constructor( } /** - * Returns an immutable instance of [BalanceGetAccountBalancesParams]. + * Returns an immutable instance of [AccountGetAccountBalancesParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): BalanceGetAccountBalancesParams = - BalanceGetAccountBalancesParams( + fun build(): AccountGetAccountBalancesParams = + AccountGetAccountBalancesParams( accountId, topMarginContributorsLimit, additionalHeaders.build(), @@ -229,7 +229,7 @@ private constructor( return true } - return other is BalanceGetAccountBalancesParams && + return other is AccountGetAccountBalancesParams && accountId == other.accountId && topMarginContributorsLimit == other.topMarginContributorsLimit && additionalHeaders == other.additionalHeaders && @@ -245,5 +245,5 @@ private constructor( ) override fun toString() = - "BalanceGetAccountBalancesParams{accountId=$accountId, topMarginContributorsLimit=$topMarginContributorsLimit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "AccountGetAccountBalancesParams{accountId=$accountId, topMarginContributorsLimit=$topMarginContributorsLimit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt index 14a52c98..937adce8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class BalanceGetAccountBalancesResponse +class AccountGetAccountBalancesResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -104,7 +104,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [BalanceGetAccountBalancesResponse]. + * [AccountGetAccountBalancesResponse]. * * The following fields are required: * ```java @@ -115,7 +115,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BalanceGetAccountBalancesResponse]. */ + /** A builder for [AccountGetAccountBalancesResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -124,13 +124,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(balanceGetAccountBalancesResponse: BalanceGetAccountBalancesResponse) = + internal fun from(accountGetAccountBalancesResponse: AccountGetAccountBalancesResponse) = apply { - metadata = balanceGetAccountBalancesResponse.metadata - error = balanceGetAccountBalancesResponse.error - data = balanceGetAccountBalancesResponse.data + metadata = accountGetAccountBalancesResponse.metadata + error = accountGetAccountBalancesResponse.error + data = accountGetAccountBalancesResponse.data additionalProperties = - balanceGetAccountBalancesResponse.additionalProperties.toMutableMap() + accountGetAccountBalancesResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -191,7 +191,7 @@ private constructor( } /** - * Returns an immutable instance of [BalanceGetAccountBalancesResponse]. + * Returns an immutable instance of [AccountGetAccountBalancesResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -203,8 +203,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BalanceGetAccountBalancesResponse = - BalanceGetAccountBalancesResponse( + fun build(): AccountGetAccountBalancesResponse = + AccountGetAccountBalancesResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -222,7 +222,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): BalanceGetAccountBalancesResponse = apply { + fun validate(): AccountGetAccountBalancesResponse = apply { if (validated) { return@apply } @@ -257,7 +257,7 @@ private constructor( return true } - return other is BalanceGetAccountBalancesResponse && + return other is AccountGetAccountBalancesResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -269,5 +269,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BalanceGetAccountBalancesResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "AccountGetAccountBalancesResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt similarity index 85% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt index 6b70d4c1..70c8e152 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.portfoliohistory +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.Params import com.clear_street.api.core.checkRequired @@ -12,7 +12,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** Retrieves daily portfolio history for the specified account. */ -class PortfolioHistoryGetPortfolioHistoryParams +class AccountGetPortfolioHistoryParams private constructor( private val accountId: Long?, private val startDate: LocalDate, @@ -40,7 +40,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [PortfolioHistoryGetPortfolioHistoryParams]. + * [AccountGetPortfolioHistoryParams]. * * The following fields are required: * ```java @@ -50,7 +50,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [PortfolioHistoryGetPortfolioHistoryParams]. */ + /** A builder for [AccountGetPortfolioHistoryParams]. */ class Builder internal constructor() { private var accountId: Long? = null @@ -60,17 +60,15 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from( - portfolioHistoryGetPortfolioHistoryParams: PortfolioHistoryGetPortfolioHistoryParams - ) = apply { - accountId = portfolioHistoryGetPortfolioHistoryParams.accountId - startDate = portfolioHistoryGetPortfolioHistoryParams.startDate - endDate = portfolioHistoryGetPortfolioHistoryParams.endDate - additionalHeaders = - portfolioHistoryGetPortfolioHistoryParams.additionalHeaders.toBuilder() - additionalQueryParams = - portfolioHistoryGetPortfolioHistoryParams.additionalQueryParams.toBuilder() - } + internal fun from(accountGetPortfolioHistoryParams: AccountGetPortfolioHistoryParams) = + apply { + accountId = accountGetPortfolioHistoryParams.accountId + startDate = accountGetPortfolioHistoryParams.startDate + endDate = accountGetPortfolioHistoryParams.endDate + additionalHeaders = accountGetPortfolioHistoryParams.additionalHeaders.toBuilder() + additionalQueryParams = + accountGetPortfolioHistoryParams.additionalQueryParams.toBuilder() + } fun accountId(accountId: Long?) = apply { this.accountId = accountId } @@ -191,7 +189,7 @@ private constructor( } /** - * Returns an immutable instance of [PortfolioHistoryGetPortfolioHistoryParams]. + * Returns an immutable instance of [AccountGetPortfolioHistoryParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -202,8 +200,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): PortfolioHistoryGetPortfolioHistoryParams = - PortfolioHistoryGetPortfolioHistoryParams( + fun build(): AccountGetPortfolioHistoryParams = + AccountGetPortfolioHistoryParams( accountId, checkRequired("startDate", startDate), endDate, @@ -234,7 +232,7 @@ private constructor( return true } - return other is PortfolioHistoryGetPortfolioHistoryParams && + return other is AccountGetPortfolioHistoryParams && accountId == other.accountId && startDate == other.startDate && endDate == other.endDate && @@ -246,5 +244,5 @@ private constructor( Objects.hash(accountId, startDate, endDate, additionalHeaders, additionalQueryParams) override fun toString() = - "PortfolioHistoryGetPortfolioHistoryParams{accountId=$accountId, startDate=$startDate, endDate=$endDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "AccountGetPortfolioHistoryParams{accountId=$accountId, startDate=$startDate, endDate=$endDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt index 74f31301..6ee944b1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.portfoliohistory +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class PortfolioHistoryGetPortfolioHistoryResponse +class AccountGetPortfolioHistoryResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -104,7 +104,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [PortfolioHistoryGetPortfolioHistoryResponse]. + * [AccountGetPortfolioHistoryResponse]. * * The following fields are required: * ```java @@ -115,7 +115,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [PortfolioHistoryGetPortfolioHistoryResponse]. */ + /** A builder for [AccountGetPortfolioHistoryResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -124,15 +124,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - portfolioHistoryGetPortfolioHistoryResponse: PortfolioHistoryGetPortfolioHistoryResponse - ) = apply { - metadata = portfolioHistoryGetPortfolioHistoryResponse.metadata - error = portfolioHistoryGetPortfolioHistoryResponse.error - data = portfolioHistoryGetPortfolioHistoryResponse.data - additionalProperties = - portfolioHistoryGetPortfolioHistoryResponse.additionalProperties.toMutableMap() - } + internal fun from(accountGetPortfolioHistoryResponse: AccountGetPortfolioHistoryResponse) = + apply { + metadata = accountGetPortfolioHistoryResponse.metadata + error = accountGetPortfolioHistoryResponse.error + data = accountGetPortfolioHistoryResponse.data + additionalProperties = + accountGetPortfolioHistoryResponse.additionalProperties.toMutableMap() + } /** Response metadata, including the request ID and optional pagination info. */ fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) @@ -191,7 +190,7 @@ private constructor( } /** - * Returns an immutable instance of [PortfolioHistoryGetPortfolioHistoryResponse]. + * Returns an immutable instance of [AccountGetPortfolioHistoryResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -203,8 +202,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): PortfolioHistoryGetPortfolioHistoryResponse = - PortfolioHistoryGetPortfolioHistoryResponse( + fun build(): AccountGetPortfolioHistoryResponse = + AccountGetPortfolioHistoryResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -222,7 +221,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): PortfolioHistoryGetPortfolioHistoryResponse = apply { + fun validate(): AccountGetPortfolioHistoryResponse = apply { if (validated) { return@apply } @@ -257,7 +256,7 @@ private constructor( return true } - return other is PortfolioHistoryGetPortfolioHistoryResponse && + return other is AccountGetPortfolioHistoryResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -269,5 +268,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PortfolioHistoryGetPortfolioHistoryResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "AccountGetPortfolioHistoryResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetails.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetails.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetails.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetails.kt index a76bdb76..85adf2ff 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetails.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetails.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsUsage.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsage.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsUsage.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsage.kt index 832c3134..fef441de 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsUsage.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsage.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginTopContributor.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributor.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginTopContributor.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributor.kt index 15e84f12..d7db8e75 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginTopContributor.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributor.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginType.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginType.kt index 722f20f2..d72443d1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponse.kt index 1b8394d8..ccce778f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.portfoliohistory +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistorySegment.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegment.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistorySegment.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegment.kt index b4324e16..486f5700 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistorySegment.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegment.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.portfoliohistory +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParams.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParams.kt index 0abb775c..e972a4a4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.version +package com.clear_street.api.models.v1.apiversion import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -8,7 +8,7 @@ import com.clear_street.api.core.http.QueryParams import java.util.Objects /** Returns the current version string for this API endpoint. */ -class VersionGetVersionParams +class ApiVersionGetVersionParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -24,22 +24,24 @@ private constructor( companion object { - @JvmStatic fun none(): VersionGetVersionParams = builder().build() + @JvmStatic fun none(): ApiVersionGetVersionParams = builder().build() - /** Returns a mutable builder for constructing an instance of [VersionGetVersionParams]. */ + /** + * Returns a mutable builder for constructing an instance of [ApiVersionGetVersionParams]. + */ @JvmStatic fun builder() = Builder() } - /** A builder for [VersionGetVersionParams]. */ + /** A builder for [ApiVersionGetVersionParams]. */ class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(versionGetVersionParams: VersionGetVersionParams) = apply { - additionalHeaders = versionGetVersionParams.additionalHeaders.toBuilder() - additionalQueryParams = versionGetVersionParams.additionalQueryParams.toBuilder() + internal fun from(apiVersionGetVersionParams: ApiVersionGetVersionParams) = apply { + additionalHeaders = apiVersionGetVersionParams.additionalHeaders.toBuilder() + additionalQueryParams = apiVersionGetVersionParams.additionalQueryParams.toBuilder() } fun additionalHeaders(additionalHeaders: Headers) = apply { @@ -141,12 +143,12 @@ private constructor( } /** - * Returns an immutable instance of [VersionGetVersionParams]. + * Returns an immutable instance of [ApiVersionGetVersionParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): VersionGetVersionParams = - VersionGetVersionParams(additionalHeaders.build(), additionalQueryParams.build()) + fun build(): ApiVersionGetVersionParams = + ApiVersionGetVersionParams(additionalHeaders.build(), additionalQueryParams.build()) } override fun _headers(): Headers = additionalHeaders @@ -158,7 +160,7 @@ private constructor( return true } - return other is VersionGetVersionParams && + return other is ApiVersionGetVersionParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } @@ -166,5 +168,5 @@ private constructor( override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) override fun toString() = - "VersionGetVersionParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "ApiVersionGetVersionParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt similarity index 90% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt index 1e261e89..04efe109 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.version +package com.clear_street.api.models.v1.apiversion import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class VersionGetVersionResponse +class ApiVersionGetVersionResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -103,7 +103,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [VersionGetVersionResponse]. + * Returns a mutable builder for constructing an instance of [ApiVersionGetVersionResponse]. * * The following fields are required: * ```java @@ -114,7 +114,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [VersionGetVersionResponse]. */ + /** A builder for [ApiVersionGetVersionResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -123,11 +123,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(versionGetVersionResponse: VersionGetVersionResponse) = apply { - metadata = versionGetVersionResponse.metadata - error = versionGetVersionResponse.error - data = versionGetVersionResponse.data - additionalProperties = versionGetVersionResponse.additionalProperties.toMutableMap() + internal fun from(apiVersionGetVersionResponse: ApiVersionGetVersionResponse) = apply { + metadata = apiVersionGetVersionResponse.metadata + error = apiVersionGetVersionResponse.error + data = apiVersionGetVersionResponse.data + additionalProperties = apiVersionGetVersionResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -187,7 +187,7 @@ private constructor( } /** - * Returns an immutable instance of [VersionGetVersionResponse]. + * Returns an immutable instance of [ApiVersionGetVersionResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -199,8 +199,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): VersionGetVersionResponse = - VersionGetVersionResponse( + fun build(): ApiVersionGetVersionResponse = + ApiVersionGetVersionResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -218,7 +218,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): VersionGetVersionResponse = apply { + fun validate(): ApiVersionGetVersionResponse = apply { if (validated) { return@apply } @@ -253,7 +253,7 @@ private constructor( return true } - return other is VersionGetVersionResponse && + return other is ApiVersionGetVersionResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -265,5 +265,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "VersionGetVersionResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "ApiVersionGetVersionResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/Version.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/Version.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/Version.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/Version.kt index e5167c3a..2a3a24bb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/version/Version.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/Version.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.version +package com.clear_street.api.models.v1.apiversion import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParams.kt similarity index 86% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParams.kt index 1802fb48..62fadd0e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.clock +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -8,7 +8,7 @@ import com.clear_street.api.core.http.QueryParams import java.util.Objects /** Returns the current server time in UTC. */ -class ClockGetClockParams +class CalendarGetClockParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -24,22 +24,22 @@ private constructor( companion object { - @JvmStatic fun none(): ClockGetClockParams = builder().build() + @JvmStatic fun none(): CalendarGetClockParams = builder().build() - /** Returns a mutable builder for constructing an instance of [ClockGetClockParams]. */ + /** Returns a mutable builder for constructing an instance of [CalendarGetClockParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [ClockGetClockParams]. */ + /** A builder for [CalendarGetClockParams]. */ class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(clockGetClockParams: ClockGetClockParams) = apply { - additionalHeaders = clockGetClockParams.additionalHeaders.toBuilder() - additionalQueryParams = clockGetClockParams.additionalQueryParams.toBuilder() + internal fun from(calendarGetClockParams: CalendarGetClockParams) = apply { + additionalHeaders = calendarGetClockParams.additionalHeaders.toBuilder() + additionalQueryParams = calendarGetClockParams.additionalQueryParams.toBuilder() } fun additionalHeaders(additionalHeaders: Headers) = apply { @@ -141,12 +141,12 @@ private constructor( } /** - * Returns an immutable instance of [ClockGetClockParams]. + * Returns an immutable instance of [CalendarGetClockParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): ClockGetClockParams = - ClockGetClockParams(additionalHeaders.build(), additionalQueryParams.build()) + fun build(): CalendarGetClockParams = + CalendarGetClockParams(additionalHeaders.build(), additionalQueryParams.build()) } override fun _headers(): Headers = additionalHeaders @@ -158,7 +158,7 @@ private constructor( return true } - return other is ClockGetClockParams && + return other is CalendarGetClockParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } @@ -166,5 +166,5 @@ private constructor( override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) override fun toString() = - "ClockGetClockParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "CalendarGetClockParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponse.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponse.kt index c917004c..04b2c98e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.clock +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class ClockGetClockResponse +class CalendarGetClockResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -103,7 +103,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [ClockGetClockResponse]. + * Returns a mutable builder for constructing an instance of [CalendarGetClockResponse]. * * The following fields are required: * ```java @@ -114,7 +114,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ClockGetClockResponse]. */ + /** A builder for [CalendarGetClockResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -123,11 +123,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(clockGetClockResponse: ClockGetClockResponse) = apply { - metadata = clockGetClockResponse.metadata - error = clockGetClockResponse.error - data = clockGetClockResponse.data - additionalProperties = clockGetClockResponse.additionalProperties.toMutableMap() + internal fun from(calendarGetClockResponse: CalendarGetClockResponse) = apply { + metadata = calendarGetClockResponse.metadata + error = calendarGetClockResponse.error + data = calendarGetClockResponse.data + additionalProperties = calendarGetClockResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -188,7 +188,7 @@ private constructor( } /** - * Returns an immutable instance of [ClockGetClockResponse]. + * Returns an immutable instance of [CalendarGetClockResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -200,8 +200,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): ClockGetClockResponse = - ClockGetClockResponse( + fun build(): CalendarGetClockResponse = + CalendarGetClockResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -219,7 +219,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): ClockGetClockResponse = apply { + fun validate(): CalendarGetClockResponse = apply { if (validated) { return@apply } @@ -254,7 +254,7 @@ private constructor( return true } - return other is ClockGetClockResponse && + return other is CalendarGetClockResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -266,5 +266,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ClockGetClockResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "CalendarGetClockResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt index dce8dba7..b554f71d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.Params import com.clear_street.api.core.checkRequired @@ -14,7 +14,7 @@ import kotlin.jvm.optionals.getOrNull * Retrieves comprehensive trading hours including pre-market, regular, and after-hours sessions. * Returns market status, session times, and next session schedules. */ -class MarketHourGetMarketHoursCalendarParams +class CalendarGetMarketHoursCalendarParams private constructor( private val date: String, private val market: MarketType?, @@ -40,7 +40,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [MarketHourGetMarketHoursCalendarParams]. + * [CalendarGetMarketHoursCalendarParams]. * * The following fields are required: * ```java @@ -50,7 +50,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [MarketHourGetMarketHoursCalendarParams]. */ + /** A builder for [CalendarGetMarketHoursCalendarParams]. */ class Builder internal constructor() { private var date: String? = null @@ -60,13 +60,13 @@ private constructor( @JvmSynthetic internal fun from( - marketHourGetMarketHoursCalendarParams: MarketHourGetMarketHoursCalendarParams + calendarGetMarketHoursCalendarParams: CalendarGetMarketHoursCalendarParams ) = apply { - date = marketHourGetMarketHoursCalendarParams.date - market = marketHourGetMarketHoursCalendarParams.market - additionalHeaders = marketHourGetMarketHoursCalendarParams.additionalHeaders.toBuilder() + date = calendarGetMarketHoursCalendarParams.date + market = calendarGetMarketHoursCalendarParams.market + additionalHeaders = calendarGetMarketHoursCalendarParams.additionalHeaders.toBuilder() additionalQueryParams = - marketHourGetMarketHoursCalendarParams.additionalQueryParams.toBuilder() + calendarGetMarketHoursCalendarParams.additionalQueryParams.toBuilder() } /** The date to query market hours for (YYYY-MM-DD). Defaults to today. */ @@ -177,7 +177,7 @@ private constructor( } /** - * Returns an immutable instance of [MarketHourGetMarketHoursCalendarParams]. + * Returns an immutable instance of [CalendarGetMarketHoursCalendarParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -188,8 +188,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): MarketHourGetMarketHoursCalendarParams = - MarketHourGetMarketHoursCalendarParams( + fun build(): CalendarGetMarketHoursCalendarParams = + CalendarGetMarketHoursCalendarParams( checkRequired("date", date), market, additionalHeaders.build(), @@ -213,7 +213,7 @@ private constructor( return true } - return other is MarketHourGetMarketHoursCalendarParams && + return other is CalendarGetMarketHoursCalendarParams && date == other.date && market == other.market && additionalHeaders == other.additionalHeaders && @@ -224,5 +224,5 @@ private constructor( Objects.hash(date, market, additionalHeaders, additionalQueryParams) override fun toString() = - "MarketHourGetMarketHoursCalendarParams{date=$date, market=$market, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "CalendarGetMarketHoursCalendarParams{date=$date, market=$market, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt index 78899352..4879fd1d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class MarketHourGetMarketHoursCalendarResponse +class CalendarGetMarketHoursCalendarResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -106,7 +106,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [MarketHourGetMarketHoursCalendarResponse]. + * [CalendarGetMarketHoursCalendarResponse]. * * The following fields are required: * ```java @@ -117,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [MarketHourGetMarketHoursCalendarResponse]. */ + /** A builder for [CalendarGetMarketHoursCalendarResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -127,13 +127,13 @@ private constructor( @JvmSynthetic internal fun from( - marketHourGetMarketHoursCalendarResponse: MarketHourGetMarketHoursCalendarResponse + calendarGetMarketHoursCalendarResponse: CalendarGetMarketHoursCalendarResponse ) = apply { - metadata = marketHourGetMarketHoursCalendarResponse.metadata - error = marketHourGetMarketHoursCalendarResponse.error - data = marketHourGetMarketHoursCalendarResponse.data.map { it.toMutableList() } + metadata = calendarGetMarketHoursCalendarResponse.metadata + error = calendarGetMarketHoursCalendarResponse.error + data = calendarGetMarketHoursCalendarResponse.data.map { it.toMutableList() } additionalProperties = - marketHourGetMarketHoursCalendarResponse.additionalProperties.toMutableMap() + calendarGetMarketHoursCalendarResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -207,7 +207,7 @@ private constructor( } /** - * Returns an immutable instance of [MarketHourGetMarketHoursCalendarResponse]. + * Returns an immutable instance of [CalendarGetMarketHoursCalendarResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -219,8 +219,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): MarketHourGetMarketHoursCalendarResponse = - MarketHourGetMarketHoursCalendarResponse( + fun build(): CalendarGetMarketHoursCalendarResponse = + CalendarGetMarketHoursCalendarResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -238,7 +238,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): MarketHourGetMarketHoursCalendarResponse = apply { + fun validate(): CalendarGetMarketHoursCalendarResponse = apply { if (validated) { return@apply } @@ -273,7 +273,7 @@ private constructor( return true } - return other is MarketHourGetMarketHoursCalendarResponse && + return other is CalendarGetMarketHoursCalendarResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -285,5 +285,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MarketHourGetMarketHoursCalendarResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "CalendarGetMarketHoursCalendarResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockDetail.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/ClockDetail.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockDetail.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/ClockDetail.kt index 0aacc8e0..2639f882 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/clock/ClockDetail.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/ClockDetail.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.clock +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/DayType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/DayType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/DayType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/DayType.kt index 8c3991d1..6dac109e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/DayType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/DayType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHoursDetail.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetail.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHoursDetail.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetail.kt index c2208052..79fa7db5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHoursDetail.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetail.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketSessionType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketSessionType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketSessionType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketSessionType.kt index a2725054..77d7d176 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketSessionType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketSessionType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketStatus.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketStatus.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketStatus.kt index 0f016e0c..74c9cf79 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketStatus.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketType.kt index 0cb30bff..acc004b2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/SessionSchedule.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/SessionSchedule.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/SessionSchedule.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/SessionSchedule.kt index 2a7c973a..662cb4b3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/SessionSchedule.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/SessionSchedule.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/TradingSessions.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/TradingSessions.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/TradingSessions.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/TradingSessions.kt index 7c4313a3..b39a9660 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendars/markethours/TradingSessions.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/TradingSessions.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/AllEventsEventType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AllEventsEventType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/AllEventsEventType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AllEventsEventType.kt index f6915733..a7047de2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/AllEventsEventType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AllEventsEventType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystDistribution.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistribution.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystDistribution.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistribution.kt index 61808542..4a5f0fcc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystDistribution.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistribution.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/AnalystRating.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystRating.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/AnalystRating.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystRating.kt index 0c74895d..1200211c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/AnalystRating.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystRating.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/FiscalPeriodType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/FiscalPeriodType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/FiscalPeriodType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/FiscalPeriodType.kt index b03849b9..da8610c9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/FiscalPeriodType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/FiscalPeriodType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentAllEventsData.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsData.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentAllEventsData.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsData.kt index cad8c57f..c2728b7e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentAllEventsData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsData.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/InstrumentAnalystConsensus.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/InstrumentAnalystConsensus.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt index 2ca4fbd9..45ab0727 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/InstrumentAnalystConsensus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -8,7 +8,6 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.instruments.AnalystRating import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/InstrumentBalanceSheetStatement.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/InstrumentBalanceSheetStatement.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt index 4929c74b..622e8236 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/InstrumentBalanceSheetStatement.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.balancesheets +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -8,7 +8,6 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/InstrumentCashFlowStatement.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/InstrumentCashFlowStatement.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt index 5298d049..ed7f72d7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/InstrumentCashFlowStatement.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.cashflowstatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -8,7 +8,6 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt similarity index 86% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt index e5a07c22..abe5d50e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -15,7 +15,7 @@ import kotlin.jvm.optionals.getOrNull * * Retrieves all instrument events grouped by date. */ -class EventGetAllInstrumentEventsParams +class InstrumentDataGetAllInstrumentEventsParams private constructor( private val eventTypes: List?, private val fromDate: String?, @@ -50,16 +50,16 @@ private constructor( companion object { - @JvmStatic fun none(): EventGetAllInstrumentEventsParams = builder().build() + @JvmStatic fun none(): InstrumentDataGetAllInstrumentEventsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [EventGetAllInstrumentEventsParams]. + * [InstrumentDataGetAllInstrumentEventsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [EventGetAllInstrumentEventsParams]. */ + /** A builder for [InstrumentDataGetAllInstrumentEventsParams]. */ class Builder internal constructor() { private var eventTypes: MutableList? = null @@ -70,16 +70,19 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(eventGetAllInstrumentEventsParams: EventGetAllInstrumentEventsParams) = - apply { - eventTypes = eventGetAllInstrumentEventsParams.eventTypes?.toMutableList() - fromDate = eventGetAllInstrumentEventsParams.fromDate - instrumentIds = eventGetAllInstrumentEventsParams.instrumentIds?.toMutableList() - toDate = eventGetAllInstrumentEventsParams.toDate - additionalHeaders = eventGetAllInstrumentEventsParams.additionalHeaders.toBuilder() - additionalQueryParams = - eventGetAllInstrumentEventsParams.additionalQueryParams.toBuilder() - } + internal fun from( + instrumentDataGetAllInstrumentEventsParams: InstrumentDataGetAllInstrumentEventsParams + ) = apply { + eventTypes = instrumentDataGetAllInstrumentEventsParams.eventTypes?.toMutableList() + fromDate = instrumentDataGetAllInstrumentEventsParams.fromDate + instrumentIds = + instrumentDataGetAllInstrumentEventsParams.instrumentIds?.toMutableList() + toDate = instrumentDataGetAllInstrumentEventsParams.toDate + additionalHeaders = + instrumentDataGetAllInstrumentEventsParams.additionalHeaders.toBuilder() + additionalQueryParams = + instrumentDataGetAllInstrumentEventsParams.additionalQueryParams.toBuilder() + } /** Filter by event type(s). Comma-delimited list. Example: `event_types=EARNINGS,IPO`. */ fun eventTypes(eventTypes: List?) = apply { @@ -231,12 +234,12 @@ private constructor( } /** - * Returns an immutable instance of [EventGetAllInstrumentEventsParams]. + * Returns an immutable instance of [InstrumentDataGetAllInstrumentEventsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): EventGetAllInstrumentEventsParams = - EventGetAllInstrumentEventsParams( + fun build(): InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams( eventTypes?.toImmutable(), fromDate, instrumentIds?.toImmutable(), @@ -266,7 +269,7 @@ private constructor( return true } - return other is EventGetAllInstrumentEventsParams && + return other is InstrumentDataGetAllInstrumentEventsParams && eventTypes == other.eventTypes && fromDate == other.fromDate && instrumentIds == other.instrumentIds && @@ -286,5 +289,5 @@ private constructor( ) override fun toString() = - "EventGetAllInstrumentEventsParams{eventTypes=$eventTypes, fromDate=$fromDate, instrumentIds=$instrumentIds, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentDataGetAllInstrumentEventsParams{eventTypes=$eventTypes, fromDate=$fromDate, instrumentIds=$instrumentIds, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt index c6e5b251..761732aa 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class EventGetAllInstrumentEventsResponse +class InstrumentDataGetAllInstrumentEventsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -106,7 +106,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [EventGetAllInstrumentEventsResponse]. + * [InstrumentDataGetAllInstrumentEventsResponse]. * * The following fields are required: * ```java @@ -117,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [EventGetAllInstrumentEventsResponse]. */ + /** A builder for [InstrumentDataGetAllInstrumentEventsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -127,13 +127,14 @@ private constructor( @JvmSynthetic internal fun from( - eventGetAllInstrumentEventsResponse: EventGetAllInstrumentEventsResponse + instrumentDataGetAllInstrumentEventsResponse: + InstrumentDataGetAllInstrumentEventsResponse ) = apply { - metadata = eventGetAllInstrumentEventsResponse.metadata - error = eventGetAllInstrumentEventsResponse.error - data = eventGetAllInstrumentEventsResponse.data + metadata = instrumentDataGetAllInstrumentEventsResponse.metadata + error = instrumentDataGetAllInstrumentEventsResponse.error + data = instrumentDataGetAllInstrumentEventsResponse.data additionalProperties = - eventGetAllInstrumentEventsResponse.additionalProperties.toMutableMap() + instrumentDataGetAllInstrumentEventsResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -194,7 +195,7 @@ private constructor( } /** - * Returns an immutable instance of [EventGetAllInstrumentEventsResponse]. + * Returns an immutable instance of [InstrumentDataGetAllInstrumentEventsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -206,8 +207,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): EventGetAllInstrumentEventsResponse = - EventGetAllInstrumentEventsResponse( + fun build(): InstrumentDataGetAllInstrumentEventsResponse = + InstrumentDataGetAllInstrumentEventsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -225,7 +226,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): EventGetAllInstrumentEventsResponse = apply { + fun validate(): InstrumentDataGetAllInstrumentEventsResponse = apply { if (validated) { return@apply } @@ -260,7 +261,7 @@ private constructor( return true } - return other is EventGetAllInstrumentEventsResponse && + return other is InstrumentDataGetAllInstrumentEventsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -272,5 +273,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventGetAllInstrumentEventsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "InstrumentDataGetAllInstrumentEventsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt index d53dc6c1..28eb4abf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -11,7 +11,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** Retrieves analyst ratings and price targets for an instrument. */ -class AnalystReportingGetInstrumentAnalystConsensusParams +class InstrumentDataGetInstrumentAnalystConsensusParams private constructor( private val instrumentId: String?, private val from: LocalDate?, @@ -39,17 +39,16 @@ private constructor( companion object { - @JvmStatic - fun none(): AnalystReportingGetInstrumentAnalystConsensusParams = builder().build() + @JvmStatic fun none(): InstrumentDataGetInstrumentAnalystConsensusParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [AnalystReportingGetInstrumentAnalystConsensusParams]. + * [InstrumentDataGetInstrumentAnalystConsensusParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [AnalystReportingGetInstrumentAnalystConsensusParams]. */ + /** A builder for [InstrumentDataGetInstrumentAnalystConsensusParams]. */ class Builder internal constructor() { private var instrumentId: String? = null @@ -60,17 +59,16 @@ private constructor( @JvmSynthetic internal fun from( - analystReportingGetInstrumentAnalystConsensusParams: - AnalystReportingGetInstrumentAnalystConsensusParams + instrumentDataGetInstrumentAnalystConsensusParams: + InstrumentDataGetInstrumentAnalystConsensusParams ) = apply { - instrumentId = analystReportingGetInstrumentAnalystConsensusParams.instrumentId - from = analystReportingGetInstrumentAnalystConsensusParams.from - to = analystReportingGetInstrumentAnalystConsensusParams.to + instrumentId = instrumentDataGetInstrumentAnalystConsensusParams.instrumentId + from = instrumentDataGetInstrumentAnalystConsensusParams.from + to = instrumentDataGetInstrumentAnalystConsensusParams.to additionalHeaders = - analystReportingGetInstrumentAnalystConsensusParams.additionalHeaders.toBuilder() + instrumentDataGetInstrumentAnalystConsensusParams.additionalHeaders.toBuilder() additionalQueryParams = - analystReportingGetInstrumentAnalystConsensusParams.additionalQueryParams - .toBuilder() + instrumentDataGetInstrumentAnalystConsensusParams.additionalQueryParams.toBuilder() } /** OEMS instrument UUID */ @@ -190,12 +188,12 @@ private constructor( } /** - * Returns an immutable instance of [AnalystReportingGetInstrumentAnalystConsensusParams]. + * Returns an immutable instance of [InstrumentDataGetInstrumentAnalystConsensusParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): AnalystReportingGetInstrumentAnalystConsensusParams = - AnalystReportingGetInstrumentAnalystConsensusParams( + fun build(): InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams( instrumentId, from, to, @@ -226,7 +224,7 @@ private constructor( return true } - return other is AnalystReportingGetInstrumentAnalystConsensusParams && + return other is InstrumentDataGetInstrumentAnalystConsensusParams && instrumentId == other.instrumentId && from == other.from && to == other.to && @@ -238,5 +236,5 @@ private constructor( Objects.hash(instrumentId, from, to, additionalHeaders, additionalQueryParams) override fun toString() = - "AnalystReportingGetInstrumentAnalystConsensusParams{instrumentId=$instrumentId, from=$from, to=$to, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentDataGetInstrumentAnalystConsensusParams{instrumentId=$instrumentId, from=$from, to=$to, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt index 8836c535..e6eac2d3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class AnalystReportingGetInstrumentAnalystConsensusResponse +class InstrumentDataGetInstrumentAnalystConsensusResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -106,7 +106,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [AnalystReportingGetInstrumentAnalystConsensusResponse]. + * [InstrumentDataGetInstrumentAnalystConsensusResponse]. * * The following fields are required: * ```java @@ -117,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AnalystReportingGetInstrumentAnalystConsensusResponse]. */ + /** A builder for [InstrumentDataGetInstrumentAnalystConsensusResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -127,14 +127,14 @@ private constructor( @JvmSynthetic internal fun from( - analystReportingGetInstrumentAnalystConsensusResponse: - AnalystReportingGetInstrumentAnalystConsensusResponse + instrumentDataGetInstrumentAnalystConsensusResponse: + InstrumentDataGetInstrumentAnalystConsensusResponse ) = apply { - metadata = analystReportingGetInstrumentAnalystConsensusResponse.metadata - error = analystReportingGetInstrumentAnalystConsensusResponse.error - data = analystReportingGetInstrumentAnalystConsensusResponse.data + metadata = instrumentDataGetInstrumentAnalystConsensusResponse.metadata + error = instrumentDataGetInstrumentAnalystConsensusResponse.error + data = instrumentDataGetInstrumentAnalystConsensusResponse.data additionalProperties = - analystReportingGetInstrumentAnalystConsensusResponse.additionalProperties + instrumentDataGetInstrumentAnalystConsensusResponse.additionalProperties .toMutableMap() } @@ -196,7 +196,7 @@ private constructor( } /** - * Returns an immutable instance of [AnalystReportingGetInstrumentAnalystConsensusResponse]. + * Returns an immutable instance of [InstrumentDataGetInstrumentAnalystConsensusResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -208,8 +208,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AnalystReportingGetInstrumentAnalystConsensusResponse = - AnalystReportingGetInstrumentAnalystConsensusResponse( + fun build(): InstrumentDataGetInstrumentAnalystConsensusResponse = + InstrumentDataGetInstrumentAnalystConsensusResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -227,7 +227,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): AnalystReportingGetInstrumentAnalystConsensusResponse = apply { + fun validate(): InstrumentDataGetInstrumentAnalystConsensusResponse = apply { if (validated) { return@apply } @@ -262,7 +262,7 @@ private constructor( return true } - return other is AnalystReportingGetInstrumentAnalystConsensusResponse && + return other is InstrumentDataGetInstrumentAnalystConsensusResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -274,5 +274,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AnalystReportingGetInstrumentAnalystConsensusResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "InstrumentDataGetInstrumentAnalystConsensusResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt index a739d63b..70048b57 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.balancesheets +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -19,7 +19,7 @@ import kotlin.jvm.optionals.getOrNull * - `from_date`: None (no lower bound) * - `to_date`: None (no upper bound) */ -class BalanceSheetGetInstrumentBalanceSheetStatementsParams +class InstrumentDataGetInstrumentBalanceSheetStatementsParams private constructor( private val instrumentId: String?, private val fromDate: String?, @@ -58,16 +58,16 @@ private constructor( companion object { @JvmStatic - fun none(): BalanceSheetGetInstrumentBalanceSheetStatementsParams = builder().build() + fun none(): InstrumentDataGetInstrumentBalanceSheetStatementsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [BalanceSheetGetInstrumentBalanceSheetStatementsParams]. + * [InstrumentDataGetInstrumentBalanceSheetStatementsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [BalanceSheetGetInstrumentBalanceSheetStatementsParams]. */ + /** A builder for [InstrumentDataGetInstrumentBalanceSheetStatementsParams]. */ class Builder internal constructor() { private var instrumentId: String? = null @@ -80,18 +80,19 @@ private constructor( @JvmSynthetic internal fun from( - balanceSheetGetInstrumentBalanceSheetStatementsParams: - BalanceSheetGetInstrumentBalanceSheetStatementsParams + instrumentDataGetInstrumentBalanceSheetStatementsParams: + InstrumentDataGetInstrumentBalanceSheetStatementsParams ) = apply { - instrumentId = balanceSheetGetInstrumentBalanceSheetStatementsParams.instrumentId - fromDate = balanceSheetGetInstrumentBalanceSheetStatementsParams.fromDate - pageSize = balanceSheetGetInstrumentBalanceSheetStatementsParams.pageSize - pageToken = balanceSheetGetInstrumentBalanceSheetStatementsParams.pageToken - toDate = balanceSheetGetInstrumentBalanceSheetStatementsParams.toDate + instrumentId = instrumentDataGetInstrumentBalanceSheetStatementsParams.instrumentId + fromDate = instrumentDataGetInstrumentBalanceSheetStatementsParams.fromDate + pageSize = instrumentDataGetInstrumentBalanceSheetStatementsParams.pageSize + pageToken = instrumentDataGetInstrumentBalanceSheetStatementsParams.pageToken + toDate = instrumentDataGetInstrumentBalanceSheetStatementsParams.toDate additionalHeaders = - balanceSheetGetInstrumentBalanceSheetStatementsParams.additionalHeaders.toBuilder() + instrumentDataGetInstrumentBalanceSheetStatementsParams.additionalHeaders + .toBuilder() additionalQueryParams = - balanceSheetGetInstrumentBalanceSheetStatementsParams.additionalQueryParams + instrumentDataGetInstrumentBalanceSheetStatementsParams.additionalQueryParams .toBuilder() } @@ -233,12 +234,13 @@ private constructor( } /** - * Returns an immutable instance of [BalanceSheetGetInstrumentBalanceSheetStatementsParams]. + * Returns an immutable instance of + * [InstrumentDataGetInstrumentBalanceSheetStatementsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): BalanceSheetGetInstrumentBalanceSheetStatementsParams = - BalanceSheetGetInstrumentBalanceSheetStatementsParams( + fun build(): InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams( instrumentId, fromDate, pageSize, @@ -273,7 +275,7 @@ private constructor( return true } - return other is BalanceSheetGetInstrumentBalanceSheetStatementsParams && + return other is InstrumentDataGetInstrumentBalanceSheetStatementsParams && instrumentId == other.instrumentId && fromDate == other.fromDate && pageSize == other.pageSize && @@ -295,5 +297,5 @@ private constructor( ) override fun toString() = - "BalanceSheetGetInstrumentBalanceSheetStatementsParams{instrumentId=$instrumentId, fromDate=$fromDate, pageSize=$pageSize, pageToken=$pageToken, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentDataGetInstrumentBalanceSheetStatementsParams{instrumentId=$instrumentId, fromDate=$fromDate, pageSize=$pageSize, pageToken=$pageToken, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt index 7523d7b2..c83f3cae 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.balancesheets +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class BalanceSheetGetInstrumentBalanceSheetStatementsResponse +class InstrumentDataGetInstrumentBalanceSheetStatementsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -108,7 +108,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [BalanceSheetGetInstrumentBalanceSheetStatementsResponse]. + * [InstrumentDataGetInstrumentBalanceSheetStatementsResponse]. * * The following fields are required: * ```java @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BalanceSheetGetInstrumentBalanceSheetStatementsResponse]. */ + /** A builder for [InstrumentDataGetInstrumentBalanceSheetStatementsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -129,17 +129,17 @@ private constructor( @JvmSynthetic internal fun from( - balanceSheetGetInstrumentBalanceSheetStatementsResponse: - BalanceSheetGetInstrumentBalanceSheetStatementsResponse + instrumentDataGetInstrumentBalanceSheetStatementsResponse: + InstrumentDataGetInstrumentBalanceSheetStatementsResponse ) = apply { - metadata = balanceSheetGetInstrumentBalanceSheetStatementsResponse.metadata - error = balanceSheetGetInstrumentBalanceSheetStatementsResponse.error + metadata = instrumentDataGetInstrumentBalanceSheetStatementsResponse.metadata + error = instrumentDataGetInstrumentBalanceSheetStatementsResponse.error data = - balanceSheetGetInstrumentBalanceSheetStatementsResponse.data.map { + instrumentDataGetInstrumentBalanceSheetStatementsResponse.data.map { it.toMutableList() } additionalProperties = - balanceSheetGetInstrumentBalanceSheetStatementsResponse.additionalProperties + instrumentDataGetInstrumentBalanceSheetStatementsResponse.additionalProperties .toMutableMap() } @@ -215,7 +215,7 @@ private constructor( /** * Returns an immutable instance of - * [BalanceSheetGetInstrumentBalanceSheetStatementsResponse]. + * [InstrumentDataGetInstrumentBalanceSheetStatementsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -227,8 +227,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BalanceSheetGetInstrumentBalanceSheetStatementsResponse = - BalanceSheetGetInstrumentBalanceSheetStatementsResponse( + fun build(): InstrumentDataGetInstrumentBalanceSheetStatementsResponse = + InstrumentDataGetInstrumentBalanceSheetStatementsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -246,7 +246,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): BalanceSheetGetInstrumentBalanceSheetStatementsResponse = apply { + fun validate(): InstrumentDataGetInstrumentBalanceSheetStatementsResponse = apply { if (validated) { return@apply } @@ -281,7 +281,7 @@ private constructor( return true } - return other is BalanceSheetGetInstrumentBalanceSheetStatementsResponse && + return other is InstrumentDataGetInstrumentBalanceSheetStatementsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -293,5 +293,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BalanceSheetGetInstrumentBalanceSheetStatementsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "InstrumentDataGetInstrumentBalanceSheetStatementsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt similarity index 85% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt index 0ac0f204..ece20624 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.cashflowstatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -15,7 +15,7 @@ import kotlin.jvm.optionals.getOrNull * Retrieves historical cash flow statements for the specified instrument. Cash flow statements show * cash inflows and outflows from operating, investing, and financing activities. */ -class CashFlowStatementGetInstrumentCashFlowStatementsParams +class InstrumentDataGetInstrumentCashFlowStatementsParams private constructor( private val instrumentId: String?, private val fromDate: String?, @@ -54,16 +54,16 @@ private constructor( companion object { @JvmStatic - fun none(): CashFlowStatementGetInstrumentCashFlowStatementsParams = builder().build() + fun none(): InstrumentDataGetInstrumentCashFlowStatementsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [CashFlowStatementGetInstrumentCashFlowStatementsParams]. + * [InstrumentDataGetInstrumentCashFlowStatementsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [CashFlowStatementGetInstrumentCashFlowStatementsParams]. */ + /** A builder for [InstrumentDataGetInstrumentCashFlowStatementsParams]. */ class Builder internal constructor() { private var instrumentId: String? = null @@ -76,18 +76,18 @@ private constructor( @JvmSynthetic internal fun from( - cashFlowStatementGetInstrumentCashFlowStatementsParams: - CashFlowStatementGetInstrumentCashFlowStatementsParams + instrumentDataGetInstrumentCashFlowStatementsParams: + InstrumentDataGetInstrumentCashFlowStatementsParams ) = apply { - instrumentId = cashFlowStatementGetInstrumentCashFlowStatementsParams.instrumentId - fromDate = cashFlowStatementGetInstrumentCashFlowStatementsParams.fromDate - pageSize = cashFlowStatementGetInstrumentCashFlowStatementsParams.pageSize - pageToken = cashFlowStatementGetInstrumentCashFlowStatementsParams.pageToken - toDate = cashFlowStatementGetInstrumentCashFlowStatementsParams.toDate + instrumentId = instrumentDataGetInstrumentCashFlowStatementsParams.instrumentId + fromDate = instrumentDataGetInstrumentCashFlowStatementsParams.fromDate + pageSize = instrumentDataGetInstrumentCashFlowStatementsParams.pageSize + pageToken = instrumentDataGetInstrumentCashFlowStatementsParams.pageToken + toDate = instrumentDataGetInstrumentCashFlowStatementsParams.toDate additionalHeaders = - cashFlowStatementGetInstrumentCashFlowStatementsParams.additionalHeaders.toBuilder() + instrumentDataGetInstrumentCashFlowStatementsParams.additionalHeaders.toBuilder() additionalQueryParams = - cashFlowStatementGetInstrumentCashFlowStatementsParams.additionalQueryParams + instrumentDataGetInstrumentCashFlowStatementsParams.additionalQueryParams .toBuilder() } @@ -229,13 +229,12 @@ private constructor( } /** - * Returns an immutable instance of - * [CashFlowStatementGetInstrumentCashFlowStatementsParams]. + * Returns an immutable instance of [InstrumentDataGetInstrumentCashFlowStatementsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams( + fun build(): InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams( instrumentId, fromDate, pageSize, @@ -270,7 +269,7 @@ private constructor( return true } - return other is CashFlowStatementGetInstrumentCashFlowStatementsParams && + return other is InstrumentDataGetInstrumentCashFlowStatementsParams && instrumentId == other.instrumentId && fromDate == other.fromDate && pageSize == other.pageSize && @@ -292,5 +291,5 @@ private constructor( ) override fun toString() = - "CashFlowStatementGetInstrumentCashFlowStatementsParams{instrumentId=$instrumentId, fromDate=$fromDate, pageSize=$pageSize, pageToken=$pageToken, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentDataGetInstrumentCashFlowStatementsParams{instrumentId=$instrumentId, fromDate=$fromDate, pageSize=$pageSize, pageToken=$pageToken, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt index 7f1a8068..0821ddcd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.cashflowstatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class CashFlowStatementGetInstrumentCashFlowStatementsResponse +class InstrumentDataGetInstrumentCashFlowStatementsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -108,7 +108,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [CashFlowStatementGetInstrumentCashFlowStatementsResponse]. + * [InstrumentDataGetInstrumentCashFlowStatementsResponse]. * * The following fields are required: * ```java @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CashFlowStatementGetInstrumentCashFlowStatementsResponse]. */ + /** A builder for [InstrumentDataGetInstrumentCashFlowStatementsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -129,17 +129,17 @@ private constructor( @JvmSynthetic internal fun from( - cashFlowStatementGetInstrumentCashFlowStatementsResponse: - CashFlowStatementGetInstrumentCashFlowStatementsResponse + instrumentDataGetInstrumentCashFlowStatementsResponse: + InstrumentDataGetInstrumentCashFlowStatementsResponse ) = apply { - metadata = cashFlowStatementGetInstrumentCashFlowStatementsResponse.metadata - error = cashFlowStatementGetInstrumentCashFlowStatementsResponse.error + metadata = instrumentDataGetInstrumentCashFlowStatementsResponse.metadata + error = instrumentDataGetInstrumentCashFlowStatementsResponse.error data = - cashFlowStatementGetInstrumentCashFlowStatementsResponse.data.map { + instrumentDataGetInstrumentCashFlowStatementsResponse.data.map { it.toMutableList() } additionalProperties = - cashFlowStatementGetInstrumentCashFlowStatementsResponse.additionalProperties + instrumentDataGetInstrumentCashFlowStatementsResponse.additionalProperties .toMutableMap() } @@ -214,8 +214,7 @@ private constructor( } /** - * Returns an immutable instance of - * [CashFlowStatementGetInstrumentCashFlowStatementsResponse]. + * Returns an immutable instance of [InstrumentDataGetInstrumentCashFlowStatementsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -227,8 +226,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CashFlowStatementGetInstrumentCashFlowStatementsResponse = - CashFlowStatementGetInstrumentCashFlowStatementsResponse( + fun build(): InstrumentDataGetInstrumentCashFlowStatementsResponse = + InstrumentDataGetInstrumentCashFlowStatementsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -246,7 +245,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): CashFlowStatementGetInstrumentCashFlowStatementsResponse = apply { + fun validate(): InstrumentDataGetInstrumentCashFlowStatementsResponse = apply { if (validated) { return@apply } @@ -281,7 +280,7 @@ private constructor( return true } - return other is CashFlowStatementGetInstrumentCashFlowStatementsResponse && + return other is InstrumentDataGetInstrumentCashFlowStatementsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -293,5 +292,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CashFlowStatementGetInstrumentCashFlowStatementsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "InstrumentDataGetInstrumentCashFlowStatementsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt similarity index 85% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt index 3b820084..178711e6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -16,7 +16,7 @@ import kotlin.jvm.optionals.getOrNull * - `from_date`: today - 365 days * - `to_date`: today + 60 days */ -class EventGetInstrumentEventsParams +class InstrumentDataGetInstrumentEventsParams private constructor( private val instrumentId: String?, private val fromDate: String?, @@ -44,16 +44,16 @@ private constructor( companion object { - @JvmStatic fun none(): EventGetInstrumentEventsParams = builder().build() + @JvmStatic fun none(): InstrumentDataGetInstrumentEventsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [EventGetInstrumentEventsParams]. + * [InstrumentDataGetInstrumentEventsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [EventGetInstrumentEventsParams]. */ + /** A builder for [InstrumentDataGetInstrumentEventsParams]. */ class Builder internal constructor() { private var instrumentId: String? = null @@ -63,12 +63,16 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(eventGetInstrumentEventsParams: EventGetInstrumentEventsParams) = apply { - instrumentId = eventGetInstrumentEventsParams.instrumentId - fromDate = eventGetInstrumentEventsParams.fromDate - toDate = eventGetInstrumentEventsParams.toDate - additionalHeaders = eventGetInstrumentEventsParams.additionalHeaders.toBuilder() - additionalQueryParams = eventGetInstrumentEventsParams.additionalQueryParams.toBuilder() + internal fun from( + instrumentDataGetInstrumentEventsParams: InstrumentDataGetInstrumentEventsParams + ) = apply { + instrumentId = instrumentDataGetInstrumentEventsParams.instrumentId + fromDate = instrumentDataGetInstrumentEventsParams.fromDate + toDate = instrumentDataGetInstrumentEventsParams.toDate + additionalHeaders = + instrumentDataGetInstrumentEventsParams.additionalHeaders.toBuilder() + additionalQueryParams = + instrumentDataGetInstrumentEventsParams.additionalQueryParams.toBuilder() } /** OEMS instrument UUID */ @@ -188,12 +192,12 @@ private constructor( } /** - * Returns an immutable instance of [EventGetInstrumentEventsParams]. + * Returns an immutable instance of [InstrumentDataGetInstrumentEventsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): EventGetInstrumentEventsParams = - EventGetInstrumentEventsParams( + fun build(): InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams( instrumentId, fromDate, toDate, @@ -224,7 +228,7 @@ private constructor( return true } - return other is EventGetInstrumentEventsParams && + return other is InstrumentDataGetInstrumentEventsParams && instrumentId == other.instrumentId && fromDate == other.fromDate && toDate == other.toDate && @@ -236,5 +240,5 @@ private constructor( Objects.hash(instrumentId, fromDate, toDate, additionalHeaders, additionalQueryParams) override fun toString() = - "EventGetInstrumentEventsParams{instrumentId=$instrumentId, fromDate=$fromDate, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentDataGetInstrumentEventsParams{instrumentId=$instrumentId, fromDate=$fromDate, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt index 09dbd545..da057348 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class EventGetInstrumentEventsResponse +class InstrumentDataGetInstrumentEventsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -106,7 +106,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [EventGetInstrumentEventsResponse]. + * [InstrumentDataGetInstrumentEventsResponse]. * * The following fields are required: * ```java @@ -117,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [EventGetInstrumentEventsResponse]. */ + /** A builder for [InstrumentDataGetInstrumentEventsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -126,14 +126,15 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(eventGetInstrumentEventsResponse: EventGetInstrumentEventsResponse) = - apply { - metadata = eventGetInstrumentEventsResponse.metadata - error = eventGetInstrumentEventsResponse.error - data = eventGetInstrumentEventsResponse.data - additionalProperties = - eventGetInstrumentEventsResponse.additionalProperties.toMutableMap() - } + internal fun from( + instrumentDataGetInstrumentEventsResponse: InstrumentDataGetInstrumentEventsResponse + ) = apply { + metadata = instrumentDataGetInstrumentEventsResponse.metadata + error = instrumentDataGetInstrumentEventsResponse.error + data = instrumentDataGetInstrumentEventsResponse.data + additionalProperties = + instrumentDataGetInstrumentEventsResponse.additionalProperties.toMutableMap() + } /** Response metadata, including the request ID and optional pagination info. */ fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) @@ -193,7 +194,7 @@ private constructor( } /** - * Returns an immutable instance of [EventGetInstrumentEventsResponse]. + * Returns an immutable instance of [InstrumentDataGetInstrumentEventsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -205,8 +206,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): EventGetInstrumentEventsResponse = - EventGetInstrumentEventsResponse( + fun build(): InstrumentDataGetInstrumentEventsResponse = + InstrumentDataGetInstrumentEventsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -224,7 +225,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): EventGetInstrumentEventsResponse = apply { + fun validate(): InstrumentDataGetInstrumentEventsResponse = apply { if (validated) { return@apply } @@ -259,7 +260,7 @@ private constructor( return true } - return other is EventGetInstrumentEventsResponse && + return other is InstrumentDataGetInstrumentEventsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -271,5 +272,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventGetInstrumentEventsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "InstrumentDataGetInstrumentEventsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt index cafcc848..fd93ed4e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.fundamentals +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -10,7 +10,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** Retrieves supplemental fundamentals and company profile data for an instrument. */ -class FundamentalGetInstrumentFundamentalsParams +class InstrumentDataGetInstrumentFundamentalsParams private constructor( private val instrumentId: String?, private val additionalHeaders: Headers, @@ -30,16 +30,16 @@ private constructor( companion object { - @JvmStatic fun none(): FundamentalGetInstrumentFundamentalsParams = builder().build() + @JvmStatic fun none(): InstrumentDataGetInstrumentFundamentalsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [FundamentalGetInstrumentFundamentalsParams]. + * [InstrumentDataGetInstrumentFundamentalsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [FundamentalGetInstrumentFundamentalsParams]. */ + /** A builder for [InstrumentDataGetInstrumentFundamentalsParams]. */ class Builder internal constructor() { private var instrumentId: String? = null @@ -48,13 +48,14 @@ private constructor( @JvmSynthetic internal fun from( - fundamentalGetInstrumentFundamentalsParams: FundamentalGetInstrumentFundamentalsParams + instrumentDataGetInstrumentFundamentalsParams: + InstrumentDataGetInstrumentFundamentalsParams ) = apply { - instrumentId = fundamentalGetInstrumentFundamentalsParams.instrumentId + instrumentId = instrumentDataGetInstrumentFundamentalsParams.instrumentId additionalHeaders = - fundamentalGetInstrumentFundamentalsParams.additionalHeaders.toBuilder() + instrumentDataGetInstrumentFundamentalsParams.additionalHeaders.toBuilder() additionalQueryParams = - fundamentalGetInstrumentFundamentalsParams.additionalQueryParams.toBuilder() + instrumentDataGetInstrumentFundamentalsParams.additionalQueryParams.toBuilder() } /** OEMS instrument UUID */ @@ -162,12 +163,12 @@ private constructor( } /** - * Returns an immutable instance of [FundamentalGetInstrumentFundamentalsParams]. + * Returns an immutable instance of [InstrumentDataGetInstrumentFundamentalsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams( + fun build(): InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams( instrumentId, additionalHeaders.build(), additionalQueryParams.build(), @@ -189,7 +190,7 @@ private constructor( return true } - return other is FundamentalGetInstrumentFundamentalsParams && + return other is InstrumentDataGetInstrumentFundamentalsParams && instrumentId == other.instrumentId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams @@ -199,5 +200,5 @@ private constructor( Objects.hash(instrumentId, additionalHeaders, additionalQueryParams) override fun toString() = - "FundamentalGetInstrumentFundamentalsParams{instrumentId=$instrumentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentDataGetInstrumentFundamentalsParams{instrumentId=$instrumentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt index 557bbbe3..3e657017 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.fundamentals +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class FundamentalGetInstrumentFundamentalsResponse +class InstrumentDataGetInstrumentFundamentalsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -106,7 +106,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [FundamentalGetInstrumentFundamentalsResponse]. + * [InstrumentDataGetInstrumentFundamentalsResponse]. * * The following fields are required: * ```java @@ -117,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [FundamentalGetInstrumentFundamentalsResponse]. */ + /** A builder for [InstrumentDataGetInstrumentFundamentalsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -127,14 +127,14 @@ private constructor( @JvmSynthetic internal fun from( - fundamentalGetInstrumentFundamentalsResponse: - FundamentalGetInstrumentFundamentalsResponse + instrumentDataGetInstrumentFundamentalsResponse: + InstrumentDataGetInstrumentFundamentalsResponse ) = apply { - metadata = fundamentalGetInstrumentFundamentalsResponse.metadata - error = fundamentalGetInstrumentFundamentalsResponse.error - data = fundamentalGetInstrumentFundamentalsResponse.data + metadata = instrumentDataGetInstrumentFundamentalsResponse.metadata + error = instrumentDataGetInstrumentFundamentalsResponse.error + data = instrumentDataGetInstrumentFundamentalsResponse.data additionalProperties = - fundamentalGetInstrumentFundamentalsResponse.additionalProperties.toMutableMap() + instrumentDataGetInstrumentFundamentalsResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -195,7 +195,7 @@ private constructor( } /** - * Returns an immutable instance of [FundamentalGetInstrumentFundamentalsResponse]. + * Returns an immutable instance of [InstrumentDataGetInstrumentFundamentalsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -207,8 +207,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): FundamentalGetInstrumentFundamentalsResponse = - FundamentalGetInstrumentFundamentalsResponse( + fun build(): InstrumentDataGetInstrumentFundamentalsResponse = + InstrumentDataGetInstrumentFundamentalsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -226,7 +226,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): FundamentalGetInstrumentFundamentalsResponse = apply { + fun validate(): InstrumentDataGetInstrumentFundamentalsResponse = apply { if (validated) { return@apply } @@ -261,7 +261,7 @@ private constructor( return true } - return other is FundamentalGetInstrumentFundamentalsResponse && + return other is InstrumentDataGetInstrumentFundamentalsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -273,5 +273,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FundamentalGetInstrumentFundamentalsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "InstrumentDataGetInstrumentFundamentalsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt similarity index 85% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt index 626eb150..3d6f0fa8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.incomestatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -17,7 +17,7 @@ import kotlin.jvm.optionals.getOrNull * - `from_date`: None (no lower bound) * - `to_date`: None (no upper bound) */ -class IncomeStatementGetInstrumentIncomeStatementsParams +class InstrumentDataGetInstrumentIncomeStatementsParams private constructor( private val instrumentId: String?, private val fromDate: String?, @@ -55,17 +55,16 @@ private constructor( companion object { - @JvmStatic - fun none(): IncomeStatementGetInstrumentIncomeStatementsParams = builder().build() + @JvmStatic fun none(): InstrumentDataGetInstrumentIncomeStatementsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [IncomeStatementGetInstrumentIncomeStatementsParams]. + * [InstrumentDataGetInstrumentIncomeStatementsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [IncomeStatementGetInstrumentIncomeStatementsParams]. */ + /** A builder for [InstrumentDataGetInstrumentIncomeStatementsParams]. */ class Builder internal constructor() { private var instrumentId: String? = null @@ -78,18 +77,18 @@ private constructor( @JvmSynthetic internal fun from( - incomeStatementGetInstrumentIncomeStatementsParams: - IncomeStatementGetInstrumentIncomeStatementsParams + instrumentDataGetInstrumentIncomeStatementsParams: + InstrumentDataGetInstrumentIncomeStatementsParams ) = apply { - instrumentId = incomeStatementGetInstrumentIncomeStatementsParams.instrumentId - fromDate = incomeStatementGetInstrumentIncomeStatementsParams.fromDate - pageSize = incomeStatementGetInstrumentIncomeStatementsParams.pageSize - pageToken = incomeStatementGetInstrumentIncomeStatementsParams.pageToken - toDate = incomeStatementGetInstrumentIncomeStatementsParams.toDate + instrumentId = instrumentDataGetInstrumentIncomeStatementsParams.instrumentId + fromDate = instrumentDataGetInstrumentIncomeStatementsParams.fromDate + pageSize = instrumentDataGetInstrumentIncomeStatementsParams.pageSize + pageToken = instrumentDataGetInstrumentIncomeStatementsParams.pageToken + toDate = instrumentDataGetInstrumentIncomeStatementsParams.toDate additionalHeaders = - incomeStatementGetInstrumentIncomeStatementsParams.additionalHeaders.toBuilder() + instrumentDataGetInstrumentIncomeStatementsParams.additionalHeaders.toBuilder() additionalQueryParams = - incomeStatementGetInstrumentIncomeStatementsParams.additionalQueryParams.toBuilder() + instrumentDataGetInstrumentIncomeStatementsParams.additionalQueryParams.toBuilder() } /** OEMS instrument UUID */ @@ -230,12 +229,12 @@ private constructor( } /** - * Returns an immutable instance of [IncomeStatementGetInstrumentIncomeStatementsParams]. + * Returns an immutable instance of [InstrumentDataGetInstrumentIncomeStatementsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams( + fun build(): InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams( instrumentId, fromDate, pageSize, @@ -270,7 +269,7 @@ private constructor( return true } - return other is IncomeStatementGetInstrumentIncomeStatementsParams && + return other is InstrumentDataGetInstrumentIncomeStatementsParams && instrumentId == other.instrumentId && fromDate == other.fromDate && pageSize == other.pageSize && @@ -292,5 +291,5 @@ private constructor( ) override fun toString() = - "IncomeStatementGetInstrumentIncomeStatementsParams{instrumentId=$instrumentId, fromDate=$fromDate, pageSize=$pageSize, pageToken=$pageToken, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentDataGetInstrumentIncomeStatementsParams{instrumentId=$instrumentId, fromDate=$fromDate, pageSize=$pageSize, pageToken=$pageToken, toDate=$toDate, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt index 69049e56..a5af88fb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.incomestatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class IncomeStatementGetInstrumentIncomeStatementsResponse +class InstrumentDataGetInstrumentIncomeStatementsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -108,7 +108,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [IncomeStatementGetInstrumentIncomeStatementsResponse]. + * [InstrumentDataGetInstrumentIncomeStatementsResponse]. * * The following fields are required: * ```java @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [IncomeStatementGetInstrumentIncomeStatementsResponse]. */ + /** A builder for [InstrumentDataGetInstrumentIncomeStatementsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -129,15 +129,15 @@ private constructor( @JvmSynthetic internal fun from( - incomeStatementGetInstrumentIncomeStatementsResponse: - IncomeStatementGetInstrumentIncomeStatementsResponse + instrumentDataGetInstrumentIncomeStatementsResponse: + InstrumentDataGetInstrumentIncomeStatementsResponse ) = apply { - metadata = incomeStatementGetInstrumentIncomeStatementsResponse.metadata - error = incomeStatementGetInstrumentIncomeStatementsResponse.error + metadata = instrumentDataGetInstrumentIncomeStatementsResponse.metadata + error = instrumentDataGetInstrumentIncomeStatementsResponse.error data = - incomeStatementGetInstrumentIncomeStatementsResponse.data.map { it.toMutableList() } + instrumentDataGetInstrumentIncomeStatementsResponse.data.map { it.toMutableList() } additionalProperties = - incomeStatementGetInstrumentIncomeStatementsResponse.additionalProperties + instrumentDataGetInstrumentIncomeStatementsResponse.additionalProperties .toMutableMap() } @@ -212,7 +212,7 @@ private constructor( } /** - * Returns an immutable instance of [IncomeStatementGetInstrumentIncomeStatementsResponse]. + * Returns an immutable instance of [InstrumentDataGetInstrumentIncomeStatementsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -224,8 +224,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): IncomeStatementGetInstrumentIncomeStatementsResponse = - IncomeStatementGetInstrumentIncomeStatementsResponse( + fun build(): InstrumentDataGetInstrumentIncomeStatementsResponse = + InstrumentDataGetInstrumentIncomeStatementsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -243,7 +243,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): IncomeStatementGetInstrumentIncomeStatementsResponse = apply { + fun validate(): InstrumentDataGetInstrumentIncomeStatementsResponse = apply { if (validated) { return@apply } @@ -278,7 +278,7 @@ private constructor( return true } - return other is IncomeStatementGetInstrumentIncomeStatementsResponse && + return other is InstrumentDataGetInstrumentIncomeStatementsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -290,5 +290,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IncomeStatementGetInstrumentIncomeStatementsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "InstrumentDataGetInstrumentIncomeStatementsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentDividendEvent.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEvent.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentDividendEvent.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEvent.kt index ed9c962b..ae378aae 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentDividendEvent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEvent.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentEarnings.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarnings.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentEarnings.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarnings.kt index f07ece14..0022d6cf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentEarnings.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarnings.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventEnvelope.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventEnvelope.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt index 528a7918..f3e925a5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventEnvelope.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -8,7 +8,6 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.instruments.InstrumentEarnings import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventIpoItem.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventIpoItem.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt index 9ec3fbce..df412883 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventIpoItem.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsByDate.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDate.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsByDate.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDate.kt index 36eebb81..f7f4f2e2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsByDate.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDate.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsData.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsData.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt index 85c8a7e6..0a5aa19b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -10,7 +10,6 @@ import com.clear_street.api.core.checkKnown import com.clear_street.api.core.checkRequired import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.instruments.InstrumentEarnings import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/InstrumentFundamentals.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/InstrumentFundamentals.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt index 525fa985..a96c2a1c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/InstrumentFundamentals.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.fundamentals +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/InstrumentIncomeStatement.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/InstrumentIncomeStatement.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt index 62d0ece7..703aada6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/InstrumentIncomeStatement.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.incomestatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -8,7 +8,6 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentSplitEvent.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEvent.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentSplitEvent.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEvent.kt index ce09b97e..83549525 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentSplitEvent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEvent.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/PriceTarget.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTarget.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/PriceTarget.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTarget.kt index 1f51f876..25fceaa6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/PriceTarget.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTarget.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummary.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummary.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummary.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummary.kt index bd38d604..9b46fd34 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummary.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummary.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.dailysummary +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt index 8910664f..d8e72c21 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.dailysummary +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.Params import com.clear_street.api.core.checkRequired @@ -22,7 +22,7 @@ import java.util.Objects * service serves daily aggregates directly, or when Polygon symbology is loaded into the instrument * cache. */ -class DailySummaryGetDailySummariesParams +class MarketDataGetDailySummariesParams private constructor( private val instrumentIds: String, private val additionalHeaders: Headers, @@ -44,7 +44,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [DailySummaryGetDailySummariesParams]. + * [MarketDataGetDailySummariesParams]. * * The following fields are required: * ```java @@ -54,7 +54,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [DailySummaryGetDailySummariesParams]. */ + /** A builder for [MarketDataGetDailySummariesParams]. */ class Builder internal constructor() { private var instrumentIds: String? = null @@ -62,14 +62,13 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from( - dailySummaryGetDailySummariesParams: DailySummaryGetDailySummariesParams - ) = apply { - instrumentIds = dailySummaryGetDailySummariesParams.instrumentIds - additionalHeaders = dailySummaryGetDailySummariesParams.additionalHeaders.toBuilder() - additionalQueryParams = - dailySummaryGetDailySummariesParams.additionalQueryParams.toBuilder() - } + internal fun from(marketDataGetDailySummariesParams: MarketDataGetDailySummariesParams) = + apply { + instrumentIds = marketDataGetDailySummariesParams.instrumentIds + additionalHeaders = marketDataGetDailySummariesParams.additionalHeaders.toBuilder() + additionalQueryParams = + marketDataGetDailySummariesParams.additionalQueryParams.toBuilder() + } /** Comma-separated OEMS instrument UUIDs (required, 1..=100) */ fun instrumentIds(instrumentIds: String) = apply { this.instrumentIds = instrumentIds } @@ -173,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [DailySummaryGetDailySummariesParams]. + * Returns an immutable instance of [MarketDataGetDailySummariesParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -184,8 +183,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): DailySummaryGetDailySummariesParams = - DailySummaryGetDailySummariesParams( + fun build(): MarketDataGetDailySummariesParams = + MarketDataGetDailySummariesParams( checkRequired("instrumentIds", instrumentIds), additionalHeaders.build(), additionalQueryParams.build(), @@ -207,7 +206,7 @@ private constructor( return true } - return other is DailySummaryGetDailySummariesParams && + return other is MarketDataGetDailySummariesParams && instrumentIds == other.instrumentIds && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams @@ -217,5 +216,5 @@ private constructor( Objects.hash(instrumentIds, additionalHeaders, additionalQueryParams) override fun toString() = - "DailySummaryGetDailySummariesParams{instrumentIds=$instrumentIds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "MarketDataGetDailySummariesParams{instrumentIds=$instrumentIds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt index acd189ac..7f9be278 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.dailysummary +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class DailySummaryGetDailySummariesResponse +class MarketDataGetDailySummariesResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -104,7 +104,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [DailySummaryGetDailySummariesResponse]. + * [MarketDataGetDailySummariesResponse]. * * The following fields are required: * ```java @@ -115,7 +115,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [DailySummaryGetDailySummariesResponse]. */ + /** A builder for [MarketDataGetDailySummariesResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -125,13 +125,13 @@ private constructor( @JvmSynthetic internal fun from( - dailySummaryGetDailySummariesResponse: DailySummaryGetDailySummariesResponse + marketDataGetDailySummariesResponse: MarketDataGetDailySummariesResponse ) = apply { - metadata = dailySummaryGetDailySummariesResponse.metadata - error = dailySummaryGetDailySummariesResponse.error - data = dailySummaryGetDailySummariesResponse.data.map { it.toMutableList() } + metadata = marketDataGetDailySummariesResponse.metadata + error = marketDataGetDailySummariesResponse.error + data = marketDataGetDailySummariesResponse.data.map { it.toMutableList() } additionalProperties = - dailySummaryGetDailySummariesResponse.additionalProperties.toMutableMap() + marketDataGetDailySummariesResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -205,7 +205,7 @@ private constructor( } /** - * Returns an immutable instance of [DailySummaryGetDailySummariesResponse]. + * Returns an immutable instance of [MarketDataGetDailySummariesResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -217,8 +217,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): DailySummaryGetDailySummariesResponse = - DailySummaryGetDailySummariesResponse( + fun build(): MarketDataGetDailySummariesResponse = + MarketDataGetDailySummariesResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -236,7 +236,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): DailySummaryGetDailySummariesResponse = apply { + fun validate(): MarketDataGetDailySummariesResponse = apply { if (validated) { return@apply } @@ -271,7 +271,7 @@ private constructor( return true } - return other is DailySummaryGetDailySummariesResponse && + return other is MarketDataGetDailySummariesResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -283,5 +283,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "DailySummaryGetDailySummariesResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "MarketDataGetDailySummariesResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt index 07ec16fa..99a41ccf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -11,7 +11,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** Get market data snapshots for one or more securities. */ -class SnapshotGetSnapshotsParams +class MarketDataGetSnapshotsParams private constructor( private val instrumentIds: List?, private val additionalHeaders: Headers, @@ -31,15 +31,15 @@ private constructor( companion object { - @JvmStatic fun none(): SnapshotGetSnapshotsParams = builder().build() + @JvmStatic fun none(): MarketDataGetSnapshotsParams = builder().build() /** - * Returns a mutable builder for constructing an instance of [SnapshotGetSnapshotsParams]. + * Returns a mutable builder for constructing an instance of [MarketDataGetSnapshotsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [SnapshotGetSnapshotsParams]. */ + /** A builder for [MarketDataGetSnapshotsParams]. */ class Builder internal constructor() { private var instrumentIds: MutableList? = null @@ -47,10 +47,10 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(snapshotGetSnapshotsParams: SnapshotGetSnapshotsParams) = apply { - instrumentIds = snapshotGetSnapshotsParams.instrumentIds?.toMutableList() - additionalHeaders = snapshotGetSnapshotsParams.additionalHeaders.toBuilder() - additionalQueryParams = snapshotGetSnapshotsParams.additionalQueryParams.toBuilder() + internal fun from(marketDataGetSnapshotsParams: MarketDataGetSnapshotsParams) = apply { + instrumentIds = marketDataGetSnapshotsParams.instrumentIds?.toMutableList() + additionalHeaders = marketDataGetSnapshotsParams.additionalHeaders.toBuilder() + additionalQueryParams = marketDataGetSnapshotsParams.additionalQueryParams.toBuilder() } /** Comma-separated OEMS instrument UUIDs. */ @@ -170,12 +170,12 @@ private constructor( } /** - * Returns an immutable instance of [SnapshotGetSnapshotsParams]. + * Returns an immutable instance of [MarketDataGetSnapshotsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): SnapshotGetSnapshotsParams = - SnapshotGetSnapshotsParams( + fun build(): MarketDataGetSnapshotsParams = + MarketDataGetSnapshotsParams( instrumentIds?.toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), @@ -197,7 +197,7 @@ private constructor( return true } - return other is SnapshotGetSnapshotsParams && + return other is MarketDataGetSnapshotsParams && instrumentIds == other.instrumentIds && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams @@ -207,5 +207,5 @@ private constructor( Objects.hash(instrumentIds, additionalHeaders, additionalQueryParams) override fun toString() = - "SnapshotGetSnapshotsParams{instrumentIds=$instrumentIds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "MarketDataGetSnapshotsParams{instrumentIds=$instrumentIds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt similarity index 90% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt index 3731c1ec..22f8897d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class SnapshotGetSnapshotsResponse +class MarketDataGetSnapshotsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -105,7 +105,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [SnapshotGetSnapshotsResponse]. + * Returns a mutable builder for constructing an instance of + * [MarketDataGetSnapshotsResponse]. * * The following fields are required: * ```java @@ -116,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SnapshotGetSnapshotsResponse]. */ + /** A builder for [MarketDataGetSnapshotsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -125,11 +126,12 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(snapshotGetSnapshotsResponse: SnapshotGetSnapshotsResponse) = apply { - metadata = snapshotGetSnapshotsResponse.metadata - error = snapshotGetSnapshotsResponse.error - data = snapshotGetSnapshotsResponse.data.map { it.toMutableList() } - additionalProperties = snapshotGetSnapshotsResponse.additionalProperties.toMutableMap() + internal fun from(marketDataGetSnapshotsResponse: MarketDataGetSnapshotsResponse) = apply { + metadata = marketDataGetSnapshotsResponse.metadata + error = marketDataGetSnapshotsResponse.error + data = marketDataGetSnapshotsResponse.data.map { it.toMutableList() } + additionalProperties = + marketDataGetSnapshotsResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -203,7 +205,7 @@ private constructor( } /** - * Returns an immutable instance of [SnapshotGetSnapshotsResponse]. + * Returns an immutable instance of [MarketDataGetSnapshotsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -215,8 +217,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): SnapshotGetSnapshotsResponse = - SnapshotGetSnapshotsResponse( + fun build(): MarketDataGetSnapshotsResponse = + MarketDataGetSnapshotsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -234,7 +236,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): SnapshotGetSnapshotsResponse = apply { + fun validate(): MarketDataGetSnapshotsResponse = apply { if (validated) { return@apply } @@ -269,7 +271,7 @@ private constructor( return true } - return other is SnapshotGetSnapshotsResponse && + return other is MarketDataGetSnapshotsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -281,5 +283,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SnapshotGetSnapshotsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "MarketDataGetSnapshotsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/MarketDataSnapshot.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/MarketDataSnapshot.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt index 4f0310a9..e51dda6e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/MarketDataSnapshot.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotLastTrade.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotLastTrade.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt index 3b9eed28..32f2d0b8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotLastTrade.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotQuote.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotQuote.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt index 1f678466..a8a04de4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotQuote.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotSession.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotSession.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt index 110c4959..8cd8dff4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotSession.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt index fcf5648e..e11d76fe 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt index 6caf0dfd..7df5c4ab 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsInstrument.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrument.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsInstrument.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrument.kt index 0b972664..0fb210b1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsInstrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrument.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsItem.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItem.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsItem.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItem.kt index 43a79ce4..bb68ad11 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsItem.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItem.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsType.kt index 674614c7..e9025b9b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/news/NewsType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt similarity index 86% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt index b794da4d..4ce99215 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt @@ -1,11 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.options +package com.clear_street.api.models.v1.instruments import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.models.v1.instruments.ContractType import java.time.LocalDate import java.util.Objects import java.util.Optional @@ -17,7 +16,7 @@ import kotlin.jvm.optionals.getOrNull * Returns options contracts for a given underlier with options-specific metadata. Exactly one * underlier identifier must be provided. */ -class OptionGetOptionContractsParams +class InstrumentGetOptionContractsParams private constructor( private val contractType: ContractType?, private val expiry: LocalDate?, @@ -59,16 +58,16 @@ private constructor( companion object { - @JvmStatic fun none(): OptionGetOptionContractsParams = builder().build() + @JvmStatic fun none(): InstrumentGetOptionContractsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [OptionGetOptionContractsParams]. + * [InstrumentGetOptionContractsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [OptionGetOptionContractsParams]. */ + /** A builder for [InstrumentGetOptionContractsParams]. */ class Builder internal constructor() { private var contractType: ContractType? = null @@ -81,16 +80,18 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(optionGetOptionContractsParams: OptionGetOptionContractsParams) = apply { - contractType = optionGetOptionContractsParams.contractType - expiry = optionGetOptionContractsParams.expiry - pageSize = optionGetOptionContractsParams.pageSize - pageToken = optionGetOptionContractsParams.pageToken - underlier = optionGetOptionContractsParams.underlier - underlyingInstrumentId = optionGetOptionContractsParams.underlyingInstrumentId - additionalHeaders = optionGetOptionContractsParams.additionalHeaders.toBuilder() - additionalQueryParams = optionGetOptionContractsParams.additionalQueryParams.toBuilder() - } + internal fun from(instrumentGetOptionContractsParams: InstrumentGetOptionContractsParams) = + apply { + contractType = instrumentGetOptionContractsParams.contractType + expiry = instrumentGetOptionContractsParams.expiry + pageSize = instrumentGetOptionContractsParams.pageSize + pageToken = instrumentGetOptionContractsParams.pageToken + underlier = instrumentGetOptionContractsParams.underlier + underlyingInstrumentId = instrumentGetOptionContractsParams.underlyingInstrumentId + additionalHeaders = instrumentGetOptionContractsParams.additionalHeaders.toBuilder() + additionalQueryParams = + instrumentGetOptionContractsParams.additionalQueryParams.toBuilder() + } /** Filter by contract type: CALL or PUT */ fun contractType(contractType: ContractType?) = apply { this.contractType = contractType } @@ -243,12 +244,12 @@ private constructor( } /** - * Returns an immutable instance of [OptionGetOptionContractsParams]. + * Returns an immutable instance of [InstrumentGetOptionContractsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): OptionGetOptionContractsParams = - OptionGetOptionContractsParams( + fun build(): InstrumentGetOptionContractsParams = + InstrumentGetOptionContractsParams( contractType, expiry, pageSize, @@ -280,7 +281,7 @@ private constructor( return true } - return other is OptionGetOptionContractsParams && + return other is InstrumentGetOptionContractsParams && contractType == other.contractType && expiry == other.expiry && pageSize == other.pageSize && @@ -304,5 +305,5 @@ private constructor( ) override fun toString() = - "OptionGetOptionContractsParams{contractType=$contractType, expiry=$expiry, pageSize=$pageSize, pageToken=$pageToken, underlier=$underlier, underlyingInstrumentId=$underlyingInstrumentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentGetOptionContractsParams{contractType=$contractType, expiry=$expiry, pageSize=$pageSize, pageToken=$pageToken, underlier=$underlier, underlyingInstrumentId=$underlyingInstrumentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt index c6abf96a..eea782cf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.options +package com.clear_street.api.models.v1.instruments import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -13,7 +13,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.instruments.OptionsContract import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -23,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class OptionGetOptionContractsResponse +class InstrumentGetOptionContractsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -107,7 +106,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [OptionGetOptionContractsResponse]. + * [InstrumentGetOptionContractsResponse]. * * The following fields are required: * ```java @@ -118,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [OptionGetOptionContractsResponse]. */ + /** A builder for [InstrumentGetOptionContractsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -127,14 +126,15 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(optionGetOptionContractsResponse: OptionGetOptionContractsResponse) = - apply { - metadata = optionGetOptionContractsResponse.metadata - error = optionGetOptionContractsResponse.error - data = optionGetOptionContractsResponse.data.map { it.toMutableList() } - additionalProperties = - optionGetOptionContractsResponse.additionalProperties.toMutableMap() - } + internal fun from( + instrumentGetOptionContractsResponse: InstrumentGetOptionContractsResponse + ) = apply { + metadata = instrumentGetOptionContractsResponse.metadata + error = instrumentGetOptionContractsResponse.error + data = instrumentGetOptionContractsResponse.data.map { it.toMutableList() } + additionalProperties = + instrumentGetOptionContractsResponse.additionalProperties.toMutableMap() + } /** Response metadata, including the request ID and optional pagination info. */ fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) @@ -207,7 +207,7 @@ private constructor( } /** - * Returns an immutable instance of [OptionGetOptionContractsResponse]. + * Returns an immutable instance of [InstrumentGetOptionContractsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -219,8 +219,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): OptionGetOptionContractsResponse = - OptionGetOptionContractsResponse( + fun build(): InstrumentGetOptionContractsResponse = + InstrumentGetOptionContractsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -238,7 +238,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): OptionGetOptionContractsResponse = apply { + fun validate(): InstrumentGetOptionContractsResponse = apply { if (validated) { return@apply } @@ -273,7 +273,7 @@ private constructor( return true } - return other is OptionGetOptionContractsResponse && + return other is InstrumentGetOptionContractsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -285,5 +285,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OptionGetOptionContractsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "InstrumentGetOptionContractsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt index fa03f00d..a19ea1ff 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt @@ -10,6 +10,8 @@ import com.clear_street.api.core.checkKnown import com.clear_street.api.core.checkRequired import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementAgreementKey +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderAction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderAction.kt index 8ca4cc70..95c596aa 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderAction.kt @@ -10,7 +10,7 @@ import com.clear_street.api.core.checkKnown import com.clear_street.api.core.checkRequired import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.accounts.orders.CancelOrderRequest +import com.clear_street.api.models.v1.orders.CancelOrderRequest import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderAction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderAction.kt index 245dc434..2187f0b8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderAction.kt @@ -10,7 +10,7 @@ import com.clear_street.api.core.checkKnown import com.clear_street.api.core.checkRequired import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.accounts.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.NewOrderRequest import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderAction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderAction.kt index fa4a4123..bed26012 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderAction.kt @@ -15,8 +15,8 @@ import com.clear_street.api.core.checkRequired import com.clear_street.api.core.getOrThrow import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.accounts.orders.CancelOrderRequest -import com.clear_street.api.models.v1.accounts.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.CancelOrderRequest +import com.clear_street.api.models.v1.orders.NewOrderRequest import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/EntitlementAgreementKey.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementKey.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/EntitlementAgreementKey.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementKey.kt index 21e8673e..df556dcc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/EntitlementAgreementKey.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementKey.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.entitlements import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementResource.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementResource.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt index a9b94b8c..342a3e1f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementResource.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlementagreements +package com.clear_street.api.models.v1.omniai.entitlements import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -10,8 +10,6 @@ import com.clear_street.api.core.checkKnown import com.clear_street.api.core.checkRequired import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.EntitlementAgreementKey -import com.clear_street.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/EntitlementCode.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCode.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/EntitlementCode.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCode.kt index 2114a7f7..2f1a0487 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/EntitlementCode.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCode.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.entitlements import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt index 5073a6e1..c25bed67 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt @@ -13,7 +13,6 @@ import com.clear_street.api.core.http.Headers import com.clear_street.api.core.http.QueryParams import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt similarity index 83% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt index bb3a4810..b8fb4d1f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlementagreements +package com.clear_street.api.models.v1.omniai.entitlements import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -8,7 +8,7 @@ import com.clear_street.api.core.http.QueryParams import java.util.Objects /** List current signable entitlement agreements for consent UX. */ -class EntitlementAgreementGetEntitlementAgreementsParams +class EntitlementGetEntitlementAgreementsParams private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -24,17 +24,16 @@ private constructor( companion object { - @JvmStatic - fun none(): EntitlementAgreementGetEntitlementAgreementsParams = builder().build() + @JvmStatic fun none(): EntitlementGetEntitlementAgreementsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [EntitlementAgreementGetEntitlementAgreementsParams]. + * [EntitlementGetEntitlementAgreementsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [EntitlementAgreementGetEntitlementAgreementsParams]. */ + /** A builder for [EntitlementGetEntitlementAgreementsParams]. */ class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() @@ -42,13 +41,12 @@ private constructor( @JvmSynthetic internal fun from( - entitlementAgreementGetEntitlementAgreementsParams: - EntitlementAgreementGetEntitlementAgreementsParams + entitlementGetEntitlementAgreementsParams: EntitlementGetEntitlementAgreementsParams ) = apply { additionalHeaders = - entitlementAgreementGetEntitlementAgreementsParams.additionalHeaders.toBuilder() + entitlementGetEntitlementAgreementsParams.additionalHeaders.toBuilder() additionalQueryParams = - entitlementAgreementGetEntitlementAgreementsParams.additionalQueryParams.toBuilder() + entitlementGetEntitlementAgreementsParams.additionalQueryParams.toBuilder() } fun additionalHeaders(additionalHeaders: Headers) = apply { @@ -150,12 +148,12 @@ private constructor( } /** - * Returns an immutable instance of [EntitlementAgreementGetEntitlementAgreementsParams]. + * Returns an immutable instance of [EntitlementGetEntitlementAgreementsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams( + fun build(): EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams( additionalHeaders.build(), additionalQueryParams.build(), ) @@ -170,7 +168,7 @@ private constructor( return true } - return other is EntitlementAgreementGetEntitlementAgreementsParams && + return other is EntitlementGetEntitlementAgreementsParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } @@ -178,5 +176,5 @@ private constructor( override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) override fun toString() = - "EntitlementAgreementGetEntitlementAgreementsParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "EntitlementGetEntitlementAgreementsParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt index 4e342c95..f72644ab 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlementagreements +package com.clear_street.api.models.v1.omniai.entitlements import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class EntitlementAgreementGetEntitlementAgreementsResponse +class EntitlementGetEntitlementAgreementsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -108,7 +108,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [EntitlementAgreementGetEntitlementAgreementsResponse]. + * [EntitlementGetEntitlementAgreementsResponse]. * * The following fields are required: * ```java @@ -119,7 +119,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [EntitlementAgreementGetEntitlementAgreementsResponse]. */ + /** A builder for [EntitlementGetEntitlementAgreementsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -129,16 +129,13 @@ private constructor( @JvmSynthetic internal fun from( - entitlementAgreementGetEntitlementAgreementsResponse: - EntitlementAgreementGetEntitlementAgreementsResponse + entitlementGetEntitlementAgreementsResponse: EntitlementGetEntitlementAgreementsResponse ) = apply { - metadata = entitlementAgreementGetEntitlementAgreementsResponse.metadata - error = entitlementAgreementGetEntitlementAgreementsResponse.error - data = - entitlementAgreementGetEntitlementAgreementsResponse.data.map { it.toMutableList() } + metadata = entitlementGetEntitlementAgreementsResponse.metadata + error = entitlementGetEntitlementAgreementsResponse.error + data = entitlementGetEntitlementAgreementsResponse.data.map { it.toMutableList() } additionalProperties = - entitlementAgreementGetEntitlementAgreementsResponse.additionalProperties - .toMutableMap() + entitlementGetEntitlementAgreementsResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -212,7 +209,7 @@ private constructor( } /** - * Returns an immutable instance of [EntitlementAgreementGetEntitlementAgreementsResponse]. + * Returns an immutable instance of [EntitlementGetEntitlementAgreementsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -224,8 +221,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): EntitlementAgreementGetEntitlementAgreementsResponse = - EntitlementAgreementGetEntitlementAgreementsResponse( + fun build(): EntitlementGetEntitlementAgreementsResponse = + EntitlementGetEntitlementAgreementsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -243,7 +240,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): EntitlementAgreementGetEntitlementAgreementsResponse = apply { + fun validate(): EntitlementGetEntitlementAgreementsResponse = apply { if (validated) { return@apply } @@ -278,7 +275,7 @@ private constructor( return true } - return other is EntitlementAgreementGetEntitlementAgreementsResponse && + return other is EntitlementGetEntitlementAgreementsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -290,5 +287,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EntitlementAgreementGetEntitlementAgreementsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "EntitlementGetEntitlementAgreementsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResource.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResource.kt index f3baaff4..8d33ea16 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResource.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResource.kt @@ -8,7 +8,6 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateFeedbackResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateFeedbackResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponse.kt index 09e76974..58e08bdc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateFeedbackResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.messages import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt index 59ef1575..caa0bb6b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt @@ -11,7 +11,7 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.Message +import com.clear_street.api.models.v1.omniai.threads.Message import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt index 5504d150..8f9dc49f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt @@ -11,7 +11,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.CreateFeedbackResponse import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CancelResponsePayload.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayload.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CancelResponsePayload.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayload.kt index 72fada16..6b707d91 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CancelResponsePayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayload.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ErrorStatus.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatus.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ErrorStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatus.kt index 95fae23b..873656e8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ErrorStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatus.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Response.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/Response.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Response.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/Response.kt index cced7388..48f3e34e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Response.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/Response.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt index a216024c..747076b4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt @@ -11,7 +11,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.CancelResponsePayload import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseContent.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContent.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseContent.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContent.kt index 4dffaa33..4e4918fa 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseContent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContent.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentPart.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPart.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentPart.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPart.kt index 7046cb25..9f3bc882 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentPart.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPart.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.BaseDeserializer import com.clear_street.api.core.BaseSerializer @@ -15,6 +15,15 @@ import com.clear_street.api.core.checkRequired import com.clear_street.api.core.getOrThrow import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clear_street.api.models.v1.omniai.ChartPayload +import com.clear_street.api.models.v1.omniai.ContentPartChartPayload +import com.clear_street.api.models.v1.omniai.ContentPartCustomPayload +import com.clear_street.api.models.v1.omniai.ContentPartStructuredActionPayload +import com.clear_street.api.models.v1.omniai.ContentPartSuggestedActionsPayload +import com.clear_street.api.models.v1.omniai.ContentPartTextPayload +import com.clear_street.api.models.v1.omniai.ContentPartThinkingPayload +import com.clear_street.api.models.v1.omniai.StructuredAction +import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt index c9350f33..3c88153f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt @@ -11,7 +11,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.Response import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseStatus.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseStatus.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseStatus.kt index 9be4fbd0..d3b4b3f8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ResponseStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseStatus.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateMessageResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateMessageResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponse.kt index 03e295cf..2ec129e5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateMessageResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateThreadResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateThreadResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponse.kt index ffcc253d..24bd2cbb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/CreateThreadResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Message.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Message.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Message.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Message.kt index 307757c5..6dd1decc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Message.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Message.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -8,6 +8,7 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clear_street.api.models.v1.omniai.responses.ErrorStatus import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageContent.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContent.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageContent.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContent.kt index 2f3533b3..b6960d48 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageContent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContent.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageContentPart.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPart.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageContentPart.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPart.kt index 9d8e13a6..d45afc13 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageContentPart.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPart.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.BaseDeserializer import com.clear_street.api.core.BaseSerializer @@ -13,6 +13,14 @@ import com.clear_street.api.core.allMaxBy import com.clear_street.api.core.checkRequired import com.clear_street.api.core.getOrThrow import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clear_street.api.models.v1.omniai.ChartPayload +import com.clear_street.api.models.v1.omniai.ContentPartChartPayload +import com.clear_street.api.models.v1.omniai.ContentPartCustomPayload +import com.clear_street.api.models.v1.omniai.ContentPartStructuredActionPayload +import com.clear_street.api.models.v1.omniai.ContentPartSuggestedActionsPayload +import com.clear_street.api.models.v1.omniai.ContentPartTextPayload +import com.clear_street.api.models.v1.omniai.StructuredAction +import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageOutcome.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageOutcome.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageOutcome.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageOutcome.kt index 3c08593b..0615e6c1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageOutcome.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageOutcome.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageRole.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageRole.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageRole.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageRole.kt index cbcbd0bc..5ad7c24e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/MessageRole.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageRole.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Thread.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Thread.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Thread.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Thread.kt index 28d7223f..c561ce33 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/Thread.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Thread.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt index 0e9626a7..f40ec4d5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads.messages +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.Enum import com.clear_street.api.core.ExcludeMissing @@ -33,7 +33,7 @@ import kotlin.jvm.optionals.getOrNull * * Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for assistant output. */ -class MessageCreateMessageParams +class ThreadCreateMessageParams private constructor( private val threadId: String?, private val body: Body, @@ -95,7 +95,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [MessageCreateMessageParams]. + * Returns a mutable builder for constructing an instance of [ThreadCreateMessageParams]. * * The following fields are required: * ```java @@ -106,7 +106,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [MessageCreateMessageParams]. */ + /** A builder for [ThreadCreateMessageParams]. */ class Builder internal constructor() { private var threadId: String? = null @@ -115,11 +115,11 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(messageCreateMessageParams: MessageCreateMessageParams) = apply { - threadId = messageCreateMessageParams.threadId - body = messageCreateMessageParams.body.toBuilder() - additionalHeaders = messageCreateMessageParams.additionalHeaders.toBuilder() - additionalQueryParams = messageCreateMessageParams.additionalQueryParams.toBuilder() + internal fun from(threadCreateMessageParams: ThreadCreateMessageParams) = apply { + threadId = threadCreateMessageParams.threadId + body = threadCreateMessageParams.body.toBuilder() + additionalHeaders = threadCreateMessageParams.additionalHeaders.toBuilder() + additionalQueryParams = threadCreateMessageParams.additionalQueryParams.toBuilder() } fun threadId(threadId: String?) = apply { this.threadId = threadId } @@ -296,7 +296,7 @@ private constructor( } /** - * Returns an immutable instance of [MessageCreateMessageParams]. + * Returns an immutable instance of [ThreadCreateMessageParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -308,8 +308,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): MessageCreateMessageParams = - MessageCreateMessageParams( + fun build(): ThreadCreateMessageParams = + ThreadCreateMessageParams( threadId, body.build(), additionalHeaders.build(), @@ -748,7 +748,7 @@ private constructor( return true } - return other is MessageCreateMessageParams && + return other is ThreadCreateMessageParams && threadId == other.threadId && body == other.body && additionalHeaders == other.additionalHeaders && @@ -759,5 +759,5 @@ private constructor( Objects.hash(threadId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "MessageCreateMessageParams{threadId=$threadId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "ThreadCreateMessageParams{threadId=$threadId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt index 8b62f40f..243ea483 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads.messages +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -11,7 +11,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.CreateMessageResponse import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -21,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class MessageCreateMessageResponse +class ThreadCreateMessageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -106,7 +105,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [MessageCreateMessageResponse]. + * Returns a mutable builder for constructing an instance of [ThreadCreateMessageResponse]. * * The following fields are required: * ```java @@ -117,7 +116,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [MessageCreateMessageResponse]. */ + /** A builder for [ThreadCreateMessageResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -126,11 +125,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(messageCreateMessageResponse: MessageCreateMessageResponse) = apply { - metadata = messageCreateMessageResponse.metadata - error = messageCreateMessageResponse.error - data = messageCreateMessageResponse.data - additionalProperties = messageCreateMessageResponse.additionalProperties.toMutableMap() + internal fun from(threadCreateMessageResponse: ThreadCreateMessageResponse) = apply { + metadata = threadCreateMessageResponse.metadata + error = threadCreateMessageResponse.error + data = threadCreateMessageResponse.data + additionalProperties = threadCreateMessageResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -191,7 +190,7 @@ private constructor( } /** - * Returns an immutable instance of [MessageCreateMessageResponse]. + * Returns an immutable instance of [ThreadCreateMessageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -203,8 +202,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): MessageCreateMessageResponse = - MessageCreateMessageResponse( + fun build(): ThreadCreateMessageResponse = + ThreadCreateMessageResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -222,7 +221,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): MessageCreateMessageResponse = apply { + fun validate(): ThreadCreateMessageResponse = apply { if (validated) { return@apply } @@ -257,7 +256,7 @@ private constructor( return true } - return other is MessageCreateMessageResponse && + return other is ThreadCreateMessageResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -269,5 +268,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MessageCreateMessageResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "ThreadCreateMessageResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt index 6c80a462..77e17305 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt @@ -11,7 +11,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.CreateThreadResponse import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt index 93054d25..31febbf5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads.messages +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.Params import com.clear_street.api.core.checkRequired @@ -20,7 +20,7 @@ import kotlin.jvm.optionals.getOrNull * If the last finalized message has role `USER`, an active response likely exists and should be * polled separately. */ -class MessageGetMessagesParams +class ThreadGetMessagesParams private constructor( private val threadId: String?, private val accountId: Long, @@ -54,7 +54,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [MessageGetMessagesParams]. + * Returns a mutable builder for constructing an instance of [ThreadGetMessagesParams]. * * The following fields are required: * ```java @@ -64,7 +64,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [MessageGetMessagesParams]. */ + /** A builder for [ThreadGetMessagesParams]. */ class Builder internal constructor() { private var threadId: String? = null @@ -75,13 +75,13 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(messageGetMessagesParams: MessageGetMessagesParams) = apply { - threadId = messageGetMessagesParams.threadId - accountId = messageGetMessagesParams.accountId - pageSize = messageGetMessagesParams.pageSize - pageToken = messageGetMessagesParams.pageToken - additionalHeaders = messageGetMessagesParams.additionalHeaders.toBuilder() - additionalQueryParams = messageGetMessagesParams.additionalQueryParams.toBuilder() + internal fun from(threadGetMessagesParams: ThreadGetMessagesParams) = apply { + threadId = threadGetMessagesParams.threadId + accountId = threadGetMessagesParams.accountId + pageSize = threadGetMessagesParams.pageSize + pageToken = threadGetMessagesParams.pageToken + additionalHeaders = threadGetMessagesParams.additionalHeaders.toBuilder() + additionalQueryParams = threadGetMessagesParams.additionalQueryParams.toBuilder() } fun threadId(threadId: String?) = apply { this.threadId = threadId } @@ -212,7 +212,7 @@ private constructor( } /** - * Returns an immutable instance of [MessageGetMessagesParams]. + * Returns an immutable instance of [ThreadGetMessagesParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -223,8 +223,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): MessageGetMessagesParams = - MessageGetMessagesParams( + fun build(): ThreadGetMessagesParams = + ThreadGetMessagesParams( threadId, checkRequired("accountId", accountId), pageSize, @@ -257,7 +257,7 @@ private constructor( return true } - return other is MessageGetMessagesParams && + return other is ThreadGetMessagesParams && threadId == other.threadId && accountId == other.accountId && pageSize == other.pageSize && @@ -277,5 +277,5 @@ private constructor( ) override fun toString() = - "MessageGetMessagesParams{threadId=$threadId, accountId=$accountId, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "ThreadGetMessagesParams{threadId=$threadId, accountId=$accountId, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt similarity index 90% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt index 58a04452..cee53fdf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads.messages +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -13,7 +13,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.Message import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -23,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class MessageGetMessagesResponse +class ThreadGetMessagesResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -104,7 +103,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [MessageGetMessagesResponse]. + * Returns a mutable builder for constructing an instance of [ThreadGetMessagesResponse]. * * The following fields are required: * ```java @@ -115,7 +114,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [MessageGetMessagesResponse]. */ + /** A builder for [ThreadGetMessagesResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -124,11 +123,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(messageGetMessagesResponse: MessageGetMessagesResponse) = apply { - metadata = messageGetMessagesResponse.metadata - error = messageGetMessagesResponse.error - data = messageGetMessagesResponse.data.map { it.toMutableList() } - additionalProperties = messageGetMessagesResponse.additionalProperties.toMutableMap() + internal fun from(threadGetMessagesResponse: ThreadGetMessagesResponse) = apply { + metadata = threadGetMessagesResponse.metadata + error = threadGetMessagesResponse.error + data = threadGetMessagesResponse.data.map { it.toMutableList() } + additionalProperties = threadGetMessagesResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -202,7 +201,7 @@ private constructor( } /** - * Returns an immutable instance of [MessageGetMessagesResponse]. + * Returns an immutable instance of [ThreadGetMessagesResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -214,8 +213,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): MessageGetMessagesResponse = - MessageGetMessagesResponse( + fun build(): ThreadGetMessagesResponse = + ThreadGetMessagesResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -233,7 +232,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): MessageGetMessagesResponse = apply { + fun validate(): ThreadGetMessagesResponse = apply { if (validated) { return@apply } @@ -268,7 +267,7 @@ private constructor( return true } - return other is MessageGetMessagesResponse && + return other is ThreadGetMessagesResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -280,5 +279,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MessageGetMessagesResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "ThreadGetMessagesResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt index 36b8b14c..7bcbbe30 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt @@ -11,7 +11,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.Thread import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt index 22d00d4c..668cc3bd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt @@ -11,7 +11,7 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.Response +import com.clear_street.api.models.v1.omniai.responses.Response import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt index 1a9e1fcd..a7794606 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt @@ -13,7 +13,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.Thread import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/CancelOrderRequest.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequest.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/CancelOrderRequest.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequest.kt index 5ee15bbe..77999cbc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/CancelOrderRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/NewOrderRequest.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/NewOrderRequest.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt index 55ea00b9..e0f44410 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/NewOrderRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/Order.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Order.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/Order.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Order.kt index 668d44c2..3cf389c9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/Order.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Order.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt index e10c73f5..4acb348e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt index c2f11fcd..7a19c60a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParams.kt index a909a127..872f139b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.JsonValue import com.clear_street.api.core.Params diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponse.kt index f905e50c..b8c5dbd6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParams.kt index f9a4f516..42406397 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Params import com.clear_street.api.core.checkRequired diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponse.kt index 87334436..d708f791 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt index 6b42eb2a..ab4f6832 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponse.kt index 6405e32b..05fd8cf2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParams.kt index 8a9d4d73..596aefd4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponse.kt index fe8a1620..df9be228 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderStatus.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderStatus.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderStatus.kt index b57aa65c..beac5b15 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderStatus.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt index 53b0234a..628b765f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.BaseDeserializer import com.clear_street.api.core.BaseSerializer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponse.kt index 64486a8c..9d93c7e4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderType.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderType.kt index b95e6cc5..e7859633 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/PositionEffect.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/PositionEffect.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/PositionEffect.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/PositionEffect.kt index 104591e6..2616ca08 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/PositionEffect.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/PositionEffect.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/QueueState.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/QueueState.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/QueueState.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/QueueState.kt index ae01431d..5da5c0e7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/QueueState.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/QueueState.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/RequestOrderType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestOrderType.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/RequestOrderType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestOrderType.kt index 2ca21042..8758a18d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/RequestOrderType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestOrderType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/RequestTimeInForce.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestTimeInForce.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/RequestTimeInForce.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestTimeInForce.kt index e70571df..fc535613 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/RequestTimeInForce.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestTimeInForce.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/Side.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Side.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/Side.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Side.kt index ad065ccd..af012a63 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/Side.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Side.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/TimeInForce.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TimeInForce.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/TimeInForce.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TimeInForce.kt index 2a46bcf3..c364d2e2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/TimeInForce.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TimeInForce.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/TrailingOffsetType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TrailingOffsetType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/TrailingOffsetType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TrailingOffsetType.kt index c9d839b3..9ea4f5b6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/orders/TrailingOffsetType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TrailingOffsetType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/Position.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/Position.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/Position.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/Position.kt index 4fd16ee0..970c54c9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/Position.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/Position.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt index 8c57777a..9e71bd3c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.JsonValue import com.clear_street.api.core.Params @@ -17,7 +17,7 @@ import kotlin.jvm.optionals.getOrNull * updated instruction with status `CANCEL_REQUESTED`; the terminal `CANCELLED` / `CANCEL_FAILED` * state arrives asynchronously via subsequent GETs. */ -class InstructionCancelPositionInstructionParams +class PositionCancelPositionInstructionParams private constructor( private val accountId: Long, private val instructionId: String?, @@ -45,7 +45,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InstructionCancelPositionInstructionParams]. + * [PositionCancelPositionInstructionParams]. * * The following fields are required: * ```java @@ -55,7 +55,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InstructionCancelPositionInstructionParams]. */ + /** A builder for [PositionCancelPositionInstructionParams]. */ class Builder internal constructor() { private var accountId: Long? = null @@ -66,16 +66,16 @@ private constructor( @JvmSynthetic internal fun from( - instructionCancelPositionInstructionParams: InstructionCancelPositionInstructionParams + positionCancelPositionInstructionParams: PositionCancelPositionInstructionParams ) = apply { - accountId = instructionCancelPositionInstructionParams.accountId - instructionId = instructionCancelPositionInstructionParams.instructionId + accountId = positionCancelPositionInstructionParams.accountId + instructionId = positionCancelPositionInstructionParams.instructionId additionalHeaders = - instructionCancelPositionInstructionParams.additionalHeaders.toBuilder() + positionCancelPositionInstructionParams.additionalHeaders.toBuilder() additionalQueryParams = - instructionCancelPositionInstructionParams.additionalQueryParams.toBuilder() + positionCancelPositionInstructionParams.additionalQueryParams.toBuilder() additionalBodyProperties = - instructionCancelPositionInstructionParams.additionalBodyProperties.toMutableMap() + positionCancelPositionInstructionParams.additionalBodyProperties.toMutableMap() } fun accountId(accountId: Long) = apply { this.accountId = accountId } @@ -207,7 +207,7 @@ private constructor( } /** - * Returns an immutable instance of [InstructionCancelPositionInstructionParams]. + * Returns an immutable instance of [PositionCancelPositionInstructionParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -218,8 +218,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InstructionCancelPositionInstructionParams = - InstructionCancelPositionInstructionParams( + fun build(): PositionCancelPositionInstructionParams = + PositionCancelPositionInstructionParams( checkRequired("accountId", accountId), instructionId, additionalHeaders.build(), @@ -247,7 +247,7 @@ private constructor( return true } - return other is InstructionCancelPositionInstructionParams && + return other is PositionCancelPositionInstructionParams && accountId == other.accountId && instructionId == other.instructionId && additionalHeaders == other.additionalHeaders && @@ -265,5 +265,5 @@ private constructor( ) override fun toString() = - "InstructionCancelPositionInstructionParams{accountId=$accountId, instructionId=$instructionId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "PositionCancelPositionInstructionParams{accountId=$accountId, instructionId=$instructionId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt index ff8b2fec..fcbf2d51 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class InstructionCancelPositionInstructionResponse +class PositionCancelPositionInstructionResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -107,7 +107,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InstructionCancelPositionInstructionResponse]. + * [PositionCancelPositionInstructionResponse]. * * The following fields are required: * ```java @@ -118,7 +118,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InstructionCancelPositionInstructionResponse]. */ + /** A builder for [PositionCancelPositionInstructionResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -128,14 +128,13 @@ private constructor( @JvmSynthetic internal fun from( - instructionCancelPositionInstructionResponse: - InstructionCancelPositionInstructionResponse + positionCancelPositionInstructionResponse: PositionCancelPositionInstructionResponse ) = apply { - metadata = instructionCancelPositionInstructionResponse.metadata - error = instructionCancelPositionInstructionResponse.error - data = instructionCancelPositionInstructionResponse.data + metadata = positionCancelPositionInstructionResponse.metadata + error = positionCancelPositionInstructionResponse.error + data = positionCancelPositionInstructionResponse.data additionalProperties = - instructionCancelPositionInstructionResponse.additionalProperties.toMutableMap() + positionCancelPositionInstructionResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -199,7 +198,7 @@ private constructor( } /** - * Returns an immutable instance of [InstructionCancelPositionInstructionResponse]. + * Returns an immutable instance of [PositionCancelPositionInstructionResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -211,8 +210,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InstructionCancelPositionInstructionResponse = - InstructionCancelPositionInstructionResponse( + fun build(): PositionCancelPositionInstructionResponse = + PositionCancelPositionInstructionResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -230,7 +229,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): InstructionCancelPositionInstructionResponse = apply { + fun validate(): PositionCancelPositionInstructionResponse = apply { if (validated) { return@apply } @@ -265,7 +264,7 @@ private constructor( return true } - return other is InstructionCancelPositionInstructionResponse && + return other is PositionCancelPositionInstructionResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -277,5 +276,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstructionCancelPositionInstructionResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "PositionCancelPositionInstructionResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt index 0b30e1e7..0bc1737f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponse.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponse.kt index 21d04670..a092391d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -13,7 +13,7 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.accounts.orders.Order +import com.clear_street.api.models.v1.orders.Order import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt index d69afb5d..9b03f498 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponse.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponse.kt index 064f19cc..66191b0d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -13,7 +13,7 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.accounts.orders.Order +import com.clear_street.api.models.v1.orders.Order import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt similarity index 85% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt index c14e0a08..85a86ee8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers @@ -13,7 +13,7 @@ import kotlin.jvm.optionals.getOrNull * Returns the current lifecycle state of exercise / DNE / CEA instructions for the account. * Optionally filter by a specific instrument. */ -class InstructionGetPositionInstructionsParams +class PositionGetPositionInstructionsParams private constructor( private val accountId: Long?, private val instrumentId: String?, @@ -36,16 +36,16 @@ private constructor( companion object { - @JvmStatic fun none(): InstructionGetPositionInstructionsParams = builder().build() + @JvmStatic fun none(): PositionGetPositionInstructionsParams = builder().build() /** * Returns a mutable builder for constructing an instance of - * [InstructionGetPositionInstructionsParams]. + * [PositionGetPositionInstructionsParams]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [InstructionGetPositionInstructionsParams]. */ + /** A builder for [PositionGetPositionInstructionsParams]. */ class Builder internal constructor() { private var accountId: Long? = null @@ -55,14 +55,13 @@ private constructor( @JvmSynthetic internal fun from( - instructionGetPositionInstructionsParams: InstructionGetPositionInstructionsParams + positionGetPositionInstructionsParams: PositionGetPositionInstructionsParams ) = apply { - accountId = instructionGetPositionInstructionsParams.accountId - instrumentId = instructionGetPositionInstructionsParams.instrumentId - additionalHeaders = - instructionGetPositionInstructionsParams.additionalHeaders.toBuilder() + accountId = positionGetPositionInstructionsParams.accountId + instrumentId = positionGetPositionInstructionsParams.instrumentId + additionalHeaders = positionGetPositionInstructionsParams.additionalHeaders.toBuilder() additionalQueryParams = - instructionGetPositionInstructionsParams.additionalQueryParams.toBuilder() + positionGetPositionInstructionsParams.additionalQueryParams.toBuilder() } fun accountId(accountId: Long?) = apply { this.accountId = accountId } @@ -182,12 +181,12 @@ private constructor( } /** - * Returns an immutable instance of [InstructionGetPositionInstructionsParams]. + * Returns an immutable instance of [PositionGetPositionInstructionsParams]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): InstructionGetPositionInstructionsParams = - InstructionGetPositionInstructionsParams( + fun build(): PositionGetPositionInstructionsParams = + PositionGetPositionInstructionsParams( accountId, instrumentId, additionalHeaders.build(), @@ -216,7 +215,7 @@ private constructor( return true } - return other is InstructionGetPositionInstructionsParams && + return other is PositionGetPositionInstructionsParams && accountId == other.accountId && instrumentId == other.instrumentId && additionalHeaders == other.additionalHeaders && @@ -227,5 +226,5 @@ private constructor( Objects.hash(accountId, instrumentId, additionalHeaders, additionalQueryParams) override fun toString() = - "InstructionGetPositionInstructionsParams{accountId=$accountId, instrumentId=$instrumentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "PositionGetPositionInstructionsParams{accountId=$accountId, instrumentId=$instrumentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt index 289de0d9..760f8444 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class InstructionSubmitPositionInstructionsResponse +class PositionGetPositionInstructionsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -106,7 +106,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InstructionSubmitPositionInstructionsResponse]. + * [PositionGetPositionInstructionsResponse]. * * The following fields are required: * ```java @@ -117,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InstructionSubmitPositionInstructionsResponse]. */ + /** A builder for [PositionGetPositionInstructionsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -127,14 +127,13 @@ private constructor( @JvmSynthetic internal fun from( - instructionSubmitPositionInstructionsResponse: - InstructionSubmitPositionInstructionsResponse + positionGetPositionInstructionsResponse: PositionGetPositionInstructionsResponse ) = apply { - metadata = instructionSubmitPositionInstructionsResponse.metadata - error = instructionSubmitPositionInstructionsResponse.error - data = instructionSubmitPositionInstructionsResponse.data.map { it.toMutableList() } + metadata = positionGetPositionInstructionsResponse.metadata + error = positionGetPositionInstructionsResponse.error + data = positionGetPositionInstructionsResponse.data.map { it.toMutableList() } additionalProperties = - instructionSubmitPositionInstructionsResponse.additionalProperties.toMutableMap() + positionGetPositionInstructionsResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -208,7 +207,7 @@ private constructor( } /** - * Returns an immutable instance of [InstructionSubmitPositionInstructionsResponse]. + * Returns an immutable instance of [PositionGetPositionInstructionsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -220,8 +219,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InstructionSubmitPositionInstructionsResponse = - InstructionSubmitPositionInstructionsResponse( + fun build(): PositionGetPositionInstructionsResponse = + PositionGetPositionInstructionsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -239,7 +238,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): InstructionSubmitPositionInstructionsResponse = apply { + fun validate(): PositionGetPositionInstructionsResponse = apply { if (validated) { return@apply } @@ -274,7 +273,7 @@ private constructor( return true } - return other is InstructionSubmitPositionInstructionsResponse && + return other is PositionGetPositionInstructionsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -286,5 +285,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstructionSubmitPositionInstructionsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "PositionGetPositionInstructionsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt index b5b59ce6..25e881e7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponse.kt index ce4739ef..e38ff36c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstruction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstruction.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt index 8e1a7ae6..756ea596 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstruction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionStatus.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt index 4bfe2229..5b678c67 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt index 2c3e516f..bafba775 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt index 566822e1..4a1e540d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -26,7 +26,7 @@ import kotlin.jvm.optionals.getOrNull * `oems-csc` independently; per-row rejections are surfaced on the corresponding response entry * without failing the batch. */ -class InstructionSubmitPositionInstructionsParams +class PositionSubmitPositionInstructionsParams private constructor( private val accountId: Long?, private val instructions: List, @@ -50,7 +50,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InstructionSubmitPositionInstructionsParams]. + * [PositionSubmitPositionInstructionsParams]. * * The following fields are required: * ```java @@ -60,7 +60,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InstructionSubmitPositionInstructionsParams]. */ + /** A builder for [PositionSubmitPositionInstructionsParams]. */ class Builder internal constructor() { private var accountId: Long? = null @@ -70,14 +70,14 @@ private constructor( @JvmSynthetic internal fun from( - instructionSubmitPositionInstructionsParams: InstructionSubmitPositionInstructionsParams + positionSubmitPositionInstructionsParams: PositionSubmitPositionInstructionsParams ) = apply { - accountId = instructionSubmitPositionInstructionsParams.accountId - instructions = instructionSubmitPositionInstructionsParams.instructions.toMutableList() + accountId = positionSubmitPositionInstructionsParams.accountId + instructions = positionSubmitPositionInstructionsParams.instructions.toMutableList() additionalHeaders = - instructionSubmitPositionInstructionsParams.additionalHeaders.toBuilder() + positionSubmitPositionInstructionsParams.additionalHeaders.toBuilder() additionalQueryParams = - instructionSubmitPositionInstructionsParams.additionalQueryParams.toBuilder() + positionSubmitPositionInstructionsParams.additionalQueryParams.toBuilder() } fun accountId(accountId: Long?) = apply { this.accountId = accountId } @@ -204,7 +204,7 @@ private constructor( } /** - * Returns an immutable instance of [InstructionSubmitPositionInstructionsParams]. + * Returns an immutable instance of [PositionSubmitPositionInstructionsParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -215,8 +215,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InstructionSubmitPositionInstructionsParams = - InstructionSubmitPositionInstructionsParams( + fun build(): PositionSubmitPositionInstructionsParams = + PositionSubmitPositionInstructionsParams( accountId, checkRequired("instructions", instructions).toImmutable(), additionalHeaders.build(), @@ -573,7 +573,7 @@ private constructor( return true } - return other is InstructionSubmitPositionInstructionsParams && + return other is PositionSubmitPositionInstructionsParams && accountId == other.accountId && instructions == other.instructions && additionalHeaders == other.additionalHeaders && @@ -584,5 +584,5 @@ private constructor( Objects.hash(accountId, instructions, additionalHeaders, additionalQueryParams) override fun toString() = - "InstructionSubmitPositionInstructionsParams{accountId=$accountId, instructions=$instructions, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "PositionSubmitPositionInstructionsParams{accountId=$accountId, instructions=$instructions, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt index 97ff3c5e..22cf7739 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -22,7 +22,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class InstructionGetPositionInstructionsResponse +class PositionSubmitPositionInstructionsResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -106,7 +106,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InstructionGetPositionInstructionsResponse]. + * [PositionSubmitPositionInstructionsResponse]. * * The following fields are required: * ```java @@ -117,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InstructionGetPositionInstructionsResponse]. */ + /** A builder for [PositionSubmitPositionInstructionsResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -127,13 +127,13 @@ private constructor( @JvmSynthetic internal fun from( - instructionGetPositionInstructionsResponse: InstructionGetPositionInstructionsResponse + positionSubmitPositionInstructionsResponse: PositionSubmitPositionInstructionsResponse ) = apply { - metadata = instructionGetPositionInstructionsResponse.metadata - error = instructionGetPositionInstructionsResponse.error - data = instructionGetPositionInstructionsResponse.data.map { it.toMutableList() } + metadata = positionSubmitPositionInstructionsResponse.metadata + error = positionSubmitPositionInstructionsResponse.error + data = positionSubmitPositionInstructionsResponse.data.map { it.toMutableList() } additionalProperties = - instructionGetPositionInstructionsResponse.additionalProperties.toMutableMap() + positionSubmitPositionInstructionsResponse.additionalProperties.toMutableMap() } /** Response metadata, including the request ID and optional pagination info. */ @@ -207,7 +207,7 @@ private constructor( } /** - * Returns an immutable instance of [InstructionGetPositionInstructionsResponse]. + * Returns an immutable instance of [PositionSubmitPositionInstructionsResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -219,8 +219,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InstructionGetPositionInstructionsResponse = - InstructionGetPositionInstructionsResponse( + fun build(): PositionSubmitPositionInstructionsResponse = + PositionSubmitPositionInstructionsResponse( checkRequired("metadata", metadata), error, checkRequired("data", data).map { it.toImmutable() }, @@ -238,7 +238,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): InstructionGetPositionInstructionsResponse = apply { + fun validate(): PositionSubmitPositionInstructionsResponse = apply { if (validated) { return@apply } @@ -273,7 +273,7 @@ private constructor( return true } - return other is InstructionGetPositionInstructionsResponse && + return other is PositionSubmitPositionInstructionsResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -285,5 +285,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstructionGetPositionInstructionsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "PositionSubmitPositionInstructionsResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionType.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionType.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionType.kt index 626afb1f..9e5cd140 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionType.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.Enum import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/AddWatchlistItemData.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemData.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/AddWatchlistItemData.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemData.kt index 2623dfb4..d4c54aec 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/AddWatchlistItemData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemData.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt index c174bd96..cf38d8bc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -21,7 +21,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** Add an instrument to a watchlist */ -class ItemAddWatchlistItemParams +class WatchlistAddWatchlistItemParams private constructor( private val watchlistId: String?, private val body: Body, @@ -59,7 +59,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [ItemAddWatchlistItemParams]. + * Returns a mutable builder for constructing an instance of + * [WatchlistAddWatchlistItemParams]. * * The following fields are required: * ```java @@ -69,7 +70,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ItemAddWatchlistItemParams]. */ + /** A builder for [WatchlistAddWatchlistItemParams]. */ class Builder internal constructor() { private var watchlistId: String? = null @@ -78,12 +79,14 @@ private constructor( private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic - internal fun from(itemAddWatchlistItemParams: ItemAddWatchlistItemParams) = apply { - watchlistId = itemAddWatchlistItemParams.watchlistId - body = itemAddWatchlistItemParams.body.toBuilder() - additionalHeaders = itemAddWatchlistItemParams.additionalHeaders.toBuilder() - additionalQueryParams = itemAddWatchlistItemParams.additionalQueryParams.toBuilder() - } + internal fun from(watchlistAddWatchlistItemParams: WatchlistAddWatchlistItemParams) = + apply { + watchlistId = watchlistAddWatchlistItemParams.watchlistId + body = watchlistAddWatchlistItemParams.body.toBuilder() + additionalHeaders = watchlistAddWatchlistItemParams.additionalHeaders.toBuilder() + additionalQueryParams = + watchlistAddWatchlistItemParams.additionalQueryParams.toBuilder() + } fun watchlistId(watchlistId: String?) = apply { this.watchlistId = watchlistId } @@ -231,7 +234,7 @@ private constructor( } /** - * Returns an immutable instance of [ItemAddWatchlistItemParams]. + * Returns an immutable instance of [WatchlistAddWatchlistItemParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -242,8 +245,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): ItemAddWatchlistItemParams = - ItemAddWatchlistItemParams( + fun build(): WatchlistAddWatchlistItemParams = + WatchlistAddWatchlistItemParams( watchlistId, body.build(), additionalHeaders.build(), @@ -445,7 +448,7 @@ private constructor( return true } - return other is ItemAddWatchlistItemParams && + return other is WatchlistAddWatchlistItemParams && watchlistId == other.watchlistId && body == other.body && additionalHeaders == other.additionalHeaders && @@ -456,5 +459,5 @@ private constructor( Objects.hash(watchlistId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "ItemAddWatchlistItemParams{watchlistId=$watchlistId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "WatchlistAddWatchlistItemParams{watchlistId=$watchlistId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt index cd6eb2c8..eff4c662 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -20,7 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -class ItemAddWatchlistItemResponse +class WatchlistAddWatchlistItemResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val metadata: JsonField, @@ -105,7 +105,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [ItemAddWatchlistItemResponse]. + * Returns a mutable builder for constructing an instance of + * [WatchlistAddWatchlistItemResponse]. * * The following fields are required: * ```java @@ -116,7 +117,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ItemAddWatchlistItemResponse]. */ + /** A builder for [WatchlistAddWatchlistItemResponse]. */ class Builder internal constructor() { private var metadata: JsonField? = null @@ -125,12 +126,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(itemAddWatchlistItemResponse: ItemAddWatchlistItemResponse) = apply { - metadata = itemAddWatchlistItemResponse.metadata - error = itemAddWatchlistItemResponse.error - data = itemAddWatchlistItemResponse.data - additionalProperties = itemAddWatchlistItemResponse.additionalProperties.toMutableMap() - } + internal fun from(watchlistAddWatchlistItemResponse: WatchlistAddWatchlistItemResponse) = + apply { + metadata = watchlistAddWatchlistItemResponse.metadata + error = watchlistAddWatchlistItemResponse.error + data = watchlistAddWatchlistItemResponse.data + additionalProperties = + watchlistAddWatchlistItemResponse.additionalProperties.toMutableMap() + } /** Response metadata, including the request ID and optional pagination info. */ fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) @@ -190,7 +193,7 @@ private constructor( } /** - * Returns an immutable instance of [ItemAddWatchlistItemResponse]. + * Returns an immutable instance of [WatchlistAddWatchlistItemResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -202,8 +205,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): ItemAddWatchlistItemResponse = - ItemAddWatchlistItemResponse( + fun build(): WatchlistAddWatchlistItemResponse = + WatchlistAddWatchlistItemResponse( checkRequired("metadata", metadata), error, checkRequired("data", data), @@ -221,7 +224,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): ItemAddWatchlistItemResponse = apply { + fun validate(): WatchlistAddWatchlistItemResponse = apply { if (validated) { return@apply } @@ -256,7 +259,7 @@ private constructor( return true } - return other is ItemAddWatchlistItemResponse && + return other is WatchlistAddWatchlistItemResponse && metadata == other.metadata && error == other.error && data == other.data && @@ -268,5 +271,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ItemAddWatchlistItemResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" + "WatchlistAddWatchlistItemResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt index 96308f7d..9a12e64e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt index 750d5a08..9978d418 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt similarity index 86% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemParams.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt index c1837d19..d6fd7ec8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.JsonValue import com.clear_street.api.core.Params @@ -13,7 +13,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** Delete an instrument from a watchlist */ -class ItemDeleteWatchlistItemParams +class WatchlistDeleteWatchlistItemParams private constructor( private val watchlistId: String, private val itemId: String?, @@ -41,7 +41,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [ItemDeleteWatchlistItemParams]. + * [WatchlistDeleteWatchlistItemParams]. * * The following fields are required: * ```java @@ -51,7 +51,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ItemDeleteWatchlistItemParams]. */ + /** A builder for [WatchlistDeleteWatchlistItemParams]. */ class Builder internal constructor() { private var watchlistId: String? = null @@ -61,14 +61,16 @@ private constructor( private var additionalBodyProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(itemDeleteWatchlistItemParams: ItemDeleteWatchlistItemParams) = apply { - watchlistId = itemDeleteWatchlistItemParams.watchlistId - itemId = itemDeleteWatchlistItemParams.itemId - additionalHeaders = itemDeleteWatchlistItemParams.additionalHeaders.toBuilder() - additionalQueryParams = itemDeleteWatchlistItemParams.additionalQueryParams.toBuilder() - additionalBodyProperties = - itemDeleteWatchlistItemParams.additionalBodyProperties.toMutableMap() - } + internal fun from(watchlistDeleteWatchlistItemParams: WatchlistDeleteWatchlistItemParams) = + apply { + watchlistId = watchlistDeleteWatchlistItemParams.watchlistId + itemId = watchlistDeleteWatchlistItemParams.itemId + additionalHeaders = watchlistDeleteWatchlistItemParams.additionalHeaders.toBuilder() + additionalQueryParams = + watchlistDeleteWatchlistItemParams.additionalQueryParams.toBuilder() + additionalBodyProperties = + watchlistDeleteWatchlistItemParams.additionalBodyProperties.toMutableMap() + } fun watchlistId(watchlistId: String) = apply { this.watchlistId = watchlistId } @@ -198,7 +200,7 @@ private constructor( } /** - * Returns an immutable instance of [ItemDeleteWatchlistItemParams]. + * Returns an immutable instance of [WatchlistDeleteWatchlistItemParams]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -209,8 +211,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): ItemDeleteWatchlistItemParams = - ItemDeleteWatchlistItemParams( + fun build(): WatchlistDeleteWatchlistItemParams = + WatchlistDeleteWatchlistItemParams( checkRequired("watchlistId", watchlistId), itemId, additionalHeaders.build(), @@ -238,7 +240,7 @@ private constructor( return true } - return other is ItemDeleteWatchlistItemParams && + return other is WatchlistDeleteWatchlistItemParams && watchlistId == other.watchlistId && itemId == other.itemId && additionalHeaders == other.additionalHeaders && @@ -256,5 +258,5 @@ private constructor( ) override fun toString() = - "ItemDeleteWatchlistItemParams{watchlistId=$watchlistId, itemId=$itemId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "WatchlistDeleteWatchlistItemParams{watchlistId=$watchlistId, itemId=$itemId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } 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/watchlist/WatchlistDeleteWatchlistItemResponse.kt similarity index 78% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponse.kt index 5271b20f..2f8cd093 100644 --- 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/watchlist/WatchlistDeleteWatchlistItemResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonValue @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import java.util.Collections import java.util.Objects -class ItemDeleteWatchlistItemResponse +class WatchlistDeleteWatchlistItemResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor(private val additionalProperties: MutableMap) { @@ -33,22 +33,23 @@ private constructor(private val additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(itemDeleteWatchlistItemResponse: ItemDeleteWatchlistItemResponse) = - apply { - additionalProperties = - itemDeleteWatchlistItemResponse.additionalProperties.toMutableMap() - } + internal fun from( + watchlistDeleteWatchlistItemResponse: WatchlistDeleteWatchlistItemResponse + ) = apply { + additionalProperties = + watchlistDeleteWatchlistItemResponse.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -70,12 +71,12 @@ private constructor(private val additionalProperties: MutableMap = - websocketHandler(V1WebsocketHandlerParams.none()) + /** View positions and manage position instructions. */ + fun positions(): PositionServiceAsync - /** @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()) + /** Create and manage watchlists. */ + fun watchlist(): WatchlistServiceAsync - /** @see websocketHandler */ - fun websocketHandler(requestOptions: RequestOptions): CompletableFuture = - websocketHandler(V1WebsocketHandlerParams.none(), requestOptions) + /** Active Websocket. */ + fun websocket(): WebsocketServiceAsync /** A view of [V1ServiceAsync] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -89,47 +71,30 @@ interface V1ServiceAsync { /** 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 + /** Endpoints for API service metadata. */ + fun apiVersion(): ApiVersionServiceAsync.WithRawResponse - /** Retrieve details and lists of tradable instruments. */ - fun instruments(): InstrumentServiceAsync.WithRawResponse + /** Access clocks and financial calendars for market sessions and events. */ + fun calendar(): CalendarServiceAsync.WithRawResponse - fun marketData(): MarketDataServiceAsync.WithRawResponse + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun instrumentData(): InstrumentDataServiceAsync.WithRawResponse - /** Retrieve market news and related instrument metadata. */ - fun news(): NewsServiceAsync.WithRawResponse + /** Retrieve core details and discovery endpoints for tradable instruments. */ + fun instruments(): InstrumentServiceAsync.WithRawResponse fun omniAi(): OmniAiServiceAsync.WithRawResponse - /** Endpoints for API service metadata. */ - fun version(): VersionServiceAsync.WithRawResponse + /** Place, monitor, and manage trading orders. */ + fun orders(): OrderServiceAsync.WithRawResponse + + /** View positions and manage position instructions. */ + fun positions(): PositionServiceAsync.WithRawResponse /** Create and manage watchlists. */ - fun watchlists(): WatchlistServiceAsync.WithRawResponse + fun watchlist(): 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) + /** Active Websocket. */ + fun websocket(): WebsocketServiceAsync.WithRawResponse } } 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 index bd3b66e2..c6b8265c 100644 --- 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 @@ -3,39 +3,28 @@ 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.ApiVersionServiceAsync +import com.clear_street.api.services.async.v1.ApiVersionServiceAsyncImpl 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.InstrumentDataServiceAsync +import com.clear_street.api.services.async.v1.InstrumentDataServiceAsyncImpl 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.OrderServiceAsync +import com.clear_street.api.services.async.v1.OrderServiceAsyncImpl +import com.clear_street.api.services.async.v1.PositionServiceAsync +import com.clear_street.api.services.async.v1.PositionServiceAsyncImpl import com.clear_street.api.services.async.v1.WatchlistServiceAsync import com.clear_street.api.services.async.v1.WatchlistServiceAsyncImpl -import java.util.concurrent.CompletableFuture +import com.clear_street.api.services.async.v1.WebsocketServiceAsync +import com.clear_street.api.services.async.v1.WebsocketServiceAsyncImpl import java.util.function.Consumer -/** Active Websocket. */ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : V1ServiceAsync { @@ -45,28 +34,34 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO private val accounts: AccountServiceAsync by lazy { AccountServiceAsyncImpl(clientOptions) } - private val calendars: CalendarServiceAsync by lazy { CalendarServiceAsyncImpl(clientOptions) } + private val apiVersion: ApiVersionServiceAsync by lazy { + ApiVersionServiceAsyncImpl(clientOptions) + } - private val clock: ClockServiceAsync by lazy { ClockServiceAsyncImpl(clientOptions) } + private val calendar: CalendarServiceAsync by lazy { CalendarServiceAsyncImpl(clientOptions) } - private val instruments: InstrumentServiceAsync by lazy { - InstrumentServiceAsyncImpl(clientOptions) + private val instrumentData: InstrumentDataServiceAsync by lazy { + InstrumentDataServiceAsyncImpl(clientOptions) } - private val marketData: MarketDataServiceAsync by lazy { - MarketDataServiceAsyncImpl(clientOptions) + private val instruments: InstrumentServiceAsync by lazy { + InstrumentServiceAsyncImpl(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 orders: OrderServiceAsync by lazy { OrderServiceAsyncImpl(clientOptions) } - private val watchlists: WatchlistServiceAsync by lazy { + private val positions: PositionServiceAsync by lazy { PositionServiceAsyncImpl(clientOptions) } + + private val watchlist: WatchlistServiceAsync by lazy { WatchlistServiceAsyncImpl(clientOptions) } + private val websocket: WebsocketServiceAsync by lazy { + WebsocketServiceAsyncImpl(clientOptions) + } + override fun withRawResponse(): V1ServiceAsync.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): V1ServiceAsync = @@ -75,74 +70,73 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** 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 + /** Endpoints for API service metadata. */ + override fun apiVersion(): ApiVersionServiceAsync = apiVersion - /** Retrieve details and lists of tradable instruments. */ - override fun instruments(): InstrumentServiceAsync = instruments + /** Access clocks and financial calendars for market sessions and events. */ + override fun calendar(): CalendarServiceAsync = calendar - override fun marketData(): MarketDataServiceAsync = marketData + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun instrumentData(): InstrumentDataServiceAsync = instrumentData - /** Retrieve market news and related instrument metadata. */ - override fun news(): NewsServiceAsync = news + /** Retrieve core details and discovery endpoints for tradable instruments. */ + override fun instruments(): InstrumentServiceAsync = instruments override fun omniAi(): OmniAiServiceAsync = omniAi - /** Endpoints for API service metadata. */ - override fun version(): VersionServiceAsync = version + /** Place, monitor, and manage trading orders. */ + override fun orders(): OrderServiceAsync = orders + + /** View positions and manage position instructions. */ + override fun positions(): PositionServiceAsync = positions /** Create and manage watchlists. */ - override fun watchlists(): WatchlistServiceAsync = watchlists + override fun watchlist(): WatchlistServiceAsync = watchlist - override fun websocketHandler( - params: V1WebsocketHandlerParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/ws - withRawResponse().websocketHandler(params, requestOptions).thenAccept {} + /** Active Websocket. */ + override fun websocket(): WebsocketServiceAsync = websocket 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 { + private val apiVersion: ApiVersionServiceAsync.WithRawResponse by lazy { + ApiVersionServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + private val calendar: CalendarServiceAsync.WithRawResponse by lazy { CalendarServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val clock: ClockServiceAsync.WithRawResponse by lazy { - ClockServiceAsyncImpl.WithRawResponseImpl(clientOptions) + private val instrumentData: InstrumentDataServiceAsync.WithRawResponse by lazy { + InstrumentDataServiceAsyncImpl.WithRawResponseImpl(clientOptions) } private val instruments: InstrumentServiceAsync.WithRawResponse by lazy { InstrumentServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val marketData: MarketDataServiceAsync.WithRawResponse by lazy { - MarketDataServiceAsyncImpl.WithRawResponseImpl(clientOptions) + private val omniAi: OmniAiServiceAsync.WithRawResponse by lazy { + OmniAiServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val news: NewsServiceAsync.WithRawResponse by lazy { - NewsServiceAsyncImpl.WithRawResponseImpl(clientOptions) + private val orders: OrderServiceAsync.WithRawResponse by lazy { + OrderServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val omniAi: OmniAiServiceAsync.WithRawResponse by lazy { - OmniAiServiceAsyncImpl.WithRawResponseImpl(clientOptions) + private val positions: PositionServiceAsync.WithRawResponse by lazy { + PositionServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val version: VersionServiceAsync.WithRawResponse by lazy { - VersionServiceAsyncImpl.WithRawResponseImpl(clientOptions) + private val watchlist: WatchlistServiceAsync.WithRawResponse by lazy { + WatchlistServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val watchlists: WatchlistServiceAsync.WithRawResponse by lazy { - WatchlistServiceAsyncImpl.WithRawResponseImpl(clientOptions) + private val websocket: WebsocketServiceAsync.WithRawResponse by lazy { + WebsocketServiceAsyncImpl.WithRawResponseImpl(clientOptions) } override fun withOptions( @@ -155,48 +149,30 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** 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 + /** Endpoints for API service metadata. */ + override fun apiVersion(): ApiVersionServiceAsync.WithRawResponse = apiVersion - /** Retrieve details and lists of tradable instruments. */ - override fun instruments(): InstrumentServiceAsync.WithRawResponse = instruments + /** Access clocks and financial calendars for market sessions and events. */ + override fun calendar(): CalendarServiceAsync.WithRawResponse = calendar - override fun marketData(): MarketDataServiceAsync.WithRawResponse = marketData + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun instrumentData(): InstrumentDataServiceAsync.WithRawResponse = instrumentData - /** Retrieve market news and related instrument metadata. */ - override fun news(): NewsServiceAsync.WithRawResponse = news + /** Retrieve core details and discovery endpoints for tradable instruments. */ + override fun instruments(): InstrumentServiceAsync.WithRawResponse = instruments override fun omniAi(): OmniAiServiceAsync.WithRawResponse = omniAi - /** Endpoints for API service metadata. */ - override fun version(): VersionServiceAsync.WithRawResponse = version + /** Place, monitor, and manage trading orders. */ + override fun orders(): OrderServiceAsync.WithRawResponse = orders + + /** View positions and manage position instructions. */ + override fun positions(): PositionServiceAsync.WithRawResponse = positions /** 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) } - } - } - } + override fun watchlist(): WatchlistServiceAsync.WithRawResponse = watchlist + + /** Active Websocket. */ + override fun websocket(): WebsocketServiceAsync.WithRawResponse = websocket } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsync.kt index aff988d0..dff348a8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsync.kt @@ -5,16 +5,16 @@ 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.accounts.AccountGetAccountBalancesParams +import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdResponse import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse -import com.clear_street.api.services.async.v1.accounts.BalanceServiceAsync -import com.clear_street.api.services.async.v1.accounts.OrderServiceAsync -import com.clear_street.api.services.async.v1.accounts.PortfolioHistoryServiceAsync -import com.clear_street.api.services.async.v1.accounts.PositionServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -33,17 +33,43 @@ interface AccountServiceAsync { */ fun withOptions(modifier: Consumer): AccountServiceAsync - /** Manage trading accounts, balances, and portfolio history. */ - fun balances(): BalanceServiceAsync + /** Fetch account balance information */ + fun getAccountBalances(accountId: Long): CompletableFuture = + getAccountBalances(accountId, AccountGetAccountBalancesParams.none()) - /** Place, monitor, and manage trading orders. */ - fun orders(): OrderServiceAsync + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + params: AccountGetAccountBalancesParams = AccountGetAccountBalancesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getAccountBalances(params.toBuilder().accountId(accountId).build(), requestOptions) - /** Manage trading accounts, balances, and portfolio history. */ - fun portfolioHistory(): PortfolioHistoryServiceAsync + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + params: AccountGetAccountBalancesParams = AccountGetAccountBalancesParams.none(), + ): CompletableFuture = + getAccountBalances(accountId, params, RequestOptions.none()) + + /** @see getAccountBalances */ + fun getAccountBalances( + params: AccountGetAccountBalancesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture - /** View account positions. */ - fun positions(): PositionServiceAsync + /** @see getAccountBalances */ + fun getAccountBalances( + params: AccountGetAccountBalancesParams + ): CompletableFuture = + getAccountBalances(params, RequestOptions.none()) + + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + requestOptions: RequestOptions, + ): CompletableFuture = + getAccountBalances(accountId, AccountGetAccountBalancesParams.none(), requestOptions) /** Fetch account details by ID */ fun getAccountById(accountId: Long): CompletableFuture = @@ -102,6 +128,33 @@ interface AccountServiceAsync { fun getAccounts(requestOptions: RequestOptions): CompletableFuture = getAccounts(AccountGetAccountsParams.none(), requestOptions) + /** Retrieves daily portfolio history for the specified account. */ + fun getPortfolioHistory( + accountId: Long, + params: AccountGetPortfolioHistoryParams, + ): CompletableFuture = + getPortfolioHistory(accountId, params, RequestOptions.none()) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + accountId: Long, + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getPortfolioHistory(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams + ): CompletableFuture = + getPortfolioHistory(params, RequestOptions.none()) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + /** Update account risk settings */ fun patchAccountById(accountId: Long): CompletableFuture = patchAccountById(accountId, AccountPatchAccountByIdParams.none()) @@ -154,17 +207,48 @@ interface AccountServiceAsync { modifier: Consumer ): AccountServiceAsync.WithRawResponse - /** Manage trading accounts, balances, and portfolio history. */ - fun balances(): BalanceServiceAsync.WithRawResponse + /** + * Returns a raw HTTP response for `get /v1/accounts/{account_id}/balances`, but is + * otherwise the same as [AccountServiceAsync.getAccountBalances]. + */ + fun getAccountBalances( + accountId: Long + ): CompletableFuture> = + getAccountBalances(accountId, AccountGetAccountBalancesParams.none()) - /** Place, monitor, and manage trading orders. */ - fun orders(): OrderServiceAsync.WithRawResponse + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + params: AccountGetAccountBalancesParams = AccountGetAccountBalancesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getAccountBalances(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + params: AccountGetAccountBalancesParams = AccountGetAccountBalancesParams.none(), + ): CompletableFuture> = + getAccountBalances(accountId, params, RequestOptions.none()) - /** Manage trading accounts, balances, and portfolio history. */ - fun portfolioHistory(): PortfolioHistoryServiceAsync.WithRawResponse + /** @see getAccountBalances */ + fun getAccountBalances( + params: AccountGetAccountBalancesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getAccountBalances */ + fun getAccountBalances( + params: AccountGetAccountBalancesParams + ): CompletableFuture> = + getAccountBalances(params, RequestOptions.none()) - /** View account positions. */ - fun positions(): PositionServiceAsync.WithRawResponse + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + requestOptions: RequestOptions, + ): CompletableFuture> = + getAccountBalances(accountId, AccountGetAccountBalancesParams.none(), requestOptions) /** * Returns a raw HTTP response for `get /v1/accounts/{account_id}`, but is otherwise the @@ -234,6 +318,36 @@ interface AccountServiceAsync { ): CompletableFuture> = getAccounts(AccountGetAccountsParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `get /v1/accounts/{account_id}/portfolio-history`, but is + * otherwise the same as [AccountServiceAsync.getPortfolioHistory]. + */ + fun getPortfolioHistory( + accountId: Long, + params: AccountGetPortfolioHistoryParams, + ): CompletableFuture> = + getPortfolioHistory(accountId, params, RequestOptions.none()) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + accountId: Long, + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getPortfolioHistory(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams + ): CompletableFuture> = + getPortfolioHistory(params, RequestOptions.none()) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + /** * Returns a raw HTTP response for `patch /v1/accounts/{account_id}`, but is otherwise the * same as [AccountServiceAsync.patchAccountById]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncImpl.kt index f8bd0b28..25100ce5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncImpl.kt @@ -16,20 +16,16 @@ 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.AccountGetAccountBalancesParams +import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdResponse import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse -import com.clear_street.api.services.async.v1.accounts.BalanceServiceAsync -import com.clear_street.api.services.async.v1.accounts.BalanceServiceAsyncImpl -import com.clear_street.api.services.async.v1.accounts.OrderServiceAsync -import com.clear_street.api.services.async.v1.accounts.OrderServiceAsyncImpl -import com.clear_street.api.services.async.v1.accounts.PortfolioHistoryServiceAsync -import com.clear_street.api.services.async.v1.accounts.PortfolioHistoryServiceAsyncImpl -import com.clear_street.api.services.async.v1.accounts.PositionServiceAsync -import com.clear_street.api.services.async.v1.accounts.PositionServiceAsyncImpl import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -42,32 +38,17 @@ class AccountServiceAsyncImpl internal constructor(private val clientOptions: Cl WithRawResponseImpl(clientOptions) } - private val balances: BalanceServiceAsync by lazy { BalanceServiceAsyncImpl(clientOptions) } - - private val orders: OrderServiceAsync by lazy { OrderServiceAsyncImpl(clientOptions) } - - private val portfolioHistory: PortfolioHistoryServiceAsync by lazy { - PortfolioHistoryServiceAsyncImpl(clientOptions) - } - - private val positions: PositionServiceAsync by lazy { PositionServiceAsyncImpl(clientOptions) } - override fun withRawResponse(): AccountServiceAsync.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): AccountServiceAsync = AccountServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Manage trading accounts, balances, and portfolio history. */ - override fun balances(): BalanceServiceAsync = balances - - /** Place, monitor, and manage trading orders. */ - override fun orders(): OrderServiceAsync = orders - - /** Manage trading accounts, balances, and portfolio history. */ - override fun portfolioHistory(): PortfolioHistoryServiceAsync = portfolioHistory - - /** View account positions. */ - override fun positions(): PositionServiceAsync = positions + override fun getAccountBalances( + params: AccountGetAccountBalancesParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/accounts/{account_id}/balances + withRawResponse().getAccountBalances(params, requestOptions).thenApply { it.parse() } override fun getAccountById( params: AccountGetAccountByIdParams, @@ -83,6 +64,13 @@ class AccountServiceAsyncImpl internal constructor(private val clientOptions: Cl // get /v1/accounts withRawResponse().getAccounts(params, requestOptions).thenApply { it.parse() } + override fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/accounts/{account_id}/portfolio-history + withRawResponse().getPortfolioHistory(params, requestOptions).thenApply { it.parse() } + override fun patchAccountById( params: AccountPatchAccountByIdParams, requestOptions: RequestOptions, @@ -96,22 +84,6 @@ class AccountServiceAsyncImpl internal constructor(private val clientOptions: Cl private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val balances: BalanceServiceAsync.WithRawResponse by lazy { - BalanceServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val orders: OrderServiceAsync.WithRawResponse by lazy { - OrderServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val portfolioHistory: PortfolioHistoryServiceAsync.WithRawResponse by lazy { - PortfolioHistoryServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val positions: PositionServiceAsync.WithRawResponse by lazy { - PositionServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): AccountServiceAsync.WithRawResponse = @@ -119,18 +91,38 @@ class AccountServiceAsyncImpl internal constructor(private val clientOptions: Cl clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Manage trading accounts, balances, and portfolio history. */ - override fun balances(): BalanceServiceAsync.WithRawResponse = balances - - /** Place, monitor, and manage trading orders. */ - override fun orders(): OrderServiceAsync.WithRawResponse = orders - - /** Manage trading accounts, balances, and portfolio history. */ - override fun portfolioHistory(): PortfolioHistoryServiceAsync.WithRawResponse = - portfolioHistory + private val getAccountBalancesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) - /** View account positions. */ - override fun positions(): PositionServiceAsync.WithRawResponse = positions + override fun getAccountBalances( + params: AccountGetAccountBalancesParams, + 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() + } + } + } + } + } private val getAccountByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -195,6 +187,39 @@ class AccountServiceAsyncImpl internal constructor(private val clientOptions: Cl } } + private val getPortfolioHistoryHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams, + 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() + } + } + } + } + } + private val patchAccountByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) 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/ApiVersionServiceAsync.kt similarity index 51% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsync.kt index 11c7c979..48602f6b 100644 --- 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/ApiVersionServiceAsync.kt @@ -5,13 +5,13 @@ 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 com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionParams +import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer /** Endpoints for API service metadata. */ -interface VersionServiceAsync { +interface ApiVersionServiceAsync { /** * Returns a view of this service that provides access to raw HTTP responses for each method. @@ -23,29 +23,32 @@ interface VersionServiceAsync { * * The original service is not modified. */ - fun withOptions(modifier: Consumer): VersionServiceAsync + fun withOptions(modifier: Consumer): ApiVersionServiceAsync /** Returns the current version string for this API endpoint. */ - fun getVersion(): CompletableFuture = - getVersion(VersionGetVersionParams.none()) + fun getVersion(): CompletableFuture = + getVersion(ApiVersionGetVersionParams.none()) /** @see getVersion */ fun getVersion( - params: VersionGetVersionParams = VersionGetVersionParams.none(), + params: ApiVersionGetVersionParams = ApiVersionGetVersionParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see getVersion */ fun getVersion( - params: VersionGetVersionParams = VersionGetVersionParams.none() - ): CompletableFuture = getVersion(params, RequestOptions.none()) + params: ApiVersionGetVersionParams = ApiVersionGetVersionParams.none() + ): CompletableFuture = getVersion(params, RequestOptions.none()) /** @see getVersion */ - fun getVersion(requestOptions: RequestOptions): CompletableFuture = - getVersion(VersionGetVersionParams.none(), requestOptions) + fun getVersion( + requestOptions: RequestOptions + ): CompletableFuture = + getVersion(ApiVersionGetVersionParams.none(), requestOptions) /** - * A view of [VersionServiceAsync] that provides access to raw HTTP responses for each method. + * A view of [ApiVersionServiceAsync] that provides access to raw HTTP responses for each + * method. */ interface WithRawResponse { @@ -56,31 +59,31 @@ interface VersionServiceAsync { */ fun withOptions( modifier: Consumer - ): VersionServiceAsync.WithRawResponse + ): ApiVersionServiceAsync.WithRawResponse /** * Returns a raw HTTP response for `get /v1/version`, but is otherwise the same as - * [VersionServiceAsync.getVersion]. + * [ApiVersionServiceAsync.getVersion]. */ - fun getVersion(): CompletableFuture> = - getVersion(VersionGetVersionParams.none()) + fun getVersion(): CompletableFuture> = + getVersion(ApiVersionGetVersionParams.none()) /** @see getVersion */ fun getVersion( - params: VersionGetVersionParams = VersionGetVersionParams.none(), + params: ApiVersionGetVersionParams = ApiVersionGetVersionParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see getVersion */ fun getVersion( - params: VersionGetVersionParams = VersionGetVersionParams.none() - ): CompletableFuture> = + params: ApiVersionGetVersionParams = ApiVersionGetVersionParams.none() + ): CompletableFuture> = getVersion(params, RequestOptions.none()) /** @see getVersion */ fun getVersion( requestOptions: RequestOptions - ): CompletableFuture> = - getVersion(VersionGetVersionParams.none(), requestOptions) + ): CompletableFuture> = + getVersion(ApiVersionGetVersionParams.none(), requestOptions) } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncImpl.kt similarity index 69% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncImpl.kt index c7cc3c81..456ab6d9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncImpl.kt @@ -14,51 +14,51 @@ 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.version.VersionGetVersionParams -import com.clear_street.api.models.v1.version.VersionGetVersionResponse +import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionParams +import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer /** Endpoints for API service metadata. */ -class VersionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - VersionServiceAsync { +class ApiVersionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ApiVersionServiceAsync { - private val withRawResponse: VersionServiceAsync.WithRawResponse by lazy { + private val withRawResponse: ApiVersionServiceAsync.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): VersionServiceAsync.WithRawResponse = withRawResponse + override fun withRawResponse(): ApiVersionServiceAsync.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): VersionServiceAsync = - VersionServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): ApiVersionServiceAsync = + ApiVersionServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun getVersion( - params: VersionGetVersionParams, + params: ApiVersionGetVersionParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /v1/version withRawResponse().getVersion(params, requestOptions).thenApply { it.parse() } class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - VersionServiceAsync.WithRawResponse { + ApiVersionServiceAsync.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): VersionServiceAsync.WithRawResponse = - VersionServiceAsyncImpl.WithRawResponseImpl( + ): ApiVersionServiceAsync.WithRawResponse = + ApiVersionServiceAsyncImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val getVersionHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val getVersionHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun getVersion( - params: VersionGetVersionParams, + params: ApiVersionGetVersionParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) 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 index 99b696a8..15d9dc82 100644 --- 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 @@ -3,9 +3,16 @@ 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.core.RequestOptions +import com.clear_street.api.core.http.HttpResponseFor +import com.clear_street.api.models.v1.calendar.CalendarGetClockParams +import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse +import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** Access clocks and financial calendars for market sessions and events. */ interface CalendarServiceAsync { /** @@ -20,8 +27,39 @@ interface CalendarServiceAsync { */ fun withOptions(modifier: Consumer): CalendarServiceAsync - /** Access financial calendars for events like earnings, dividends, and splits. */ - fun marketHours(): MarketHourServiceAsync + /** Returns the current server time in UTC. */ + fun getClock(): CompletableFuture = + getClock(CalendarGetClockParams.none()) + + /** @see getClock */ + fun getClock( + params: CalendarGetClockParams = CalendarGetClockParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getClock */ + fun getClock( + params: CalendarGetClockParams = CalendarGetClockParams.none() + ): CompletableFuture = getClock(params, RequestOptions.none()) + + /** @see getClock */ + fun getClock(requestOptions: RequestOptions): CompletableFuture = + getClock(CalendarGetClockParams.none(), requestOptions) + + /** + * Retrieves comprehensive trading hours including pre-market, regular, and after-hours + * sessions. Returns market status, session times, and next session schedules. + */ + fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams + ): CompletableFuture = + getMarketHoursCalendar(params, RequestOptions.none()) + + /** @see getMarketHoursCalendar */ + fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture /** * A view of [CalendarServiceAsync] that provides access to raw HTTP responses for each method. @@ -37,7 +75,44 @@ interface CalendarServiceAsync { modifier: Consumer ): CalendarServiceAsync.WithRawResponse - /** Access financial calendars for events like earnings, dividends, and splits. */ - fun marketHours(): MarketHourServiceAsync.WithRawResponse + /** + * Returns a raw HTTP response for `get /v1/clock`, but is otherwise the same as + * [CalendarServiceAsync.getClock]. + */ + fun getClock(): CompletableFuture> = + getClock(CalendarGetClockParams.none()) + + /** @see getClock */ + fun getClock( + params: CalendarGetClockParams = CalendarGetClockParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getClock */ + fun getClock( + params: CalendarGetClockParams = CalendarGetClockParams.none() + ): CompletableFuture> = + getClock(params, RequestOptions.none()) + + /** @see getClock */ + fun getClock( + requestOptions: RequestOptions + ): CompletableFuture> = + getClock(CalendarGetClockParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /v1/calendars/market-hours`, but is otherwise the + * same as [CalendarServiceAsync.getMarketHoursCalendar]. + */ + fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams + ): CompletableFuture> = + getMarketHoursCalendar(params, RequestOptions.none()) + + /** @see getMarketHoursCalendar */ + fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> } } 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 index 89470f9c..acf0c3aa 100644 --- 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 @@ -3,10 +3,25 @@ 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 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.calendar.CalendarGetClockParams +import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse +import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** Access clocks and financial calendars for market sessions and events. */ class CalendarServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CalendarServiceAsync { @@ -14,24 +29,30 @@ class CalendarServiceAsyncImpl internal constructor(private val clientOptions: C 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 + override fun getClock( + params: CalendarGetClockParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/clock + withRawResponse().getClock(params, requestOptions).thenApply { it.parse() } + + override fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/calendars/market-hours + withRawResponse().getMarketHoursCalendar(params, requestOptions).thenApply { it.parse() } class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : CalendarServiceAsync.WithRawResponse { - private val marketHours: MarketHourServiceAsync.WithRawResponse by lazy { - MarketHourServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer @@ -40,7 +61,64 @@ class CalendarServiceAsyncImpl internal constructor(private val clientOptions: C clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Access financial calendars for events like earnings, dividends, and splits. */ - override fun marketHours(): MarketHourServiceAsync.WithRawResponse = marketHours + private val getClockHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getClock( + params: CalendarGetClockParams, + 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() + } + } + } + } + } + + private val getMarketHoursCalendarHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams, + 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/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/InstrumentDataServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsync.kt new file mode 100644 index 00000000..35ce0c5f --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsync.kt @@ -0,0 +1,809 @@ +// 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.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse +import com.clear_street.api.services.async.v1.instrumentdata.MarketDataServiceAsync +import com.clear_street.api.services.async.v1.instrumentdata.NewsServiceAsync +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +/** Retrieve instrument analytics, market data, news, and related reference data. */ +interface InstrumentDataServiceAsync { + + /** + * 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): InstrumentDataServiceAsync + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun marketData(): MarketDataServiceAsync + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun news(): NewsServiceAsync + + /** + * List instrument events across all securities. + * + * Retrieves all instrument events grouped by date. + */ + fun getAllInstrumentEvents(): CompletableFuture = + getAllInstrumentEvents(InstrumentDataGetAllInstrumentEventsParams.none()) + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams.none() + ): CompletableFuture = + getAllInstrumentEvents(params, RequestOptions.none()) + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + requestOptions: RequestOptions + ): CompletableFuture = + getAllInstrumentEvents(InstrumentDataGetAllInstrumentEventsParams.none(), requestOptions) + + /** Retrieves analyst ratings and price targets for an instrument. */ + fun getInstrumentAnalystConsensus( + instrumentId: String + ): CompletableFuture = + getInstrumentAnalystConsensus( + instrumentId, + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + ) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + params: InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getInstrumentAnalystConsensus( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + params: InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + ): CompletableFuture = + getInstrumentAnalystConsensus(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams + ): CompletableFuture = + getInstrumentAnalystConsensus(params, RequestOptions.none()) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + getInstrumentAnalystConsensus( + instrumentId, + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + requestOptions, + ) + + /** + * 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, + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + ) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getInstrumentBalanceSheetStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + ): CompletableFuture = + getInstrumentBalanceSheetStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams + ): CompletableFuture = + getInstrumentBalanceSheetStatements(params, RequestOptions.none()) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + getInstrumentBalanceSheetStatements( + instrumentId, + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + requestOptions, + ) + + /** + * Get cash flow statements for an instrument. + * + * Retrieves historical cash flow statements for the specified instrument. Cash flow statements + * show cash inflows and outflows from operating, investing, and financing activities. + */ + fun getInstrumentCashFlowStatements( + instrumentId: String + ): CompletableFuture = + getInstrumentCashFlowStatements( + instrumentId, + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + ) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getInstrumentCashFlowStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + ): CompletableFuture = + getInstrumentCashFlowStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams + ): CompletableFuture = + getInstrumentCashFlowStatements(params, RequestOptions.none()) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + getInstrumentCashFlowStatements( + instrumentId, + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + requestOptions, + ) + + /** + * Retrieves corporate events (dividends, splits, etc.) for an instrument, grouped by event + * type. + * + * Date range defaults: + * - `from_date`: today - 365 days + * - `to_date`: today + 60 days + */ + fun getInstrumentEvents( + instrumentId: String + ): CompletableFuture = + getInstrumentEvents(instrumentId, InstrumentDataGetInstrumentEventsParams.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + params: InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getInstrumentEvents(params.toBuilder().instrumentId(instrumentId).build(), requestOptions) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + params: InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams.none(), + ): CompletableFuture = + getInstrumentEvents(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams + ): CompletableFuture = + getInstrumentEvents(params, RequestOptions.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + getInstrumentEvents( + instrumentId, + InstrumentDataGetInstrumentEventsParams.none(), + requestOptions, + ) + + /** Retrieves supplemental fundamentals and company profile data for an instrument. */ + fun getInstrumentFundamentals( + instrumentId: String + ): CompletableFuture = + getInstrumentFundamentals( + instrumentId, + InstrumentDataGetInstrumentFundamentalsParams.none(), + ) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + params: InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getInstrumentFundamentals( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + params: InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams.none(), + ): CompletableFuture = + getInstrumentFundamentals(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams + ): CompletableFuture = + getInstrumentFundamentals(params, RequestOptions.none()) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + getInstrumentFundamentals( + instrumentId, + InstrumentDataGetInstrumentFundamentalsParams.none(), + requestOptions, + ) + + /** + * Retrieves quarterly income 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 getInstrumentIncomeStatements( + instrumentId: String + ): CompletableFuture = + getInstrumentIncomeStatements( + instrumentId, + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + ) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getInstrumentIncomeStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + ): CompletableFuture = + getInstrumentIncomeStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams + ): CompletableFuture = + getInstrumentIncomeStatements(params, RequestOptions.none()) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + getInstrumentIncomeStatements( + instrumentId, + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + requestOptions, + ) + + /** + * A view of [InstrumentDataServiceAsync] 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 + ): InstrumentDataServiceAsync.WithRawResponse + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun marketData(): MarketDataServiceAsync.WithRawResponse + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun news(): NewsServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `get /v1/instruments/events`, but is otherwise the same + * as [InstrumentDataServiceAsync.getAllInstrumentEvents]. + */ + fun getAllInstrumentEvents(): + CompletableFuture> = + getAllInstrumentEvents(InstrumentDataGetAllInstrumentEventsParams.none()) + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams.none() + ): CompletableFuture> = + getAllInstrumentEvents(params, RequestOptions.none()) + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + requestOptions: RequestOptions + ): CompletableFuture> = + getAllInstrumentEvents( + InstrumentDataGetAllInstrumentEventsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/analyst-reporting`, + * but is otherwise the same as [InstrumentDataServiceAsync.getInstrumentAnalystConsensus]. + */ + fun getInstrumentAnalystConsensus( + instrumentId: String + ): CompletableFuture> = + getInstrumentAnalystConsensus( + instrumentId, + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + ) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + params: InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getInstrumentAnalystConsensus( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + params: InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + ): CompletableFuture> = + getInstrumentAnalystConsensus(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams + ): CompletableFuture> = + getInstrumentAnalystConsensus(params, RequestOptions.none()) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + getInstrumentAnalystConsensus( + instrumentId, + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/balance-sheets`, but + * is otherwise the same as + * [InstrumentDataServiceAsync.getInstrumentBalanceSheetStatements]. + */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String + ): CompletableFuture< + HttpResponseFor + > = + getInstrumentBalanceSheetStatements( + instrumentId, + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + ) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture< + HttpResponseFor + > = + getInstrumentBalanceSheetStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + ): CompletableFuture< + HttpResponseFor + > = getInstrumentBalanceSheetStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture< + HttpResponseFor + > + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams + ): CompletableFuture< + HttpResponseFor + > = getInstrumentBalanceSheetStatements(params, RequestOptions.none()) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture< + HttpResponseFor + > = + getInstrumentBalanceSheetStatements( + instrumentId, + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get + * /v1/instruments/{instrument_id}/cash-flow-statements`, but is otherwise the same as + * [InstrumentDataServiceAsync.getInstrumentCashFlowStatements]. + */ + fun getInstrumentCashFlowStatements( + instrumentId: String + ): CompletableFuture< + HttpResponseFor + > = + getInstrumentCashFlowStatements( + instrumentId, + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + ) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture< + HttpResponseFor + > = + getInstrumentCashFlowStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + ): CompletableFuture< + HttpResponseFor + > = getInstrumentCashFlowStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams + ): CompletableFuture< + HttpResponseFor + > = getInstrumentCashFlowStatements(params, RequestOptions.none()) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture< + HttpResponseFor + > = + getInstrumentCashFlowStatements( + instrumentId, + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/events`, but is + * otherwise the same as [InstrumentDataServiceAsync.getInstrumentEvents]. + */ + fun getInstrumentEvents( + instrumentId: String + ): CompletableFuture> = + getInstrumentEvents(instrumentId, InstrumentDataGetInstrumentEventsParams.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + params: InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getInstrumentEvents( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + params: InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams.none(), + ): CompletableFuture> = + getInstrumentEvents(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams + ): CompletableFuture> = + getInstrumentEvents(params, RequestOptions.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + getInstrumentEvents( + instrumentId, + InstrumentDataGetInstrumentEventsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/fundamentals`, but + * is otherwise the same as [InstrumentDataServiceAsync.getInstrumentFundamentals]. + */ + fun getInstrumentFundamentals( + instrumentId: String + ): CompletableFuture> = + getInstrumentFundamentals( + instrumentId, + InstrumentDataGetInstrumentFundamentalsParams.none(), + ) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + params: InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getInstrumentFundamentals( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + params: InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams.none(), + ): CompletableFuture> = + getInstrumentFundamentals(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams + ): CompletableFuture> = + getInstrumentFundamentals(params, RequestOptions.none()) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + getInstrumentFundamentals( + instrumentId, + InstrumentDataGetInstrumentFundamentalsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/income-statements`, + * but is otherwise the same as [InstrumentDataServiceAsync.getInstrumentIncomeStatements]. + */ + fun getInstrumentIncomeStatements( + instrumentId: String + ): CompletableFuture> = + getInstrumentIncomeStatements( + instrumentId, + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + ) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getInstrumentIncomeStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + ): CompletableFuture> = + getInstrumentIncomeStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams + ): CompletableFuture> = + getInstrumentIncomeStatements(params, RequestOptions.none()) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + getInstrumentIncomeStatements( + instrumentId, + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + requestOptions, + ) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt new file mode 100644 index 00000000..74ba42e7 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt @@ -0,0 +1,402 @@ +// 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.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.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse +import com.clear_street.api.services.async.v1.instrumentdata.MarketDataServiceAsync +import com.clear_street.api.services.async.v1.instrumentdata.MarketDataServiceAsyncImpl +import com.clear_street.api.services.async.v1.instrumentdata.NewsServiceAsync +import com.clear_street.api.services.async.v1.instrumentdata.NewsServiceAsyncImpl +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +/** Retrieve instrument analytics, market data, news, and related reference data. */ +class InstrumentDataServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : InstrumentDataServiceAsync { + + private val withRawResponse: InstrumentDataServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + private val marketData: MarketDataServiceAsync by lazy { + MarketDataServiceAsyncImpl(clientOptions) + } + + private val news: NewsServiceAsync by lazy { NewsServiceAsyncImpl(clientOptions) } + + override fun withRawResponse(): InstrumentDataServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): InstrumentDataServiceAsync = + InstrumentDataServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun marketData(): MarketDataServiceAsync = marketData + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun news(): NewsServiceAsync = news + + override fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/instruments/events + withRawResponse().getAllInstrumentEvents(params, requestOptions).thenApply { it.parse() } + + override fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/instruments/{instrument_id}/analyst-reporting + withRawResponse().getInstrumentAnalystConsensus(params, requestOptions).thenApply { + it.parse() + } + + override fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/instruments/{instrument_id}/balance-sheets + withRawResponse().getInstrumentBalanceSheetStatements(params, requestOptions).thenApply { + it.parse() + } + + override fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/instruments/{instrument_id}/cash-flow-statements + withRawResponse().getInstrumentCashFlowStatements(params, requestOptions).thenApply { + it.parse() + } + + override fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/instruments/{instrument_id}/events + withRawResponse().getInstrumentEvents(params, requestOptions).thenApply { it.parse() } + + override fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/instruments/{instrument_id}/fundamentals + withRawResponse().getInstrumentFundamentals(params, requestOptions).thenApply { it.parse() } + + override fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/instruments/{instrument_id}/income-statements + withRawResponse().getInstrumentIncomeStatements(params, requestOptions).thenApply { + it.parse() + } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InstrumentDataServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + private val marketData: MarketDataServiceAsync.WithRawResponse by lazy { + MarketDataServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + private val news: NewsServiceAsync.WithRawResponse by lazy { + NewsServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + override fun withOptions( + modifier: Consumer + ): InstrumentDataServiceAsync.WithRawResponse = + InstrumentDataServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun marketData(): MarketDataServiceAsync.WithRawResponse = marketData + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun news(): NewsServiceAsync.WithRawResponse = news + + private val getAllInstrumentEventsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "instruments", "events") + .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 { getAllInstrumentEventsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val getInstrumentAnalystConsensusHandler: + Handler = + jsonHandler( + clientOptions.jsonMapper + ) + + override fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams, + 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.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() + } + } + } + } + } + + private val getInstrumentBalanceSheetStatementsHandler: + Handler = + jsonHandler( + clientOptions.jsonMapper + ) + + override fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams, + 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), "balance-sheets") + .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 { getInstrumentBalanceSheetStatementsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val getInstrumentCashFlowStatementsHandler: + Handler = + jsonHandler( + clientOptions.jsonMapper + ) + + override fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams, + 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), + "cash-flow-statements", + ) + .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 { getInstrumentCashFlowStatementsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val getInstrumentEventsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams, + 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.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "instruments", params._pathParam(0), "events") + .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 { getInstrumentEventsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val getInstrumentFundamentalsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams, + 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.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "instruments", params._pathParam(0), "fundamentals") + .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 { getInstrumentFundamentalsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val getInstrumentIncomeStatementsHandler: + Handler = + jsonHandler( + clientOptions.jsonMapper + ) + + override fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams, + 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.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "instruments", params._pathParam(0), "income-statements") + .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 { getInstrumentIncomeStatementsHandler.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/InstrumentServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsync.kt index ca34a830..a0be4ae2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsync.kt @@ -9,19 +9,14 @@ import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdPar import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsResponse +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsResponse import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsResponse -import com.clear_street.api.services.async.v1.instruments.AnalystReportingServiceAsync -import com.clear_street.api.services.async.v1.instruments.BalanceSheetServiceAsync -import com.clear_street.api.services.async.v1.instruments.CashFlowStatementServiceAsync -import com.clear_street.api.services.async.v1.instruments.EventServiceAsync -import com.clear_street.api.services.async.v1.instruments.FundamentalServiceAsync -import com.clear_street.api.services.async.v1.instruments.IncomeStatementServiceAsync -import com.clear_street.api.services.async.v1.instruments.OptionServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer -/** Retrieve details and lists of tradable instruments. */ +/** Retrieve core details and discovery endpoints for tradable instruments. */ interface InstrumentServiceAsync { /** @@ -36,27 +31,6 @@ interface InstrumentServiceAsync { */ fun withOptions(modifier: Consumer): InstrumentServiceAsync - /** Retrieve details and lists of tradable instruments. */ - fun analystReporting(): AnalystReportingServiceAsync - - /** Retrieve details and lists of tradable instruments. */ - fun balanceSheets(): BalanceSheetServiceAsync - - /** Retrieve details and lists of tradable instruments. */ - fun cashFlowStatements(): CashFlowStatementServiceAsync - - /** Retrieve details and lists of tradable instruments. */ - fun events(): EventServiceAsync - - /** Retrieve details and lists of tradable instruments. */ - fun fundamentals(): FundamentalServiceAsync - - /** Retrieve details and lists of tradable instruments. */ - fun incomeStatements(): IncomeStatementServiceAsync - - /** Retrieve details and lists of tradable instruments. */ - fun options(): OptionServiceAsync - /** Retrieves detailed information for a specific instrument. */ fun getInstrumentById( instrumentId: String @@ -119,6 +93,33 @@ interface InstrumentServiceAsync { ): CompletableFuture = getInstruments(InstrumentGetInstrumentsParams.none(), requestOptions) + /** + * List options contracts. + * + * Returns options contracts for a given underlier with options-specific metadata. Exactly one + * underlier identifier must be provided. + */ + fun getOptionContracts(): CompletableFuture = + getOptionContracts(InstrumentGetOptionContractsParams.none()) + + /** @see getOptionContracts */ + fun getOptionContracts( + params: InstrumentGetOptionContractsParams = InstrumentGetOptionContractsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getOptionContracts */ + fun getOptionContracts( + params: InstrumentGetOptionContractsParams = InstrumentGetOptionContractsParams.none() + ): CompletableFuture = + getOptionContracts(params, RequestOptions.none()) + + /** @see getOptionContracts */ + fun getOptionContracts( + requestOptions: RequestOptions + ): CompletableFuture = + getOptionContracts(InstrumentGetOptionContractsParams.none(), requestOptions) + /** * Search instruments by symbol, alternate identifier, or company name. * @@ -156,27 +157,6 @@ interface InstrumentServiceAsync { modifier: Consumer ): InstrumentServiceAsync.WithRawResponse - /** Retrieve details and lists of tradable instruments. */ - fun analystReporting(): AnalystReportingServiceAsync.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun balanceSheets(): BalanceSheetServiceAsync.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun cashFlowStatements(): CashFlowStatementServiceAsync.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun events(): EventServiceAsync.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun fundamentals(): FundamentalServiceAsync.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun incomeStatements(): IncomeStatementServiceAsync.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun options(): OptionServiceAsync.WithRawResponse - /** * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}`, but is otherwise * the same as [InstrumentServiceAsync.getInstrumentById]. @@ -249,6 +229,32 @@ interface InstrumentServiceAsync { ): CompletableFuture> = getInstruments(InstrumentGetInstrumentsParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `get /v1/instruments/options/contracts`, but is otherwise + * the same as [InstrumentServiceAsync.getOptionContracts]. + */ + fun getOptionContracts(): + CompletableFuture> = + getOptionContracts(InstrumentGetOptionContractsParams.none()) + + /** @see getOptionContracts */ + fun getOptionContracts( + params: InstrumentGetOptionContractsParams = InstrumentGetOptionContractsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getOptionContracts */ + fun getOptionContracts( + params: InstrumentGetOptionContractsParams = InstrumentGetOptionContractsParams.none() + ): CompletableFuture> = + getOptionContracts(params, RequestOptions.none()) + + /** @see getOptionContracts */ + fun getOptionContracts( + requestOptions: RequestOptions + ): CompletableFuture> = + getOptionContracts(InstrumentGetOptionContractsParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /v1/instruments/search`, but is otherwise the same * as [InstrumentServiceAsync.searchInstruments]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncImpl.kt index a6239519..0b5b6f0a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncImpl.kt @@ -19,27 +19,15 @@ import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdPar import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsResponse +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsResponse import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsResponse -import com.clear_street.api.services.async.v1.instruments.AnalystReportingServiceAsync -import com.clear_street.api.services.async.v1.instruments.AnalystReportingServiceAsyncImpl -import com.clear_street.api.services.async.v1.instruments.BalanceSheetServiceAsync -import com.clear_street.api.services.async.v1.instruments.BalanceSheetServiceAsyncImpl -import com.clear_street.api.services.async.v1.instruments.CashFlowStatementServiceAsync -import com.clear_street.api.services.async.v1.instruments.CashFlowStatementServiceAsyncImpl -import com.clear_street.api.services.async.v1.instruments.EventServiceAsync -import com.clear_street.api.services.async.v1.instruments.EventServiceAsyncImpl -import com.clear_street.api.services.async.v1.instruments.FundamentalServiceAsync -import com.clear_street.api.services.async.v1.instruments.FundamentalServiceAsyncImpl -import com.clear_street.api.services.async.v1.instruments.IncomeStatementServiceAsync -import com.clear_street.api.services.async.v1.instruments.IncomeStatementServiceAsyncImpl -import com.clear_street.api.services.async.v1.instruments.OptionServiceAsync -import com.clear_street.api.services.async.v1.instruments.OptionServiceAsyncImpl import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull -/** Retrieve details and lists of tradable instruments. */ +/** Retrieve core details and discovery endpoints for tradable instruments. */ class InstrumentServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : InstrumentServiceAsync { @@ -47,56 +35,11 @@ class InstrumentServiceAsyncImpl internal constructor(private val clientOptions: WithRawResponseImpl(clientOptions) } - private val analystReporting: AnalystReportingServiceAsync by lazy { - AnalystReportingServiceAsyncImpl(clientOptions) - } - - private val balanceSheets: BalanceSheetServiceAsync by lazy { - BalanceSheetServiceAsyncImpl(clientOptions) - } - - private val cashFlowStatements: CashFlowStatementServiceAsync by lazy { - CashFlowStatementServiceAsyncImpl(clientOptions) - } - - private val events: EventServiceAsync by lazy { EventServiceAsyncImpl(clientOptions) } - - private val fundamentals: FundamentalServiceAsync by lazy { - FundamentalServiceAsyncImpl(clientOptions) - } - - private val incomeStatements: IncomeStatementServiceAsync by lazy { - IncomeStatementServiceAsyncImpl(clientOptions) - } - - private val options: OptionServiceAsync by lazy { OptionServiceAsyncImpl(clientOptions) } - override fun withRawResponse(): InstrumentServiceAsync.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): InstrumentServiceAsync = InstrumentServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Retrieve details and lists of tradable instruments. */ - override fun analystReporting(): AnalystReportingServiceAsync = analystReporting - - /** Retrieve details and lists of tradable instruments. */ - override fun balanceSheets(): BalanceSheetServiceAsync = balanceSheets - - /** Retrieve details and lists of tradable instruments. */ - override fun cashFlowStatements(): CashFlowStatementServiceAsync = cashFlowStatements - - /** Retrieve details and lists of tradable instruments. */ - override fun events(): EventServiceAsync = events - - /** Retrieve details and lists of tradable instruments. */ - override fun fundamentals(): FundamentalServiceAsync = fundamentals - - /** Retrieve details and lists of tradable instruments. */ - override fun incomeStatements(): IncomeStatementServiceAsync = incomeStatements - - /** Retrieve details and lists of tradable instruments. */ - override fun options(): OptionServiceAsync = options - override fun getInstrumentById( params: InstrumentGetInstrumentByIdParams, requestOptions: RequestOptions, @@ -111,6 +54,13 @@ class InstrumentServiceAsyncImpl internal constructor(private val clientOptions: // get /v1/instruments withRawResponse().getInstruments(params, requestOptions).thenApply { it.parse() } + override fun getOptionContracts( + params: InstrumentGetOptionContractsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/instruments/options/contracts + withRawResponse().getOptionContracts(params, requestOptions).thenApply { it.parse() } + override fun searchInstruments( params: InstrumentSearchInstrumentsParams, requestOptions: RequestOptions, @@ -124,34 +74,6 @@ class InstrumentServiceAsyncImpl internal constructor(private val clientOptions: private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val analystReporting: AnalystReportingServiceAsync.WithRawResponse by lazy { - AnalystReportingServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val balanceSheets: BalanceSheetServiceAsync.WithRawResponse by lazy { - BalanceSheetServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val cashFlowStatements: CashFlowStatementServiceAsync.WithRawResponse by lazy { - CashFlowStatementServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val events: EventServiceAsync.WithRawResponse by lazy { - EventServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val fundamentals: FundamentalServiceAsync.WithRawResponse by lazy { - FundamentalServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val incomeStatements: IncomeStatementServiceAsync.WithRawResponse by lazy { - IncomeStatementServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - - private val options: OptionServiceAsync.WithRawResponse by lazy { - OptionServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): InstrumentServiceAsync.WithRawResponse = @@ -159,30 +81,6 @@ class InstrumentServiceAsyncImpl internal constructor(private val clientOptions: clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Retrieve details and lists of tradable instruments. */ - override fun analystReporting(): AnalystReportingServiceAsync.WithRawResponse = - analystReporting - - /** Retrieve details and lists of tradable instruments. */ - override fun balanceSheets(): BalanceSheetServiceAsync.WithRawResponse = balanceSheets - - /** Retrieve details and lists of tradable instruments. */ - override fun cashFlowStatements(): CashFlowStatementServiceAsync.WithRawResponse = - cashFlowStatements - - /** Retrieve details and lists of tradable instruments. */ - override fun events(): EventServiceAsync.WithRawResponse = events - - /** Retrieve details and lists of tradable instruments. */ - override fun fundamentals(): FundamentalServiceAsync.WithRawResponse = fundamentals - - /** Retrieve details and lists of tradable instruments. */ - override fun incomeStatements(): IncomeStatementServiceAsync.WithRawResponse = - incomeStatements - - /** Retrieve details and lists of tradable instruments. */ - override fun options(): OptionServiceAsync.WithRawResponse = options - private val getInstrumentByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -246,6 +144,36 @@ class InstrumentServiceAsyncImpl internal constructor(private val clientOptions: } } + private val getOptionContractsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getOptionContracts( + params: InstrumentGetOptionContractsParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "instruments", "options", "contracts") + .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 { getOptionContractsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val searchInstrumentsHandler: Handler = jsonHandler(clientOptions.jsonMapper) 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/OmniAiServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt index 71a6d50b..7440265f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt @@ -3,7 +3,6 @@ package com.clear_street.api.services.async.v1 import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.async.v1.omniai.EntitlementAgreementServiceAsync import com.clear_street.api.services.async.v1.omniai.EntitlementServiceAsync import com.clear_street.api.services.async.v1.omniai.MessageServiceAsync import com.clear_street.api.services.async.v1.omniai.ResponseServiceAsync @@ -24,14 +23,6 @@ interface OmniAiServiceAsync { */ fun withOptions(modifier: Consumer): OmniAiServiceAsync - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages from - * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. - */ - fun entitlementAgreements(): EntitlementAgreementServiceAsync - /** * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from @@ -78,14 +69,6 @@ interface OmniAiServiceAsync { modifier: Consumer ): OmniAiServiceAsync.WithRawResponse - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages - * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. - */ - fun entitlementAgreements(): EntitlementAgreementServiceAsync.WithRawResponse - /** * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt index c077d276..79c12e45 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt @@ -3,8 +3,6 @@ package com.clear_street.api.services.async.v1 import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.async.v1.omniai.EntitlementAgreementServiceAsync -import com.clear_street.api.services.async.v1.omniai.EntitlementAgreementServiceAsyncImpl import com.clear_street.api.services.async.v1.omniai.EntitlementServiceAsync import com.clear_street.api.services.async.v1.omniai.EntitlementServiceAsyncImpl import com.clear_street.api.services.async.v1.omniai.MessageServiceAsync @@ -22,10 +20,6 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli WithRawResponseImpl(clientOptions) } - private val entitlementAgreements: EntitlementAgreementServiceAsync by lazy { - EntitlementAgreementServiceAsyncImpl(clientOptions) - } - private val entitlements: EntitlementServiceAsync by lazy { EntitlementServiceAsyncImpl(clientOptions) } @@ -41,14 +35,6 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli override fun withOptions(modifier: Consumer): OmniAiServiceAsync = OmniAiServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages from - * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. - */ - override fun entitlementAgreements(): EntitlementAgreementServiceAsync = entitlementAgreements - /** * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from @@ -84,11 +70,6 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : OmniAiServiceAsync.WithRawResponse { - private val entitlementAgreements: - EntitlementAgreementServiceAsync.WithRawResponse by lazy { - EntitlementAgreementServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - private val entitlements: EntitlementServiceAsync.WithRawResponse by lazy { EntitlementServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -112,15 +93,6 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli clientOptions.toBuilder().apply(modifier::accept).build() ) - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages - * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. - */ - override fun entitlementAgreements(): EntitlementAgreementServiceAsync.WithRawResponse = - entitlementAgreements - /** * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt index a50d52ff..b49d75d3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.accounts +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.accounts.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelAllOpenOrdersResponse -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderResponse -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdResponse -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersResponse -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderResponse -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersResponse +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse +import com.clear_street.api.models.v1.orders.OrderGetOrdersParams +import com.clear_street.api.models.v1.orders.OrderGetOrdersResponse +import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams +import com.clear_street.api.models.v1.orders.OrderReplaceOrderResponse +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt index a8e735d2..58af578e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.accounts +package com.clear_street.api.services.async.v1 import com.clear_street.api.core.ClientOptions import com.clear_street.api.core.RequestOptions @@ -16,18 +16,18 @@ 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.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelAllOpenOrdersResponse -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderResponse -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdResponse -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersResponse -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderResponse -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersResponse +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse +import com.clear_street.api.models.v1.orders.OrderGetOrdersParams +import com.clear_street.api.models.v1.orders.OrderGetOrdersResponse +import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams +import com.clear_street.api.models.v1.orders.OrderReplaceOrderResponse +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt new file mode 100644 index 00000000..433e5aa7 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt @@ -0,0 +1,508 @@ +// 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.positions.PositionCancelPositionInstructionParams +import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse +import com.clear_street.api.models.v1.positions.PositionClosePositionParams +import com.clear_street.api.models.v1.positions.PositionClosePositionResponse +import com.clear_street.api.models.v1.positions.PositionClosePositionsParams +import com.clear_street.api.models.v1.positions.PositionClosePositionsResponse +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsResponse +import com.clear_street.api.models.v1.positions.PositionGetPositionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +/** View positions and manage position instructions. */ +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 + + /** + * 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: PositionCancelPositionInstructionParams, + ): CompletableFuture = + cancelPositionInstruction(instructionId, params, RequestOptions.none()) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + instructionId: String, + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + cancelPositionInstruction( + params.toBuilder().instructionId(instructionId).build(), + requestOptions, + ) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams + ): CompletableFuture = + cancelPositionInstruction(params, RequestOptions.none()) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * 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) + + /** + * 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, PositionGetPositionInstructionsParams.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + params: PositionGetPositionInstructionsParams = + PositionGetPositionInstructionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + params: PositionGetPositionInstructionsParams = PositionGetPositionInstructionsParams.none(), + ): CompletableFuture = + getPositionInstructions(accountId, params, RequestOptions.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + params: PositionGetPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getPositionInstructions */ + fun getPositionInstructions( + params: PositionGetPositionInstructionsParams + ): CompletableFuture = + getPositionInstructions(params, RequestOptions.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + requestOptions: RequestOptions, + ): CompletableFuture = + getPositionInstructions( + accountId, + PositionGetPositionInstructionsParams.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) + + /** + * 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: PositionSubmitPositionInstructionsParams, + ): CompletableFuture = + submitPositionInstructions(accountId, params, RequestOptions.none()) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + accountId: Long, + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + submitPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams + ): CompletableFuture = + submitPositionInstructions(params, RequestOptions.none()) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * 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 + + /** + * Returns a raw HTTP response for `delete + * /v1/accounts/{account_id}/positions/instructions/{instruction_id}`, but is otherwise the + * same as [PositionServiceAsync.cancelPositionInstruction]. + */ + fun cancelPositionInstruction( + instructionId: String, + params: PositionCancelPositionInstructionParams, + ): CompletableFuture> = + cancelPositionInstruction(instructionId, params, RequestOptions.none()) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + instructionId: String, + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + cancelPositionInstruction( + params.toBuilder().instructionId(instructionId).build(), + requestOptions, + ) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams + ): CompletableFuture> = + cancelPositionInstruction(params, RequestOptions.none()) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * 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/instructions`, + * but is otherwise the same as [PositionServiceAsync.getPositionInstructions]. + */ + fun getPositionInstructions( + accountId: Long + ): CompletableFuture> = + getPositionInstructions(accountId, PositionGetPositionInstructionsParams.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + params: PositionGetPositionInstructionsParams = + PositionGetPositionInstructionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + params: PositionGetPositionInstructionsParams = + PositionGetPositionInstructionsParams.none(), + ): CompletableFuture> = + getPositionInstructions(accountId, params, RequestOptions.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + params: PositionGetPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getPositionInstructions */ + fun getPositionInstructions( + params: PositionGetPositionInstructionsParams + ): CompletableFuture> = + getPositionInstructions(params, RequestOptions.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + requestOptions: RequestOptions, + ): CompletableFuture> = + getPositionInstructions( + accountId, + PositionGetPositionInstructionsParams.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) + + /** + * Returns a raw HTTP response for `post /v1/accounts/{account_id}/positions/instructions`, + * but is otherwise the same as [PositionServiceAsync.submitPositionInstructions]. + */ + fun submitPositionInstructions( + accountId: Long, + params: PositionSubmitPositionInstructionsParams, + ): CompletableFuture> = + submitPositionInstructions(accountId, params, RequestOptions.none()) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + accountId: Long, + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + submitPositionInstructions( + params.toBuilder().accountId(accountId).build(), + requestOptions, + ) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams + ): CompletableFuture> = + submitPositionInstructions(params, RequestOptions.none()) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + } +} 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/PositionServiceAsyncImpl.kt similarity index 50% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncImpl.kt index 9784a544..cc26aa02 100644 --- 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/PositionServiceAsyncImpl.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.accounts +package com.clear_street.api.services.async.v1 import com.clear_street.api.core.ClientOptions import com.clear_street.api.core.RequestOptions @@ -16,19 +16,23 @@ 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 com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse +import com.clear_street.api.models.v1.positions.PositionClosePositionParams +import com.clear_street.api.models.v1.positions.PositionClosePositionResponse +import com.clear_street.api.models.v1.positions.PositionClosePositionsParams +import com.clear_street.api.models.v1.positions.PositionClosePositionsResponse +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsResponse +import com.clear_street.api.models.v1.positions.PositionGetPositionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull -/** View account positions. */ +/** View positions and manage position instructions. */ class PositionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : PositionServiceAsync { @@ -36,17 +40,17 @@ class PositionServiceAsyncImpl internal constructor(private val clientOptions: C 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 cancelPositionInstruction( + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // delete /v1/accounts/{account_id}/positions/instructions/{instruction_id} + withRawResponse().cancelPositionInstruction(params, requestOptions).thenApply { it.parse() } override fun closePosition( params: PositionClosePositionParams, @@ -62,6 +66,13 @@ class PositionServiceAsyncImpl internal constructor(private val clientOptions: C // delete /v1/accounts/{account_id}/positions withRawResponse().closePositions(params, requestOptions).thenApply { it.parse() } + override fun getPositionInstructions( + params: PositionGetPositionInstructionsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/accounts/{account_id}/positions/instructions + withRawResponse().getPositionInstructions(params, requestOptions).thenApply { it.parse() } + override fun getPositions( params: PositionGetPositionsParams, requestOptions: RequestOptions, @@ -69,16 +80,21 @@ class PositionServiceAsyncImpl internal constructor(private val clientOptions: C // get /v1/accounts/{account_id}/positions withRawResponse().getPositions(params, requestOptions).thenApply { it.parse() } + override fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams, + 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) : 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 = @@ -86,8 +102,47 @@ class PositionServiceAsyncImpl internal constructor(private val clientOptions: C clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */ - override fun instructions(): InstructionServiceAsync.WithRawResponse = instructions + private val cancelPositionInstructionHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams, + 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 closePositionHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -163,6 +218,46 @@ class PositionServiceAsyncImpl internal constructor(private val clientOptions: C } } + private val getPositionInstructionsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getPositionInstructions( + params: PositionGetPositionInstructionsParams, + 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 getPositionsHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -195,5 +290,46 @@ class PositionServiceAsyncImpl internal constructor(private val clientOptions: C } } } + + private val submitPositionInstructionsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams, + 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/WatchlistServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsync.kt index 2cf0fbaa..7085949e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsync.kt @@ -5,15 +5,18 @@ 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.watchlists.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistCreateWatchlistResponse -import com.clear_street.api.models.v1.watchlists.WatchlistDeleteWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistDeleteWatchlistResponse -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistByIdParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistByIdResponse -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsResponse -import com.clear_street.api.services.async.v1.watchlists.ItemServiceAsync +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistResponse +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -32,8 +35,32 @@ interface WatchlistServiceAsync { */ fun withOptions(modifier: Consumer): WatchlistServiceAsync - /** Create and manage watchlists. */ - fun items(): ItemServiceAsync + /** Add an instrument to a watchlist */ + fun addWatchlistItem( + watchlistId: String, + params: WatchlistAddWatchlistItemParams, + ): CompletableFuture = + addWatchlistItem(watchlistId, params, RequestOptions.none()) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + watchlistId: String, + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + addWatchlistItem(params.toBuilder().watchlistId(watchlistId).build(), requestOptions) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams + ): CompletableFuture = + addWatchlistItem(params, RequestOptions.none()) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture /** Create Watchlist */ fun createWatchlist( @@ -85,6 +112,33 @@ interface WatchlistServiceAsync { ): CompletableFuture = deleteWatchlist(watchlistId, WatchlistDeleteWatchlistParams.none(), requestOptions) + /** Delete an instrument from a watchlist */ + fun deleteWatchlistItem( + itemId: String, + params: WatchlistDeleteWatchlistItemParams, + ): CompletableFuture = + deleteWatchlistItem(itemId, params, RequestOptions.none()) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + itemId: String, + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + deleteWatchlistItem(params.toBuilder().itemId(itemId).build(), requestOptions) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams + ): CompletableFuture = + deleteWatchlistItem(params, RequestOptions.none()) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + /** Get a watchlist by ID with all its items */ fun getWatchlistById( watchlistId: String @@ -161,8 +215,35 @@ interface WatchlistServiceAsync { modifier: Consumer ): WatchlistServiceAsync.WithRawResponse - /** Create and manage watchlists. */ - fun items(): ItemServiceAsync.WithRawResponse + /** + * Returns a raw HTTP response for `post /v1/watchlists/{watchlist_id}/items`, but is + * otherwise the same as [WatchlistServiceAsync.addWatchlistItem]. + */ + fun addWatchlistItem( + watchlistId: String, + params: WatchlistAddWatchlistItemParams, + ): CompletableFuture> = + addWatchlistItem(watchlistId, params, RequestOptions.none()) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + watchlistId: String, + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + addWatchlistItem(params.toBuilder().watchlistId(watchlistId).build(), requestOptions) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams + ): CompletableFuture> = + addWatchlistItem(params, RequestOptions.none()) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> /** * Returns a raw HTTP response for `post /v1/watchlists`, but is otherwise the same as @@ -222,6 +303,36 @@ interface WatchlistServiceAsync { ): CompletableFuture> = deleteWatchlist(watchlistId, WatchlistDeleteWatchlistParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `delete /v1/watchlists/{watchlist_id}/items/{item_id}`, + * but is otherwise the same as [WatchlistServiceAsync.deleteWatchlistItem]. + */ + fun deleteWatchlistItem( + itemId: String, + params: WatchlistDeleteWatchlistItemParams, + ): CompletableFuture> = + deleteWatchlistItem(itemId, params, RequestOptions.none()) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + itemId: String, + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + deleteWatchlistItem(params.toBuilder().itemId(itemId).build(), requestOptions) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams + ): CompletableFuture> = + deleteWatchlistItem(params, RequestOptions.none()) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + /** * Returns a raw HTTP response for `get /v1/watchlists/{watchlist_id}`, but is otherwise the * same as [WatchlistServiceAsync.getWatchlistById]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncImpl.kt index 773f53f6..b4802aac 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncImpl.kt @@ -16,16 +16,18 @@ 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.watchlists.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistCreateWatchlistResponse -import com.clear_street.api.models.v1.watchlists.WatchlistDeleteWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistDeleteWatchlistResponse -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistByIdParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistByIdResponse -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsResponse -import com.clear_street.api.services.async.v1.watchlists.ItemServiceAsync -import com.clear_street.api.services.async.v1.watchlists.ItemServiceAsyncImpl +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistResponse +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -38,15 +40,17 @@ class WatchlistServiceAsyncImpl internal constructor(private val clientOptions: WithRawResponseImpl(clientOptions) } - private val items: ItemServiceAsync by lazy { ItemServiceAsyncImpl(clientOptions) } - override fun withRawResponse(): WatchlistServiceAsync.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): WatchlistServiceAsync = WatchlistServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Create and manage watchlists. */ - override fun items(): ItemServiceAsync = items + override fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /v1/watchlists/{watchlist_id}/items + withRawResponse().addWatchlistItem(params, requestOptions).thenApply { it.parse() } override fun createWatchlist( params: WatchlistCreateWatchlistParams, @@ -62,6 +66,13 @@ class WatchlistServiceAsyncImpl internal constructor(private val clientOptions: // delete /v1/watchlists/{watchlist_id} withRawResponse().deleteWatchlist(params, requestOptions).thenApply { it.parse() } + override fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // delete /v1/watchlists/{watchlist_id}/items/{item_id} + withRawResponse().deleteWatchlistItem(params, requestOptions).thenApply { it.parse() } + override fun getWatchlistById( params: WatchlistGetWatchlistByIdParams, requestOptions: RequestOptions, @@ -82,10 +93,6 @@ class WatchlistServiceAsyncImpl internal constructor(private val clientOptions: private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val items: ItemServiceAsync.WithRawResponse by lazy { - ItemServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): WatchlistServiceAsync.WithRawResponse = @@ -93,8 +100,39 @@ class WatchlistServiceAsyncImpl internal constructor(private val clientOptions: clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Create and manage watchlists. */ - override fun items(): ItemServiceAsync.WithRawResponse = items + private val addWatchlistItemHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("watchlistId", params.watchlistId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "watchlists", params._pathParam(0), "items") + .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 { addWatchlistItemHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } private val createWatchlistHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -161,6 +199,46 @@ class WatchlistServiceAsyncImpl internal constructor(private val clientOptions: } } + private val deleteWatchlistItemHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("itemId", params.itemId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.DELETE) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "v1", + "watchlists", + params._pathParam(0), + "items", + 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 { deleteWatchlistItemHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val getWatchlistByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsync.kt new file mode 100644 index 00000000..02bb1324 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsync.kt @@ -0,0 +1,82 @@ +// 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.HttpResponse +import com.clear_street.api.models.v1.websocket.WebsocketWebsocketHandlerParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +/** Active Websocket. */ +interface WebsocketServiceAsync { + + /** + * 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): WebsocketServiceAsync + + /** Upgrade the HTTP connection to a WebSocket and echo incoming messages. */ + fun websocketHandler(): CompletableFuture = + websocketHandler(WebsocketWebsocketHandlerParams.none()) + + /** @see websocketHandler */ + fun websocketHandler( + params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see websocketHandler */ + fun websocketHandler( + params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none() + ): CompletableFuture = websocketHandler(params, RequestOptions.none()) + + /** @see websocketHandler */ + fun websocketHandler(requestOptions: RequestOptions): CompletableFuture = + websocketHandler(WebsocketWebsocketHandlerParams.none(), requestOptions) + + /** + * A view of [WebsocketServiceAsync] 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 + ): WebsocketServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `get /v1/ws`, but is otherwise the same as + * [WebsocketServiceAsync.websocketHandler]. + */ + fun websocketHandler(): CompletableFuture = + websocketHandler(WebsocketWebsocketHandlerParams.none()) + + /** @see websocketHandler */ + fun websocketHandler( + params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see websocketHandler */ + fun websocketHandler( + params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none() + ): CompletableFuture = websocketHandler(params, RequestOptions.none()) + + /** @see websocketHandler */ + fun websocketHandler(requestOptions: RequestOptions): CompletableFuture = + websocketHandler(WebsocketWebsocketHandlerParams.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/WebsocketServiceAsyncImpl.kt similarity index 52% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncImpl.kt index 18c1a65c..f671c08f 100644 --- 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/WebsocketServiceAsyncImpl.kt @@ -4,66 +4,63 @@ 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.emptyHandler 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 com.clear_street.api.models.v1.websocket.WebsocketWebsocketHandlerParams 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 { +/** Active Websocket. */ +class WebsocketServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + WebsocketServiceAsync { - private val withRawResponse: ClockServiceAsync.WithRawResponse by lazy { + private val withRawResponse: WebsocketServiceAsync.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): ClockServiceAsync.WithRawResponse = withRawResponse + override fun withRawResponse(): WebsocketServiceAsync.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): ClockServiceAsync = - ClockServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): WebsocketServiceAsync = + WebsocketServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - override fun getClock( - params: ClockGetClockParams, + override fun websocketHandler( + params: WebsocketWebsocketHandlerParams, requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/clock - withRawResponse().getClock(params, requestOptions).thenApply { it.parse() } + ): CompletableFuture = + // get /v1/ws + withRawResponse().websocketHandler(params, requestOptions).thenAccept {} class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - ClockServiceAsync.WithRawResponse { + WebsocketServiceAsync.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): ClockServiceAsync.WithRawResponse = - ClockServiceAsyncImpl.WithRawResponseImpl( + ): WebsocketServiceAsync.WithRawResponse = + WebsocketServiceAsyncImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val getClockHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val websocketHandlerHandler: Handler = emptyHandler() - override fun getClock( - params: ClockGetClockParams, + override fun websocketHandler( + params: WebsocketWebsocketHandlerParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "clock") + .addPathSegments("v1", "ws") .build() .prepareAsync(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -71,13 +68,7 @@ class ClockServiceAsyncImpl internal constructor(private val clientOptions: Clie .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } .thenApply { response -> errorHandler.handle(response).parseable { - response - .use { getClockHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } + response.use { websocketHandlerHandler.handle(it) } } } } 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/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/instrumentdata/MarketDataServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt new file mode 100644 index 00000000..ed8a72b6 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.async.v1.instrumentdata + +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.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +/** Retrieve instrument analytics, market data, news, and related reference data. */ +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 + + /** + * Returns the most recent OHLV and current price for the requested OEMS instruments. Backed by + * the in-memory Polygon snapshot cache. + * + * Response contract: every request returns one row per **unique** `instrument_id`, in + * first-seen request order. Unresolvable IDs come back with `symbol = null` and every + * market-data field `null`; resolvable IDs with no cache entry come back with `symbol` + * populated but market-data fields `null`. + * + * **Note (temporary):** ID resolution currently goes through the supplemental screener (OEMS + * instrument_id → FMP fmp_symbol → metadata_id → realtime cache). Removed when the market-data + * service serves daily aggregates directly, or when Polygon symbology is loaded into the + * instrument cache. + */ + fun getDailySummaries( + params: MarketDataGetDailySummariesParams + ): CompletableFuture = + getDailySummaries(params, RequestOptions.none()) + + /** @see getDailySummaries */ + fun getDailySummaries( + params: MarketDataGetDailySummariesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** Get market data snapshots for one or more securities. */ + fun getSnapshots(): CompletableFuture = + getSnapshots(MarketDataGetSnapshotsParams.none()) + + /** @see getSnapshots */ + fun getSnapshots( + params: MarketDataGetSnapshotsParams = MarketDataGetSnapshotsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getSnapshots */ + fun getSnapshots( + params: MarketDataGetSnapshotsParams = MarketDataGetSnapshotsParams.none() + ): CompletableFuture = + getSnapshots(params, RequestOptions.none()) + + /** @see getSnapshots */ + fun getSnapshots( + requestOptions: RequestOptions + ): CompletableFuture = + getSnapshots(MarketDataGetSnapshotsParams.none(), requestOptions) + + /** + * 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 + + /** + * Returns a raw HTTP response for `get /v1/market-data/daily-summary`, but is otherwise the + * same as [MarketDataServiceAsync.getDailySummaries]. + */ + fun getDailySummaries( + params: MarketDataGetDailySummariesParams + ): CompletableFuture> = + getDailySummaries(params, RequestOptions.none()) + + /** @see getDailySummaries */ + fun getDailySummaries( + params: MarketDataGetDailySummariesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * Returns a raw HTTP response for `get /v1/market-data/snapshot`, but is otherwise the same + * as [MarketDataServiceAsync.getSnapshots]. + */ + fun getSnapshots(): CompletableFuture> = + getSnapshots(MarketDataGetSnapshotsParams.none()) + + /** @see getSnapshots */ + fun getSnapshots( + params: MarketDataGetSnapshotsParams = MarketDataGetSnapshotsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getSnapshots */ + fun getSnapshots( + params: MarketDataGetSnapshotsParams = MarketDataGetSnapshotsParams.none() + ): CompletableFuture> = + getSnapshots(params, RequestOptions.none()) + + /** @see getSnapshots */ + fun getSnapshots( + requestOptions: RequestOptions + ): CompletableFuture> = + getSnapshots(MarketDataGetSnapshotsParams.none(), requestOptions) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt similarity index 52% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt index 504e897f..dc6c8cfd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt @@ -1,10 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.instruments +package com.clear_street.api.services.async.v1.instrumentdata 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 @@ -15,66 +14,65 @@ 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.events.EventGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetAllInstrumentEventsResponse -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull -/** Retrieve details and lists of tradable instruments. */ -class EventServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - EventServiceAsync { +/** Retrieve instrument analytics, market data, news, and related reference data. */ +class MarketDataServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + MarketDataServiceAsync { - private val withRawResponse: EventServiceAsync.WithRawResponse by lazy { + private val withRawResponse: MarketDataServiceAsync.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): EventServiceAsync.WithRawResponse = withRawResponse + override fun withRawResponse(): MarketDataServiceAsync.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): EventServiceAsync = - EventServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): MarketDataServiceAsync = + MarketDataServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - override fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams, + override fun getDailySummaries( + params: MarketDataGetDailySummariesParams, requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/instruments/events - withRawResponse().getAllInstrumentEvents(params, requestOptions).thenApply { it.parse() } + ): CompletableFuture = + // get /v1/market-data/daily-summary + withRawResponse().getDailySummaries(params, requestOptions).thenApply { it.parse() } - override fun getInstrumentEvents( - params: EventGetInstrumentEventsParams, + override fun getSnapshots( + params: MarketDataGetSnapshotsParams, requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/instruments/{instrument_id}/events - withRawResponse().getInstrumentEvents(params, requestOptions).thenApply { it.parse() } + ): CompletableFuture = + // get /v1/market-data/snapshot + withRawResponse().getSnapshots(params, requestOptions).thenApply { it.parse() } class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - EventServiceAsync.WithRawResponse { + MarketDataServiceAsync.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): EventServiceAsync.WithRawResponse = - EventServiceAsyncImpl.WithRawResponseImpl( + ): MarketDataServiceAsync.WithRawResponse = + MarketDataServiceAsyncImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val getAllInstrumentEventsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val getDailySummariesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) - override fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams, + override fun getDailySummaries( + params: MarketDataGetDailySummariesParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "instruments", "events") + .addPathSegments("v1", "market-data", "daily-summary") .build() .prepareAsync(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -83,7 +81,7 @@ class EventServiceAsyncImpl internal constructor(private val clientOptions: Clie .thenApply { response -> errorHandler.handle(response).parseable { response - .use { getAllInstrumentEventsHandler.handle(it) } + .use { getDailySummariesHandler.handle(it) } .also { if (requestOptions.responseValidation!!) { it.validate() @@ -93,21 +91,18 @@ class EventServiceAsyncImpl internal constructor(private val clientOptions: Clie } } - private val getInstrumentEventsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val getSnapshotsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) - override fun getInstrumentEvents( - params: EventGetInstrumentEventsParams, + override fun getSnapshots( + params: MarketDataGetSnapshotsParams, 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()) + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "instruments", params._pathParam(0), "events") + .addPathSegments("v1", "market-data", "snapshot") .build() .prepareAsync(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) @@ -116,7 +111,7 @@ class EventServiceAsyncImpl internal constructor(private val clientOptions: Clie .thenApply { response -> errorHandler.handle(response).parseable { response - .use { getInstrumentEventsHandler.handle(it) } + .use { getSnapshotsHandler.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/NewsServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsync.kt similarity index 90% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/NewsServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsync.kt index bfb9792c..b88e17dc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/NewsServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsync.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clear_street.api.services.async.v1.instrumentdata 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.news.NewsGetNewsParams -import com.clear_street.api.models.v1.news.NewsGetNewsResponse +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer -/** Retrieve market news and related instrument metadata. */ +/** Retrieve instrument analytics, market data, news, and related reference data. */ interface NewsServiceAsync { /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/NewsServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/NewsServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt index 0e8d0b56..98cd3ee0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/NewsServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clear_street.api.services.async.v1.instrumentdata import com.clear_street.api.core.ClientOptions import com.clear_street.api.core.RequestOptions @@ -14,12 +14,12 @@ 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.news.NewsGetNewsParams -import com.clear_street.api.models.v1.news.NewsGetNewsResponse +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer -/** Retrieve market news and related instrument metadata. */ +/** Retrieve instrument analytics, market data, news, and related reference data. */ class NewsServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : NewsServiceAsync { 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 - > - - /** @see getInstrumentBalanceSheetStatements */ - fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams - ): CompletableFuture< - HttpResponseFor - > = getInstrumentBalanceSheetStatements(params, RequestOptions.none()) - - /** @see getInstrumentBalanceSheetStatements */ - fun getInstrumentBalanceSheetStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture< - HttpResponseFor - > = - getInstrumentBalanceSheetStatements( - instrumentId, - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsyncImpl.kt deleted file mode 100644 index db46333c..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsyncImpl.kt +++ /dev/null @@ -1,97 +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.balancesheets.BalanceSheetGetInstrumentBalanceSheetStatementsParams -import com.clear_street.api.models.v1.instruments.balancesheets.BalanceSheetGetInstrumentBalanceSheetStatementsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class BalanceSheetServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - BalanceSheetServiceAsync { - - private val withRawResponse: BalanceSheetServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): BalanceSheetServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): BalanceSheetServiceAsync = - BalanceSheetServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/instruments/{instrument_id}/balance-sheets - withRawResponse().getInstrumentBalanceSheetStatements(params, requestOptions).thenApply { - it.parse() - } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - BalanceSheetServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): BalanceSheetServiceAsync.WithRawResponse = - BalanceSheetServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentBalanceSheetStatementsHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams, - 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), "balance-sheets") - .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 { getInstrumentBalanceSheetStatementsHandler.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/CashFlowStatementServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsync.kt deleted file mode 100644 index da93aabd..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsync.kt +++ /dev/null @@ -1,166 +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.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instruments.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface CashFlowStatementServiceAsync { - - /** - * 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): CashFlowStatementServiceAsync - - /** - * Get cash flow statements for an instrument. - * - * Retrieves historical cash flow statements for the specified instrument. Cash flow statements - * show cash inflows and outflows from operating, investing, and financing activities. - */ - fun getInstrumentCashFlowStatements( - instrumentId: String - ): CompletableFuture = - getInstrumentCashFlowStatements( - instrumentId, - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - ) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - params: CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - getInstrumentCashFlowStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - params: CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - ): CompletableFuture = - getInstrumentCashFlowStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams - ): CompletableFuture = - getInstrumentCashFlowStatements(params, RequestOptions.none()) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture = - getInstrumentCashFlowStatements( - instrumentId, - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - requestOptions, - ) - - /** - * A view of [CashFlowStatementServiceAsync] 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 - ): CashFlowStatementServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get - * /v1/instruments/{instrument_id}/cash-flow-statements`, but is otherwise the same as - * [CashFlowStatementServiceAsync.getInstrumentCashFlowStatements]. - */ - fun getInstrumentCashFlowStatements( - instrumentId: String - ): CompletableFuture< - HttpResponseFor - > = - getInstrumentCashFlowStatements( - instrumentId, - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - ) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - params: CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture< - HttpResponseFor - > = - getInstrumentCashFlowStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - params: CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - ): CompletableFuture< - HttpResponseFor - > = getInstrumentCashFlowStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture< - HttpResponseFor - > - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams - ): CompletableFuture< - HttpResponseFor - > = getInstrumentCashFlowStatements(params, RequestOptions.none()) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture< - HttpResponseFor - > = - getInstrumentCashFlowStatements( - instrumentId, - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsyncImpl.kt deleted file mode 100644 index 63469014..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsyncImpl.kt +++ /dev/null @@ -1,104 +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.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instruments.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class CashFlowStatementServiceAsyncImpl -internal constructor(private val clientOptions: ClientOptions) : CashFlowStatementServiceAsync { - - private val withRawResponse: CashFlowStatementServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): CashFlowStatementServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions( - modifier: Consumer - ): CashFlowStatementServiceAsync = - CashFlowStatementServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/instruments/{instrument_id}/cash-flow-statements - withRawResponse().getInstrumentCashFlowStatements(params, requestOptions).thenApply { - it.parse() - } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - CashFlowStatementServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): CashFlowStatementServiceAsync.WithRawResponse = - CashFlowStatementServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentCashFlowStatementsHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams, - 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), - "cash-flow-statements", - ) - .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 { getInstrumentCashFlowStatementsHandler.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/EventServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsync.kt deleted file mode 100644 index 8c05abe1..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsync.kt +++ /dev/null @@ -1,187 +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.events.EventGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetAllInstrumentEventsResponse -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface EventServiceAsync { - - /** - * 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): EventServiceAsync - - /** - * List instrument events across all securities. - * - * Retrieves all instrument events grouped by date. - */ - fun getAllInstrumentEvents(): CompletableFuture = - getAllInstrumentEvents(EventGetAllInstrumentEventsParams.none()) - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams = EventGetAllInstrumentEventsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams = EventGetAllInstrumentEventsParams.none() - ): CompletableFuture = - getAllInstrumentEvents(params, RequestOptions.none()) - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - requestOptions: RequestOptions - ): CompletableFuture = - getAllInstrumentEvents(EventGetAllInstrumentEventsParams.none(), requestOptions) - - /** - * Retrieves corporate events (dividends, splits, etc.) for an instrument, grouped by event - * type. - * - * Date range defaults: - * - `from_date`: today - 365 days - * - `to_date`: today + 60 days - */ - fun getInstrumentEvents( - instrumentId: String - ): CompletableFuture = - getInstrumentEvents(instrumentId, EventGetInstrumentEventsParams.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - params: EventGetInstrumentEventsParams = EventGetInstrumentEventsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - getInstrumentEvents(params.toBuilder().instrumentId(instrumentId).build(), requestOptions) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - params: EventGetInstrumentEventsParams = EventGetInstrumentEventsParams.none(), - ): CompletableFuture = - getInstrumentEvents(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - params: EventGetInstrumentEventsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - params: EventGetInstrumentEventsParams - ): CompletableFuture = - getInstrumentEvents(params, RequestOptions.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture = - getInstrumentEvents(instrumentId, EventGetInstrumentEventsParams.none(), requestOptions) - - /** A view of [EventServiceAsync] 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 - ): EventServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/events`, but is otherwise the same - * as [EventServiceAsync.getAllInstrumentEvents]. - */ - fun getAllInstrumentEvents(): - CompletableFuture> = - getAllInstrumentEvents(EventGetAllInstrumentEventsParams.none()) - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams = EventGetAllInstrumentEventsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams = EventGetAllInstrumentEventsParams.none() - ): CompletableFuture> = - getAllInstrumentEvents(params, RequestOptions.none()) - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - requestOptions: RequestOptions - ): CompletableFuture> = - getAllInstrumentEvents(EventGetAllInstrumentEventsParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/events`, but is - * otherwise the same as [EventServiceAsync.getInstrumentEvents]. - */ - fun getInstrumentEvents( - instrumentId: String - ): CompletableFuture> = - getInstrumentEvents(instrumentId, EventGetInstrumentEventsParams.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - params: EventGetInstrumentEventsParams = EventGetInstrumentEventsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - getInstrumentEvents( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - params: EventGetInstrumentEventsParams = EventGetInstrumentEventsParams.none(), - ): CompletableFuture> = - getInstrumentEvents(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - params: EventGetInstrumentEventsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - params: EventGetInstrumentEventsParams - ): CompletableFuture> = - getInstrumentEvents(params, RequestOptions.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture> = - getInstrumentEvents(instrumentId, EventGetInstrumentEventsParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsync.kt deleted file mode 100644 index 499d9321..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsync.kt +++ /dev/null @@ -1,147 +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.fundamentals.FundamentalGetInstrumentFundamentalsParams -import com.clear_street.api.models.v1.instruments.fundamentals.FundamentalGetInstrumentFundamentalsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface FundamentalServiceAsync { - - /** - * 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): FundamentalServiceAsync - - /** Retrieves supplemental fundamentals and company profile data for an instrument. */ - fun getInstrumentFundamentals( - instrumentId: String - ): CompletableFuture = - getInstrumentFundamentals(instrumentId, FundamentalGetInstrumentFundamentalsParams.none()) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - params: FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - getInstrumentFundamentals( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - params: FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams.none(), - ): CompletableFuture = - getInstrumentFundamentals(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams - ): CompletableFuture = - getInstrumentFundamentals(params, RequestOptions.none()) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture = - getInstrumentFundamentals( - instrumentId, - FundamentalGetInstrumentFundamentalsParams.none(), - requestOptions, - ) - - /** - * A view of [FundamentalServiceAsync] 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 - ): FundamentalServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/fundamentals`, but - * is otherwise the same as [FundamentalServiceAsync.getInstrumentFundamentals]. - */ - fun getInstrumentFundamentals( - instrumentId: String - ): CompletableFuture> = - getInstrumentFundamentals( - instrumentId, - FundamentalGetInstrumentFundamentalsParams.none(), - ) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - params: FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - getInstrumentFundamentals( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - params: FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams.none(), - ): CompletableFuture> = - getInstrumentFundamentals(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams - ): CompletableFuture> = - getInstrumentFundamentals(params, RequestOptions.none()) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture> = - getInstrumentFundamentals( - instrumentId, - FundamentalGetInstrumentFundamentalsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsyncImpl.kt deleted file mode 100644 index 659f77ac..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsyncImpl.kt +++ /dev/null @@ -1,91 +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.fundamentals.FundamentalGetInstrumentFundamentalsParams -import com.clear_street.api.models.v1.instruments.fundamentals.FundamentalGetInstrumentFundamentalsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class FundamentalServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - FundamentalServiceAsync { - - private val withRawResponse: FundamentalServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): FundamentalServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): FundamentalServiceAsync = - FundamentalServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/instruments/{instrument_id}/fundamentals - withRawResponse().getInstrumentFundamentals(params, requestOptions).thenApply { it.parse() } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - FundamentalServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): FundamentalServiceAsync.WithRawResponse = - FundamentalServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentFundamentalsHandler: - Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams, - 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.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "instruments", params._pathParam(0), "fundamentals") - .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 { getInstrumentFundamentalsHandler.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/IncomeStatementServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsync.kt deleted file mode 100644 index 089beb72..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsync.kt +++ /dev/null @@ -1,165 +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.incomestatements.IncomeStatementGetInstrumentIncomeStatementsParams -import com.clear_street.api.models.v1.instruments.incomestatements.IncomeStatementGetInstrumentIncomeStatementsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface IncomeStatementServiceAsync { - - /** - * 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): IncomeStatementServiceAsync - - /** - * Retrieves quarterly income 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 getInstrumentIncomeStatements( - instrumentId: String - ): CompletableFuture = - getInstrumentIncomeStatements( - instrumentId, - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - ) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - params: IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - getInstrumentIncomeStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - params: IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - ): CompletableFuture = - getInstrumentIncomeStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams - ): CompletableFuture = - getInstrumentIncomeStatements(params, RequestOptions.none()) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture = - getInstrumentIncomeStatements( - instrumentId, - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - requestOptions, - ) - - /** - * A view of [IncomeStatementServiceAsync] 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 - ): IncomeStatementServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/income-statements`, - * but is otherwise the same as [IncomeStatementServiceAsync.getInstrumentIncomeStatements]. - */ - fun getInstrumentIncomeStatements( - instrumentId: String - ): CompletableFuture< - HttpResponseFor - > = - getInstrumentIncomeStatements( - instrumentId, - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - ) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - params: IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture< - HttpResponseFor - > = - getInstrumentIncomeStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - params: IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - ): CompletableFuture< - HttpResponseFor - > = getInstrumentIncomeStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams - ): CompletableFuture< - HttpResponseFor - > = getInstrumentIncomeStatements(params, RequestOptions.none()) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): CompletableFuture< - HttpResponseFor - > = - getInstrumentIncomeStatements( - instrumentId, - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsyncImpl.kt deleted file mode 100644 index fd310c5e..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsyncImpl.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.incomestatements.IncomeStatementGetInstrumentIncomeStatementsParams -import com.clear_street.api.models.v1.instruments.incomestatements.IncomeStatementGetInstrumentIncomeStatementsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class IncomeStatementServiceAsyncImpl -internal constructor(private val clientOptions: ClientOptions) : IncomeStatementServiceAsync { - - private val withRawResponse: IncomeStatementServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): IncomeStatementServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions( - modifier: Consumer - ): IncomeStatementServiceAsync = - IncomeStatementServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/instruments/{instrument_id}/income-statements - withRawResponse().getInstrumentIncomeStatements(params, requestOptions).thenApply { - it.parse() - } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - IncomeStatementServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): IncomeStatementServiceAsync.WithRawResponse = - IncomeStatementServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentIncomeStatementsHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams, - 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), "income-statements") - .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 { getInstrumentIncomeStatementsHandler.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/OptionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsync.kt deleted file mode 100644 index ef9a2d44..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsync.kt +++ /dev/null @@ -1,95 +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.options.OptionGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.options.OptionGetOptionContractsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface OptionServiceAsync { - - /** - * 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): OptionServiceAsync - - /** - * List options contracts. - * - * Returns options contracts for a given underlier with options-specific metadata. Exactly one - * underlier identifier must be provided. - */ - fun getOptionContracts(): CompletableFuture = - getOptionContracts(OptionGetOptionContractsParams.none()) - - /** @see getOptionContracts */ - fun getOptionContracts( - params: OptionGetOptionContractsParams = OptionGetOptionContractsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getOptionContracts */ - fun getOptionContracts( - params: OptionGetOptionContractsParams = OptionGetOptionContractsParams.none() - ): CompletableFuture = - getOptionContracts(params, RequestOptions.none()) - - /** @see getOptionContracts */ - fun getOptionContracts( - requestOptions: RequestOptions - ): CompletableFuture = - getOptionContracts(OptionGetOptionContractsParams.none(), requestOptions) - - /** - * A view of [OptionServiceAsync] 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 - ): OptionServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/options/contracts`, but is otherwise - * the same as [OptionServiceAsync.getOptionContracts]. - */ - fun getOptionContracts(): - CompletableFuture> = - getOptionContracts(OptionGetOptionContractsParams.none()) - - /** @see getOptionContracts */ - fun getOptionContracts( - params: OptionGetOptionContractsParams = OptionGetOptionContractsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see getOptionContracts */ - fun getOptionContracts( - params: OptionGetOptionContractsParams = OptionGetOptionContractsParams.none() - ): CompletableFuture> = - getOptionContracts(params, RequestOptions.none()) - - /** @see getOptionContracts */ - fun getOptionContracts( - requestOptions: RequestOptions - ): CompletableFuture> = - getOptionContracts(OptionGetOptionContractsParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsyncImpl.kt deleted file mode 100644 index 8cf20c97..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsyncImpl.kt +++ /dev/null @@ -1,85 +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.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.options.OptionGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.options.OptionGetOptionContractsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -class OptionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - OptionServiceAsync { - - private val withRawResponse: OptionServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): OptionServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): OptionServiceAsync = - OptionServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getOptionContracts( - params: OptionGetOptionContractsParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/instruments/options/contracts - withRawResponse().getOptionContracts(params, requestOptions).thenApply { it.parse() } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - OptionServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): OptionServiceAsync.WithRawResponse = - OptionServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getOptionContractsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getOptionContracts( - params: OptionGetOptionContractsParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "instruments", "options", "contracts") - .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 { getOptionContractsHandler.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/marketdata/DailySummaryServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsync.kt deleted file mode 100644 index 71a9344c..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsync.kt +++ /dev/null @@ -1,83 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.marketdata - -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.marketdata.dailysummary.DailySummaryGetDailySummariesParams -import com.clear_street.api.models.v1.marketdata.dailysummary.DailySummaryGetDailySummariesResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Real-time market data snapshots. */ -interface DailySummaryServiceAsync { - - /** - * 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): DailySummaryServiceAsync - - /** - * Returns the most recent OHLV and current price for the requested OEMS instruments. Backed by - * the in-memory Polygon snapshot cache. - * - * Response contract: every request returns one row per **unique** `instrument_id`, in - * first-seen request order. Unresolvable IDs come back with `symbol = null` and every - * market-data field `null`; resolvable IDs with no cache entry come back with `symbol` - * populated but market-data fields `null`. - * - * **Note (temporary):** ID resolution currently goes through the supplemental screener (OEMS - * instrument_id → FMP fmp_symbol → metadata_id → realtime cache). Removed when the market-data - * service serves daily aggregates directly, or when Polygon symbology is loaded into the - * instrument cache. - */ - fun getDailySummaries( - params: DailySummaryGetDailySummariesParams - ): CompletableFuture = - getDailySummaries(params, RequestOptions.none()) - - /** @see getDailySummaries */ - fun getDailySummaries( - params: DailySummaryGetDailySummariesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** - * A view of [DailySummaryServiceAsync] 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 - ): DailySummaryServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/market-data/daily-summary`, but is otherwise the - * same as [DailySummaryServiceAsync.getDailySummaries]. - */ - fun getDailySummaries( - params: DailySummaryGetDailySummariesParams - ): CompletableFuture> = - getDailySummaries(params, RequestOptions.none()) - - /** @see getDailySummaries */ - fun getDailySummaries( - params: DailySummaryGetDailySummariesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsyncImpl.kt deleted file mode 100644 index 42b9435b..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsyncImpl.kt +++ /dev/null @@ -1,85 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.marketdata - -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.marketdata.dailysummary.DailySummaryGetDailySummariesParams -import com.clear_street.api.models.v1.marketdata.dailysummary.DailySummaryGetDailySummariesResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Real-time market data snapshots. */ -class DailySummaryServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - DailySummaryServiceAsync { - - private val withRawResponse: DailySummaryServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): DailySummaryServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): DailySummaryServiceAsync = - DailySummaryServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getDailySummaries( - params: DailySummaryGetDailySummariesParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/market-data/daily-summary - withRawResponse().getDailySummaries(params, requestOptions).thenApply { it.parse() } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - DailySummaryServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): DailySummaryServiceAsync.WithRawResponse = - DailySummaryServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getDailySummariesHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getDailySummaries( - params: DailySummaryGetDailySummariesParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "market-data", "daily-summary") - .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 { getDailySummariesHandler.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/marketdata/SnapshotServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsync.kt deleted file mode 100644 index 7421e1c3..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsync.kt +++ /dev/null @@ -1,88 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.marketdata - -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.marketdata.snapshot.SnapshotGetSnapshotsParams -import com.clear_street.api.models.v1.marketdata.snapshot.SnapshotGetSnapshotsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Real-time market data snapshots. */ -interface SnapshotServiceAsync { - - /** - * 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): SnapshotServiceAsync - - /** Get market data snapshots for one or more securities. */ - fun getSnapshots(): CompletableFuture = - getSnapshots(SnapshotGetSnapshotsParams.none()) - - /** @see getSnapshots */ - fun getSnapshots( - params: SnapshotGetSnapshotsParams = SnapshotGetSnapshotsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getSnapshots */ - fun getSnapshots( - params: SnapshotGetSnapshotsParams = SnapshotGetSnapshotsParams.none() - ): CompletableFuture = getSnapshots(params, RequestOptions.none()) - - /** @see getSnapshots */ - fun getSnapshots( - requestOptions: RequestOptions - ): CompletableFuture = - getSnapshots(SnapshotGetSnapshotsParams.none(), requestOptions) - - /** - * A view of [SnapshotServiceAsync] 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 - ): SnapshotServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/market-data/snapshot`, but is otherwise the same - * as [SnapshotServiceAsync.getSnapshots]. - */ - fun getSnapshots(): CompletableFuture> = - getSnapshots(SnapshotGetSnapshotsParams.none()) - - /** @see getSnapshots */ - fun getSnapshots( - params: SnapshotGetSnapshotsParams = SnapshotGetSnapshotsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see getSnapshots */ - fun getSnapshots( - params: SnapshotGetSnapshotsParams = SnapshotGetSnapshotsParams.none() - ): CompletableFuture> = - getSnapshots(params, RequestOptions.none()) - - /** @see getSnapshots */ - fun getSnapshots( - requestOptions: RequestOptions - ): CompletableFuture> = - getSnapshots(SnapshotGetSnapshotsParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsyncImpl.kt deleted file mode 100644 index d891c2bf..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsyncImpl.kt +++ /dev/null @@ -1,85 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.marketdata - -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.marketdata.snapshot.SnapshotGetSnapshotsParams -import com.clear_street.api.models.v1.marketdata.snapshot.SnapshotGetSnapshotsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Real-time market data snapshots. */ -class SnapshotServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - SnapshotServiceAsync { - - private val withRawResponse: SnapshotServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): SnapshotServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): SnapshotServiceAsync = - SnapshotServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getSnapshots( - params: SnapshotGetSnapshotsParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/market-data/snapshot - withRawResponse().getSnapshots(params, requestOptions).thenApply { it.parse() } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - SnapshotServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): SnapshotServiceAsync.WithRawResponse = - SnapshotServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getSnapshotsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getSnapshots( - params: SnapshotGetSnapshotsParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "market-data", "snapshot") - .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 { getSnapshotsHandler.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/omniai/EntitlementAgreementServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsync.kt deleted file mode 100644 index 729a221d..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsync.kt +++ /dev/null @@ -1,111 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.omniai - -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.omniai.entitlementagreements.EntitlementAgreementGetEntitlementAgreementsParams -import com.clear_street.api.models.v1.omniai.entitlementagreements.EntitlementAgreementGetEntitlementAgreementsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** - * Thread-centric AI assistant for conversational trading. Create threads to start conversations, - * poll response objects for in-progress output, and read finalized messages from thread history. - * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. - */ -interface EntitlementAgreementServiceAsync { - - /** - * 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): EntitlementAgreementServiceAsync - - /** List current signable entitlement agreements for consent UX. */ - fun getEntitlementAgreements(): - CompletableFuture = - getEntitlementAgreements(EntitlementAgreementGetEntitlementAgreementsParams.none()) - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams.none() - ): CompletableFuture = - getEntitlementAgreements(params, RequestOptions.none()) - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - requestOptions: RequestOptions - ): CompletableFuture = - getEntitlementAgreements( - EntitlementAgreementGetEntitlementAgreementsParams.none(), - requestOptions, - ) - - /** - * A view of [EntitlementAgreementServiceAsync] 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 - ): EntitlementAgreementServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/omni-ai/entitlement-agreements`, but is - * otherwise the same as [EntitlementAgreementServiceAsync.getEntitlementAgreements]. - */ - fun getEntitlementAgreements(): - CompletableFuture< - HttpResponseFor - > = getEntitlementAgreements(EntitlementAgreementGetEntitlementAgreementsParams.none()) - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams.none() - ): CompletableFuture< - HttpResponseFor - > = getEntitlementAgreements(params, RequestOptions.none()) - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - requestOptions: RequestOptions - ): CompletableFuture< - HttpResponseFor - > = - getEntitlementAgreements( - EntitlementAgreementGetEntitlementAgreementsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsyncImpl.kt deleted file mode 100644 index 147e64c9..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsyncImpl.kt +++ /dev/null @@ -1,100 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.omniai - -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.omniai.entitlementagreements.EntitlementAgreementGetEntitlementAgreementsParams -import com.clear_street.api.models.v1.omniai.entitlementagreements.EntitlementAgreementGetEntitlementAgreementsResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** - * Thread-centric AI assistant for conversational trading. Create threads to start conversations, - * poll response objects for in-progress output, and read finalized messages from thread history. - * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. - */ -class EntitlementAgreementServiceAsyncImpl -internal constructor(private val clientOptions: ClientOptions) : EntitlementAgreementServiceAsync { - - private val withRawResponse: EntitlementAgreementServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): EntitlementAgreementServiceAsync.WithRawResponse = - withRawResponse - - override fun withOptions( - modifier: Consumer - ): EntitlementAgreementServiceAsync = - EntitlementAgreementServiceAsyncImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - override fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/omni-ai/entitlement-agreements - withRawResponse().getEntitlementAgreements(params, requestOptions).thenApply { it.parse() } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - EntitlementAgreementServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): EntitlementAgreementServiceAsync.WithRawResponse = - EntitlementAgreementServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getEntitlementAgreementsHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams, - requestOptions: RequestOptions, - ): CompletableFuture< - HttpResponseFor - > { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "omni-ai", "entitlement-agreements") - .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 { getEntitlementAgreementsHandler.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/omniai/EntitlementServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt index e1364efb..b0e06a66 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt @@ -9,6 +9,8 @@ import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntit import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse import java.util.concurrent.CompletableFuture @@ -86,6 +88,30 @@ interface EntitlementServiceAsync { ): CompletableFuture = deleteEntitlement(entitlementId, EntitlementDeleteEntitlementParams.none(), requestOptions) + /** List current signable entitlement agreements for consent UX. */ + fun getEntitlementAgreements(): CompletableFuture = + getEntitlementAgreements(EntitlementGetEntitlementAgreementsParams.none()) + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams.none() + ): CompletableFuture = + getEntitlementAgreements(params, RequestOptions.none()) + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + requestOptions: RequestOptions + ): CompletableFuture = + getEntitlementAgreements(EntitlementGetEntitlementAgreementsParams.none(), requestOptions) + /** List caller's active entitlement grants. */ fun getEntitlements(): CompletableFuture = getEntitlements(EntitlementGetEntitlementsParams.none()) @@ -188,6 +214,37 @@ interface EntitlementServiceAsync { requestOptions, ) + /** + * Returns a raw HTTP response for `get /v1/omni-ai/entitlement-agreements`, but is + * otherwise the same as [EntitlementServiceAsync.getEntitlementAgreements]. + */ + fun getEntitlementAgreements(): + CompletableFuture> = + getEntitlementAgreements(EntitlementGetEntitlementAgreementsParams.none()) + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams.none() + ): CompletableFuture> = + getEntitlementAgreements(params, RequestOptions.none()) + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + requestOptions: RequestOptions + ): CompletableFuture> = + getEntitlementAgreements( + EntitlementGetEntitlementAgreementsParams.none(), + requestOptions, + ) + /** * Returns a raw HTTP response for `get /v1/omni-ai/entitlements`, but is otherwise the same * as [EntitlementServiceAsync.getEntitlements]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt index e67d2291..621c1a2c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt @@ -20,6 +20,8 @@ import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntit import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse import java.util.concurrent.CompletableFuture @@ -58,6 +60,13 @@ class EntitlementServiceAsyncImpl internal constructor(private val clientOptions // delete /v1/omni-ai/entitlements/{entitlement_id} withRawResponse().deleteEntitlement(params, requestOptions).thenApply { it.parse() } + override fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/omni-ai/entitlement-agreements + withRawResponse().getEntitlementAgreements(params, requestOptions).thenApply { it.parse() } + override fun getEntitlements( params: EntitlementGetEntitlementsParams, requestOptions: RequestOptions, @@ -143,6 +152,37 @@ class EntitlementServiceAsyncImpl internal constructor(private val clientOptions } } + private val getEntitlementAgreementsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "omni-ai", "entitlement-agreements") + .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 { getEntitlementAgreementsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val getEntitlementsHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt index 23b887cd..62f06440 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt @@ -5,15 +5,18 @@ package com.clear_street.api.services.async.v1.omniai 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.omniai.threads.ThreadCreateMessageParams +import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse -import com.clear_street.api.services.async.v1.omniai.threads.MessageServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -38,12 +41,40 @@ interface ThreadServiceAsync { fun withOptions(modifier: Consumer): ThreadServiceAsync /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages from - * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * Continue an existing conversation thread. + * + * Appends a new user message to the thread and starts an assistant response. Only one response + * may be active per thread at a time — if the previous turn is still in progress, this endpoint + * returns **409 Conflict**. Wait for the active response to reach a terminal status before + * submitting the next turn. + * + * Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for assistant + * output. */ - fun messages(): MessageServiceAsync + fun createMessage( + threadId: String, + params: ThreadCreateMessageParams, + ): CompletableFuture = + createMessage(threadId, params, RequestOptions.none()) + + /** @see createMessage */ + fun createMessage( + threadId: String, + params: ThreadCreateMessageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + createMessage(params.toBuilder().threadId(threadId).build(), requestOptions) + + /** @see createMessage */ + fun createMessage( + params: ThreadCreateMessageParams + ): CompletableFuture = createMessage(params, RequestOptions.none()) + + /** @see createMessage */ + fun createMessage( + params: ThreadCreateMessageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture /** * Create a new conversation thread. @@ -66,6 +97,40 @@ interface ThreadServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** + * List finalized messages in a thread. + * + * Returns **finalized** messages in chronological order. Messages from in-progress assistant + * turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET + * /omni-ai/responses/{response_id}` for live output. + * + * If the last finalized message has role `USER`, an active response likely exists and should be + * polled separately. + */ + fun getMessages( + threadId: String, + params: ThreadGetMessagesParams, + ): CompletableFuture = + getMessages(threadId, params, RequestOptions.none()) + + /** @see getMessages */ + fun getMessages( + threadId: String, + params: ThreadGetMessagesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getMessages(params.toBuilder().threadId(threadId).build(), requestOptions) + + /** @see getMessages */ + fun getMessages(params: ThreadGetMessagesParams): CompletableFuture = + getMessages(params, RequestOptions.none()) + + /** @see getMessages */ + fun getMessages( + params: ThreadGetMessagesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + /** * Get a specific thread. * @@ -163,12 +228,34 @@ interface ThreadServiceAsync { ): ThreadServiceAsync.WithRawResponse /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages - * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Returns a raw HTTP response for `post /v1/omni-ai/threads/{thread_id}/messages`, but is + * otherwise the same as [ThreadServiceAsync.createMessage]. */ - fun messages(): MessageServiceAsync.WithRawResponse + fun createMessage( + threadId: String, + params: ThreadCreateMessageParams, + ): CompletableFuture> = + createMessage(threadId, params, RequestOptions.none()) + + /** @see createMessage */ + fun createMessage( + threadId: String, + params: ThreadCreateMessageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + createMessage(params.toBuilder().threadId(threadId).build(), requestOptions) + + /** @see createMessage */ + fun createMessage( + params: ThreadCreateMessageParams + ): CompletableFuture> = + createMessage(params, RequestOptions.none()) + + /** @see createMessage */ + fun createMessage( + params: ThreadCreateMessageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> /** * Returns a raw HTTP response for `post /v1/omni-ai/threads`, but is otherwise the same as @@ -185,6 +272,36 @@ interface ThreadServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> + /** + * Returns a raw HTTP response for `get /v1/omni-ai/threads/{thread_id}/messages`, but is + * otherwise the same as [ThreadServiceAsync.getMessages]. + */ + fun getMessages( + threadId: String, + params: ThreadGetMessagesParams, + ): CompletableFuture> = + getMessages(threadId, params, RequestOptions.none()) + + /** @see getMessages */ + fun getMessages( + threadId: String, + params: ThreadGetMessagesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getMessages(params.toBuilder().threadId(threadId).build(), requestOptions) + + /** @see getMessages */ + fun getMessages( + params: ThreadGetMessagesParams + ): CompletableFuture> = + getMessages(params, RequestOptions.none()) + + /** @see getMessages */ + fun getMessages( + params: ThreadGetMessagesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + /** * Returns a raw HTTP response for `get /v1/omni-ai/threads/{thread_id}`, but is otherwise * the same as [ThreadServiceAsync.getThreadById]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt index f9d3f791..a7a0459a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt @@ -16,16 +16,18 @@ 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.omniai.threads.ThreadCreateMessageParams +import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse -import com.clear_street.api.services.async.v1.omniai.threads.MessageServiceAsync -import com.clear_street.api.services.async.v1.omniai.threads.MessageServiceAsyncImpl import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -43,20 +45,17 @@ class ThreadServiceAsyncImpl internal constructor(private val clientOptions: Cli WithRawResponseImpl(clientOptions) } - private val messages: MessageServiceAsync by lazy { MessageServiceAsyncImpl(clientOptions) } - override fun withRawResponse(): ThreadServiceAsync.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): ThreadServiceAsync = ThreadServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages from - * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. - */ - override fun messages(): MessageServiceAsync = messages + override fun createMessage( + params: ThreadCreateMessageParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /v1/omni-ai/threads/{thread_id}/messages + withRawResponse().createMessage(params, requestOptions).thenApply { it.parse() } override fun createThread( params: ThreadCreateThreadParams, @@ -65,6 +64,13 @@ class ThreadServiceAsyncImpl internal constructor(private val clientOptions: Cli // post /v1/omni-ai/threads withRawResponse().createThread(params, requestOptions).thenApply { it.parse() } + override fun getMessages( + params: ThreadGetMessagesParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/omni-ai/threads/{thread_id}/messages + withRawResponse().getMessages(params, requestOptions).thenApply { it.parse() } + override fun getThreadById( params: ThreadGetThreadByIdParams, requestOptions: RequestOptions, @@ -92,10 +98,6 @@ class ThreadServiceAsyncImpl internal constructor(private val clientOptions: Cli private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val messages: MessageServiceAsync.WithRawResponse by lazy { - MessageServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): ThreadServiceAsync.WithRawResponse = @@ -103,13 +105,39 @@ class ThreadServiceAsyncImpl internal constructor(private val clientOptions: Cli clientOptions.toBuilder().apply(modifier::accept).build() ) - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages - * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. - */ - override fun messages(): MessageServiceAsync.WithRawResponse = messages + private val createMessageHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun createMessage( + params: ThreadCreateMessageParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("threadId", params.threadId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "omni-ai", "threads", params._pathParam(0), "messages") + .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 { createMessageHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } private val createThreadHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -142,6 +170,39 @@ class ThreadServiceAsyncImpl internal constructor(private val clientOptions: Cli } } + private val getMessagesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getMessages( + params: ThreadGetMessagesParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("threadId", params.threadId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "omni-ai", "threads", params._pathParam(0), "messages") + .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 { getMessagesHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val getThreadByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsync.kt deleted file mode 100644 index 96621886..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsync.kt +++ /dev/null @@ -1,181 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.omniai.threads - -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.omniai.threads.messages.MessageCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageCreateMessageResponse -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** - * Thread-centric AI assistant for conversational trading. Create threads to start conversations, - * poll response objects for in-progress output, and read finalized messages from thread history. - * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. - */ -interface MessageServiceAsync { - - /** - * 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): MessageServiceAsync - - /** - * Continue an existing conversation thread. - * - * Appends a new user message to the thread and starts an assistant response. Only one response - * may be active per thread at a time — if the previous turn is still in progress, this endpoint - * returns **409 Conflict**. Wait for the active response to reach a terminal status before - * submitting the next turn. - * - * Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for assistant - * output. - */ - fun createMessage( - threadId: String, - params: MessageCreateMessageParams, - ): CompletableFuture = - createMessage(threadId, params, RequestOptions.none()) - - /** @see createMessage */ - fun createMessage( - threadId: String, - params: MessageCreateMessageParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - createMessage(params.toBuilder().threadId(threadId).build(), requestOptions) - - /** @see createMessage */ - fun createMessage( - params: MessageCreateMessageParams - ): CompletableFuture = - createMessage(params, RequestOptions.none()) - - /** @see createMessage */ - fun createMessage( - params: MessageCreateMessageParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** - * List finalized messages in a thread. - * - * Returns **finalized** messages in chronological order. Messages from in-progress assistant - * turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET - * /omni-ai/responses/{response_id}` for live output. - * - * If the last finalized message has role `USER`, an active response likely exists and should be - * polled separately. - */ - fun getMessages( - threadId: String, - params: MessageGetMessagesParams, - ): CompletableFuture = - getMessages(threadId, params, RequestOptions.none()) - - /** @see getMessages */ - fun getMessages( - threadId: String, - params: MessageGetMessagesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - getMessages(params.toBuilder().threadId(threadId).build(), requestOptions) - - /** @see getMessages */ - fun getMessages( - params: MessageGetMessagesParams - ): CompletableFuture = getMessages(params, RequestOptions.none()) - - /** @see getMessages */ - fun getMessages( - params: MessageGetMessagesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** - * A view of [MessageServiceAsync] 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 - ): MessageServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `post /v1/omni-ai/threads/{thread_id}/messages`, but is - * otherwise the same as [MessageServiceAsync.createMessage]. - */ - fun createMessage( - threadId: String, - params: MessageCreateMessageParams, - ): CompletableFuture> = - createMessage(threadId, params, RequestOptions.none()) - - /** @see createMessage */ - fun createMessage( - threadId: String, - params: MessageCreateMessageParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - createMessage(params.toBuilder().threadId(threadId).build(), requestOptions) - - /** @see createMessage */ - fun createMessage( - params: MessageCreateMessageParams - ): CompletableFuture> = - createMessage(params, RequestOptions.none()) - - /** @see createMessage */ - fun createMessage( - params: MessageCreateMessageParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** - * Returns a raw HTTP response for `get /v1/omni-ai/threads/{thread_id}/messages`, but is - * otherwise the same as [MessageServiceAsync.getMessages]. - */ - fun getMessages( - threadId: String, - params: MessageGetMessagesParams, - ): CompletableFuture> = - getMessages(threadId, params, RequestOptions.none()) - - /** @see getMessages */ - fun getMessages( - threadId: String, - params: MessageGetMessagesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - getMessages(params.toBuilder().threadId(threadId).build(), requestOptions) - - /** @see getMessages */ - fun getMessages( - params: MessageGetMessagesParams - ): CompletableFuture> = - getMessages(params, RequestOptions.none()) - - /** @see getMessages */ - fun getMessages( - params: MessageGetMessagesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsyncImpl.kt deleted file mode 100644 index b18ed846..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsyncImpl.kt +++ /dev/null @@ -1,139 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.omniai.threads - -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.omniai.threads.messages.MessageCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageCreateMessageResponse -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** - * Thread-centric AI assistant for conversational trading. Create threads to start conversations, - * poll response objects for in-progress output, and read finalized messages from thread history. - * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. - */ -class MessageServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - MessageServiceAsync { - - private val withRawResponse: MessageServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): MessageServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): MessageServiceAsync = - MessageServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun createMessage( - params: MessageCreateMessageParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // post /v1/omni-ai/threads/{thread_id}/messages - withRawResponse().createMessage(params, requestOptions).thenApply { it.parse() } - - override fun getMessages( - params: MessageGetMessagesParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/omni-ai/threads/{thread_id}/messages - withRawResponse().getMessages(params, requestOptions).thenApply { it.parse() } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - MessageServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): MessageServiceAsync.WithRawResponse = - MessageServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val createMessageHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun createMessage( - params: MessageCreateMessageParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("threadId", params.threadId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "omni-ai", "threads", params._pathParam(0), "messages") - .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 { createMessageHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } - - private val getMessagesHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getMessages( - params: MessageGetMessagesParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("threadId", params.threadId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "omni-ai", "threads", params._pathParam(0), "messages") - .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 { getMessagesHandler.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/watchlists/ItemServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsync.kt deleted file mode 100644 index 05741b86..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsync.kt +++ /dev/null @@ -1,154 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.watchlists - -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.watchlists.items.ItemAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemAddWatchlistItemResponse -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Create and manage watchlists. */ -interface ItemServiceAsync { - - /** - * 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): ItemServiceAsync - - /** Add an instrument to a watchlist */ - fun addWatchlistItem( - watchlistId: String, - params: ItemAddWatchlistItemParams, - ): CompletableFuture = - addWatchlistItem(watchlistId, params, RequestOptions.none()) - - /** @see addWatchlistItem */ - fun addWatchlistItem( - watchlistId: String, - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - addWatchlistItem(params.toBuilder().watchlistId(watchlistId).build(), requestOptions) - - /** @see addWatchlistItem */ - fun addWatchlistItem( - params: ItemAddWatchlistItemParams - ): CompletableFuture = - addWatchlistItem(params, RequestOptions.none()) - - /** @see addWatchlistItem */ - fun addWatchlistItem( - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** Delete an instrument from a watchlist */ - fun deleteWatchlistItem( - itemId: String, - params: ItemDeleteWatchlistItemParams, - ): CompletableFuture = - deleteWatchlistItem(itemId, params, RequestOptions.none()) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - itemId: String, - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - deleteWatchlistItem(params.toBuilder().itemId(itemId).build(), requestOptions) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams - ): CompletableFuture = - deleteWatchlistItem(params, RequestOptions.none()) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** A view of [ItemServiceAsync] 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): ItemServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `post /v1/watchlists/{watchlist_id}/items`, but is - * otherwise the same as [ItemServiceAsync.addWatchlistItem]. - */ - fun addWatchlistItem( - watchlistId: String, - params: ItemAddWatchlistItemParams, - ): CompletableFuture> = - addWatchlistItem(watchlistId, params, RequestOptions.none()) - - /** @see addWatchlistItem */ - fun addWatchlistItem( - watchlistId: String, - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - addWatchlistItem(params.toBuilder().watchlistId(watchlistId).build(), requestOptions) - - /** @see addWatchlistItem */ - fun addWatchlistItem( - params: ItemAddWatchlistItemParams - ): CompletableFuture> = - addWatchlistItem(params, RequestOptions.none()) - - /** @see addWatchlistItem */ - fun addWatchlistItem( - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** - * Returns a raw HTTP response for `delete /v1/watchlists/{watchlist_id}/items/{item_id}`, - * but is otherwise the same as [ItemServiceAsync.deleteWatchlistItem]. - */ - fun deleteWatchlistItem( - itemId: String, - params: ItemDeleteWatchlistItemParams, - ): CompletableFuture> = - deleteWatchlistItem(itemId, params, RequestOptions.none()) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - itemId: String, - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - deleteWatchlistItem(params.toBuilder().itemId(itemId).build(), requestOptions) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams - ): CompletableFuture> = - deleteWatchlistItem(params, RequestOptions.none()) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsyncImpl.kt deleted file mode 100644 index 65119ec1..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsyncImpl.kt +++ /dev/null @@ -1,141 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.watchlists - -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.watchlists.items.ItemAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemAddWatchlistItemResponse -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemResponse -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Create and manage watchlists. */ -class ItemServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - ItemServiceAsync { - - private val withRawResponse: ItemServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): ItemServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): ItemServiceAsync = - ItemServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun addWatchlistItem( - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // post /v1/watchlists/{watchlist_id}/items - withRawResponse().addWatchlistItem(params, requestOptions).thenApply { it.parse() } - - override fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // delete /v1/watchlists/{watchlist_id}/items/{item_id} - withRawResponse().deleteWatchlistItem(params, requestOptions).thenApply { it.parse() } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - ItemServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): ItemServiceAsync.WithRawResponse = - ItemServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val addWatchlistItemHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun addWatchlistItem( - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("watchlistId", params.watchlistId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "watchlists", params._pathParam(0), "items") - .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 { addWatchlistItemHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } - - private val deleteWatchlistItemHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("itemId", params.itemId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.DELETE) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments( - "v1", - "watchlists", - params._pathParam(0), - "items", - 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 { deleteWatchlistItemHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt index 743e28c1..978a88f8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt @@ -3,22 +3,18 @@ package com.clear_street.api.services.blocking 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.blocking.v1.AccountService +import com.clear_street.api.services.blocking.v1.ApiVersionService import com.clear_street.api.services.blocking.v1.CalendarService -import com.clear_street.api.services.blocking.v1.ClockService +import com.clear_street.api.services.blocking.v1.InstrumentDataService import com.clear_street.api.services.blocking.v1.InstrumentService -import com.clear_street.api.services.blocking.v1.MarketDataService -import com.clear_street.api.services.blocking.v1.NewsService import com.clear_street.api.services.blocking.v1.OmniAiService -import com.clear_street.api.services.blocking.v1.VersionService +import com.clear_street.api.services.blocking.v1.OrderService +import com.clear_street.api.services.blocking.v1.PositionService import com.clear_street.api.services.blocking.v1.WatchlistService -import com.google.errorprone.annotations.MustBeClosed +import com.clear_street.api.services.blocking.v1.WebsocketService import java.util.function.Consumer -/** Active Websocket. */ interface V1Service { /** @@ -36,43 +32,31 @@ interface V1Service { /** Manage trading accounts, balances, and portfolio history. */ fun accounts(): AccountService - fun calendars(): CalendarService - - /** Access financial calendars for events like earnings, dividends, and splits. */ - fun clock(): ClockService + /** Endpoints for API service metadata. */ + fun apiVersion(): ApiVersionService - /** Retrieve details and lists of tradable instruments. */ - fun instruments(): InstrumentService + /** Access clocks and financial calendars for market sessions and events. */ + fun calendar(): CalendarService - fun marketData(): MarketDataService + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun instrumentData(): InstrumentDataService - /** Retrieve market news and related instrument metadata. */ - fun news(): NewsService + /** Retrieve core details and discovery endpoints for tradable instruments. */ + fun instruments(): InstrumentService fun omniAi(): OmniAiService - /** Endpoints for API service metadata. */ - fun version(): VersionService + /** Place, monitor, and manage trading orders. */ + fun orders(): OrderService - /** Create and manage watchlists. */ - fun watchlists(): WatchlistService - - /** Upgrade the HTTP connection to a WebSocket and echo incoming messages. */ - fun websocketHandler() = websocketHandler(V1WebsocketHandlerParams.none()) + /** View positions and manage position instructions. */ + fun positions(): PositionService - /** @see websocketHandler */ - fun websocketHandler( - params: V1WebsocketHandlerParams = V1WebsocketHandlerParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ) - - /** @see websocketHandler */ - fun websocketHandler(params: V1WebsocketHandlerParams = V1WebsocketHandlerParams.none()) = - websocketHandler(params, RequestOptions.none()) + /** Create and manage watchlists. */ + fun watchlist(): WatchlistService - /** @see websocketHandler */ - fun websocketHandler(requestOptions: RequestOptions) = - websocketHandler(V1WebsocketHandlerParams.none(), requestOptions) + /** Active Websocket. */ + fun websocket(): WebsocketService /** A view of [V1Service] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -87,50 +71,30 @@ interface V1Service { /** Manage trading accounts, balances, and portfolio history. */ fun accounts(): AccountService.WithRawResponse - fun calendars(): CalendarService.WithRawResponse - - /** Access financial calendars for events like earnings, dividends, and splits. */ - fun clock(): ClockService.WithRawResponse + /** Endpoints for API service metadata. */ + fun apiVersion(): ApiVersionService.WithRawResponse - /** Retrieve details and lists of tradable instruments. */ - fun instruments(): InstrumentService.WithRawResponse + /** Access clocks and financial calendars for market sessions and events. */ + fun calendar(): CalendarService.WithRawResponse - fun marketData(): MarketDataService.WithRawResponse + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun instrumentData(): InstrumentDataService.WithRawResponse - /** Retrieve market news and related instrument metadata. */ - fun news(): NewsService.WithRawResponse + /** Retrieve core details and discovery endpoints for tradable instruments. */ + fun instruments(): InstrumentService.WithRawResponse fun omniAi(): OmniAiService.WithRawResponse - /** Endpoints for API service metadata. */ - fun version(): VersionService.WithRawResponse + /** Place, monitor, and manage trading orders. */ + fun orders(): OrderService.WithRawResponse + + /** View positions and manage position instructions. */ + fun positions(): PositionService.WithRawResponse /** Create and manage watchlists. */ - fun watchlists(): WatchlistService.WithRawResponse + fun watchlist(): WatchlistService.WithRawResponse - /** - * Returns a raw HTTP response for `get /v1/ws`, but is otherwise the same as - * [V1Service.websocketHandler]. - */ - @MustBeClosed - fun websocketHandler(): HttpResponse = websocketHandler(V1WebsocketHandlerParams.none()) - - /** @see websocketHandler */ - @MustBeClosed - fun websocketHandler( - params: V1WebsocketHandlerParams = V1WebsocketHandlerParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponse - - /** @see websocketHandler */ - @MustBeClosed - fun websocketHandler( - params: V1WebsocketHandlerParams = V1WebsocketHandlerParams.none() - ): HttpResponse = websocketHandler(params, RequestOptions.none()) - - /** @see websocketHandler */ - @MustBeClosed - fun websocketHandler(requestOptions: RequestOptions): HttpResponse = - websocketHandler(V1WebsocketHandlerParams.none(), requestOptions) + /** Active Websocket. */ + fun websocket(): WebsocketService.WithRawResponse } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt index bc0392cf..c27db079 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt @@ -3,38 +3,28 @@ package com.clear_street.api.services.blocking 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.prepare -import com.clear_street.api.models.v1.V1WebsocketHandlerParams import com.clear_street.api.services.blocking.v1.AccountService import com.clear_street.api.services.blocking.v1.AccountServiceImpl +import com.clear_street.api.services.blocking.v1.ApiVersionService +import com.clear_street.api.services.blocking.v1.ApiVersionServiceImpl import com.clear_street.api.services.blocking.v1.CalendarService import com.clear_street.api.services.blocking.v1.CalendarServiceImpl -import com.clear_street.api.services.blocking.v1.ClockService -import com.clear_street.api.services.blocking.v1.ClockServiceImpl +import com.clear_street.api.services.blocking.v1.InstrumentDataService +import com.clear_street.api.services.blocking.v1.InstrumentDataServiceImpl import com.clear_street.api.services.blocking.v1.InstrumentService import com.clear_street.api.services.blocking.v1.InstrumentServiceImpl -import com.clear_street.api.services.blocking.v1.MarketDataService -import com.clear_street.api.services.blocking.v1.MarketDataServiceImpl -import com.clear_street.api.services.blocking.v1.NewsService -import com.clear_street.api.services.blocking.v1.NewsServiceImpl import com.clear_street.api.services.blocking.v1.OmniAiService import com.clear_street.api.services.blocking.v1.OmniAiServiceImpl -import com.clear_street.api.services.blocking.v1.VersionService -import com.clear_street.api.services.blocking.v1.VersionServiceImpl +import com.clear_street.api.services.blocking.v1.OrderService +import com.clear_street.api.services.blocking.v1.OrderServiceImpl +import com.clear_street.api.services.blocking.v1.PositionService +import com.clear_street.api.services.blocking.v1.PositionServiceImpl import com.clear_street.api.services.blocking.v1.WatchlistService import com.clear_street.api.services.blocking.v1.WatchlistServiceImpl +import com.clear_street.api.services.blocking.v1.WebsocketService +import com.clear_street.api.services.blocking.v1.WebsocketServiceImpl import java.util.function.Consumer -/** Active Websocket. */ class V1ServiceImpl internal constructor(private val clientOptions: ClientOptions) : V1Service { private val withRawResponse: V1Service.WithRawResponse by lazy { @@ -43,21 +33,25 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption private val accounts: AccountService by lazy { AccountServiceImpl(clientOptions) } - private val calendars: CalendarService by lazy { CalendarServiceImpl(clientOptions) } + private val apiVersion: ApiVersionService by lazy { ApiVersionServiceImpl(clientOptions) } - private val clock: ClockService by lazy { ClockServiceImpl(clientOptions) } + private val calendar: CalendarService by lazy { CalendarServiceImpl(clientOptions) } + + private val instrumentData: InstrumentDataService by lazy { + InstrumentDataServiceImpl(clientOptions) + } private val instruments: InstrumentService by lazy { InstrumentServiceImpl(clientOptions) } - private val marketData: MarketDataService by lazy { MarketDataServiceImpl(clientOptions) } + private val omniAi: OmniAiService by lazy { OmniAiServiceImpl(clientOptions) } - private val news: NewsService by lazy { NewsServiceImpl(clientOptions) } + private val orders: OrderService by lazy { OrderServiceImpl(clientOptions) } - private val omniAi: OmniAiService by lazy { OmniAiServiceImpl(clientOptions) } + private val positions: PositionService by lazy { PositionServiceImpl(clientOptions) } - private val version: VersionService by lazy { VersionServiceImpl(clientOptions) } + private val watchlist: WatchlistService by lazy { WatchlistServiceImpl(clientOptions) } - private val watchlists: WatchlistService by lazy { WatchlistServiceImpl(clientOptions) } + private val websocket: WebsocketService by lazy { WebsocketServiceImpl(clientOptions) } override fun withRawResponse(): V1Service.WithRawResponse = withRawResponse @@ -67,75 +61,73 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** Manage trading accounts, balances, and portfolio history. */ override fun accounts(): AccountService = accounts - override fun calendars(): CalendarService = calendars - - /** Access financial calendars for events like earnings, dividends, and splits. */ - override fun clock(): ClockService = clock + /** Endpoints for API service metadata. */ + override fun apiVersion(): ApiVersionService = apiVersion - /** Retrieve details and lists of tradable instruments. */ - override fun instruments(): InstrumentService = instruments + /** Access clocks and financial calendars for market sessions and events. */ + override fun calendar(): CalendarService = calendar - override fun marketData(): MarketDataService = marketData + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun instrumentData(): InstrumentDataService = instrumentData - /** Retrieve market news and related instrument metadata. */ - override fun news(): NewsService = news + /** Retrieve core details and discovery endpoints for tradable instruments. */ + override fun instruments(): InstrumentService = instruments override fun omniAi(): OmniAiService = omniAi - /** Endpoints for API service metadata. */ - override fun version(): VersionService = version + /** Place, monitor, and manage trading orders. */ + override fun orders(): OrderService = orders + + /** View positions and manage position instructions. */ + override fun positions(): PositionService = positions /** Create and manage watchlists. */ - override fun watchlists(): WatchlistService = watchlists - - override fun websocketHandler( - params: V1WebsocketHandlerParams, - requestOptions: RequestOptions, - ) { - // get /v1/ws - withRawResponse().websocketHandler(params, requestOptions) - } + override fun watchlist(): WatchlistService = watchlist + + /** Active Websocket. */ + override fun websocket(): WebsocketService = websocket class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : V1Service.WithRawResponse { - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val accounts: AccountService.WithRawResponse by lazy { AccountServiceImpl.WithRawResponseImpl(clientOptions) } - private val calendars: CalendarService.WithRawResponse by lazy { + private val apiVersion: ApiVersionService.WithRawResponse by lazy { + ApiVersionServiceImpl.WithRawResponseImpl(clientOptions) + } + + private val calendar: CalendarService.WithRawResponse by lazy { CalendarServiceImpl.WithRawResponseImpl(clientOptions) } - private val clock: ClockService.WithRawResponse by lazy { - ClockServiceImpl.WithRawResponseImpl(clientOptions) + private val instrumentData: InstrumentDataService.WithRawResponse by lazy { + InstrumentDataServiceImpl.WithRawResponseImpl(clientOptions) } private val instruments: InstrumentService.WithRawResponse by lazy { InstrumentServiceImpl.WithRawResponseImpl(clientOptions) } - private val marketData: MarketDataService.WithRawResponse by lazy { - MarketDataServiceImpl.WithRawResponseImpl(clientOptions) + private val omniAi: OmniAiService.WithRawResponse by lazy { + OmniAiServiceImpl.WithRawResponseImpl(clientOptions) } - private val news: NewsService.WithRawResponse by lazy { - NewsServiceImpl.WithRawResponseImpl(clientOptions) + private val orders: OrderService.WithRawResponse by lazy { + OrderServiceImpl.WithRawResponseImpl(clientOptions) } - private val omniAi: OmniAiService.WithRawResponse by lazy { - OmniAiServiceImpl.WithRawResponseImpl(clientOptions) + private val positions: PositionService.WithRawResponse by lazy { + PositionServiceImpl.WithRawResponseImpl(clientOptions) } - private val version: VersionService.WithRawResponse by lazy { - VersionServiceImpl.WithRawResponseImpl(clientOptions) + private val watchlist: WatchlistService.WithRawResponse by lazy { + WatchlistServiceImpl.WithRawResponseImpl(clientOptions) } - private val watchlists: WatchlistService.WithRawResponse by lazy { - WatchlistServiceImpl.WithRawResponseImpl(clientOptions) + private val websocket: WebsocketService.WithRawResponse by lazy { + WebsocketServiceImpl.WithRawResponseImpl(clientOptions) } override fun withOptions( @@ -148,45 +140,30 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** Manage trading accounts, balances, and portfolio history. */ override fun accounts(): AccountService.WithRawResponse = accounts - override fun calendars(): CalendarService.WithRawResponse = calendars - - /** Access financial calendars for events like earnings, dividends, and splits. */ - override fun clock(): ClockService.WithRawResponse = clock + /** Endpoints for API service metadata. */ + override fun apiVersion(): ApiVersionService.WithRawResponse = apiVersion - /** Retrieve details and lists of tradable instruments. */ - override fun instruments(): InstrumentService.WithRawResponse = instruments + /** Access clocks and financial calendars for market sessions and events. */ + override fun calendar(): CalendarService.WithRawResponse = calendar - override fun marketData(): MarketDataService.WithRawResponse = marketData + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun instrumentData(): InstrumentDataService.WithRawResponse = instrumentData - /** Retrieve market news and related instrument metadata. */ - override fun news(): NewsService.WithRawResponse = news + /** Retrieve core details and discovery endpoints for tradable instruments. */ + override fun instruments(): InstrumentService.WithRawResponse = instruments override fun omniAi(): OmniAiService.WithRawResponse = omniAi - /** Endpoints for API service metadata. */ - override fun version(): VersionService.WithRawResponse = version + /** Place, monitor, and manage trading orders. */ + override fun orders(): OrderService.WithRawResponse = orders + + /** View positions and manage position instructions. */ + override fun positions(): PositionService.WithRawResponse = positions /** Create and manage watchlists. */ - override fun watchlists(): WatchlistService.WithRawResponse = watchlists - - private val websocketHandlerHandler: Handler = emptyHandler() - - override fun websocketHandler( - params: V1WebsocketHandlerParams, - requestOptions: RequestOptions, - ): HttpResponse { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "ws") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response.use { websocketHandlerHandler.handle(it) } - } - } + override fun watchlist(): WatchlistService.WithRawResponse = watchlist + + /** Active Websocket. */ + override fun websocket(): WebsocketService.WithRawResponse = websocket } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountService.kt index bae1d0ff..404242d6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountService.kt @@ -5,16 +5,16 @@ package com.clear_street.api.services.blocking.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.accounts.AccountGetAccountBalancesParams +import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdResponse import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse -import com.clear_street.api.services.blocking.v1.accounts.BalanceService -import com.clear_street.api.services.blocking.v1.accounts.OrderService -import com.clear_street.api.services.blocking.v1.accounts.PortfolioHistoryService -import com.clear_street.api.services.blocking.v1.accounts.PositionService import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer @@ -33,17 +33,42 @@ interface AccountService { */ fun withOptions(modifier: Consumer): AccountService - /** Manage trading accounts, balances, and portfolio history. */ - fun balances(): BalanceService + /** Fetch account balance information */ + fun getAccountBalances(accountId: Long): AccountGetAccountBalancesResponse = + getAccountBalances(accountId, AccountGetAccountBalancesParams.none()) - /** Place, monitor, and manage trading orders. */ - fun orders(): OrderService + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + params: AccountGetAccountBalancesParams = AccountGetAccountBalancesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): AccountGetAccountBalancesResponse = + getAccountBalances(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + params: AccountGetAccountBalancesParams = AccountGetAccountBalancesParams.none(), + ): AccountGetAccountBalancesResponse = + getAccountBalances(accountId, params, RequestOptions.none()) + + /** @see getAccountBalances */ + fun getAccountBalances( + params: AccountGetAccountBalancesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): AccountGetAccountBalancesResponse - /** Manage trading accounts, balances, and portfolio history. */ - fun portfolioHistory(): PortfolioHistoryService + /** @see getAccountBalances */ + fun getAccountBalances( + params: AccountGetAccountBalancesParams + ): AccountGetAccountBalancesResponse = getAccountBalances(params, RequestOptions.none()) - /** View account positions. */ - fun positions(): PositionService + /** @see getAccountBalances */ + fun getAccountBalances( + accountId: Long, + requestOptions: RequestOptions, + ): AccountGetAccountBalancesResponse = + getAccountBalances(accountId, AccountGetAccountBalancesParams.none(), requestOptions) /** Fetch account details by ID */ fun getAccountById(accountId: Long): AccountGetAccountByIdResponse = @@ -98,6 +123,32 @@ interface AccountService { fun getAccounts(requestOptions: RequestOptions): AccountGetAccountsResponse = getAccounts(AccountGetAccountsParams.none(), requestOptions) + /** Retrieves daily portfolio history for the specified account. */ + fun getPortfolioHistory( + accountId: Long, + params: AccountGetPortfolioHistoryParams, + ): AccountGetPortfolioHistoryResponse = + getPortfolioHistory(accountId, params, RequestOptions.none()) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + accountId: Long, + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): AccountGetPortfolioHistoryResponse = + getPortfolioHistory(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams + ): AccountGetPortfolioHistoryResponse = getPortfolioHistory(params, RequestOptions.none()) + + /** @see getPortfolioHistory */ + fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): AccountGetPortfolioHistoryResponse + /** Update account risk settings */ fun patchAccountById(accountId: Long): AccountPatchAccountByIdResponse = patchAccountById(accountId, AccountPatchAccountByIdParams.none()) @@ -143,17 +194,54 @@ interface AccountService { */ fun withOptions(modifier: Consumer): AccountService.WithRawResponse - /** Manage trading accounts, balances, and portfolio history. */ - fun balances(): BalanceService.WithRawResponse + /** + * Returns a raw HTTP response for `get /v1/accounts/{account_id}/balances`, but is + * otherwise the same as [AccountService.getAccountBalances]. + */ + @MustBeClosed + fun getAccountBalances( + accountId: Long + ): HttpResponseFor = + getAccountBalances(accountId, AccountGetAccountBalancesParams.none()) + + /** @see getAccountBalances */ + @MustBeClosed + fun getAccountBalances( + accountId: Long, + params: AccountGetAccountBalancesParams = AccountGetAccountBalancesParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getAccountBalances(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getAccountBalances */ + @MustBeClosed + fun getAccountBalances( + accountId: Long, + params: AccountGetAccountBalancesParams = AccountGetAccountBalancesParams.none(), + ): HttpResponseFor = + getAccountBalances(accountId, params, RequestOptions.none()) - /** Place, monitor, and manage trading orders. */ - fun orders(): OrderService.WithRawResponse + /** @see getAccountBalances */ + @MustBeClosed + fun getAccountBalances( + params: AccountGetAccountBalancesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor - /** Manage trading accounts, balances, and portfolio history. */ - fun portfolioHistory(): PortfolioHistoryService.WithRawResponse + /** @see getAccountBalances */ + @MustBeClosed + fun getAccountBalances( + params: AccountGetAccountBalancesParams + ): HttpResponseFor = + getAccountBalances(params, RequestOptions.none()) - /** View account positions. */ - fun positions(): PositionService.WithRawResponse + /** @see getAccountBalances */ + @MustBeClosed + fun getAccountBalances( + accountId: Long, + requestOptions: RequestOptions, + ): HttpResponseFor = + getAccountBalances(accountId, AccountGetAccountBalancesParams.none(), requestOptions) /** * Returns a raw HTTP response for `get /v1/accounts/{account_id}`, but is otherwise the @@ -230,6 +318,40 @@ interface AccountService { ): HttpResponseFor = getAccounts(AccountGetAccountsParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `get /v1/accounts/{account_id}/portfolio-history`, but is + * otherwise the same as [AccountService.getPortfolioHistory]. + */ + @MustBeClosed + fun getPortfolioHistory( + accountId: Long, + params: AccountGetPortfolioHistoryParams, + ): HttpResponseFor = + getPortfolioHistory(accountId, params, RequestOptions.none()) + + /** @see getPortfolioHistory */ + @MustBeClosed + fun getPortfolioHistory( + accountId: Long, + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getPortfolioHistory(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPortfolioHistory */ + @MustBeClosed + fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams + ): HttpResponseFor = + getPortfolioHistory(params, RequestOptions.none()) + + /** @see getPortfolioHistory */ + @MustBeClosed + fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + /** * Returns a raw HTTP response for `patch /v1/accounts/{account_id}`, but is otherwise the * same as [AccountService.patchAccountById]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceImpl.kt index 00761c7a..4dce82cc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceImpl.kt @@ -16,20 +16,16 @@ 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.prepare +import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesParams +import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdResponse import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse -import com.clear_street.api.services.blocking.v1.accounts.BalanceService -import com.clear_street.api.services.blocking.v1.accounts.BalanceServiceImpl -import com.clear_street.api.services.blocking.v1.accounts.OrderService -import com.clear_street.api.services.blocking.v1.accounts.OrderServiceImpl -import com.clear_street.api.services.blocking.v1.accounts.PortfolioHistoryService -import com.clear_street.api.services.blocking.v1.accounts.PortfolioHistoryServiceImpl -import com.clear_street.api.services.blocking.v1.accounts.PositionService -import com.clear_street.api.services.blocking.v1.accounts.PositionServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -41,32 +37,17 @@ class AccountServiceImpl internal constructor(private val clientOptions: ClientO WithRawResponseImpl(clientOptions) } - private val balances: BalanceService by lazy { BalanceServiceImpl(clientOptions) } - - private val orders: OrderService by lazy { OrderServiceImpl(clientOptions) } - - private val portfolioHistory: PortfolioHistoryService by lazy { - PortfolioHistoryServiceImpl(clientOptions) - } - - private val positions: PositionService by lazy { PositionServiceImpl(clientOptions) } - override fun withRawResponse(): AccountService.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): AccountService = AccountServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Manage trading accounts, balances, and portfolio history. */ - override fun balances(): BalanceService = balances - - /** Place, monitor, and manage trading orders. */ - override fun orders(): OrderService = orders - - /** Manage trading accounts, balances, and portfolio history. */ - override fun portfolioHistory(): PortfolioHistoryService = portfolioHistory - - /** View account positions. */ - override fun positions(): PositionService = positions + override fun getAccountBalances( + params: AccountGetAccountBalancesParams, + requestOptions: RequestOptions, + ): AccountGetAccountBalancesResponse = + // get /v1/accounts/{account_id}/balances + withRawResponse().getAccountBalances(params, requestOptions).parse() override fun getAccountById( params: AccountGetAccountByIdParams, @@ -82,6 +63,13 @@ class AccountServiceImpl internal constructor(private val clientOptions: ClientO // get /v1/accounts withRawResponse().getAccounts(params, requestOptions).parse() + override fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions, + ): AccountGetPortfolioHistoryResponse = + // get /v1/accounts/{account_id}/portfolio-history + withRawResponse().getPortfolioHistory(params, requestOptions).parse() + override fun patchAccountById( params: AccountPatchAccountByIdParams, requestOptions: RequestOptions, @@ -95,22 +83,6 @@ class AccountServiceImpl internal constructor(private val clientOptions: ClientO private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val balances: BalanceService.WithRawResponse by lazy { - BalanceServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val orders: OrderService.WithRawResponse by lazy { - OrderServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val portfolioHistory: PortfolioHistoryService.WithRawResponse by lazy { - PortfolioHistoryServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val positions: PositionService.WithRawResponse by lazy { - PositionServiceImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): AccountService.WithRawResponse = @@ -118,17 +90,35 @@ class AccountServiceImpl internal constructor(private val clientOptions: ClientO clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Manage trading accounts, balances, and portfolio history. */ - override fun balances(): BalanceService.WithRawResponse = balances - - /** Place, monitor, and manage trading orders. */ - override fun orders(): OrderService.WithRawResponse = orders - - /** Manage trading accounts, balances, and portfolio history. */ - override fun portfolioHistory(): PortfolioHistoryService.WithRawResponse = portfolioHistory + private val getAccountBalancesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) - /** View account positions. */ - override fun positions(): PositionService.WithRawResponse = positions + override fun getAccountBalances( + params: AccountGetAccountBalancesParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // 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() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getAccountBalancesHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } private val getAccountByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -187,6 +177,36 @@ class AccountServiceImpl internal constructor(private val clientOptions: ClientO } } + private val getPortfolioHistoryHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getPortfolioHistory( + params: AccountGetPortfolioHistoryParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // 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() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getPortfolioHistoryHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val patchAccountByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionService.kt new file mode 100644 index 00000000..7a4b0bdb --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionService.kt @@ -0,0 +1,86 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.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.apiversion.ApiVersionGetVersionParams +import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionResponse +import com.google.errorprone.annotations.MustBeClosed +import java.util.function.Consumer + +/** Endpoints for API service metadata. */ +interface ApiVersionService { + + /** + * 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): ApiVersionService + + /** Returns the current version string for this API endpoint. */ + fun getVersion(): ApiVersionGetVersionResponse = getVersion(ApiVersionGetVersionParams.none()) + + /** @see getVersion */ + fun getVersion( + params: ApiVersionGetVersionParams = ApiVersionGetVersionParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): ApiVersionGetVersionResponse + + /** @see getVersion */ + fun getVersion( + params: ApiVersionGetVersionParams = ApiVersionGetVersionParams.none() + ): ApiVersionGetVersionResponse = getVersion(params, RequestOptions.none()) + + /** @see getVersion */ + fun getVersion(requestOptions: RequestOptions): ApiVersionGetVersionResponse = + getVersion(ApiVersionGetVersionParams.none(), requestOptions) + + /** A view of [ApiVersionService] 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 + ): ApiVersionService.WithRawResponse + + /** + * Returns a raw HTTP response for `get /v1/version`, but is otherwise the same as + * [ApiVersionService.getVersion]. + */ + @MustBeClosed + fun getVersion(): HttpResponseFor = + getVersion(ApiVersionGetVersionParams.none()) + + /** @see getVersion */ + @MustBeClosed + fun getVersion( + params: ApiVersionGetVersionParams = ApiVersionGetVersionParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getVersion */ + @MustBeClosed + fun getVersion( + params: ApiVersionGetVersionParams = ApiVersionGetVersionParams.none() + ): HttpResponseFor = getVersion(params, RequestOptions.none()) + + /** @see getVersion */ + @MustBeClosed + fun getVersion( + requestOptions: RequestOptions + ): HttpResponseFor = + getVersion(ApiVersionGetVersionParams.none(), requestOptions) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/VersionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceImpl.kt similarity index 69% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/VersionServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceImpl.kt index 7e2e7ef4..7d150ce2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/VersionServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceImpl.kt @@ -14,50 +14,50 @@ 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.prepare -import com.clear_street.api.models.v1.version.VersionGetVersionParams -import com.clear_street.api.models.v1.version.VersionGetVersionResponse +import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionParams +import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionResponse import java.util.function.Consumer /** Endpoints for API service metadata. */ -class VersionServiceImpl internal constructor(private val clientOptions: ClientOptions) : - VersionService { +class ApiVersionServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ApiVersionService { - private val withRawResponse: VersionService.WithRawResponse by lazy { + private val withRawResponse: ApiVersionService.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): VersionService.WithRawResponse = withRawResponse + override fun withRawResponse(): ApiVersionService.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): VersionService = - VersionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): ApiVersionService = + ApiVersionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun getVersion( - params: VersionGetVersionParams, + params: ApiVersionGetVersionParams, requestOptions: RequestOptions, - ): VersionGetVersionResponse = + ): ApiVersionGetVersionResponse = // get /v1/version withRawResponse().getVersion(params, requestOptions).parse() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - VersionService.WithRawResponse { + ApiVersionService.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): VersionService.WithRawResponse = - VersionServiceImpl.WithRawResponseImpl( + ): ApiVersionService.WithRawResponse = + ApiVersionServiceImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val getVersionHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val getVersionHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun getVersion( - params: VersionGetVersionParams, + params: ApiVersionGetVersionParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarService.kt index ccf3ee5a..90a6f2c8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarService.kt @@ -3,9 +3,16 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.calendars.MarketHourService +import com.clear_street.api.core.RequestOptions +import com.clear_street.api.core.http.HttpResponseFor +import com.clear_street.api.models.v1.calendar.CalendarGetClockParams +import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse +import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer +/** Access clocks and financial calendars for market sessions and events. */ interface CalendarService { /** @@ -20,8 +27,38 @@ interface CalendarService { */ fun withOptions(modifier: Consumer): CalendarService - /** Access financial calendars for events like earnings, dividends, and splits. */ - fun marketHours(): MarketHourService + /** Returns the current server time in UTC. */ + fun getClock(): CalendarGetClockResponse = getClock(CalendarGetClockParams.none()) + + /** @see getClock */ + fun getClock( + params: CalendarGetClockParams = CalendarGetClockParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CalendarGetClockResponse + + /** @see getClock */ + fun getClock( + params: CalendarGetClockParams = CalendarGetClockParams.none() + ): CalendarGetClockResponse = getClock(params, RequestOptions.none()) + + /** @see getClock */ + fun getClock(requestOptions: RequestOptions): CalendarGetClockResponse = + getClock(CalendarGetClockParams.none(), requestOptions) + + /** + * Retrieves comprehensive trading hours including pre-market, regular, and after-hours + * sessions. Returns market status, session times, and next session schedules. + */ + fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams + ): CalendarGetMarketHoursCalendarResponse = + getMarketHoursCalendar(params, RequestOptions.none()) + + /** @see getMarketHoursCalendar */ + fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CalendarGetMarketHoursCalendarResponse /** A view of [CalendarService] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -33,7 +70,47 @@ interface CalendarService { */ fun withOptions(modifier: Consumer): CalendarService.WithRawResponse - /** Access financial calendars for events like earnings, dividends, and splits. */ - fun marketHours(): MarketHourService.WithRawResponse + /** + * Returns a raw HTTP response for `get /v1/clock`, but is otherwise the same as + * [CalendarService.getClock]. + */ + @MustBeClosed + fun getClock(): HttpResponseFor = + getClock(CalendarGetClockParams.none()) + + /** @see getClock */ + @MustBeClosed + fun getClock( + params: CalendarGetClockParams = CalendarGetClockParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getClock */ + @MustBeClosed + fun getClock( + params: CalendarGetClockParams = CalendarGetClockParams.none() + ): HttpResponseFor = getClock(params, RequestOptions.none()) + + /** @see getClock */ + @MustBeClosed + fun getClock(requestOptions: RequestOptions): HttpResponseFor = + getClock(CalendarGetClockParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /v1/calendars/market-hours`, but is otherwise the + * same as [CalendarService.getMarketHoursCalendar]. + */ + @MustBeClosed + fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams + ): HttpResponseFor = + getMarketHoursCalendar(params, RequestOptions.none()) + + /** @see getMarketHoursCalendar */ + @MustBeClosed + fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceImpl.kt index 581ac892..c004bae0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceImpl.kt @@ -3,10 +3,24 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.calendars.MarketHourService -import com.clear_street.api.services.blocking.v1.calendars.MarketHourServiceImpl +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.prepare +import com.clear_street.api.models.v1.calendar.CalendarGetClockParams +import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse import java.util.function.Consumer +/** Access clocks and financial calendars for market sessions and events. */ class CalendarServiceImpl internal constructor(private val clientOptions: ClientOptions) : CalendarService { @@ -14,22 +28,30 @@ class CalendarServiceImpl internal constructor(private val clientOptions: Client WithRawResponseImpl(clientOptions) } - private val marketHours: MarketHourService by lazy { MarketHourServiceImpl(clientOptions) } - override fun withRawResponse(): CalendarService.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): CalendarService = CalendarServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Access financial calendars for events like earnings, dividends, and splits. */ - override fun marketHours(): MarketHourService = marketHours + override fun getClock( + params: CalendarGetClockParams, + requestOptions: RequestOptions, + ): CalendarGetClockResponse = + // get /v1/clock + withRawResponse().getClock(params, requestOptions).parse() + + override fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams, + requestOptions: RequestOptions, + ): CalendarGetMarketHoursCalendarResponse = + // get /v1/calendars/market-hours + withRawResponse().getMarketHoursCalendar(params, requestOptions).parse() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : CalendarService.WithRawResponse { - private val marketHours: MarketHourService.WithRawResponse by lazy { - MarketHourServiceImpl.WithRawResponseImpl(clientOptions) - } + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer @@ -38,7 +60,58 @@ class CalendarServiceImpl internal constructor(private val clientOptions: Client clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Access financial calendars for events like earnings, dividends, and splits. */ - override fun marketHours(): MarketHourService.WithRawResponse = marketHours + private val getClockHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getClock( + params: CalendarGetClockParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "clock") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getClockHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getMarketHoursCalendarHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getMarketHoursCalendar( + params: CalendarGetMarketHoursCalendarParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "calendars", "market-hours") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return 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/blocking/v1/ClockService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ClockService.kt deleted file mode 100644 index 024c5d57..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ClockService.kt +++ /dev/null @@ -1,81 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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 com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Access financial calendars for events like earnings, dividends, and splits. */ -interface ClockService { - - /** - * 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): ClockService - - /** Returns the current server time in UTC. */ - fun getClock(): ClockGetClockResponse = getClock(ClockGetClockParams.none()) - - /** @see getClock */ - fun getClock( - params: ClockGetClockParams = ClockGetClockParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): ClockGetClockResponse - - /** @see getClock */ - fun getClock(params: ClockGetClockParams = ClockGetClockParams.none()): ClockGetClockResponse = - getClock(params, RequestOptions.none()) - - /** @see getClock */ - fun getClock(requestOptions: RequestOptions): ClockGetClockResponse = - getClock(ClockGetClockParams.none(), requestOptions) - - /** A view of [ClockService] 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): ClockService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/clock`, but is otherwise the same as - * [ClockService.getClock]. - */ - @MustBeClosed - fun getClock(): HttpResponseFor = - getClock(ClockGetClockParams.none()) - - /** @see getClock */ - @MustBeClosed - fun getClock( - params: ClockGetClockParams = ClockGetClockParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getClock */ - @MustBeClosed - fun getClock( - params: ClockGetClockParams = ClockGetClockParams.none() - ): HttpResponseFor = getClock(params, RequestOptions.none()) - - /** @see getClock */ - @MustBeClosed - fun getClock(requestOptions: RequestOptions): HttpResponseFor = - getClock(ClockGetClockParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataService.kt new file mode 100644 index 00000000..6151949e --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataService.kt @@ -0,0 +1,827 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.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.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse +import com.clear_street.api.services.blocking.v1.instrumentdata.MarketDataService +import com.clear_street.api.services.blocking.v1.instrumentdata.NewsService +import com.google.errorprone.annotations.MustBeClosed +import java.util.function.Consumer + +/** Retrieve instrument analytics, market data, news, and related reference data. */ +interface InstrumentDataService { + + /** + * 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): InstrumentDataService + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun marketData(): MarketDataService + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun news(): NewsService + + /** + * List instrument events across all securities. + * + * Retrieves all instrument events grouped by date. + */ + fun getAllInstrumentEvents(): InstrumentDataGetAllInstrumentEventsResponse = + getAllInstrumentEvents(InstrumentDataGetAllInstrumentEventsParams.none()) + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetAllInstrumentEventsResponse + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams.none() + ): InstrumentDataGetAllInstrumentEventsResponse = + getAllInstrumentEvents(params, RequestOptions.none()) + + /** @see getAllInstrumentEvents */ + fun getAllInstrumentEvents( + requestOptions: RequestOptions + ): InstrumentDataGetAllInstrumentEventsResponse = + getAllInstrumentEvents(InstrumentDataGetAllInstrumentEventsParams.none(), requestOptions) + + /** Retrieves analyst ratings and price targets for an instrument. */ + fun getInstrumentAnalystConsensus( + instrumentId: String + ): InstrumentDataGetInstrumentAnalystConsensusResponse = + getInstrumentAnalystConsensus( + instrumentId, + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + ) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + params: InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentAnalystConsensusResponse = + getInstrumentAnalystConsensus( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + params: InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + ): InstrumentDataGetInstrumentAnalystConsensusResponse = + getInstrumentAnalystConsensus(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentAnalystConsensusResponse + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams + ): InstrumentDataGetInstrumentAnalystConsensusResponse = + getInstrumentAnalystConsensus(params, RequestOptions.none()) + + /** @see getInstrumentAnalystConsensus */ + fun getInstrumentAnalystConsensus( + instrumentId: String, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentAnalystConsensusResponse = + getInstrumentAnalystConsensus( + instrumentId, + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + requestOptions, + ) + + /** + * 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 + ): InstrumentDataGetInstrumentBalanceSheetStatementsResponse = + getInstrumentBalanceSheetStatements( + instrumentId, + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + ) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentBalanceSheetStatementsResponse = + getInstrumentBalanceSheetStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + ): InstrumentDataGetInstrumentBalanceSheetStatementsResponse = + getInstrumentBalanceSheetStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentBalanceSheetStatementsResponse + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams + ): InstrumentDataGetInstrumentBalanceSheetStatementsResponse = + getInstrumentBalanceSheetStatements(params, RequestOptions.none()) + + /** @see getInstrumentBalanceSheetStatements */ + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentBalanceSheetStatementsResponse = + getInstrumentBalanceSheetStatements( + instrumentId, + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + requestOptions, + ) + + /** + * Get cash flow statements for an instrument. + * + * Retrieves historical cash flow statements for the specified instrument. Cash flow statements + * show cash inflows and outflows from operating, investing, and financing activities. + */ + fun getInstrumentCashFlowStatements( + instrumentId: String + ): InstrumentDataGetInstrumentCashFlowStatementsResponse = + getInstrumentCashFlowStatements( + instrumentId, + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + ) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentCashFlowStatementsResponse = + getInstrumentCashFlowStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + ): InstrumentDataGetInstrumentCashFlowStatementsResponse = + getInstrumentCashFlowStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentCashFlowStatementsResponse + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams + ): InstrumentDataGetInstrumentCashFlowStatementsResponse = + getInstrumentCashFlowStatements(params, RequestOptions.none()) + + /** @see getInstrumentCashFlowStatements */ + fun getInstrumentCashFlowStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentCashFlowStatementsResponse = + getInstrumentCashFlowStatements( + instrumentId, + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + requestOptions, + ) + + /** + * Retrieves corporate events (dividends, splits, etc.) for an instrument, grouped by event + * type. + * + * Date range defaults: + * - `from_date`: today - 365 days + * - `to_date`: today + 60 days + */ + fun getInstrumentEvents(instrumentId: String): InstrumentDataGetInstrumentEventsResponse = + getInstrumentEvents(instrumentId, InstrumentDataGetInstrumentEventsParams.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + params: InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentEventsResponse = + getInstrumentEvents(params.toBuilder().instrumentId(instrumentId).build(), requestOptions) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + params: InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams.none(), + ): InstrumentDataGetInstrumentEventsResponse = + getInstrumentEvents(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentEventsResponse + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams + ): InstrumentDataGetInstrumentEventsResponse = + getInstrumentEvents(params, RequestOptions.none()) + + /** @see getInstrumentEvents */ + fun getInstrumentEvents( + instrumentId: String, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentEventsResponse = + getInstrumentEvents( + instrumentId, + InstrumentDataGetInstrumentEventsParams.none(), + requestOptions, + ) + + /** Retrieves supplemental fundamentals and company profile data for an instrument. */ + fun getInstrumentFundamentals( + instrumentId: String + ): InstrumentDataGetInstrumentFundamentalsResponse = + getInstrumentFundamentals( + instrumentId, + InstrumentDataGetInstrumentFundamentalsParams.none(), + ) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + params: InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentFundamentalsResponse = + getInstrumentFundamentals( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + params: InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams.none(), + ): InstrumentDataGetInstrumentFundamentalsResponse = + getInstrumentFundamentals(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentFundamentalsResponse + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams + ): InstrumentDataGetInstrumentFundamentalsResponse = + getInstrumentFundamentals(params, RequestOptions.none()) + + /** @see getInstrumentFundamentals */ + fun getInstrumentFundamentals( + instrumentId: String, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentFundamentalsResponse = + getInstrumentFundamentals( + instrumentId, + InstrumentDataGetInstrumentFundamentalsParams.none(), + requestOptions, + ) + + /** + * Retrieves quarterly income 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 getInstrumentIncomeStatements( + instrumentId: String + ): InstrumentDataGetInstrumentIncomeStatementsResponse = + getInstrumentIncomeStatements( + instrumentId, + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + ) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentIncomeStatementsResponse = + getInstrumentIncomeStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + ): InstrumentDataGetInstrumentIncomeStatementsResponse = + getInstrumentIncomeStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentDataGetInstrumentIncomeStatementsResponse + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams + ): InstrumentDataGetInstrumentIncomeStatementsResponse = + getInstrumentIncomeStatements(params, RequestOptions.none()) + + /** @see getInstrumentIncomeStatements */ + fun getInstrumentIncomeStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentIncomeStatementsResponse = + getInstrumentIncomeStatements( + instrumentId, + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + requestOptions, + ) + + /** + * A view of [InstrumentDataService] 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 + ): InstrumentDataService.WithRawResponse + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun marketData(): MarketDataService.WithRawResponse + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + fun news(): NewsService.WithRawResponse + + /** + * Returns a raw HTTP response for `get /v1/instruments/events`, but is otherwise the same + * as [InstrumentDataService.getAllInstrumentEvents]. + */ + @MustBeClosed + fun getAllInstrumentEvents(): + HttpResponseFor = + getAllInstrumentEvents(InstrumentDataGetAllInstrumentEventsParams.none()) + + /** @see getAllInstrumentEvents */ + @MustBeClosed + fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getAllInstrumentEvents */ + @MustBeClosed + fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams = + InstrumentDataGetAllInstrumentEventsParams.none() + ): HttpResponseFor = + getAllInstrumentEvents(params, RequestOptions.none()) + + /** @see getAllInstrumentEvents */ + @MustBeClosed + fun getAllInstrumentEvents( + requestOptions: RequestOptions + ): HttpResponseFor = + getAllInstrumentEvents( + InstrumentDataGetAllInstrumentEventsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/analyst-reporting`, + * but is otherwise the same as [InstrumentDataService.getInstrumentAnalystConsensus]. + */ + @MustBeClosed + fun getInstrumentAnalystConsensus( + instrumentId: String + ): HttpResponseFor = + getInstrumentAnalystConsensus( + instrumentId, + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + ) + + /** @see getInstrumentAnalystConsensus */ + @MustBeClosed + fun getInstrumentAnalystConsensus( + instrumentId: String, + params: InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getInstrumentAnalystConsensus( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentAnalystConsensus */ + @MustBeClosed + fun getInstrumentAnalystConsensus( + instrumentId: String, + params: InstrumentDataGetInstrumentAnalystConsensusParams = + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + ): HttpResponseFor = + getInstrumentAnalystConsensus(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentAnalystConsensus */ + @MustBeClosed + fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getInstrumentAnalystConsensus */ + @MustBeClosed + fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams + ): HttpResponseFor = + getInstrumentAnalystConsensus(params, RequestOptions.none()) + + /** @see getInstrumentAnalystConsensus */ + @MustBeClosed + fun getInstrumentAnalystConsensus( + instrumentId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + getInstrumentAnalystConsensus( + instrumentId, + InstrumentDataGetInstrumentAnalystConsensusParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/balance-sheets`, but + * is otherwise the same as [InstrumentDataService.getInstrumentBalanceSheetStatements]. + */ + @MustBeClosed + fun getInstrumentBalanceSheetStatements( + instrumentId: String + ): HttpResponseFor = + getInstrumentBalanceSheetStatements( + instrumentId, + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + ) + + /** @see getInstrumentBalanceSheetStatements */ + @MustBeClosed + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getInstrumentBalanceSheetStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentBalanceSheetStatements */ + @MustBeClosed + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams = + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + ): HttpResponseFor = + getInstrumentBalanceSheetStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentBalanceSheetStatements */ + @MustBeClosed + fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getInstrumentBalanceSheetStatements */ + @MustBeClosed + fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams + ): HttpResponseFor = + getInstrumentBalanceSheetStatements(params, RequestOptions.none()) + + /** @see getInstrumentBalanceSheetStatements */ + @MustBeClosed + fun getInstrumentBalanceSheetStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + getInstrumentBalanceSheetStatements( + instrumentId, + InstrumentDataGetInstrumentBalanceSheetStatementsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get + * /v1/instruments/{instrument_id}/cash-flow-statements`, but is otherwise the same as + * [InstrumentDataService.getInstrumentCashFlowStatements]. + */ + @MustBeClosed + fun getInstrumentCashFlowStatements( + instrumentId: String + ): HttpResponseFor = + getInstrumentCashFlowStatements( + instrumentId, + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + ) + + /** @see getInstrumentCashFlowStatements */ + @MustBeClosed + fun getInstrumentCashFlowStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getInstrumentCashFlowStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentCashFlowStatements */ + @MustBeClosed + fun getInstrumentCashFlowStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentCashFlowStatementsParams = + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + ): HttpResponseFor = + getInstrumentCashFlowStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentCashFlowStatements */ + @MustBeClosed + fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getInstrumentCashFlowStatements */ + @MustBeClosed + fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams + ): HttpResponseFor = + getInstrumentCashFlowStatements(params, RequestOptions.none()) + + /** @see getInstrumentCashFlowStatements */ + @MustBeClosed + fun getInstrumentCashFlowStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + getInstrumentCashFlowStatements( + instrumentId, + InstrumentDataGetInstrumentCashFlowStatementsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/events`, but is + * otherwise the same as [InstrumentDataService.getInstrumentEvents]. + */ + @MustBeClosed + fun getInstrumentEvents( + instrumentId: String + ): HttpResponseFor = + getInstrumentEvents(instrumentId, InstrumentDataGetInstrumentEventsParams.none()) + + /** @see getInstrumentEvents */ + @MustBeClosed + fun getInstrumentEvents( + instrumentId: String, + params: InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getInstrumentEvents( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentEvents */ + @MustBeClosed + fun getInstrumentEvents( + instrumentId: String, + params: InstrumentDataGetInstrumentEventsParams = + InstrumentDataGetInstrumentEventsParams.none(), + ): HttpResponseFor = + getInstrumentEvents(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentEvents */ + @MustBeClosed + fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getInstrumentEvents */ + @MustBeClosed + fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams + ): HttpResponseFor = + getInstrumentEvents(params, RequestOptions.none()) + + /** @see getInstrumentEvents */ + @MustBeClosed + fun getInstrumentEvents( + instrumentId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + getInstrumentEvents( + instrumentId, + InstrumentDataGetInstrumentEventsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/fundamentals`, but + * is otherwise the same as [InstrumentDataService.getInstrumentFundamentals]. + */ + @MustBeClosed + fun getInstrumentFundamentals( + instrumentId: String + ): HttpResponseFor = + getInstrumentFundamentals( + instrumentId, + InstrumentDataGetInstrumentFundamentalsParams.none(), + ) + + /** @see getInstrumentFundamentals */ + @MustBeClosed + fun getInstrumentFundamentals( + instrumentId: String, + params: InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getInstrumentFundamentals( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentFundamentals */ + @MustBeClosed + fun getInstrumentFundamentals( + instrumentId: String, + params: InstrumentDataGetInstrumentFundamentalsParams = + InstrumentDataGetInstrumentFundamentalsParams.none(), + ): HttpResponseFor = + getInstrumentFundamentals(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentFundamentals */ + @MustBeClosed + fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getInstrumentFundamentals */ + @MustBeClosed + fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams + ): HttpResponseFor = + getInstrumentFundamentals(params, RequestOptions.none()) + + /** @see getInstrumentFundamentals */ + @MustBeClosed + fun getInstrumentFundamentals( + instrumentId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + getInstrumentFundamentals( + instrumentId, + InstrumentDataGetInstrumentFundamentalsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/income-statements`, + * but is otherwise the same as [InstrumentDataService.getInstrumentIncomeStatements]. + */ + @MustBeClosed + fun getInstrumentIncomeStatements( + instrumentId: String + ): HttpResponseFor = + getInstrumentIncomeStatements( + instrumentId, + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + ) + + /** @see getInstrumentIncomeStatements */ + @MustBeClosed + fun getInstrumentIncomeStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getInstrumentIncomeStatements( + params.toBuilder().instrumentId(instrumentId).build(), + requestOptions, + ) + + /** @see getInstrumentIncomeStatements */ + @MustBeClosed + fun getInstrumentIncomeStatements( + instrumentId: String, + params: InstrumentDataGetInstrumentIncomeStatementsParams = + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + ): HttpResponseFor = + getInstrumentIncomeStatements(instrumentId, params, RequestOptions.none()) + + /** @see getInstrumentIncomeStatements */ + @MustBeClosed + fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getInstrumentIncomeStatements */ + @MustBeClosed + fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams + ): HttpResponseFor = + getInstrumentIncomeStatements(params, RequestOptions.none()) + + /** @see getInstrumentIncomeStatements */ + @MustBeClosed + fun getInstrumentIncomeStatements( + instrumentId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + getInstrumentIncomeStatements( + instrumentId, + InstrumentDataGetInstrumentIncomeStatementsParams.none(), + requestOptions, + ) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceImpl.kt new file mode 100644 index 00000000..b6b0089b --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceImpl.kt @@ -0,0 +1,364 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1 + +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.prepare +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse +import com.clear_street.api.services.blocking.v1.instrumentdata.MarketDataService +import com.clear_street.api.services.blocking.v1.instrumentdata.MarketDataServiceImpl +import com.clear_street.api.services.blocking.v1.instrumentdata.NewsService +import com.clear_street.api.services.blocking.v1.instrumentdata.NewsServiceImpl +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +/** Retrieve instrument analytics, market data, news, and related reference data. */ +class InstrumentDataServiceImpl internal constructor(private val clientOptions: ClientOptions) : + InstrumentDataService { + + private val withRawResponse: InstrumentDataService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + private val marketData: MarketDataService by lazy { MarketDataServiceImpl(clientOptions) } + + private val news: NewsService by lazy { NewsServiceImpl(clientOptions) } + + override fun withRawResponse(): InstrumentDataService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): InstrumentDataService = + InstrumentDataServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun marketData(): MarketDataService = marketData + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun news(): NewsService = news + + override fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams, + requestOptions: RequestOptions, + ): InstrumentDataGetAllInstrumentEventsResponse = + // get /v1/instruments/events + withRawResponse().getAllInstrumentEvents(params, requestOptions).parse() + + override fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentAnalystConsensusResponse = + // get /v1/instruments/{instrument_id}/analyst-reporting + withRawResponse().getInstrumentAnalystConsensus(params, requestOptions).parse() + + override fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentBalanceSheetStatementsResponse = + // get /v1/instruments/{instrument_id}/balance-sheets + withRawResponse().getInstrumentBalanceSheetStatements(params, requestOptions).parse() + + override fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentCashFlowStatementsResponse = + // get /v1/instruments/{instrument_id}/cash-flow-statements + withRawResponse().getInstrumentCashFlowStatements(params, requestOptions).parse() + + override fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentEventsResponse = + // get /v1/instruments/{instrument_id}/events + withRawResponse().getInstrumentEvents(params, requestOptions).parse() + + override fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentFundamentalsResponse = + // get /v1/instruments/{instrument_id}/fundamentals + withRawResponse().getInstrumentFundamentals(params, requestOptions).parse() + + override fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams, + requestOptions: RequestOptions, + ): InstrumentDataGetInstrumentIncomeStatementsResponse = + // get /v1/instruments/{instrument_id}/income-statements + withRawResponse().getInstrumentIncomeStatements(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InstrumentDataService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + private val marketData: MarketDataService.WithRawResponse by lazy { + MarketDataServiceImpl.WithRawResponseImpl(clientOptions) + } + + private val news: NewsService.WithRawResponse by lazy { + NewsServiceImpl.WithRawResponseImpl(clientOptions) + } + + override fun withOptions( + modifier: Consumer + ): InstrumentDataService.WithRawResponse = + InstrumentDataServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun marketData(): MarketDataService.WithRawResponse = marketData + + /** Retrieve instrument analytics, market data, news, and related reference data. */ + override fun news(): NewsService.WithRawResponse = news + + private val getAllInstrumentEventsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getAllInstrumentEvents( + params: InstrumentDataGetAllInstrumentEventsParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "instruments", "events") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getAllInstrumentEventsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getInstrumentAnalystConsensusHandler: + Handler = + jsonHandler( + clientOptions.jsonMapper + ) + + override fun getInstrumentAnalystConsensus( + params: InstrumentDataGetInstrumentAnalystConsensusParams, + requestOptions: RequestOptions, + ): 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() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getInstrumentAnalystConsensusHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getInstrumentBalanceSheetStatementsHandler: + Handler = + jsonHandler( + clientOptions.jsonMapper + ) + + override fun getInstrumentBalanceSheetStatements( + params: InstrumentDataGetInstrumentBalanceSheetStatementsParams, + requestOptions: RequestOptions, + ): 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), "balance-sheets") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getInstrumentBalanceSheetStatementsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getInstrumentCashFlowStatementsHandler: + Handler = + jsonHandler( + clientOptions.jsonMapper + ) + + override fun getInstrumentCashFlowStatements( + params: InstrumentDataGetInstrumentCashFlowStatementsParams, + requestOptions: RequestOptions, + ): 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), + "cash-flow-statements", + ) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getInstrumentCashFlowStatementsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getInstrumentEventsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getInstrumentEvents( + params: InstrumentDataGetInstrumentEventsParams, + requestOptions: RequestOptions, + ): 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), "events") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getInstrumentEventsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getInstrumentFundamentalsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getInstrumentFundamentals( + params: InstrumentDataGetInstrumentFundamentalsParams, + requestOptions: RequestOptions, + ): 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), "fundamentals") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getInstrumentFundamentalsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getInstrumentIncomeStatementsHandler: + Handler = + jsonHandler( + clientOptions.jsonMapper + ) + + override fun getInstrumentIncomeStatements( + params: InstrumentDataGetInstrumentIncomeStatementsParams, + requestOptions: RequestOptions, + ): 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), "income-statements") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getInstrumentIncomeStatementsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentService.kt index 338763a7..bab2aa7d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentService.kt @@ -9,19 +9,14 @@ import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdPar import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsResponse +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsResponse import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsResponse -import com.clear_street.api.services.blocking.v1.instruments.AnalystReportingService -import com.clear_street.api.services.blocking.v1.instruments.BalanceSheetService -import com.clear_street.api.services.blocking.v1.instruments.CashFlowStatementService -import com.clear_street.api.services.blocking.v1.instruments.EventService -import com.clear_street.api.services.blocking.v1.instruments.FundamentalService -import com.clear_street.api.services.blocking.v1.instruments.IncomeStatementService -import com.clear_street.api.services.blocking.v1.instruments.OptionService import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer -/** Retrieve details and lists of tradable instruments. */ +/** Retrieve core details and discovery endpoints for tradable instruments. */ interface InstrumentService { /** @@ -36,27 +31,6 @@ interface InstrumentService { */ fun withOptions(modifier: Consumer): InstrumentService - /** Retrieve details and lists of tradable instruments. */ - fun analystReporting(): AnalystReportingService - - /** Retrieve details and lists of tradable instruments. */ - fun balanceSheets(): BalanceSheetService - - /** Retrieve details and lists of tradable instruments. */ - fun cashFlowStatements(): CashFlowStatementService - - /** Retrieve details and lists of tradable instruments. */ - fun events(): EventService - - /** Retrieve details and lists of tradable instruments. */ - fun fundamentals(): FundamentalService - - /** Retrieve details and lists of tradable instruments. */ - fun incomeStatements(): IncomeStatementService - - /** Retrieve details and lists of tradable instruments. */ - fun options(): OptionService - /** Retrieves detailed information for a specific instrument. */ fun getInstrumentById(instrumentId: String): InstrumentGetInstrumentByIdResponse = getInstrumentById(instrumentId, InstrumentGetInstrumentByIdParams.none()) @@ -113,6 +87,30 @@ interface InstrumentService { fun getInstruments(requestOptions: RequestOptions): InstrumentGetInstrumentsResponse = getInstruments(InstrumentGetInstrumentsParams.none(), requestOptions) + /** + * List options contracts. + * + * Returns options contracts for a given underlier with options-specific metadata. Exactly one + * underlier identifier must be provided. + */ + fun getOptionContracts(): InstrumentGetOptionContractsResponse = + getOptionContracts(InstrumentGetOptionContractsParams.none()) + + /** @see getOptionContracts */ + fun getOptionContracts( + params: InstrumentGetOptionContractsParams = InstrumentGetOptionContractsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InstrumentGetOptionContractsResponse + + /** @see getOptionContracts */ + fun getOptionContracts( + params: InstrumentGetOptionContractsParams = InstrumentGetOptionContractsParams.none() + ): InstrumentGetOptionContractsResponse = getOptionContracts(params, RequestOptions.none()) + + /** @see getOptionContracts */ + fun getOptionContracts(requestOptions: RequestOptions): InstrumentGetOptionContractsResponse = + getOptionContracts(InstrumentGetOptionContractsParams.none(), requestOptions) + /** * Search instruments by symbol, alternate identifier, or company name. * @@ -146,27 +144,6 @@ interface InstrumentService { modifier: Consumer ): InstrumentService.WithRawResponse - /** Retrieve details and lists of tradable instruments. */ - fun analystReporting(): AnalystReportingService.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun balanceSheets(): BalanceSheetService.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun cashFlowStatements(): CashFlowStatementService.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun events(): EventService.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun fundamentals(): FundamentalService.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun incomeStatements(): IncomeStatementService.WithRawResponse - - /** Retrieve details and lists of tradable instruments. */ - fun options(): OptionService.WithRawResponse - /** * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}`, but is otherwise * the same as [InstrumentService.getInstrumentById]. @@ -249,6 +226,35 @@ interface InstrumentService { ): HttpResponseFor = getInstruments(InstrumentGetInstrumentsParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `get /v1/instruments/options/contracts`, but is otherwise + * the same as [InstrumentService.getOptionContracts]. + */ + @MustBeClosed + fun getOptionContracts(): HttpResponseFor = + getOptionContracts(InstrumentGetOptionContractsParams.none()) + + /** @see getOptionContracts */ + @MustBeClosed + fun getOptionContracts( + params: InstrumentGetOptionContractsParams = InstrumentGetOptionContractsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getOptionContracts */ + @MustBeClosed + fun getOptionContracts( + params: InstrumentGetOptionContractsParams = InstrumentGetOptionContractsParams.none() + ): HttpResponseFor = + getOptionContracts(params, RequestOptions.none()) + + /** @see getOptionContracts */ + @MustBeClosed + fun getOptionContracts( + requestOptions: RequestOptions + ): HttpResponseFor = + getOptionContracts(InstrumentGetOptionContractsParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /v1/instruments/search`, but is otherwise the same * as [InstrumentService.searchInstruments]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceImpl.kt index 327038c5..f3c2cab0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceImpl.kt @@ -19,26 +19,14 @@ import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdPar import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsResponse +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsResponse import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsResponse -import com.clear_street.api.services.blocking.v1.instruments.AnalystReportingService -import com.clear_street.api.services.blocking.v1.instruments.AnalystReportingServiceImpl -import com.clear_street.api.services.blocking.v1.instruments.BalanceSheetService -import com.clear_street.api.services.blocking.v1.instruments.BalanceSheetServiceImpl -import com.clear_street.api.services.blocking.v1.instruments.CashFlowStatementService -import com.clear_street.api.services.blocking.v1.instruments.CashFlowStatementServiceImpl -import com.clear_street.api.services.blocking.v1.instruments.EventService -import com.clear_street.api.services.blocking.v1.instruments.EventServiceImpl -import com.clear_street.api.services.blocking.v1.instruments.FundamentalService -import com.clear_street.api.services.blocking.v1.instruments.FundamentalServiceImpl -import com.clear_street.api.services.blocking.v1.instruments.IncomeStatementService -import com.clear_street.api.services.blocking.v1.instruments.IncomeStatementServiceImpl -import com.clear_street.api.services.blocking.v1.instruments.OptionService -import com.clear_street.api.services.blocking.v1.instruments.OptionServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull -/** Retrieve details and lists of tradable instruments. */ +/** Retrieve core details and discovery endpoints for tradable instruments. */ class InstrumentServiceImpl internal constructor(private val clientOptions: ClientOptions) : InstrumentService { @@ -46,54 +34,11 @@ class InstrumentServiceImpl internal constructor(private val clientOptions: Clie WithRawResponseImpl(clientOptions) } - private val analystReporting: AnalystReportingService by lazy { - AnalystReportingServiceImpl(clientOptions) - } - - private val balanceSheets: BalanceSheetService by lazy { - BalanceSheetServiceImpl(clientOptions) - } - - private val cashFlowStatements: CashFlowStatementService by lazy { - CashFlowStatementServiceImpl(clientOptions) - } - - private val events: EventService by lazy { EventServiceImpl(clientOptions) } - - private val fundamentals: FundamentalService by lazy { FundamentalServiceImpl(clientOptions) } - - private val incomeStatements: IncomeStatementService by lazy { - IncomeStatementServiceImpl(clientOptions) - } - - private val options: OptionService by lazy { OptionServiceImpl(clientOptions) } - override fun withRawResponse(): InstrumentService.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): InstrumentService = InstrumentServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Retrieve details and lists of tradable instruments. */ - override fun analystReporting(): AnalystReportingService = analystReporting - - /** Retrieve details and lists of tradable instruments. */ - override fun balanceSheets(): BalanceSheetService = balanceSheets - - /** Retrieve details and lists of tradable instruments. */ - override fun cashFlowStatements(): CashFlowStatementService = cashFlowStatements - - /** Retrieve details and lists of tradable instruments. */ - override fun events(): EventService = events - - /** Retrieve details and lists of tradable instruments. */ - override fun fundamentals(): FundamentalService = fundamentals - - /** Retrieve details and lists of tradable instruments. */ - override fun incomeStatements(): IncomeStatementService = incomeStatements - - /** Retrieve details and lists of tradable instruments. */ - override fun options(): OptionService = options - override fun getInstrumentById( params: InstrumentGetInstrumentByIdParams, requestOptions: RequestOptions, @@ -108,6 +53,13 @@ class InstrumentServiceImpl internal constructor(private val clientOptions: Clie // get /v1/instruments withRawResponse().getInstruments(params, requestOptions).parse() + override fun getOptionContracts( + params: InstrumentGetOptionContractsParams, + requestOptions: RequestOptions, + ): InstrumentGetOptionContractsResponse = + // get /v1/instruments/options/contracts + withRawResponse().getOptionContracts(params, requestOptions).parse() + override fun searchInstruments( params: InstrumentSearchInstrumentsParams, requestOptions: RequestOptions, @@ -121,34 +73,6 @@ class InstrumentServiceImpl internal constructor(private val clientOptions: Clie private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val analystReporting: AnalystReportingService.WithRawResponse by lazy { - AnalystReportingServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val balanceSheets: BalanceSheetService.WithRawResponse by lazy { - BalanceSheetServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val cashFlowStatements: CashFlowStatementService.WithRawResponse by lazy { - CashFlowStatementServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val events: EventService.WithRawResponse by lazy { - EventServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val fundamentals: FundamentalService.WithRawResponse by lazy { - FundamentalServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val incomeStatements: IncomeStatementService.WithRawResponse by lazy { - IncomeStatementServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val options: OptionService.WithRawResponse by lazy { - OptionServiceImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): InstrumentService.WithRawResponse = @@ -156,28 +80,6 @@ class InstrumentServiceImpl internal constructor(private val clientOptions: Clie clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Retrieve details and lists of tradable instruments. */ - override fun analystReporting(): AnalystReportingService.WithRawResponse = analystReporting - - /** Retrieve details and lists of tradable instruments. */ - override fun balanceSheets(): BalanceSheetService.WithRawResponse = balanceSheets - - /** Retrieve details and lists of tradable instruments. */ - override fun cashFlowStatements(): CashFlowStatementService.WithRawResponse = - cashFlowStatements - - /** Retrieve details and lists of tradable instruments. */ - override fun events(): EventService.WithRawResponse = events - - /** Retrieve details and lists of tradable instruments. */ - override fun fundamentals(): FundamentalService.WithRawResponse = fundamentals - - /** Retrieve details and lists of tradable instruments. */ - override fun incomeStatements(): IncomeStatementService.WithRawResponse = incomeStatements - - /** Retrieve details and lists of tradable instruments. */ - override fun options(): OptionService.WithRawResponse = options - private val getInstrumentByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -235,6 +137,33 @@ class InstrumentServiceImpl internal constructor(private val clientOptions: Clie } } + private val getOptionContractsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getOptionContracts( + params: InstrumentGetOptionContractsParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "instruments", "options", "contracts") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getOptionContractsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val searchInstrumentsHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/MarketDataService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/MarketDataService.kt deleted file mode 100644 index 19a72377..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/MarketDataService.kt +++ /dev/null @@ -1,48 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.marketdata.DailySummaryService -import com.clear_street.api.services.blocking.v1.marketdata.SnapshotService -import java.util.function.Consumer - -interface MarketDataService { - - /** - * 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): MarketDataService - - /** Real-time market data snapshots. */ - fun dailySummary(): DailySummaryService - - /** Real-time market data snapshots. */ - fun snapshot(): SnapshotService - - /** A view of [MarketDataService] 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 - ): MarketDataService.WithRawResponse - - /** Real-time market data snapshots. */ - fun dailySummary(): DailySummaryService.WithRawResponse - - /** Real-time market data snapshots. */ - fun snapshot(): SnapshotService.WithRawResponse - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/MarketDataServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/MarketDataServiceImpl.kt deleted file mode 100644 index a15c68ab..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/MarketDataServiceImpl.kt +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.marketdata.DailySummaryService -import com.clear_street.api.services.blocking.v1.marketdata.DailySummaryServiceImpl -import com.clear_street.api.services.blocking.v1.marketdata.SnapshotService -import com.clear_street.api.services.blocking.v1.marketdata.SnapshotServiceImpl -import java.util.function.Consumer - -class MarketDataServiceImpl internal constructor(private val clientOptions: ClientOptions) : - MarketDataService { - - private val withRawResponse: MarketDataService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - private val dailySummary: DailySummaryService by lazy { DailySummaryServiceImpl(clientOptions) } - - private val snapshot: SnapshotService by lazy { SnapshotServiceImpl(clientOptions) } - - override fun withRawResponse(): MarketDataService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): MarketDataService = - MarketDataServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - /** Real-time market data snapshots. */ - override fun dailySummary(): DailySummaryService = dailySummary - - /** Real-time market data snapshots. */ - override fun snapshot(): SnapshotService = snapshot - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - MarketDataService.WithRawResponse { - - private val dailySummary: DailySummaryService.WithRawResponse by lazy { - DailySummaryServiceImpl.WithRawResponseImpl(clientOptions) - } - - private val snapshot: SnapshotService.WithRawResponse by lazy { - SnapshotServiceImpl.WithRawResponseImpl(clientOptions) - } - - override fun withOptions( - modifier: Consumer - ): MarketDataService.WithRawResponse = - MarketDataServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - /** Real-time market data snapshots. */ - override fun dailySummary(): DailySummaryService.WithRawResponse = dailySummary - - /** Real-time market data snapshots. */ - override fun snapshot(): SnapshotService.WithRawResponse = snapshot - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt index 36c75b82..177ba36b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt @@ -3,7 +3,6 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.omniai.EntitlementAgreementService import com.clear_street.api.services.blocking.v1.omniai.EntitlementService import com.clear_street.api.services.blocking.v1.omniai.MessageService import com.clear_street.api.services.blocking.v1.omniai.ResponseService @@ -24,14 +23,6 @@ interface OmniAiService { */ fun withOptions(modifier: Consumer): OmniAiService - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages from - * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. - */ - fun entitlementAgreements(): EntitlementAgreementService - /** * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from @@ -74,14 +65,6 @@ interface OmniAiService { */ fun withOptions(modifier: Consumer): OmniAiService.WithRawResponse - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages - * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. - */ - fun entitlementAgreements(): EntitlementAgreementService.WithRawResponse - /** * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt index 1ac09705..5ced1e79 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt @@ -3,8 +3,6 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.omniai.EntitlementAgreementService -import com.clear_street.api.services.blocking.v1.omniai.EntitlementAgreementServiceImpl import com.clear_street.api.services.blocking.v1.omniai.EntitlementService import com.clear_street.api.services.blocking.v1.omniai.EntitlementServiceImpl import com.clear_street.api.services.blocking.v1.omniai.MessageService @@ -22,10 +20,6 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp WithRawResponseImpl(clientOptions) } - private val entitlementAgreements: EntitlementAgreementService by lazy { - EntitlementAgreementServiceImpl(clientOptions) - } - private val entitlements: EntitlementService by lazy { EntitlementServiceImpl(clientOptions) } private val messages: MessageService by lazy { MessageServiceImpl(clientOptions) } @@ -39,14 +33,6 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp override fun withOptions(modifier: Consumer): OmniAiService = OmniAiServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages from - * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. - */ - override fun entitlementAgreements(): EntitlementAgreementService = entitlementAgreements - /** * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from @@ -82,10 +68,6 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : OmniAiService.WithRawResponse { - private val entitlementAgreements: EntitlementAgreementService.WithRawResponse by lazy { - EntitlementAgreementServiceImpl.WithRawResponseImpl(clientOptions) - } - private val entitlements: EntitlementService.WithRawResponse by lazy { EntitlementServiceImpl.WithRawResponseImpl(clientOptions) } @@ -109,15 +91,6 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp clientOptions.toBuilder().apply(modifier::accept).build() ) - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages - * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. - */ - override fun entitlementAgreements(): EntitlementAgreementService.WithRawResponse = - entitlementAgreements - /** * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderService.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt index 3b6a09e8..97b6e5ac 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.accounts +package com.clear_street.api.services.blocking.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.accounts.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelAllOpenOrdersResponse -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderResponse -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdResponse -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersResponse -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderResponse -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersResponse +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse +import com.clear_street.api.models.v1.orders.OrderGetOrdersParams +import com.clear_street.api.models.v1.orders.OrderGetOrdersResponse +import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams +import com.clear_street.api.models.v1.orders.OrderReplaceOrderResponse +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt index d86aee3c..5e36e09d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.accounts +package com.clear_street.api.services.blocking.v1 import com.clear_street.api.core.ClientOptions import com.clear_street.api.core.RequestOptions @@ -16,18 +16,18 @@ 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.prepare -import com.clear_street.api.models.v1.accounts.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelAllOpenOrdersResponse -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderResponse -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdResponse -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersResponse -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderResponse -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersResponse +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse +import com.clear_street.api.models.v1.orders.OrderGetOrdersParams +import com.clear_street.api.models.v1.orders.OrderGetOrdersResponse +import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams +import com.clear_street.api.models.v1.orders.OrderReplaceOrderResponse +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt new file mode 100644 index 00000000..63bdd895 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt @@ -0,0 +1,520 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.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.positions.PositionCancelPositionInstructionParams +import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse +import com.clear_street.api.models.v1.positions.PositionClosePositionParams +import com.clear_street.api.models.v1.positions.PositionClosePositionResponse +import com.clear_street.api.models.v1.positions.PositionClosePositionsParams +import com.clear_street.api.models.v1.positions.PositionClosePositionsResponse +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsResponse +import com.clear_street.api.models.v1.positions.PositionGetPositionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse +import com.google.errorprone.annotations.MustBeClosed +import java.util.function.Consumer + +/** View positions and manage position instructions. */ +interface PositionService { + + /** + * 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): PositionService + + /** + * 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: PositionCancelPositionInstructionParams, + ): PositionCancelPositionInstructionResponse = + cancelPositionInstruction(instructionId, params, RequestOptions.none()) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + instructionId: String, + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionCancelPositionInstructionResponse = + cancelPositionInstruction( + params.toBuilder().instructionId(instructionId).build(), + requestOptions, + ) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams + ): PositionCancelPositionInstructionResponse = + cancelPositionInstruction(params, RequestOptions.none()) + + /** @see cancelPositionInstruction */ + fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionCancelPositionInstructionResponse + + /** + * Delete a position within an account for an instrument. + * + * Retrieves orders generated to close the position. + */ + fun closePosition( + instrumentId: String, + params: PositionClosePositionParams, + ): PositionClosePositionResponse = closePosition(instrumentId, params, RequestOptions.none()) + + /** @see closePosition */ + fun closePosition( + instrumentId: String, + params: PositionClosePositionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionClosePositionResponse = + closePosition(params.toBuilder().instrumentId(instrumentId).build(), requestOptions) + + /** @see closePosition */ + fun closePosition(params: PositionClosePositionParams): PositionClosePositionResponse = + closePosition(params, RequestOptions.none()) + + /** @see closePosition */ + fun closePosition( + params: PositionClosePositionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionClosePositionResponse + + /** + * Delete all positions within an account. + * + * Closes all positions for the specified trading account. + */ + fun closePositions(accountId: Long): PositionClosePositionsResponse = + closePositions(accountId, PositionClosePositionsParams.none()) + + /** @see closePositions */ + fun closePositions( + accountId: Long, + params: PositionClosePositionsParams = PositionClosePositionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionClosePositionsResponse = + closePositions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see closePositions */ + fun closePositions( + accountId: Long, + params: PositionClosePositionsParams = PositionClosePositionsParams.none(), + ): PositionClosePositionsResponse = closePositions(accountId, params, RequestOptions.none()) + + /** @see closePositions */ + fun closePositions( + params: PositionClosePositionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionClosePositionsResponse + + /** @see closePositions */ + fun closePositions(params: PositionClosePositionsParams): PositionClosePositionsResponse = + closePositions(params, RequestOptions.none()) + + /** @see closePositions */ + fun closePositions( + accountId: Long, + requestOptions: RequestOptions, + ): PositionClosePositionsResponse = + closePositions(accountId, PositionClosePositionsParams.none(), requestOptions) + + /** + * Returns the current lifecycle state of exercise / DNE / CEA instructions for the account. + * Optionally filter by a specific instrument. + */ + fun getPositionInstructions(accountId: Long): PositionGetPositionInstructionsResponse = + getPositionInstructions(accountId, PositionGetPositionInstructionsParams.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + params: PositionGetPositionInstructionsParams = + PositionGetPositionInstructionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionGetPositionInstructionsResponse = + getPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + params: PositionGetPositionInstructionsParams = PositionGetPositionInstructionsParams.none(), + ): PositionGetPositionInstructionsResponse = + getPositionInstructions(accountId, params, RequestOptions.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + params: PositionGetPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionGetPositionInstructionsResponse + + /** @see getPositionInstructions */ + fun getPositionInstructions( + params: PositionGetPositionInstructionsParams + ): PositionGetPositionInstructionsResponse = + getPositionInstructions(params, RequestOptions.none()) + + /** @see getPositionInstructions */ + fun getPositionInstructions( + accountId: Long, + requestOptions: RequestOptions, + ): PositionGetPositionInstructionsResponse = + getPositionInstructions( + accountId, + PositionGetPositionInstructionsParams.none(), + requestOptions, + ) + + /** Retrieves all positions for the specified trading account. */ + fun getPositions(accountId: Long): PositionGetPositionsResponse = + getPositions(accountId, PositionGetPositionsParams.none()) + + /** @see getPositions */ + fun getPositions( + accountId: Long, + params: PositionGetPositionsParams = PositionGetPositionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionGetPositionsResponse = + getPositions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPositions */ + fun getPositions( + accountId: Long, + params: PositionGetPositionsParams = PositionGetPositionsParams.none(), + ): PositionGetPositionsResponse = getPositions(accountId, params, RequestOptions.none()) + + /** @see getPositions */ + fun getPositions( + params: PositionGetPositionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionGetPositionsResponse + + /** @see getPositions */ + fun getPositions(params: PositionGetPositionsParams): PositionGetPositionsResponse = + getPositions(params, RequestOptions.none()) + + /** @see getPositions */ + fun getPositions( + accountId: Long, + requestOptions: RequestOptions, + ): PositionGetPositionsResponse = + getPositions(accountId, PositionGetPositionsParams.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: PositionSubmitPositionInstructionsParams, + ): PositionSubmitPositionInstructionsResponse = + submitPositionInstructions(accountId, params, RequestOptions.none()) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + accountId: Long, + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionSubmitPositionInstructionsResponse = + submitPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams + ): PositionSubmitPositionInstructionsResponse = + submitPositionInstructions(params, RequestOptions.none()) + + /** @see submitPositionInstructions */ + fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): PositionSubmitPositionInstructionsResponse + + /** A view of [PositionService] 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): PositionService.WithRawResponse + + /** + * Returns a raw HTTP response for `delete + * /v1/accounts/{account_id}/positions/instructions/{instruction_id}`, but is otherwise the + * same as [PositionService.cancelPositionInstruction]. + */ + @MustBeClosed + fun cancelPositionInstruction( + instructionId: String, + params: PositionCancelPositionInstructionParams, + ): HttpResponseFor = + cancelPositionInstruction(instructionId, params, RequestOptions.none()) + + /** @see cancelPositionInstruction */ + @MustBeClosed + fun cancelPositionInstruction( + instructionId: String, + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + cancelPositionInstruction( + params.toBuilder().instructionId(instructionId).build(), + requestOptions, + ) + + /** @see cancelPositionInstruction */ + @MustBeClosed + fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams + ): HttpResponseFor = + cancelPositionInstruction(params, RequestOptions.none()) + + /** @see cancelPositionInstruction */ + @MustBeClosed + fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `delete + * /v1/accounts/{account_id}/positions/{instrument_id}`, but is otherwise the same as + * [PositionService.closePosition]. + */ + @MustBeClosed + fun closePosition( + instrumentId: String, + params: PositionClosePositionParams, + ): HttpResponseFor = + closePosition(instrumentId, params, RequestOptions.none()) + + /** @see closePosition */ + @MustBeClosed + fun closePosition( + instrumentId: String, + params: PositionClosePositionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + closePosition(params.toBuilder().instrumentId(instrumentId).build(), requestOptions) + + /** @see closePosition */ + @MustBeClosed + fun closePosition( + params: PositionClosePositionParams + ): HttpResponseFor = + closePosition(params, RequestOptions.none()) + + /** @see closePosition */ + @MustBeClosed + fun closePosition( + params: PositionClosePositionParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `delete /v1/accounts/{account_id}/positions`, but is + * otherwise the same as [PositionService.closePositions]. + */ + @MustBeClosed + fun closePositions(accountId: Long): HttpResponseFor = + closePositions(accountId, PositionClosePositionsParams.none()) + + /** @see closePositions */ + @MustBeClosed + fun closePositions( + accountId: Long, + params: PositionClosePositionsParams = PositionClosePositionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + closePositions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see closePositions */ + @MustBeClosed + fun closePositions( + accountId: Long, + params: PositionClosePositionsParams = PositionClosePositionsParams.none(), + ): HttpResponseFor = + closePositions(accountId, params, RequestOptions.none()) + + /** @see closePositions */ + @MustBeClosed + fun closePositions( + params: PositionClosePositionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see closePositions */ + @MustBeClosed + fun closePositions( + params: PositionClosePositionsParams + ): HttpResponseFor = + closePositions(params, RequestOptions.none()) + + /** @see closePositions */ + @MustBeClosed + fun closePositions( + accountId: Long, + requestOptions: RequestOptions, + ): HttpResponseFor = + closePositions(accountId, PositionClosePositionsParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /v1/accounts/{account_id}/positions/instructions`, + * but is otherwise the same as [PositionService.getPositionInstructions]. + */ + @MustBeClosed + fun getPositionInstructions( + accountId: Long + ): HttpResponseFor = + getPositionInstructions(accountId, PositionGetPositionInstructionsParams.none()) + + /** @see getPositionInstructions */ + @MustBeClosed + fun getPositionInstructions( + accountId: Long, + params: PositionGetPositionInstructionsParams = + PositionGetPositionInstructionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPositionInstructions */ + @MustBeClosed + fun getPositionInstructions( + accountId: Long, + params: PositionGetPositionInstructionsParams = + PositionGetPositionInstructionsParams.none(), + ): HttpResponseFor = + getPositionInstructions(accountId, params, RequestOptions.none()) + + /** @see getPositionInstructions */ + @MustBeClosed + fun getPositionInstructions( + params: PositionGetPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getPositionInstructions */ + @MustBeClosed + fun getPositionInstructions( + params: PositionGetPositionInstructionsParams + ): HttpResponseFor = + getPositionInstructions(params, RequestOptions.none()) + + /** @see getPositionInstructions */ + @MustBeClosed + fun getPositionInstructions( + accountId: Long, + requestOptions: RequestOptions, + ): HttpResponseFor = + getPositionInstructions( + accountId, + PositionGetPositionInstructionsParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /v1/accounts/{account_id}/positions`, but is + * otherwise the same as [PositionService.getPositions]. + */ + @MustBeClosed + fun getPositions(accountId: Long): HttpResponseFor = + getPositions(accountId, PositionGetPositionsParams.none()) + + /** @see getPositions */ + @MustBeClosed + fun getPositions( + accountId: Long, + params: PositionGetPositionsParams = PositionGetPositionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getPositions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getPositions */ + @MustBeClosed + fun getPositions( + accountId: Long, + params: PositionGetPositionsParams = PositionGetPositionsParams.none(), + ): HttpResponseFor = + getPositions(accountId, params, RequestOptions.none()) + + /** @see getPositions */ + @MustBeClosed + fun getPositions( + params: PositionGetPositionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getPositions */ + @MustBeClosed + fun getPositions( + params: PositionGetPositionsParams + ): HttpResponseFor = + getPositions(params, RequestOptions.none()) + + /** @see getPositions */ + @MustBeClosed + fun getPositions( + accountId: Long, + requestOptions: RequestOptions, + ): HttpResponseFor = + getPositions(accountId, PositionGetPositionsParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /v1/accounts/{account_id}/positions/instructions`, + * but is otherwise the same as [PositionService.submitPositionInstructions]. + */ + @MustBeClosed + fun submitPositionInstructions( + accountId: Long, + params: PositionSubmitPositionInstructionsParams, + ): HttpResponseFor = + submitPositionInstructions(accountId, params, RequestOptions.none()) + + /** @see submitPositionInstructions */ + @MustBeClosed + fun submitPositionInstructions( + accountId: Long, + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + submitPositionInstructions( + params.toBuilder().accountId(accountId).build(), + requestOptions, + ) + + /** @see submitPositionInstructions */ + @MustBeClosed + fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams + ): HttpResponseFor = + submitPositionInstructions(params, RequestOptions.none()) + + /** @see submitPositionInstructions */ + @MustBeClosed + fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceImpl.kt new file mode 100644 index 00000000..370bc414 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceImpl.kt @@ -0,0 +1,314 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1 + +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.prepare +import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse +import com.clear_street.api.models.v1.positions.PositionClosePositionParams +import com.clear_street.api.models.v1.positions.PositionClosePositionResponse +import com.clear_street.api.models.v1.positions.PositionClosePositionsParams +import com.clear_street.api.models.v1.positions.PositionClosePositionsResponse +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsResponse +import com.clear_street.api.models.v1.positions.PositionGetPositionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +/** View positions and manage position instructions. */ +class PositionServiceImpl internal constructor(private val clientOptions: ClientOptions) : + PositionService { + + private val withRawResponse: PositionService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): PositionService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): PositionService = + PositionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions, + ): PositionCancelPositionInstructionResponse = + // delete /v1/accounts/{account_id}/positions/instructions/{instruction_id} + withRawResponse().cancelPositionInstruction(params, requestOptions).parse() + + override fun closePosition( + params: PositionClosePositionParams, + requestOptions: RequestOptions, + ): PositionClosePositionResponse = + // delete /v1/accounts/{account_id}/positions/{instrument_id} + withRawResponse().closePosition(params, requestOptions).parse() + + override fun closePositions( + params: PositionClosePositionsParams, + requestOptions: RequestOptions, + ): PositionClosePositionsResponse = + // delete /v1/accounts/{account_id}/positions + withRawResponse().closePositions(params, requestOptions).parse() + + override fun getPositionInstructions( + params: PositionGetPositionInstructionsParams, + requestOptions: RequestOptions, + ): PositionGetPositionInstructionsResponse = + // get /v1/accounts/{account_id}/positions/instructions + withRawResponse().getPositionInstructions(params, requestOptions).parse() + + override fun getPositions( + params: PositionGetPositionsParams, + requestOptions: RequestOptions, + ): PositionGetPositionsResponse = + // get /v1/accounts/{account_id}/positions + withRawResponse().getPositions(params, requestOptions).parse() + + override fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions, + ): PositionSubmitPositionInstructionsResponse = + // post /v1/accounts/{account_id}/positions/instructions + withRawResponse().submitPositionInstructions(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + PositionService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): PositionService.WithRawResponse = + PositionServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val cancelPositionInstructionHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun cancelPositionInstruction( + params: PositionCancelPositionInstructionParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // 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() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { cancelPositionInstructionHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val closePositionHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun closePosition( + params: PositionClosePositionParams, + requestOptions: RequestOptions, + ): 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.DELETE) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "v1", + "accounts", + params._pathParam(0), + "positions", + params._pathParam(1), + ) + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return 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, + ): HttpResponseFor { + // 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() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { closePositionsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getPositionInstructionsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getPositionInstructions( + params: PositionGetPositionInstructionsParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // 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() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getPositionInstructionsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getPositionsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getPositions( + params: PositionGetPositionsParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // 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() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getPositionsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val submitPositionInstructionsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun submitPositionInstructions( + params: PositionSubmitPositionInstructionsParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // 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() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return 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/blocking/v1/VersionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/VersionService.kt deleted file mode 100644 index ce2f5dd2..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/VersionService.kt +++ /dev/null @@ -1,82 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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 com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Endpoints for API service metadata. */ -interface VersionService { - - /** - * 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): VersionService - - /** Returns the current version string for this API endpoint. */ - fun getVersion(): VersionGetVersionResponse = getVersion(VersionGetVersionParams.none()) - - /** @see getVersion */ - fun getVersion( - params: VersionGetVersionParams = VersionGetVersionParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): VersionGetVersionResponse - - /** @see getVersion */ - fun getVersion( - params: VersionGetVersionParams = VersionGetVersionParams.none() - ): VersionGetVersionResponse = getVersion(params, RequestOptions.none()) - - /** @see getVersion */ - fun getVersion(requestOptions: RequestOptions): VersionGetVersionResponse = - getVersion(VersionGetVersionParams.none(), requestOptions) - - /** A view of [VersionService] 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): VersionService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/version`, but is otherwise the same as - * [VersionService.getVersion]. - */ - @MustBeClosed - fun getVersion(): HttpResponseFor = - getVersion(VersionGetVersionParams.none()) - - /** @see getVersion */ - @MustBeClosed - fun getVersion( - params: VersionGetVersionParams = VersionGetVersionParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getVersion */ - @MustBeClosed - fun getVersion( - params: VersionGetVersionParams = VersionGetVersionParams.none() - ): HttpResponseFor = getVersion(params, RequestOptions.none()) - - /** @see getVersion */ - @MustBeClosed - fun getVersion(requestOptions: RequestOptions): HttpResponseFor = - getVersion(VersionGetVersionParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistService.kt index 2d79526e..44cb5c27 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistService.kt @@ -5,15 +5,18 @@ package com.clear_street.api.services.blocking.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.watchlists.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistCreateWatchlistResponse -import com.clear_street.api.models.v1.watchlists.WatchlistDeleteWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistDeleteWatchlistResponse -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistByIdParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistByIdResponse -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsResponse -import com.clear_street.api.services.blocking.v1.watchlists.ItemService +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistResponse +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer @@ -32,8 +35,31 @@ interface WatchlistService { */ fun withOptions(modifier: Consumer): WatchlistService - /** Create and manage watchlists. */ - fun items(): ItemService + /** Add an instrument to a watchlist */ + fun addWatchlistItem( + watchlistId: String, + params: WatchlistAddWatchlistItemParams, + ): WatchlistAddWatchlistItemResponse = + addWatchlistItem(watchlistId, params, RequestOptions.none()) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + watchlistId: String, + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): WatchlistAddWatchlistItemResponse = + addWatchlistItem(params.toBuilder().watchlistId(watchlistId).build(), requestOptions) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams + ): WatchlistAddWatchlistItemResponse = addWatchlistItem(params, RequestOptions.none()) + + /** @see addWatchlistItem */ + fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): WatchlistAddWatchlistItemResponse /** Create Watchlist */ fun createWatchlist(params: WatchlistCreateWatchlistParams): WatchlistCreateWatchlistResponse = @@ -81,6 +107,32 @@ interface WatchlistService { ): WatchlistDeleteWatchlistResponse = deleteWatchlist(watchlistId, WatchlistDeleteWatchlistParams.none(), requestOptions) + /** Delete an instrument from a watchlist */ + fun deleteWatchlistItem( + itemId: String, + params: WatchlistDeleteWatchlistItemParams, + ): WatchlistDeleteWatchlistItemResponse = + deleteWatchlistItem(itemId, params, RequestOptions.none()) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + itemId: String, + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): WatchlistDeleteWatchlistItemResponse = + deleteWatchlistItem(params.toBuilder().itemId(itemId).build(), requestOptions) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams + ): WatchlistDeleteWatchlistItemResponse = deleteWatchlistItem(params, RequestOptions.none()) + + /** @see deleteWatchlistItem */ + fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): WatchlistDeleteWatchlistItemResponse + /** Get a watchlist by ID with all its items */ fun getWatchlistById(watchlistId: String): WatchlistGetWatchlistByIdResponse = getWatchlistById(watchlistId, WatchlistGetWatchlistByIdParams.none()) @@ -147,8 +199,39 @@ interface WatchlistService { */ fun withOptions(modifier: Consumer): WatchlistService.WithRawResponse - /** Create and manage watchlists. */ - fun items(): ItemService.WithRawResponse + /** + * Returns a raw HTTP response for `post /v1/watchlists/{watchlist_id}/items`, but is + * otherwise the same as [WatchlistService.addWatchlistItem]. + */ + @MustBeClosed + fun addWatchlistItem( + watchlistId: String, + params: WatchlistAddWatchlistItemParams, + ): HttpResponseFor = + addWatchlistItem(watchlistId, params, RequestOptions.none()) + + /** @see addWatchlistItem */ + @MustBeClosed + fun addWatchlistItem( + watchlistId: String, + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + addWatchlistItem(params.toBuilder().watchlistId(watchlistId).build(), requestOptions) + + /** @see addWatchlistItem */ + @MustBeClosed + fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams + ): HttpResponseFor = + addWatchlistItem(params, RequestOptions.none()) + + /** @see addWatchlistItem */ + @MustBeClosed + fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor /** * Returns a raw HTTP response for `post /v1/watchlists`, but is otherwise the same as @@ -216,6 +299,40 @@ interface WatchlistService { ): HttpResponseFor = deleteWatchlist(watchlistId, WatchlistDeleteWatchlistParams.none(), requestOptions) + /** + * Returns a raw HTTP response for `delete /v1/watchlists/{watchlist_id}/items/{item_id}`, + * but is otherwise the same as [WatchlistService.deleteWatchlistItem]. + */ + @MustBeClosed + fun deleteWatchlistItem( + itemId: String, + params: WatchlistDeleteWatchlistItemParams, + ): HttpResponseFor = + deleteWatchlistItem(itemId, params, RequestOptions.none()) + + /** @see deleteWatchlistItem */ + @MustBeClosed + fun deleteWatchlistItem( + itemId: String, + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + deleteWatchlistItem(params.toBuilder().itemId(itemId).build(), requestOptions) + + /** @see deleteWatchlistItem */ + @MustBeClosed + fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams + ): HttpResponseFor = + deleteWatchlistItem(params, RequestOptions.none()) + + /** @see deleteWatchlistItem */ + @MustBeClosed + fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + /** * Returns a raw HTTP response for `get /v1/watchlists/{watchlist_id}`, but is otherwise the * same as [WatchlistService.getWatchlistById]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceImpl.kt index 08347edd..0211f844 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceImpl.kt @@ -16,16 +16,18 @@ 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.prepare -import com.clear_street.api.models.v1.watchlists.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistCreateWatchlistResponse -import com.clear_street.api.models.v1.watchlists.WatchlistDeleteWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistDeleteWatchlistResponse -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistByIdParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistByIdResponse -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsResponse -import com.clear_street.api.services.blocking.v1.watchlists.ItemService -import com.clear_street.api.services.blocking.v1.watchlists.ItemServiceImpl +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistResponse +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -37,15 +39,17 @@ class WatchlistServiceImpl internal constructor(private val clientOptions: Clien WithRawResponseImpl(clientOptions) } - private val items: ItemService by lazy { ItemServiceImpl(clientOptions) } - override fun withRawResponse(): WatchlistService.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): WatchlistService = WatchlistServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** Create and manage watchlists. */ - override fun items(): ItemService = items + override fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions, + ): WatchlistAddWatchlistItemResponse = + // post /v1/watchlists/{watchlist_id}/items + withRawResponse().addWatchlistItem(params, requestOptions).parse() override fun createWatchlist( params: WatchlistCreateWatchlistParams, @@ -61,6 +65,13 @@ class WatchlistServiceImpl internal constructor(private val clientOptions: Clien // delete /v1/watchlists/{watchlist_id} withRawResponse().deleteWatchlist(params, requestOptions).parse() + override fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions, + ): WatchlistDeleteWatchlistItemResponse = + // delete /v1/watchlists/{watchlist_id}/items/{item_id} + withRawResponse().deleteWatchlistItem(params, requestOptions).parse() + override fun getWatchlistById( params: WatchlistGetWatchlistByIdParams, requestOptions: RequestOptions, @@ -81,10 +92,6 @@ class WatchlistServiceImpl internal constructor(private val clientOptions: Clien private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val items: ItemService.WithRawResponse by lazy { - ItemServiceImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): WatchlistService.WithRawResponse = @@ -92,8 +99,36 @@ class WatchlistServiceImpl internal constructor(private val clientOptions: Clien clientOptions.toBuilder().apply(modifier::accept).build() ) - /** Create and manage watchlists. */ - override fun items(): ItemService.WithRawResponse = items + private val addWatchlistItemHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun addWatchlistItem( + params: WatchlistAddWatchlistItemParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("watchlistId", params.watchlistId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "watchlists", params._pathParam(0), "items") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { addWatchlistItemHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } private val createWatchlistHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -154,6 +189,43 @@ class WatchlistServiceImpl internal constructor(private val clientOptions: Clien } } + private val deleteWatchlistItemHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun deleteWatchlistItem( + params: WatchlistDeleteWatchlistItemParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("itemId", params.itemId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.DELETE) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments( + "v1", + "watchlists", + params._pathParam(0), + "items", + params._pathParam(1), + ) + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { deleteWatchlistItemHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val getWatchlistByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketService.kt new file mode 100644 index 00000000..d6e47bb6 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketService.kt @@ -0,0 +1,81 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1 + +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.websocket.WebsocketWebsocketHandlerParams +import com.google.errorprone.annotations.MustBeClosed +import java.util.function.Consumer + +/** Active Websocket. */ +interface WebsocketService { + + /** + * 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): WebsocketService + + /** Upgrade the HTTP connection to a WebSocket and echo incoming messages. */ + fun websocketHandler() = websocketHandler(WebsocketWebsocketHandlerParams.none()) + + /** @see websocketHandler */ + fun websocketHandler( + params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ) + + /** @see websocketHandler */ + fun websocketHandler( + params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none() + ) = websocketHandler(params, RequestOptions.none()) + + /** @see websocketHandler */ + fun websocketHandler(requestOptions: RequestOptions) = + websocketHandler(WebsocketWebsocketHandlerParams.none(), requestOptions) + + /** A view of [WebsocketService] 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): WebsocketService.WithRawResponse + + /** + * Returns a raw HTTP response for `get /v1/ws`, but is otherwise the same as + * [WebsocketService.websocketHandler]. + */ + @MustBeClosed + fun websocketHandler(): HttpResponse = + websocketHandler(WebsocketWebsocketHandlerParams.none()) + + /** @see websocketHandler */ + @MustBeClosed + fun websocketHandler( + params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponse + + /** @see websocketHandler */ + @MustBeClosed + fun websocketHandler( + params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none() + ): HttpResponse = websocketHandler(params, RequestOptions.none()) + + /** @see websocketHandler */ + @MustBeClosed + fun websocketHandler(requestOptions: RequestOptions): HttpResponse = + websocketHandler(WebsocketWebsocketHandlerParams.none(), requestOptions) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ClockServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceImpl.kt similarity index 52% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ClockServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceImpl.kt index bbdd0516..3a2f6752 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ClockServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceImpl.kt @@ -4,77 +4,69 @@ package com.clear_street.api.services.blocking.v1 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.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.prepare -import com.clear_street.api.models.v1.clock.ClockGetClockParams -import com.clear_street.api.models.v1.clock.ClockGetClockResponse +import com.clear_street.api.models.v1.websocket.WebsocketWebsocketHandlerParams import java.util.function.Consumer -/** Access financial calendars for events like earnings, dividends, and splits. */ -class ClockServiceImpl internal constructor(private val clientOptions: ClientOptions) : - ClockService { +/** Active Websocket. */ +class WebsocketServiceImpl internal constructor(private val clientOptions: ClientOptions) : + WebsocketService { - private val withRawResponse: ClockService.WithRawResponse by lazy { + private val withRawResponse: WebsocketService.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): ClockService.WithRawResponse = withRawResponse + override fun withRawResponse(): WebsocketService.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): ClockService = - ClockServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): WebsocketService = + WebsocketServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - override fun getClock( - params: ClockGetClockParams, + override fun websocketHandler( + params: WebsocketWebsocketHandlerParams, requestOptions: RequestOptions, - ): ClockGetClockResponse = - // get /v1/clock - withRawResponse().getClock(params, requestOptions).parse() + ) { + // get /v1/ws + withRawResponse().websocketHandler(params, requestOptions) + } class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - ClockService.WithRawResponse { + WebsocketService.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): ClockService.WithRawResponse = - ClockServiceImpl.WithRawResponseImpl( + ): WebsocketService.WithRawResponse = + WebsocketServiceImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val getClockHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val websocketHandlerHandler: Handler = emptyHandler() - override fun getClock( - params: ClockGetClockParams, + override fun websocketHandler( + params: WebsocketWebsocketHandlerParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponse { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "clock") + .addPathSegments("v1", "ws") .build() .prepare(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) val response = clientOptions.httpClient.execute(request, requestOptions) return errorHandler.handle(response).parseable { - response - .use { getClockHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } + response.use { websocketHandlerHandler.handle(it) } } } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceService.kt deleted file mode 100644 index dd726e21..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceService.kt +++ /dev/null @@ -1,124 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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 com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Manage trading accounts, balances, and portfolio history. */ -interface BalanceService { - - /** - * 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): BalanceService - - /** Fetch account balance information */ - fun getAccountBalances(accountId: Long): BalanceGetAccountBalancesResponse = - getAccountBalances(accountId, BalanceGetAccountBalancesParams.none()) - - /** @see getAccountBalances */ - fun getAccountBalances( - accountId: Long, - params: BalanceGetAccountBalancesParams = BalanceGetAccountBalancesParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): BalanceGetAccountBalancesResponse = - getAccountBalances(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see getAccountBalances */ - fun getAccountBalances( - accountId: Long, - params: BalanceGetAccountBalancesParams = BalanceGetAccountBalancesParams.none(), - ): BalanceGetAccountBalancesResponse = - getAccountBalances(accountId, params, RequestOptions.none()) - - /** @see getAccountBalances */ - fun getAccountBalances( - params: BalanceGetAccountBalancesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): BalanceGetAccountBalancesResponse - - /** @see getAccountBalances */ - fun getAccountBalances( - params: BalanceGetAccountBalancesParams - ): BalanceGetAccountBalancesResponse = getAccountBalances(params, RequestOptions.none()) - - /** @see getAccountBalances */ - fun getAccountBalances( - accountId: Long, - requestOptions: RequestOptions, - ): BalanceGetAccountBalancesResponse = - getAccountBalances(accountId, BalanceGetAccountBalancesParams.none(), requestOptions) - - /** A view of [BalanceService] 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): BalanceService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/accounts/{account_id}/balances`, but is - * otherwise the same as [BalanceService.getAccountBalances]. - */ - @MustBeClosed - fun getAccountBalances( - accountId: Long - ): HttpResponseFor = - getAccountBalances(accountId, BalanceGetAccountBalancesParams.none()) - - /** @see getAccountBalances */ - @MustBeClosed - fun getAccountBalances( - accountId: Long, - params: BalanceGetAccountBalancesParams = BalanceGetAccountBalancesParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getAccountBalances(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see getAccountBalances */ - @MustBeClosed - fun getAccountBalances( - accountId: Long, - params: BalanceGetAccountBalancesParams = BalanceGetAccountBalancesParams.none(), - ): HttpResponseFor = - getAccountBalances(accountId, params, RequestOptions.none()) - - /** @see getAccountBalances */ - @MustBeClosed - fun getAccountBalances( - params: BalanceGetAccountBalancesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getAccountBalances */ - @MustBeClosed - fun getAccountBalances( - params: BalanceGetAccountBalancesParams - ): HttpResponseFor = - getAccountBalances(params, RequestOptions.none()) - - /** @see getAccountBalances */ - @MustBeClosed - fun getAccountBalances( - accountId: Long, - requestOptions: RequestOptions, - ): HttpResponseFor = - getAccountBalances(accountId, BalanceGetAccountBalancesParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceServiceImpl.kt deleted file mode 100644 index 3a95b7b3..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceServiceImpl.kt +++ /dev/null @@ -1,86 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.accounts.balances.BalanceGetAccountBalancesParams -import com.clear_street.api.models.v1.accounts.balances.BalanceGetAccountBalancesResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Manage trading accounts, balances, and portfolio history. */ -class BalanceServiceImpl internal constructor(private val clientOptions: ClientOptions) : - BalanceService { - - private val withRawResponse: BalanceService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): BalanceService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): BalanceService = - BalanceServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getAccountBalances( - params: BalanceGetAccountBalancesParams, - requestOptions: RequestOptions, - ): BalanceGetAccountBalancesResponse = - // get /v1/accounts/{account_id}/balances - withRawResponse().getAccountBalances(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - BalanceService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): BalanceService.WithRawResponse = - BalanceServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getAccountBalancesHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getAccountBalances( - params: BalanceGetAccountBalancesParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // 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() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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/blocking/v1/accounts/PortfolioHistoryService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryService.kt deleted file mode 100644 index 8ffcd44f..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryService.kt +++ /dev/null @@ -1,104 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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 com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Manage trading accounts, balances, and portfolio history. */ -interface PortfolioHistoryService { - - /** - * 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): PortfolioHistoryService - - /** Retrieves daily portfolio history for the specified account. */ - fun getPortfolioHistory( - accountId: Long, - params: PortfolioHistoryGetPortfolioHistoryParams, - ): PortfolioHistoryGetPortfolioHistoryResponse = - getPortfolioHistory(accountId, params, RequestOptions.none()) - - /** @see getPortfolioHistory */ - fun getPortfolioHistory( - accountId: Long, - params: PortfolioHistoryGetPortfolioHistoryParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): PortfolioHistoryGetPortfolioHistoryResponse = - getPortfolioHistory(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see getPortfolioHistory */ - fun getPortfolioHistory( - params: PortfolioHistoryGetPortfolioHistoryParams - ): PortfolioHistoryGetPortfolioHistoryResponse = - getPortfolioHistory(params, RequestOptions.none()) - - /** @see getPortfolioHistory */ - fun getPortfolioHistory( - params: PortfolioHistoryGetPortfolioHistoryParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): PortfolioHistoryGetPortfolioHistoryResponse - - /** - * A view of [PortfolioHistoryService] 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 - ): PortfolioHistoryService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/accounts/{account_id}/portfolio-history`, but is - * otherwise the same as [PortfolioHistoryService.getPortfolioHistory]. - */ - @MustBeClosed - fun getPortfolioHistory( - accountId: Long, - params: PortfolioHistoryGetPortfolioHistoryParams, - ): HttpResponseFor = - getPortfolioHistory(accountId, params, RequestOptions.none()) - - /** @see getPortfolioHistory */ - @MustBeClosed - fun getPortfolioHistory( - accountId: Long, - params: PortfolioHistoryGetPortfolioHistoryParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getPortfolioHistory(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see getPortfolioHistory */ - @MustBeClosed - fun getPortfolioHistory( - params: PortfolioHistoryGetPortfolioHistoryParams - ): HttpResponseFor = - getPortfolioHistory(params, RequestOptions.none()) - - /** @see getPortfolioHistory */ - @MustBeClosed - fun getPortfolioHistory( - params: PortfolioHistoryGetPortfolioHistoryParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryServiceImpl.kt deleted file mode 100644 index eca2468c..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryServiceImpl.kt +++ /dev/null @@ -1,87 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.accounts.portfoliohistory.PortfolioHistoryGetPortfolioHistoryParams -import com.clear_street.api.models.v1.accounts.portfoliohistory.PortfolioHistoryGetPortfolioHistoryResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Manage trading accounts, balances, and portfolio history. */ -class PortfolioHistoryServiceImpl internal constructor(private val clientOptions: ClientOptions) : - PortfolioHistoryService { - - private val withRawResponse: PortfolioHistoryService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): PortfolioHistoryService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): PortfolioHistoryService = - PortfolioHistoryServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getPortfolioHistory( - params: PortfolioHistoryGetPortfolioHistoryParams, - requestOptions: RequestOptions, - ): PortfolioHistoryGetPortfolioHistoryResponse = - // get /v1/accounts/{account_id}/portfolio-history - withRawResponse().getPortfolioHistory(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - PortfolioHistoryService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): PortfolioHistoryService.WithRawResponse = - PortfolioHistoryServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getPortfolioHistoryHandler: - Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getPortfolioHistory( - params: PortfolioHistoryGetPortfolioHistoryParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // 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() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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/blocking/v1/accounts/PositionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionService.kt deleted file mode 100644 index d30ad3d6..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionService.kt +++ /dev/null @@ -1,280 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.blocking.v1.accounts.positions.InstructionService -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** View account positions. */ -interface PositionService { - - /** - * 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): PositionService - - /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */ - fun instructions(): InstructionService - - /** - * Delete a position within an account for an instrument. - * - * Retrieves orders generated to close the position. - */ - fun closePosition( - instrumentId: String, - params: PositionClosePositionParams, - ): PositionClosePositionResponse = closePosition(instrumentId, params, RequestOptions.none()) - - /** @see closePosition */ - fun closePosition( - instrumentId: String, - params: PositionClosePositionParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): PositionClosePositionResponse = - closePosition(params.toBuilder().instrumentId(instrumentId).build(), requestOptions) - - /** @see closePosition */ - fun closePosition(params: PositionClosePositionParams): PositionClosePositionResponse = - closePosition(params, RequestOptions.none()) - - /** @see closePosition */ - fun closePosition( - params: PositionClosePositionParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): PositionClosePositionResponse - - /** - * Delete all positions within an account. - * - * Closes all positions for the specified trading account. - */ - fun closePositions(accountId: Long): PositionClosePositionsResponse = - closePositions(accountId, PositionClosePositionsParams.none()) - - /** @see closePositions */ - fun closePositions( - accountId: Long, - params: PositionClosePositionsParams = PositionClosePositionsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): PositionClosePositionsResponse = - closePositions(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see closePositions */ - fun closePositions( - accountId: Long, - params: PositionClosePositionsParams = PositionClosePositionsParams.none(), - ): PositionClosePositionsResponse = closePositions(accountId, params, RequestOptions.none()) - - /** @see closePositions */ - fun closePositions( - params: PositionClosePositionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): PositionClosePositionsResponse - - /** @see closePositions */ - fun closePositions(params: PositionClosePositionsParams): PositionClosePositionsResponse = - closePositions(params, RequestOptions.none()) - - /** @see closePositions */ - fun closePositions( - accountId: Long, - requestOptions: RequestOptions, - ): PositionClosePositionsResponse = - closePositions(accountId, PositionClosePositionsParams.none(), requestOptions) - - /** Retrieves all positions for the specified trading account. */ - fun getPositions(accountId: Long): PositionGetPositionsResponse = - getPositions(accountId, PositionGetPositionsParams.none()) - - /** @see getPositions */ - fun getPositions( - accountId: Long, - params: PositionGetPositionsParams = PositionGetPositionsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): PositionGetPositionsResponse = - getPositions(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see getPositions */ - fun getPositions( - accountId: Long, - params: PositionGetPositionsParams = PositionGetPositionsParams.none(), - ): PositionGetPositionsResponse = getPositions(accountId, params, RequestOptions.none()) - - /** @see getPositions */ - fun getPositions( - params: PositionGetPositionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): PositionGetPositionsResponse - - /** @see getPositions */ - fun getPositions(params: PositionGetPositionsParams): PositionGetPositionsResponse = - getPositions(params, RequestOptions.none()) - - /** @see getPositions */ - fun getPositions( - accountId: Long, - requestOptions: RequestOptions, - ): PositionGetPositionsResponse = - getPositions(accountId, PositionGetPositionsParams.none(), requestOptions) - - /** A view of [PositionService] 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): PositionService.WithRawResponse - - /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */ - fun instructions(): InstructionService.WithRawResponse - - /** - * Returns a raw HTTP response for `delete - * /v1/accounts/{account_id}/positions/{instrument_id}`, but is otherwise the same as - * [PositionService.closePosition]. - */ - @MustBeClosed - fun closePosition( - instrumentId: String, - params: PositionClosePositionParams, - ): HttpResponseFor = - closePosition(instrumentId, params, RequestOptions.none()) - - /** @see closePosition */ - @MustBeClosed - fun closePosition( - instrumentId: String, - params: PositionClosePositionParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - closePosition(params.toBuilder().instrumentId(instrumentId).build(), requestOptions) - - /** @see closePosition */ - @MustBeClosed - fun closePosition( - params: PositionClosePositionParams - ): HttpResponseFor = - closePosition(params, RequestOptions.none()) - - /** @see closePosition */ - @MustBeClosed - fun closePosition( - params: PositionClosePositionParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** - * Returns a raw HTTP response for `delete /v1/accounts/{account_id}/positions`, but is - * otherwise the same as [PositionService.closePositions]. - */ - @MustBeClosed - fun closePositions(accountId: Long): HttpResponseFor = - closePositions(accountId, PositionClosePositionsParams.none()) - - /** @see closePositions */ - @MustBeClosed - fun closePositions( - accountId: Long, - params: PositionClosePositionsParams = PositionClosePositionsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - closePositions(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see closePositions */ - @MustBeClosed - fun closePositions( - accountId: Long, - params: PositionClosePositionsParams = PositionClosePositionsParams.none(), - ): HttpResponseFor = - closePositions(accountId, params, RequestOptions.none()) - - /** @see closePositions */ - @MustBeClosed - fun closePositions( - params: PositionClosePositionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see closePositions */ - @MustBeClosed - fun closePositions( - params: PositionClosePositionsParams - ): HttpResponseFor = - closePositions(params, RequestOptions.none()) - - /** @see closePositions */ - @MustBeClosed - fun closePositions( - accountId: Long, - requestOptions: RequestOptions, - ): HttpResponseFor = - closePositions(accountId, PositionClosePositionsParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /v1/accounts/{account_id}/positions`, but is - * otherwise the same as [PositionService.getPositions]. - */ - @MustBeClosed - fun getPositions(accountId: Long): HttpResponseFor = - getPositions(accountId, PositionGetPositionsParams.none()) - - /** @see getPositions */ - @MustBeClosed - fun getPositions( - accountId: Long, - params: PositionGetPositionsParams = PositionGetPositionsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getPositions(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see getPositions */ - @MustBeClosed - fun getPositions( - accountId: Long, - params: PositionGetPositionsParams = PositionGetPositionsParams.none(), - ): HttpResponseFor = - getPositions(accountId, params, RequestOptions.none()) - - /** @see getPositions */ - @MustBeClosed - fun getPositions( - params: PositionGetPositionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getPositions */ - @MustBeClosed - fun getPositions( - params: PositionGetPositionsParams - ): HttpResponseFor = - getPositions(params, RequestOptions.none()) - - /** @see getPositions */ - @MustBeClosed - fun getPositions( - accountId: Long, - requestOptions: RequestOptions, - ): HttpResponseFor = - getPositions(accountId, PositionGetPositionsParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionServiceImpl.kt deleted file mode 100644 index 1184a986..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionServiceImpl.kt +++ /dev/null @@ -1,187 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -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.blocking.v1.accounts.positions.InstructionService -import com.clear_street.api.services.blocking.v1.accounts.positions.InstructionServiceImpl -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** View account positions. */ -class PositionServiceImpl internal constructor(private val clientOptions: ClientOptions) : - PositionService { - - private val withRawResponse: PositionService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - private val instructions: InstructionService by lazy { InstructionServiceImpl(clientOptions) } - - override fun withRawResponse(): PositionService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): PositionService = - PositionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */ - override fun instructions(): InstructionService = instructions - - override fun closePosition( - params: PositionClosePositionParams, - requestOptions: RequestOptions, - ): PositionClosePositionResponse = - // delete /v1/accounts/{account_id}/positions/{instrument_id} - withRawResponse().closePosition(params, requestOptions).parse() - - override fun closePositions( - params: PositionClosePositionsParams, - requestOptions: RequestOptions, - ): PositionClosePositionsResponse = - // delete /v1/accounts/{account_id}/positions - withRawResponse().closePositions(params, requestOptions).parse() - - override fun getPositions( - params: PositionGetPositionsParams, - requestOptions: RequestOptions, - ): PositionGetPositionsResponse = - // get /v1/accounts/{account_id}/positions - withRawResponse().getPositions(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - PositionService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - private val instructions: InstructionService.WithRawResponse by lazy { - InstructionServiceImpl.WithRawResponseImpl(clientOptions) - } - - override fun withOptions( - modifier: Consumer - ): PositionService.WithRawResponse = - PositionServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */ - override fun instructions(): InstructionService.WithRawResponse = instructions - - private val closePositionHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun closePosition( - params: PositionClosePositionParams, - requestOptions: RequestOptions, - ): 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.DELETE) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments( - "v1", - "accounts", - params._pathParam(0), - "positions", - params._pathParam(1), - ) - .body(json(clientOptions.jsonMapper, params._body())) - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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, - ): HttpResponseFor { - // 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() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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, - ): HttpResponseFor { - // 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() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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/blocking/v1/accounts/positions/InstructionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionService.kt deleted file mode 100644 index 3da540e8..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionService.kt +++ /dev/null @@ -1,288 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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 com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */ -interface InstructionService { - - /** - * 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): InstructionService - - /** - * 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, - ): InstructionCancelPositionInstructionResponse = - cancelPositionInstruction(instructionId, params, RequestOptions.none()) - - /** @see cancelPositionInstruction */ - fun cancelPositionInstruction( - instructionId: String, - params: InstructionCancelPositionInstructionParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): InstructionCancelPositionInstructionResponse = - cancelPositionInstruction( - params.toBuilder().instructionId(instructionId).build(), - requestOptions, - ) - - /** @see cancelPositionInstruction */ - fun cancelPositionInstruction( - params: InstructionCancelPositionInstructionParams - ): InstructionCancelPositionInstructionResponse = - cancelPositionInstruction(params, RequestOptions.none()) - - /** @see cancelPositionInstruction */ - fun cancelPositionInstruction( - params: InstructionCancelPositionInstructionParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): InstructionCancelPositionInstructionResponse - - /** - * Returns the current lifecycle state of exercise / DNE / CEA instructions for the account. - * Optionally filter by a specific instrument. - */ - fun getPositionInstructions(accountId: Long): InstructionGetPositionInstructionsResponse = - getPositionInstructions(accountId, InstructionGetPositionInstructionsParams.none()) - - /** @see getPositionInstructions */ - fun getPositionInstructions( - accountId: Long, - params: InstructionGetPositionInstructionsParams = - InstructionGetPositionInstructionsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): InstructionGetPositionInstructionsResponse = - getPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see getPositionInstructions */ - fun getPositionInstructions( - accountId: Long, - params: InstructionGetPositionInstructionsParams = - InstructionGetPositionInstructionsParams.none(), - ): InstructionGetPositionInstructionsResponse = - getPositionInstructions(accountId, params, RequestOptions.none()) - - /** @see getPositionInstructions */ - fun getPositionInstructions( - params: InstructionGetPositionInstructionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): InstructionGetPositionInstructionsResponse - - /** @see getPositionInstructions */ - fun getPositionInstructions( - params: InstructionGetPositionInstructionsParams - ): InstructionGetPositionInstructionsResponse = - getPositionInstructions(params, RequestOptions.none()) - - /** @see getPositionInstructions */ - fun getPositionInstructions( - accountId: Long, - requestOptions: RequestOptions, - ): InstructionGetPositionInstructionsResponse = - 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, - ): InstructionSubmitPositionInstructionsResponse = - submitPositionInstructions(accountId, params, RequestOptions.none()) - - /** @see submitPositionInstructions */ - fun submitPositionInstructions( - accountId: Long, - params: InstructionSubmitPositionInstructionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): InstructionSubmitPositionInstructionsResponse = - submitPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see submitPositionInstructions */ - fun submitPositionInstructions( - params: InstructionSubmitPositionInstructionsParams - ): InstructionSubmitPositionInstructionsResponse = - submitPositionInstructions(params, RequestOptions.none()) - - /** @see submitPositionInstructions */ - fun submitPositionInstructions( - params: InstructionSubmitPositionInstructionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): InstructionSubmitPositionInstructionsResponse - - /** - * A view of [InstructionService] 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 - ): InstructionService.WithRawResponse - - /** - * Returns a raw HTTP response for `delete - * /v1/accounts/{account_id}/positions/instructions/{instruction_id}`, but is otherwise the - * same as [InstructionService.cancelPositionInstruction]. - */ - @MustBeClosed - fun cancelPositionInstruction( - instructionId: String, - params: InstructionCancelPositionInstructionParams, - ): HttpResponseFor = - cancelPositionInstruction(instructionId, params, RequestOptions.none()) - - /** @see cancelPositionInstruction */ - @MustBeClosed - fun cancelPositionInstruction( - instructionId: String, - params: InstructionCancelPositionInstructionParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - cancelPositionInstruction( - params.toBuilder().instructionId(instructionId).build(), - requestOptions, - ) - - /** @see cancelPositionInstruction */ - @MustBeClosed - fun cancelPositionInstruction( - params: InstructionCancelPositionInstructionParams - ): HttpResponseFor = - cancelPositionInstruction(params, RequestOptions.none()) - - /** @see cancelPositionInstruction */ - @MustBeClosed - fun cancelPositionInstruction( - params: InstructionCancelPositionInstructionParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** - * Returns a raw HTTP response for `get /v1/accounts/{account_id}/positions/instructions`, - * but is otherwise the same as [InstructionService.getPositionInstructions]. - */ - @MustBeClosed - fun getPositionInstructions( - accountId: Long - ): HttpResponseFor = - getPositionInstructions(accountId, InstructionGetPositionInstructionsParams.none()) - - /** @see getPositionInstructions */ - @MustBeClosed - fun getPositionInstructions( - accountId: Long, - params: InstructionGetPositionInstructionsParams = - InstructionGetPositionInstructionsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions) - - /** @see getPositionInstructions */ - @MustBeClosed - fun getPositionInstructions( - accountId: Long, - params: InstructionGetPositionInstructionsParams = - InstructionGetPositionInstructionsParams.none(), - ): HttpResponseFor = - getPositionInstructions(accountId, params, RequestOptions.none()) - - /** @see getPositionInstructions */ - @MustBeClosed - fun getPositionInstructions( - params: InstructionGetPositionInstructionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getPositionInstructions */ - @MustBeClosed - fun getPositionInstructions( - params: InstructionGetPositionInstructionsParams - ): HttpResponseFor = - getPositionInstructions(params, RequestOptions.none()) - - /** @see getPositionInstructions */ - @MustBeClosed - fun getPositionInstructions( - accountId: Long, - requestOptions: RequestOptions, - ): HttpResponseFor = - getPositionInstructions( - accountId, - InstructionGetPositionInstructionsParams.none(), - requestOptions, - ) - - /** - * Returns a raw HTTP response for `post /v1/accounts/{account_id}/positions/instructions`, - * but is otherwise the same as [InstructionService.submitPositionInstructions]. - */ - @MustBeClosed - fun submitPositionInstructions( - accountId: Long, - params: InstructionSubmitPositionInstructionsParams, - ): HttpResponseFor = - submitPositionInstructions(accountId, params, RequestOptions.none()) - - /** @see submitPositionInstructions */ - @MustBeClosed - fun submitPositionInstructions( - accountId: Long, - params: InstructionSubmitPositionInstructionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - submitPositionInstructions( - params.toBuilder().accountId(accountId).build(), - requestOptions, - ) - - /** @see submitPositionInstructions */ - @MustBeClosed - fun submitPositionInstructions( - params: InstructionSubmitPositionInstructionsParams - ): HttpResponseFor = - submitPositionInstructions(params, RequestOptions.none()) - - /** @see submitPositionInstructions */ - @MustBeClosed - fun submitPositionInstructions( - params: InstructionSubmitPositionInstructionsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionServiceImpl.kt deleted file mode 100644 index 216c0706..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionServiceImpl.kt +++ /dev/null @@ -1,189 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -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.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */ -class InstructionServiceImpl internal constructor(private val clientOptions: ClientOptions) : - InstructionService { - - private val withRawResponse: InstructionService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): InstructionService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): InstructionService = - InstructionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun cancelPositionInstruction( - params: InstructionCancelPositionInstructionParams, - requestOptions: RequestOptions, - ): InstructionCancelPositionInstructionResponse = - // delete /v1/accounts/{account_id}/positions/instructions/{instruction_id} - withRawResponse().cancelPositionInstruction(params, requestOptions).parse() - - override fun getPositionInstructions( - params: InstructionGetPositionInstructionsParams, - requestOptions: RequestOptions, - ): InstructionGetPositionInstructionsResponse = - // get /v1/accounts/{account_id}/positions/instructions - withRawResponse().getPositionInstructions(params, requestOptions).parse() - - override fun submitPositionInstructions( - params: InstructionSubmitPositionInstructionsParams, - requestOptions: RequestOptions, - ): InstructionSubmitPositionInstructionsResponse = - // post /v1/accounts/{account_id}/positions/instructions - withRawResponse().submitPositionInstructions(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - InstructionService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): InstructionService.WithRawResponse = - InstructionServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val cancelPositionInstructionHandler: - Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun cancelPositionInstruction( - params: InstructionCancelPositionInstructionParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // 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() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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, - ): HttpResponseFor { - // 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() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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, - ): HttpResponseFor { - // 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() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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/blocking/v1/calendars/MarketHourService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourService.kt deleted file mode 100644 index 60ece64c..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourService.kt +++ /dev/null @@ -1,72 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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 com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Access financial calendars for events like earnings, dividends, and splits. */ -interface MarketHourService { - - /** - * 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): MarketHourService - - /** - * 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 - ): MarketHourGetMarketHoursCalendarResponse = - getMarketHoursCalendar(params, RequestOptions.none()) - - /** @see getMarketHoursCalendar */ - fun getMarketHoursCalendar( - params: MarketHourGetMarketHoursCalendarParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): MarketHourGetMarketHoursCalendarResponse - - /** A view of [MarketHourService] 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 - ): MarketHourService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/calendars/market-hours`, but is otherwise the - * same as [MarketHourService.getMarketHoursCalendar]. - */ - @MustBeClosed - fun getMarketHoursCalendar( - params: MarketHourGetMarketHoursCalendarParams - ): HttpResponseFor = - getMarketHoursCalendar(params, RequestOptions.none()) - - /** @see getMarketHoursCalendar */ - @MustBeClosed - fun getMarketHoursCalendar( - params: MarketHourGetMarketHoursCalendarParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourServiceImpl.kt deleted file mode 100644 index 39602091..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourServiceImpl.kt +++ /dev/null @@ -1,82 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.calendars.markethours.MarketHourGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendars.markethours.MarketHourGetMarketHoursCalendarResponse -import java.util.function.Consumer - -/** Access financial calendars for events like earnings, dividends, and splits. */ -class MarketHourServiceImpl internal constructor(private val clientOptions: ClientOptions) : - MarketHourService { - - private val withRawResponse: MarketHourService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): MarketHourService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): MarketHourService = - MarketHourServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getMarketHoursCalendar( - params: MarketHourGetMarketHoursCalendarParams, - requestOptions: RequestOptions, - ): MarketHourGetMarketHoursCalendarResponse = - // get /v1/calendars/market-hours - withRawResponse().getMarketHoursCalendar(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - MarketHourService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): MarketHourService.WithRawResponse = - MarketHourServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getMarketHoursCalendarHandler: - Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getMarketHoursCalendar( - params: MarketHourGetMarketHoursCalendarParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "calendars", "market-hours") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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/blocking/v1/instrumentdata/MarketDataService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataService.kt new file mode 100644 index 00000000..b476b8bc --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataService.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1.instrumentdata + +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.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse +import com.google.errorprone.annotations.MustBeClosed +import java.util.function.Consumer + +/** Retrieve instrument analytics, market data, news, and related reference data. */ +interface MarketDataService { + + /** + * 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): MarketDataService + + /** + * Returns the most recent OHLV and current price for the requested OEMS instruments. Backed by + * the in-memory Polygon snapshot cache. + * + * Response contract: every request returns one row per **unique** `instrument_id`, in + * first-seen request order. Unresolvable IDs come back with `symbol = null` and every + * market-data field `null`; resolvable IDs with no cache entry come back with `symbol` + * populated but market-data fields `null`. + * + * **Note (temporary):** ID resolution currently goes through the supplemental screener (OEMS + * instrument_id → FMP fmp_symbol → metadata_id → realtime cache). Removed when the market-data + * service serves daily aggregates directly, or when Polygon symbology is loaded into the + * instrument cache. + */ + fun getDailySummaries( + params: MarketDataGetDailySummariesParams + ): MarketDataGetDailySummariesResponse = getDailySummaries(params, RequestOptions.none()) + + /** @see getDailySummaries */ + fun getDailySummaries( + params: MarketDataGetDailySummariesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): MarketDataGetDailySummariesResponse + + /** Get market data snapshots for one or more securities. */ + fun getSnapshots(): MarketDataGetSnapshotsResponse = + getSnapshots(MarketDataGetSnapshotsParams.none()) + + /** @see getSnapshots */ + fun getSnapshots( + params: MarketDataGetSnapshotsParams = MarketDataGetSnapshotsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): MarketDataGetSnapshotsResponse + + /** @see getSnapshots */ + fun getSnapshots( + params: MarketDataGetSnapshotsParams = MarketDataGetSnapshotsParams.none() + ): MarketDataGetSnapshotsResponse = getSnapshots(params, RequestOptions.none()) + + /** @see getSnapshots */ + fun getSnapshots(requestOptions: RequestOptions): MarketDataGetSnapshotsResponse = + getSnapshots(MarketDataGetSnapshotsParams.none(), requestOptions) + + /** A view of [MarketDataService] 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 + ): MarketDataService.WithRawResponse + + /** + * Returns a raw HTTP response for `get /v1/market-data/daily-summary`, but is otherwise the + * same as [MarketDataService.getDailySummaries]. + */ + @MustBeClosed + fun getDailySummaries( + params: MarketDataGetDailySummariesParams + ): HttpResponseFor = + getDailySummaries(params, RequestOptions.none()) + + /** @see getDailySummaries */ + @MustBeClosed + fun getDailySummaries( + params: MarketDataGetDailySummariesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `get /v1/market-data/snapshot`, but is otherwise the same + * as [MarketDataService.getSnapshots]. + */ + @MustBeClosed + fun getSnapshots(): HttpResponseFor = + getSnapshots(MarketDataGetSnapshotsParams.none()) + + /** @see getSnapshots */ + @MustBeClosed + fun getSnapshots( + params: MarketDataGetSnapshotsParams = MarketDataGetSnapshotsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getSnapshots */ + @MustBeClosed + fun getSnapshots( + params: MarketDataGetSnapshotsParams = MarketDataGetSnapshotsParams.none() + ): HttpResponseFor = + getSnapshots(params, RequestOptions.none()) + + /** @see getSnapshots */ + @MustBeClosed + fun getSnapshots( + requestOptions: RequestOptions + ): HttpResponseFor = + getSnapshots(MarketDataGetSnapshotsParams.none(), requestOptions) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt similarity index 51% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt index 6b3139d9..47374608 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt @@ -1,10 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.instruments +package com.clear_street.api.services.blocking.v1.instrumentdata 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 @@ -15,72 +14,71 @@ 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.prepare -import com.clear_street.api.models.v1.instruments.events.EventGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetAllInstrumentEventsResponse -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsResponse +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull -/** Retrieve details and lists of tradable instruments. */ -class EventServiceImpl internal constructor(private val clientOptions: ClientOptions) : - EventService { +/** Retrieve instrument analytics, market data, news, and related reference data. */ +class MarketDataServiceImpl internal constructor(private val clientOptions: ClientOptions) : + MarketDataService { - private val withRawResponse: EventService.WithRawResponse by lazy { + private val withRawResponse: MarketDataService.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } - override fun withRawResponse(): EventService.WithRawResponse = withRawResponse + override fun withRawResponse(): MarketDataService.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): EventService = - EventServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): MarketDataService = + MarketDataServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - override fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams, + override fun getDailySummaries( + params: MarketDataGetDailySummariesParams, requestOptions: RequestOptions, - ): EventGetAllInstrumentEventsResponse = - // get /v1/instruments/events - withRawResponse().getAllInstrumentEvents(params, requestOptions).parse() + ): MarketDataGetDailySummariesResponse = + // get /v1/market-data/daily-summary + withRawResponse().getDailySummaries(params, requestOptions).parse() - override fun getInstrumentEvents( - params: EventGetInstrumentEventsParams, + override fun getSnapshots( + params: MarketDataGetSnapshotsParams, requestOptions: RequestOptions, - ): EventGetInstrumentEventsResponse = - // get /v1/instruments/{instrument_id}/events - withRawResponse().getInstrumentEvents(params, requestOptions).parse() + ): MarketDataGetSnapshotsResponse = + // get /v1/market-data/snapshot + withRawResponse().getSnapshots(params, requestOptions).parse() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - EventService.WithRawResponse { + MarketDataService.WithRawResponse { private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) override fun withOptions( modifier: Consumer - ): EventService.WithRawResponse = - EventServiceImpl.WithRawResponseImpl( + ): MarketDataService.WithRawResponse = + MarketDataServiceImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - private val getAllInstrumentEventsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val getDailySummariesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) - override fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams, + override fun getDailySummaries( + params: MarketDataGetDailySummariesParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "instruments", "events") + .addPathSegments("v1", "market-data", "daily-summary") .build() .prepare(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) val response = clientOptions.httpClient.execute(request, requestOptions) return errorHandler.handle(response).parseable { response - .use { getAllInstrumentEventsHandler.handle(it) } + .use { getDailySummariesHandler.handle(it) } .also { if (requestOptions.responseValidation!!) { it.validate() @@ -89,28 +87,25 @@ class EventServiceImpl internal constructor(private val clientOptions: ClientOpt } } - private val getInstrumentEventsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val getSnapshotsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) - override fun getInstrumentEvents( - params: EventGetInstrumentEventsParams, + override fun getSnapshots( + params: MarketDataGetSnapshotsParams, requestOptions: RequestOptions, - ): 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()) + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "instruments", params._pathParam(0), "events") + .addPathSegments("v1", "market-data", "snapshot") .build() .prepare(clientOptions, params) val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) val response = clientOptions.httpClient.execute(request, requestOptions) return errorHandler.handle(response).parseable { response - .use { getInstrumentEventsHandler.handle(it) } + .use { getSnapshotsHandler.handle(it) } .also { if (requestOptions.responseValidation!!) { it.validate() diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/NewsService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsService.kt similarity index 90% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/NewsService.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsService.kt index 22ac973a..b27a9831 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/NewsService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsService.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clear_street.api.services.blocking.v1.instrumentdata 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.news.NewsGetNewsParams -import com.clear_street.api.models.v1.news.NewsGetNewsResponse +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer -/** Retrieve market news and related instrument metadata. */ +/** Retrieve instrument analytics, market data, news, and related reference data. */ interface NewsService { /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/NewsServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt similarity index 90% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/NewsServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt index 5a4c0e28..7c1aecf7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/NewsServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clear_street.api.services.blocking.v1.instrumentdata import com.clear_street.api.core.ClientOptions import com.clear_street.api.core.RequestOptions @@ -14,11 +14,11 @@ 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.prepare -import com.clear_street.api.models.v1.news.NewsGetNewsParams -import com.clear_street.api.models.v1.news.NewsGetNewsResponse +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsResponse import java.util.function.Consumer -/** Retrieve market news and related instrument metadata. */ +/** Retrieve instrument analytics, market data, news, and related reference data. */ class NewsServiceImpl internal constructor(private val clientOptions: ClientOptions) : NewsService { private val withRawResponse: NewsService.WithRawResponse by lazy { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingService.kt deleted file mode 100644 index b86e6207..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingService.kt +++ /dev/null @@ -1,156 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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 com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface AnalystReportingService { - - /** - * 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): AnalystReportingService - - /** Retrieves analyst ratings and price targets for an instrument. */ - fun getInstrumentAnalystConsensus( - instrumentId: String - ): AnalystReportingGetInstrumentAnalystConsensusResponse = - getInstrumentAnalystConsensus( - instrumentId, - AnalystReportingGetInstrumentAnalystConsensusParams.none(), - ) - - /** @see getInstrumentAnalystConsensus */ - fun getInstrumentAnalystConsensus( - instrumentId: String, - params: AnalystReportingGetInstrumentAnalystConsensusParams = - AnalystReportingGetInstrumentAnalystConsensusParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): AnalystReportingGetInstrumentAnalystConsensusResponse = - getInstrumentAnalystConsensus( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentAnalystConsensus */ - fun getInstrumentAnalystConsensus( - instrumentId: String, - params: AnalystReportingGetInstrumentAnalystConsensusParams = - AnalystReportingGetInstrumentAnalystConsensusParams.none(), - ): AnalystReportingGetInstrumentAnalystConsensusResponse = - getInstrumentAnalystConsensus(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentAnalystConsensus */ - fun getInstrumentAnalystConsensus( - params: AnalystReportingGetInstrumentAnalystConsensusParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): AnalystReportingGetInstrumentAnalystConsensusResponse - - /** @see getInstrumentAnalystConsensus */ - fun getInstrumentAnalystConsensus( - params: AnalystReportingGetInstrumentAnalystConsensusParams - ): AnalystReportingGetInstrumentAnalystConsensusResponse = - getInstrumentAnalystConsensus(params, RequestOptions.none()) - - /** @see getInstrumentAnalystConsensus */ - fun getInstrumentAnalystConsensus( - instrumentId: String, - requestOptions: RequestOptions, - ): AnalystReportingGetInstrumentAnalystConsensusResponse = - getInstrumentAnalystConsensus( - instrumentId, - AnalystReportingGetInstrumentAnalystConsensusParams.none(), - requestOptions, - ) - - /** - * A view of [AnalystReportingService] 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 - ): AnalystReportingService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/analyst-reporting`, - * but is otherwise the same as [AnalystReportingService.getInstrumentAnalystConsensus]. - */ - @MustBeClosed - fun getInstrumentAnalystConsensus( - instrumentId: String - ): HttpResponseFor = - getInstrumentAnalystConsensus( - instrumentId, - AnalystReportingGetInstrumentAnalystConsensusParams.none(), - ) - - /** @see getInstrumentAnalystConsensus */ - @MustBeClosed - fun getInstrumentAnalystConsensus( - instrumentId: String, - params: AnalystReportingGetInstrumentAnalystConsensusParams = - AnalystReportingGetInstrumentAnalystConsensusParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getInstrumentAnalystConsensus( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentAnalystConsensus */ - @MustBeClosed - fun getInstrumentAnalystConsensus( - instrumentId: String, - params: AnalystReportingGetInstrumentAnalystConsensusParams = - AnalystReportingGetInstrumentAnalystConsensusParams.none(), - ): HttpResponseFor = - getInstrumentAnalystConsensus(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentAnalystConsensus */ - @MustBeClosed - fun getInstrumentAnalystConsensus( - params: AnalystReportingGetInstrumentAnalystConsensusParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getInstrumentAnalystConsensus */ - @MustBeClosed - fun getInstrumentAnalystConsensus( - params: AnalystReportingGetInstrumentAnalystConsensusParams - ): HttpResponseFor = - getInstrumentAnalystConsensus(params, RequestOptions.none()) - - /** @see getInstrumentAnalystConsensus */ - @MustBeClosed - fun getInstrumentAnalystConsensus( - instrumentId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = - getInstrumentAnalystConsensus( - instrumentId, - AnalystReportingGetInstrumentAnalystConsensusParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingServiceImpl.kt deleted file mode 100644 index 0ece8147..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingServiceImpl.kt +++ /dev/null @@ -1,89 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.instruments.analystreporting.AnalystReportingGetInstrumentAnalystConsensusParams -import com.clear_street.api.models.v1.instruments.analystreporting.AnalystReportingGetInstrumentAnalystConsensusResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class AnalystReportingServiceImpl internal constructor(private val clientOptions: ClientOptions) : - AnalystReportingService { - - private val withRawResponse: AnalystReportingService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): AnalystReportingService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): AnalystReportingService = - AnalystReportingServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentAnalystConsensus( - params: AnalystReportingGetInstrumentAnalystConsensusParams, - requestOptions: RequestOptions, - ): AnalystReportingGetInstrumentAnalystConsensusResponse = - // get /v1/instruments/{instrument_id}/analyst-reporting - withRawResponse().getInstrumentAnalystConsensus(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - AnalystReportingService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): AnalystReportingService.WithRawResponse = - AnalystReportingServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentAnalystConsensusHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getInstrumentAnalystConsensus( - params: AnalystReportingGetInstrumentAnalystConsensusParams, - requestOptions: RequestOptions, - ): 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() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return 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/blocking/v1/instruments/BalanceSheetService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetService.kt deleted file mode 100644 index 74f557a3..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetService.kt +++ /dev/null @@ -1,164 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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 com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface BalanceSheetService { - - /** - * 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): BalanceSheetService - - /** - * 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 - ): BalanceSheetGetInstrumentBalanceSheetStatementsResponse = - getInstrumentBalanceSheetStatements( - instrumentId, - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - ) - - /** @see getInstrumentBalanceSheetStatements */ - fun getInstrumentBalanceSheetStatements( - instrumentId: String, - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams = - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): BalanceSheetGetInstrumentBalanceSheetStatementsResponse = - getInstrumentBalanceSheetStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentBalanceSheetStatements */ - fun getInstrumentBalanceSheetStatements( - instrumentId: String, - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams = - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - ): BalanceSheetGetInstrumentBalanceSheetStatementsResponse = - getInstrumentBalanceSheetStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentBalanceSheetStatements */ - fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): BalanceSheetGetInstrumentBalanceSheetStatementsResponse - - /** @see getInstrumentBalanceSheetStatements */ - fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams - ): BalanceSheetGetInstrumentBalanceSheetStatementsResponse = - getInstrumentBalanceSheetStatements(params, RequestOptions.none()) - - /** @see getInstrumentBalanceSheetStatements */ - fun getInstrumentBalanceSheetStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): BalanceSheetGetInstrumentBalanceSheetStatementsResponse = - getInstrumentBalanceSheetStatements( - instrumentId, - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - requestOptions, - ) - - /** - * A view of [BalanceSheetService] 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 - ): BalanceSheetService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/balance-sheets`, but - * is otherwise the same as [BalanceSheetService.getInstrumentBalanceSheetStatements]. - */ - @MustBeClosed - fun getInstrumentBalanceSheetStatements( - instrumentId: String - ): HttpResponseFor = - getInstrumentBalanceSheetStatements( - instrumentId, - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - ) - - /** @see getInstrumentBalanceSheetStatements */ - @MustBeClosed - fun getInstrumentBalanceSheetStatements( - instrumentId: String, - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams = - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getInstrumentBalanceSheetStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentBalanceSheetStatements */ - @MustBeClosed - fun getInstrumentBalanceSheetStatements( - instrumentId: String, - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams = - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - ): HttpResponseFor = - getInstrumentBalanceSheetStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentBalanceSheetStatements */ - @MustBeClosed - fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getInstrumentBalanceSheetStatements */ - @MustBeClosed - fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams - ): HttpResponseFor = - getInstrumentBalanceSheetStatements(params, RequestOptions.none()) - - /** @see getInstrumentBalanceSheetStatements */ - @MustBeClosed - fun getInstrumentBalanceSheetStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = - getInstrumentBalanceSheetStatements( - instrumentId, - BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetServiceImpl.kt deleted file mode 100644 index 3922bc05..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetServiceImpl.kt +++ /dev/null @@ -1,89 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.instruments.balancesheets.BalanceSheetGetInstrumentBalanceSheetStatementsParams -import com.clear_street.api.models.v1.instruments.balancesheets.BalanceSheetGetInstrumentBalanceSheetStatementsResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class BalanceSheetServiceImpl internal constructor(private val clientOptions: ClientOptions) : - BalanceSheetService { - - private val withRawResponse: BalanceSheetService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): BalanceSheetService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): BalanceSheetService = - BalanceSheetServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams, - requestOptions: RequestOptions, - ): BalanceSheetGetInstrumentBalanceSheetStatementsResponse = - // get /v1/instruments/{instrument_id}/balance-sheets - withRawResponse().getInstrumentBalanceSheetStatements(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - BalanceSheetService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): BalanceSheetService.WithRawResponse = - BalanceSheetServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentBalanceSheetStatementsHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getInstrumentBalanceSheetStatements( - params: BalanceSheetGetInstrumentBalanceSheetStatementsParams, - requestOptions: RequestOptions, - ): 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), "balance-sheets") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getInstrumentBalanceSheetStatementsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementService.kt deleted file mode 100644 index a1385a10..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementService.kt +++ /dev/null @@ -1,162 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instruments.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface CashFlowStatementService { - - /** - * 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): CashFlowStatementService - - /** - * Get cash flow statements for an instrument. - * - * Retrieves historical cash flow statements for the specified instrument. Cash flow statements - * show cash inflows and outflows from operating, investing, and financing activities. - */ - fun getInstrumentCashFlowStatements( - instrumentId: String - ): CashFlowStatementGetInstrumentCashFlowStatementsResponse = - getInstrumentCashFlowStatements( - instrumentId, - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - ) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - params: CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CashFlowStatementGetInstrumentCashFlowStatementsResponse = - getInstrumentCashFlowStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - params: CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - ): CashFlowStatementGetInstrumentCashFlowStatementsResponse = - getInstrumentCashFlowStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CashFlowStatementGetInstrumentCashFlowStatementsResponse - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams - ): CashFlowStatementGetInstrumentCashFlowStatementsResponse = - getInstrumentCashFlowStatements(params, RequestOptions.none()) - - /** @see getInstrumentCashFlowStatements */ - fun getInstrumentCashFlowStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): CashFlowStatementGetInstrumentCashFlowStatementsResponse = - getInstrumentCashFlowStatements( - instrumentId, - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - requestOptions, - ) - - /** - * A view of [CashFlowStatementService] 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 - ): CashFlowStatementService.WithRawResponse - - /** - * Returns a raw HTTP response for `get - * /v1/instruments/{instrument_id}/cash-flow-statements`, but is otherwise the same as - * [CashFlowStatementService.getInstrumentCashFlowStatements]. - */ - @MustBeClosed - fun getInstrumentCashFlowStatements( - instrumentId: String - ): HttpResponseFor = - getInstrumentCashFlowStatements( - instrumentId, - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - ) - - /** @see getInstrumentCashFlowStatements */ - @MustBeClosed - fun getInstrumentCashFlowStatements( - instrumentId: String, - params: CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getInstrumentCashFlowStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentCashFlowStatements */ - @MustBeClosed - fun getInstrumentCashFlowStatements( - instrumentId: String, - params: CashFlowStatementGetInstrumentCashFlowStatementsParams = - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - ): HttpResponseFor = - getInstrumentCashFlowStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentCashFlowStatements */ - @MustBeClosed - fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getInstrumentCashFlowStatements */ - @MustBeClosed - fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams - ): HttpResponseFor = - getInstrumentCashFlowStatements(params, RequestOptions.none()) - - /** @see getInstrumentCashFlowStatements */ - @MustBeClosed - fun getInstrumentCashFlowStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = - getInstrumentCashFlowStatements( - instrumentId, - CashFlowStatementGetInstrumentCashFlowStatementsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementServiceImpl.kt deleted file mode 100644 index d66b38a2..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementServiceImpl.kt +++ /dev/null @@ -1,94 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.instruments.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instruments.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class CashFlowStatementServiceImpl internal constructor(private val clientOptions: ClientOptions) : - CashFlowStatementService { - - private val withRawResponse: CashFlowStatementService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): CashFlowStatementService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): CashFlowStatementService = - CashFlowStatementServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams, - requestOptions: RequestOptions, - ): CashFlowStatementGetInstrumentCashFlowStatementsResponse = - // get /v1/instruments/{instrument_id}/cash-flow-statements - withRawResponse().getInstrumentCashFlowStatements(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - CashFlowStatementService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): CashFlowStatementService.WithRawResponse = - CashFlowStatementServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentCashFlowStatementsHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getInstrumentCashFlowStatements( - params: CashFlowStatementGetInstrumentCashFlowStatementsParams, - requestOptions: RequestOptions, - ): 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), - "cash-flow-statements", - ) - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getInstrumentCashFlowStatementsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventService.kt deleted file mode 100644 index 341b63b7..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventService.kt +++ /dev/null @@ -1,190 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.events.EventGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetAllInstrumentEventsResponse -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface EventService { - - /** - * 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): EventService - - /** - * List instrument events across all securities. - * - * Retrieves all instrument events grouped by date. - */ - fun getAllInstrumentEvents(): EventGetAllInstrumentEventsResponse = - getAllInstrumentEvents(EventGetAllInstrumentEventsParams.none()) - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams = EventGetAllInstrumentEventsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): EventGetAllInstrumentEventsResponse - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams = EventGetAllInstrumentEventsParams.none() - ): EventGetAllInstrumentEventsResponse = getAllInstrumentEvents(params, RequestOptions.none()) - - /** @see getAllInstrumentEvents */ - fun getAllInstrumentEvents( - requestOptions: RequestOptions - ): EventGetAllInstrumentEventsResponse = - getAllInstrumentEvents(EventGetAllInstrumentEventsParams.none(), requestOptions) - - /** - * Retrieves corporate events (dividends, splits, etc.) for an instrument, grouped by event - * type. - * - * Date range defaults: - * - `from_date`: today - 365 days - * - `to_date`: today + 60 days - */ - fun getInstrumentEvents(instrumentId: String): EventGetInstrumentEventsResponse = - getInstrumentEvents(instrumentId, EventGetInstrumentEventsParams.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - params: EventGetInstrumentEventsParams = EventGetInstrumentEventsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): EventGetInstrumentEventsResponse = - getInstrumentEvents(params.toBuilder().instrumentId(instrumentId).build(), requestOptions) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - params: EventGetInstrumentEventsParams = EventGetInstrumentEventsParams.none(), - ): EventGetInstrumentEventsResponse = - getInstrumentEvents(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - params: EventGetInstrumentEventsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): EventGetInstrumentEventsResponse - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - params: EventGetInstrumentEventsParams - ): EventGetInstrumentEventsResponse = getInstrumentEvents(params, RequestOptions.none()) - - /** @see getInstrumentEvents */ - fun getInstrumentEvents( - instrumentId: String, - requestOptions: RequestOptions, - ): EventGetInstrumentEventsResponse = - getInstrumentEvents(instrumentId, EventGetInstrumentEventsParams.none(), requestOptions) - - /** A view of [EventService] 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): EventService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/events`, but is otherwise the same - * as [EventService.getAllInstrumentEvents]. - */ - @MustBeClosed - fun getAllInstrumentEvents(): HttpResponseFor = - getAllInstrumentEvents(EventGetAllInstrumentEventsParams.none()) - - /** @see getAllInstrumentEvents */ - @MustBeClosed - fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams = EventGetAllInstrumentEventsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getAllInstrumentEvents */ - @MustBeClosed - fun getAllInstrumentEvents( - params: EventGetAllInstrumentEventsParams = EventGetAllInstrumentEventsParams.none() - ): HttpResponseFor = - getAllInstrumentEvents(params, RequestOptions.none()) - - /** @see getAllInstrumentEvents */ - @MustBeClosed - fun getAllInstrumentEvents( - requestOptions: RequestOptions - ): HttpResponseFor = - getAllInstrumentEvents(EventGetAllInstrumentEventsParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/events`, but is - * otherwise the same as [EventService.getInstrumentEvents]. - */ - @MustBeClosed - fun getInstrumentEvents( - instrumentId: String - ): HttpResponseFor = - getInstrumentEvents(instrumentId, EventGetInstrumentEventsParams.none()) - - /** @see getInstrumentEvents */ - @MustBeClosed - fun getInstrumentEvents( - instrumentId: String, - params: EventGetInstrumentEventsParams = EventGetInstrumentEventsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getInstrumentEvents( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentEvents */ - @MustBeClosed - fun getInstrumentEvents( - instrumentId: String, - params: EventGetInstrumentEventsParams = EventGetInstrumentEventsParams.none(), - ): HttpResponseFor = - getInstrumentEvents(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentEvents */ - @MustBeClosed - fun getInstrumentEvents( - params: EventGetInstrumentEventsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getInstrumentEvents */ - @MustBeClosed - fun getInstrumentEvents( - params: EventGetInstrumentEventsParams - ): HttpResponseFor = - getInstrumentEvents(params, RequestOptions.none()) - - /** @see getInstrumentEvents */ - @MustBeClosed - fun getInstrumentEvents( - instrumentId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = - getInstrumentEvents(instrumentId, EventGetInstrumentEventsParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalService.kt deleted file mode 100644 index 9c768665..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalService.kt +++ /dev/null @@ -1,152 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.fundamentals.FundamentalGetInstrumentFundamentalsParams -import com.clear_street.api.models.v1.instruments.fundamentals.FundamentalGetInstrumentFundamentalsResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface FundamentalService { - - /** - * 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): FundamentalService - - /** Retrieves supplemental fundamentals and company profile data for an instrument. */ - fun getInstrumentFundamentals( - instrumentId: String - ): FundamentalGetInstrumentFundamentalsResponse = - getInstrumentFundamentals(instrumentId, FundamentalGetInstrumentFundamentalsParams.none()) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - params: FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): FundamentalGetInstrumentFundamentalsResponse = - getInstrumentFundamentals( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - params: FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams.none(), - ): FundamentalGetInstrumentFundamentalsResponse = - getInstrumentFundamentals(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): FundamentalGetInstrumentFundamentalsResponse - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams - ): FundamentalGetInstrumentFundamentalsResponse = - getInstrumentFundamentals(params, RequestOptions.none()) - - /** @see getInstrumentFundamentals */ - fun getInstrumentFundamentals( - instrumentId: String, - requestOptions: RequestOptions, - ): FundamentalGetInstrumentFundamentalsResponse = - getInstrumentFundamentals( - instrumentId, - FundamentalGetInstrumentFundamentalsParams.none(), - requestOptions, - ) - - /** - * A view of [FundamentalService] 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 - ): FundamentalService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/fundamentals`, but - * is otherwise the same as [FundamentalService.getInstrumentFundamentals]. - */ - @MustBeClosed - fun getInstrumentFundamentals( - instrumentId: String - ): HttpResponseFor = - getInstrumentFundamentals( - instrumentId, - FundamentalGetInstrumentFundamentalsParams.none(), - ) - - /** @see getInstrumentFundamentals */ - @MustBeClosed - fun getInstrumentFundamentals( - instrumentId: String, - params: FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getInstrumentFundamentals( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentFundamentals */ - @MustBeClosed - fun getInstrumentFundamentals( - instrumentId: String, - params: FundamentalGetInstrumentFundamentalsParams = - FundamentalGetInstrumentFundamentalsParams.none(), - ): HttpResponseFor = - getInstrumentFundamentals(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentFundamentals */ - @MustBeClosed - fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getInstrumentFundamentals */ - @MustBeClosed - fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams - ): HttpResponseFor = - getInstrumentFundamentals(params, RequestOptions.none()) - - /** @see getInstrumentFundamentals */ - @MustBeClosed - fun getInstrumentFundamentals( - instrumentId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = - getInstrumentFundamentals( - instrumentId, - FundamentalGetInstrumentFundamentalsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalServiceImpl.kt deleted file mode 100644 index 65994298..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalServiceImpl.kt +++ /dev/null @@ -1,87 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.instruments.fundamentals.FundamentalGetInstrumentFundamentalsParams -import com.clear_street.api.models.v1.instruments.fundamentals.FundamentalGetInstrumentFundamentalsResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class FundamentalServiceImpl internal constructor(private val clientOptions: ClientOptions) : - FundamentalService { - - private val withRawResponse: FundamentalService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): FundamentalService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): FundamentalService = - FundamentalServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams, - requestOptions: RequestOptions, - ): FundamentalGetInstrumentFundamentalsResponse = - // get /v1/instruments/{instrument_id}/fundamentals - withRawResponse().getInstrumentFundamentals(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - FundamentalService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): FundamentalService.WithRawResponse = - FundamentalServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentFundamentalsHandler: - Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getInstrumentFundamentals( - params: FundamentalGetInstrumentFundamentalsParams, - requestOptions: RequestOptions, - ): 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), "fundamentals") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getInstrumentFundamentalsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementService.kt deleted file mode 100644 index 78e18878..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementService.kt +++ /dev/null @@ -1,163 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.incomestatements.IncomeStatementGetInstrumentIncomeStatementsParams -import com.clear_street.api.models.v1.instruments.incomestatements.IncomeStatementGetInstrumentIncomeStatementsResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface IncomeStatementService { - - /** - * 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): IncomeStatementService - - /** - * Retrieves quarterly income 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 getInstrumentIncomeStatements( - instrumentId: String - ): IncomeStatementGetInstrumentIncomeStatementsResponse = - getInstrumentIncomeStatements( - instrumentId, - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - ) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - params: IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): IncomeStatementGetInstrumentIncomeStatementsResponse = - getInstrumentIncomeStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - params: IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - ): IncomeStatementGetInstrumentIncomeStatementsResponse = - getInstrumentIncomeStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): IncomeStatementGetInstrumentIncomeStatementsResponse - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams - ): IncomeStatementGetInstrumentIncomeStatementsResponse = - getInstrumentIncomeStatements(params, RequestOptions.none()) - - /** @see getInstrumentIncomeStatements */ - fun getInstrumentIncomeStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): IncomeStatementGetInstrumentIncomeStatementsResponse = - getInstrumentIncomeStatements( - instrumentId, - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - requestOptions, - ) - - /** - * A view of [IncomeStatementService] 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 - ): IncomeStatementService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/income-statements`, - * but is otherwise the same as [IncomeStatementService.getInstrumentIncomeStatements]. - */ - @MustBeClosed - fun getInstrumentIncomeStatements( - instrumentId: String - ): HttpResponseFor = - getInstrumentIncomeStatements( - instrumentId, - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - ) - - /** @see getInstrumentIncomeStatements */ - @MustBeClosed - fun getInstrumentIncomeStatements( - instrumentId: String, - params: IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getInstrumentIncomeStatements( - params.toBuilder().instrumentId(instrumentId).build(), - requestOptions, - ) - - /** @see getInstrumentIncomeStatements */ - @MustBeClosed - fun getInstrumentIncomeStatements( - instrumentId: String, - params: IncomeStatementGetInstrumentIncomeStatementsParams = - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - ): HttpResponseFor = - getInstrumentIncomeStatements(instrumentId, params, RequestOptions.none()) - - /** @see getInstrumentIncomeStatements */ - @MustBeClosed - fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getInstrumentIncomeStatements */ - @MustBeClosed - fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams - ): HttpResponseFor = - getInstrumentIncomeStatements(params, RequestOptions.none()) - - /** @see getInstrumentIncomeStatements */ - @MustBeClosed - fun getInstrumentIncomeStatements( - instrumentId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = - getInstrumentIncomeStatements( - instrumentId, - IncomeStatementGetInstrumentIncomeStatementsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementServiceImpl.kt deleted file mode 100644 index 3760b37d..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementServiceImpl.kt +++ /dev/null @@ -1,89 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.instruments.incomestatements.IncomeStatementGetInstrumentIncomeStatementsParams -import com.clear_street.api.models.v1.instruments.incomestatements.IncomeStatementGetInstrumentIncomeStatementsResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Retrieve details and lists of tradable instruments. */ -class IncomeStatementServiceImpl internal constructor(private val clientOptions: ClientOptions) : - IncomeStatementService { - - private val withRawResponse: IncomeStatementService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): IncomeStatementService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): IncomeStatementService = - IncomeStatementServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams, - requestOptions: RequestOptions, - ): IncomeStatementGetInstrumentIncomeStatementsResponse = - // get /v1/instruments/{instrument_id}/income-statements - withRawResponse().getInstrumentIncomeStatements(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - IncomeStatementService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): IncomeStatementService.WithRawResponse = - IncomeStatementServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getInstrumentIncomeStatementsHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getInstrumentIncomeStatements( - params: IncomeStatementGetInstrumentIncomeStatementsParams, - requestOptions: RequestOptions, - ): 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), "income-statements") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getInstrumentIncomeStatementsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionService.kt deleted file mode 100644 index 2cc26c19..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionService.kt +++ /dev/null @@ -1,91 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.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.options.OptionGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.options.OptionGetOptionContractsResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -interface OptionService { - - /** - * 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): OptionService - - /** - * List options contracts. - * - * Returns options contracts for a given underlier with options-specific metadata. Exactly one - * underlier identifier must be provided. - */ - fun getOptionContracts(): OptionGetOptionContractsResponse = - getOptionContracts(OptionGetOptionContractsParams.none()) - - /** @see getOptionContracts */ - fun getOptionContracts( - params: OptionGetOptionContractsParams = OptionGetOptionContractsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): OptionGetOptionContractsResponse - - /** @see getOptionContracts */ - fun getOptionContracts( - params: OptionGetOptionContractsParams = OptionGetOptionContractsParams.none() - ): OptionGetOptionContractsResponse = getOptionContracts(params, RequestOptions.none()) - - /** @see getOptionContracts */ - fun getOptionContracts(requestOptions: RequestOptions): OptionGetOptionContractsResponse = - getOptionContracts(OptionGetOptionContractsParams.none(), requestOptions) - - /** A view of [OptionService] 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): OptionService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/instruments/options/contracts`, but is otherwise - * the same as [OptionService.getOptionContracts]. - */ - @MustBeClosed - fun getOptionContracts(): HttpResponseFor = - getOptionContracts(OptionGetOptionContractsParams.none()) - - /** @see getOptionContracts */ - @MustBeClosed - fun getOptionContracts( - params: OptionGetOptionContractsParams = OptionGetOptionContractsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getOptionContracts */ - @MustBeClosed - fun getOptionContracts( - params: OptionGetOptionContractsParams = OptionGetOptionContractsParams.none() - ): HttpResponseFor = - getOptionContracts(params, RequestOptions.none()) - - /** @see getOptionContracts */ - @MustBeClosed - fun getOptionContracts( - requestOptions: RequestOptions - ): HttpResponseFor = - getOptionContracts(OptionGetOptionContractsParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionServiceImpl.kt deleted file mode 100644 index befb4040..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionServiceImpl.kt +++ /dev/null @@ -1,81 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.instruments - -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.prepare -import com.clear_street.api.models.v1.instruments.options.OptionGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.options.OptionGetOptionContractsResponse -import java.util.function.Consumer - -/** Retrieve details and lists of tradable instruments. */ -class OptionServiceImpl internal constructor(private val clientOptions: ClientOptions) : - OptionService { - - private val withRawResponse: OptionService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): OptionService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): OptionService = - OptionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getOptionContracts( - params: OptionGetOptionContractsParams, - requestOptions: RequestOptions, - ): OptionGetOptionContractsResponse = - // get /v1/instruments/options/contracts - withRawResponse().getOptionContracts(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - OptionService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): OptionService.WithRawResponse = - OptionServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getOptionContractsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getOptionContracts( - params: OptionGetOptionContractsParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "instruments", "options", "contracts") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getOptionContractsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryService.kt deleted file mode 100644 index 283552a6..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryService.kt +++ /dev/null @@ -1,83 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.marketdata - -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.marketdata.dailysummary.DailySummaryGetDailySummariesParams -import com.clear_street.api.models.v1.marketdata.dailysummary.DailySummaryGetDailySummariesResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Real-time market data snapshots. */ -interface DailySummaryService { - - /** - * 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): DailySummaryService - - /** - * Returns the most recent OHLV and current price for the requested OEMS instruments. Backed by - * the in-memory Polygon snapshot cache. - * - * Response contract: every request returns one row per **unique** `instrument_id`, in - * first-seen request order. Unresolvable IDs come back with `symbol = null` and every - * market-data field `null`; resolvable IDs with no cache entry come back with `symbol` - * populated but market-data fields `null`. - * - * **Note (temporary):** ID resolution currently goes through the supplemental screener (OEMS - * instrument_id → FMP fmp_symbol → metadata_id → realtime cache). Removed when the market-data - * service serves daily aggregates directly, or when Polygon symbology is loaded into the - * instrument cache. - */ - fun getDailySummaries( - params: DailySummaryGetDailySummariesParams - ): DailySummaryGetDailySummariesResponse = getDailySummaries(params, RequestOptions.none()) - - /** @see getDailySummaries */ - fun getDailySummaries( - params: DailySummaryGetDailySummariesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): DailySummaryGetDailySummariesResponse - - /** - * A view of [DailySummaryService] 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 - ): DailySummaryService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/market-data/daily-summary`, but is otherwise the - * same as [DailySummaryService.getDailySummaries]. - */ - @MustBeClosed - fun getDailySummaries( - params: DailySummaryGetDailySummariesParams - ): HttpResponseFor = - getDailySummaries(params, RequestOptions.none()) - - /** @see getDailySummaries */ - @MustBeClosed - fun getDailySummaries( - params: DailySummaryGetDailySummariesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryServiceImpl.kt deleted file mode 100644 index dc116999..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryServiceImpl.kt +++ /dev/null @@ -1,81 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.marketdata - -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.prepare -import com.clear_street.api.models.v1.marketdata.dailysummary.DailySummaryGetDailySummariesParams -import com.clear_street.api.models.v1.marketdata.dailysummary.DailySummaryGetDailySummariesResponse -import java.util.function.Consumer - -/** Real-time market data snapshots. */ -class DailySummaryServiceImpl internal constructor(private val clientOptions: ClientOptions) : - DailySummaryService { - - private val withRawResponse: DailySummaryService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): DailySummaryService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): DailySummaryService = - DailySummaryServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getDailySummaries( - params: DailySummaryGetDailySummariesParams, - requestOptions: RequestOptions, - ): DailySummaryGetDailySummariesResponse = - // get /v1/market-data/daily-summary - withRawResponse().getDailySummaries(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - DailySummaryService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): DailySummaryService.WithRawResponse = - DailySummaryServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getDailySummariesHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getDailySummaries( - params: DailySummaryGetDailySummariesParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "market-data", "daily-summary") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getDailySummariesHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotService.kt deleted file mode 100644 index 16ae3cb2..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotService.kt +++ /dev/null @@ -1,86 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.marketdata - -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.marketdata.snapshot.SnapshotGetSnapshotsParams -import com.clear_street.api.models.v1.marketdata.snapshot.SnapshotGetSnapshotsResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Real-time market data snapshots. */ -interface SnapshotService { - - /** - * 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): SnapshotService - - /** Get market data snapshots for one or more securities. */ - fun getSnapshots(): SnapshotGetSnapshotsResponse = - getSnapshots(SnapshotGetSnapshotsParams.none()) - - /** @see getSnapshots */ - fun getSnapshots( - params: SnapshotGetSnapshotsParams = SnapshotGetSnapshotsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): SnapshotGetSnapshotsResponse - - /** @see getSnapshots */ - fun getSnapshots( - params: SnapshotGetSnapshotsParams = SnapshotGetSnapshotsParams.none() - ): SnapshotGetSnapshotsResponse = getSnapshots(params, RequestOptions.none()) - - /** @see getSnapshots */ - fun getSnapshots(requestOptions: RequestOptions): SnapshotGetSnapshotsResponse = - getSnapshots(SnapshotGetSnapshotsParams.none(), requestOptions) - - /** A view of [SnapshotService] 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): SnapshotService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/market-data/snapshot`, but is otherwise the same - * as [SnapshotService.getSnapshots]. - */ - @MustBeClosed - fun getSnapshots(): HttpResponseFor = - getSnapshots(SnapshotGetSnapshotsParams.none()) - - /** @see getSnapshots */ - @MustBeClosed - fun getSnapshots( - params: SnapshotGetSnapshotsParams = SnapshotGetSnapshotsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getSnapshots */ - @MustBeClosed - fun getSnapshots( - params: SnapshotGetSnapshotsParams = SnapshotGetSnapshotsParams.none() - ): HttpResponseFor = - getSnapshots(params, RequestOptions.none()) - - /** @see getSnapshots */ - @MustBeClosed - fun getSnapshots( - requestOptions: RequestOptions - ): HttpResponseFor = - getSnapshots(SnapshotGetSnapshotsParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotServiceImpl.kt deleted file mode 100644 index da0d3cb3..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotServiceImpl.kt +++ /dev/null @@ -1,81 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.marketdata - -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.prepare -import com.clear_street.api.models.v1.marketdata.snapshot.SnapshotGetSnapshotsParams -import com.clear_street.api.models.v1.marketdata.snapshot.SnapshotGetSnapshotsResponse -import java.util.function.Consumer - -/** Real-time market data snapshots. */ -class SnapshotServiceImpl internal constructor(private val clientOptions: ClientOptions) : - SnapshotService { - - private val withRawResponse: SnapshotService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): SnapshotService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): SnapshotService = - SnapshotServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getSnapshots( - params: SnapshotGetSnapshotsParams, - requestOptions: RequestOptions, - ): SnapshotGetSnapshotsResponse = - // get /v1/market-data/snapshot - withRawResponse().getSnapshots(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - SnapshotService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): SnapshotService.WithRawResponse = - SnapshotServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getSnapshotsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getSnapshots( - params: SnapshotGetSnapshotsParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "market-data", "snapshot") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getSnapshotsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementService.kt deleted file mode 100644 index e22f4b57..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementService.kt +++ /dev/null @@ -1,110 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.omniai - -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.omniai.entitlementagreements.EntitlementAgreementGetEntitlementAgreementsParams -import com.clear_street.api.models.v1.omniai.entitlementagreements.EntitlementAgreementGetEntitlementAgreementsResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** - * Thread-centric AI assistant for conversational trading. Create threads to start conversations, - * poll response objects for in-progress output, and read finalized messages from thread history. - * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. - */ -interface EntitlementAgreementService { - - /** - * 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): EntitlementAgreementService - - /** List current signable entitlement agreements for consent UX. */ - fun getEntitlementAgreements(): EntitlementAgreementGetEntitlementAgreementsResponse = - getEntitlementAgreements(EntitlementAgreementGetEntitlementAgreementsParams.none()) - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): EntitlementAgreementGetEntitlementAgreementsResponse - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams.none() - ): EntitlementAgreementGetEntitlementAgreementsResponse = - getEntitlementAgreements(params, RequestOptions.none()) - - /** @see getEntitlementAgreements */ - fun getEntitlementAgreements( - requestOptions: RequestOptions - ): EntitlementAgreementGetEntitlementAgreementsResponse = - getEntitlementAgreements( - EntitlementAgreementGetEntitlementAgreementsParams.none(), - requestOptions, - ) - - /** - * A view of [EntitlementAgreementService] 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 - ): EntitlementAgreementService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/omni-ai/entitlement-agreements`, but is - * otherwise the same as [EntitlementAgreementService.getEntitlementAgreements]. - */ - @MustBeClosed - fun getEntitlementAgreements(): - HttpResponseFor = - getEntitlementAgreements(EntitlementAgreementGetEntitlementAgreementsParams.none()) - - /** @see getEntitlementAgreements */ - @MustBeClosed - fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getEntitlementAgreements */ - @MustBeClosed - fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams = - EntitlementAgreementGetEntitlementAgreementsParams.none() - ): HttpResponseFor = - getEntitlementAgreements(params, RequestOptions.none()) - - /** @see getEntitlementAgreements */ - @MustBeClosed - fun getEntitlementAgreements( - requestOptions: RequestOptions - ): HttpResponseFor = - getEntitlementAgreements( - EntitlementAgreementGetEntitlementAgreementsParams.none(), - requestOptions, - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementServiceImpl.kt deleted file mode 100644 index a3e9105b..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementServiceImpl.kt +++ /dev/null @@ -1,91 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.omniai - -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.prepare -import com.clear_street.api.models.v1.omniai.entitlementagreements.EntitlementAgreementGetEntitlementAgreementsParams -import com.clear_street.api.models.v1.omniai.entitlementagreements.EntitlementAgreementGetEntitlementAgreementsResponse -import java.util.function.Consumer - -/** - * Thread-centric AI assistant for conversational trading. Create threads to start conversations, - * poll response objects for in-progress output, and read finalized messages from thread history. - * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. - */ -class EntitlementAgreementServiceImpl -internal constructor(private val clientOptions: ClientOptions) : EntitlementAgreementService { - - private val withRawResponse: EntitlementAgreementService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): EntitlementAgreementService.WithRawResponse = withRawResponse - - override fun withOptions( - modifier: Consumer - ): EntitlementAgreementService = - EntitlementAgreementServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams, - requestOptions: RequestOptions, - ): EntitlementAgreementGetEntitlementAgreementsResponse = - // get /v1/omni-ai/entitlement-agreements - withRawResponse().getEntitlementAgreements(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - EntitlementAgreementService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): EntitlementAgreementService.WithRawResponse = - EntitlementAgreementServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val getEntitlementAgreementsHandler: - Handler = - jsonHandler( - clientOptions.jsonMapper - ) - - override fun getEntitlementAgreements( - params: EntitlementAgreementGetEntitlementAgreementsParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "omni-ai", "entitlement-agreements") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getEntitlementAgreementsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt index 0e826798..145dd68e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt @@ -9,6 +9,8 @@ import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntit import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse import com.google.errorprone.annotations.MustBeClosed @@ -82,6 +84,30 @@ interface EntitlementService { ): EntitlementDeleteEntitlementResponse = deleteEntitlement(entitlementId, EntitlementDeleteEntitlementParams.none(), requestOptions) + /** List current signable entitlement agreements for consent UX. */ + fun getEntitlementAgreements(): EntitlementGetEntitlementAgreementsResponse = + getEntitlementAgreements(EntitlementGetEntitlementAgreementsParams.none()) + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): EntitlementGetEntitlementAgreementsResponse + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams.none() + ): EntitlementGetEntitlementAgreementsResponse = + getEntitlementAgreements(params, RequestOptions.none()) + + /** @see getEntitlementAgreements */ + fun getEntitlementAgreements( + requestOptions: RequestOptions + ): EntitlementGetEntitlementAgreementsResponse = + getEntitlementAgreements(EntitlementGetEntitlementAgreementsParams.none(), requestOptions) + /** List caller's active entitlement grants. */ fun getEntitlements(): EntitlementGetEntitlementsResponse = getEntitlements(EntitlementGetEntitlementsParams.none()) @@ -188,6 +214,41 @@ interface EntitlementService { requestOptions, ) + /** + * Returns a raw HTTP response for `get /v1/omni-ai/entitlement-agreements`, but is + * otherwise the same as [EntitlementService.getEntitlementAgreements]. + */ + @MustBeClosed + fun getEntitlementAgreements(): + HttpResponseFor = + getEntitlementAgreements(EntitlementGetEntitlementAgreementsParams.none()) + + /** @see getEntitlementAgreements */ + @MustBeClosed + fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getEntitlementAgreements */ + @MustBeClosed + fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams = + EntitlementGetEntitlementAgreementsParams.none() + ): HttpResponseFor = + getEntitlementAgreements(params, RequestOptions.none()) + + /** @see getEntitlementAgreements */ + @MustBeClosed + fun getEntitlementAgreements( + requestOptions: RequestOptions + ): HttpResponseFor = + getEntitlementAgreements( + EntitlementGetEntitlementAgreementsParams.none(), + requestOptions, + ) + /** * Returns a raw HTTP response for `get /v1/omni-ai/entitlements`, but is otherwise the same * as [EntitlementService.getEntitlements]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt index 62cb0974..77a70643 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt @@ -20,6 +20,8 @@ import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntit import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse import java.util.function.Consumer @@ -57,6 +59,13 @@ class EntitlementServiceImpl internal constructor(private val clientOptions: Cli // delete /v1/omni-ai/entitlements/{entitlement_id} withRawResponse().deleteEntitlement(params, requestOptions).parse() + override fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams, + requestOptions: RequestOptions, + ): EntitlementGetEntitlementAgreementsResponse = + // get /v1/omni-ai/entitlement-agreements + withRawResponse().getEntitlementAgreements(params, requestOptions).parse() + override fun getEntitlements( params: EntitlementGetEntitlementsParams, requestOptions: RequestOptions, @@ -136,6 +145,34 @@ class EntitlementServiceImpl internal constructor(private val clientOptions: Cli } } + private val getEntitlementAgreementsHandler: + Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getEntitlementAgreements( + params: EntitlementGetEntitlementAgreementsParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "omni-ai", "entitlement-agreements") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getEntitlementAgreementsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val getEntitlementsHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt index f22bbd34..168d164c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt @@ -5,15 +5,18 @@ package com.clear_street.api.services.blocking.v1.omniai 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.omniai.threads.ThreadCreateMessageParams +import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse -import com.clear_street.api.services.blocking.v1.omniai.threads.MessageService import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer @@ -38,12 +41,38 @@ interface ThreadService { fun withOptions(modifier: Consumer): ThreadService /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages from - * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * Continue an existing conversation thread. + * + * Appends a new user message to the thread and starts an assistant response. Only one response + * may be active per thread at a time — if the previous turn is still in progress, this endpoint + * returns **409 Conflict**. Wait for the active response to reach a terminal status before + * submitting the next turn. + * + * Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for assistant + * output. */ - fun messages(): MessageService + fun createMessage( + threadId: String, + params: ThreadCreateMessageParams, + ): ThreadCreateMessageResponse = createMessage(threadId, params, RequestOptions.none()) + + /** @see createMessage */ + fun createMessage( + threadId: String, + params: ThreadCreateMessageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ThreadCreateMessageResponse = + createMessage(params.toBuilder().threadId(threadId).build(), requestOptions) + + /** @see createMessage */ + fun createMessage(params: ThreadCreateMessageParams): ThreadCreateMessageResponse = + createMessage(params, RequestOptions.none()) + + /** @see createMessage */ + fun createMessage( + params: ThreadCreateMessageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ThreadCreateMessageResponse /** * Create a new conversation thread. @@ -65,6 +94,37 @@ interface ThreadService { requestOptions: RequestOptions = RequestOptions.none(), ): ThreadCreateThreadResponse + /** + * List finalized messages in a thread. + * + * Returns **finalized** messages in chronological order. Messages from in-progress assistant + * turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET + * /omni-ai/responses/{response_id}` for live output. + * + * If the last finalized message has role `USER`, an active response likely exists and should be + * polled separately. + */ + fun getMessages(threadId: String, params: ThreadGetMessagesParams): ThreadGetMessagesResponse = + getMessages(threadId, params, RequestOptions.none()) + + /** @see getMessages */ + fun getMessages( + threadId: String, + params: ThreadGetMessagesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ThreadGetMessagesResponse = + getMessages(params.toBuilder().threadId(threadId).build(), requestOptions) + + /** @see getMessages */ + fun getMessages(params: ThreadGetMessagesParams): ThreadGetMessagesResponse = + getMessages(params, RequestOptions.none()) + + /** @see getMessages */ + fun getMessages( + params: ThreadGetMessagesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ThreadGetMessagesResponse + /** * Get a specific thread. * @@ -153,12 +213,38 @@ interface ThreadService { fun withOptions(modifier: Consumer): ThreadService.WithRawResponse /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages - * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Returns a raw HTTP response for `post /v1/omni-ai/threads/{thread_id}/messages`, but is + * otherwise the same as [ThreadService.createMessage]. */ - fun messages(): MessageService.WithRawResponse + @MustBeClosed + fun createMessage( + threadId: String, + params: ThreadCreateMessageParams, + ): HttpResponseFor = + createMessage(threadId, params, RequestOptions.none()) + + /** @see createMessage */ + @MustBeClosed + fun createMessage( + threadId: String, + params: ThreadCreateMessageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + createMessage(params.toBuilder().threadId(threadId).build(), requestOptions) + + /** @see createMessage */ + @MustBeClosed + fun createMessage( + params: ThreadCreateMessageParams + ): HttpResponseFor = + createMessage(params, RequestOptions.none()) + + /** @see createMessage */ + @MustBeClosed + fun createMessage( + params: ThreadCreateMessageParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor /** * Returns a raw HTTP response for `post /v1/omni-ai/threads`, but is otherwise the same as @@ -176,6 +262,39 @@ interface ThreadService { requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + /** + * Returns a raw HTTP response for `get /v1/omni-ai/threads/{thread_id}/messages`, but is + * otherwise the same as [ThreadService.getMessages]. + */ + @MustBeClosed + fun getMessages( + threadId: String, + params: ThreadGetMessagesParams, + ): HttpResponseFor = + getMessages(threadId, params, RequestOptions.none()) + + /** @see getMessages */ + @MustBeClosed + fun getMessages( + threadId: String, + params: ThreadGetMessagesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getMessages(params.toBuilder().threadId(threadId).build(), requestOptions) + + /** @see getMessages */ + @MustBeClosed + fun getMessages( + params: ThreadGetMessagesParams + ): HttpResponseFor = getMessages(params, RequestOptions.none()) + + /** @see getMessages */ + @MustBeClosed + fun getMessages( + params: ThreadGetMessagesParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + /** * Returns a raw HTTP response for `get /v1/omni-ai/threads/{thread_id}`, but is otherwise * the same as [ThreadService.getThreadById]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt index 6a26fb08..44f03356 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt @@ -16,16 +16,18 @@ 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.prepare +import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageParams +import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse -import com.clear_street.api.services.blocking.v1.omniai.threads.MessageService -import com.clear_street.api.services.blocking.v1.omniai.threads.MessageServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -42,20 +44,17 @@ class ThreadServiceImpl internal constructor(private val clientOptions: ClientOp WithRawResponseImpl(clientOptions) } - private val messages: MessageService by lazy { MessageServiceImpl(clientOptions) } - override fun withRawResponse(): ThreadService.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): ThreadService = ThreadServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages from - * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. - */ - override fun messages(): MessageService = messages + override fun createMessage( + params: ThreadCreateMessageParams, + requestOptions: RequestOptions, + ): ThreadCreateMessageResponse = + // post /v1/omni-ai/threads/{thread_id}/messages + withRawResponse().createMessage(params, requestOptions).parse() override fun createThread( params: ThreadCreateThreadParams, @@ -64,6 +63,13 @@ class ThreadServiceImpl internal constructor(private val clientOptions: ClientOp // post /v1/omni-ai/threads withRawResponse().createThread(params, requestOptions).parse() + override fun getMessages( + params: ThreadGetMessagesParams, + requestOptions: RequestOptions, + ): ThreadGetMessagesResponse = + // get /v1/omni-ai/threads/{thread_id}/messages + withRawResponse().getMessages(params, requestOptions).parse() + override fun getThreadById( params: ThreadGetThreadByIdParams, requestOptions: RequestOptions, @@ -91,10 +97,6 @@ class ThreadServiceImpl internal constructor(private val clientOptions: ClientOp private val errorHandler: Handler = errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - private val messages: MessageService.WithRawResponse by lazy { - MessageServiceImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): ThreadService.WithRawResponse = @@ -102,13 +104,36 @@ class ThreadServiceImpl internal constructor(private val clientOptions: ClientOp clientOptions.toBuilder().apply(modifier::accept).build() ) - /** - * Thread-centric AI assistant for conversational trading. Create threads to start - * conversations, poll response objects for in-progress output, and read finalized messages - * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. - */ - override fun messages(): MessageService.WithRawResponse = messages + private val createMessageHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun createMessage( + params: ThreadCreateMessageParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("threadId", params.threadId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "omni-ai", "threads", params._pathParam(0), "messages") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createMessageHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } private val createThreadHandler: Handler = jsonHandler(clientOptions.jsonMapper) @@ -138,6 +163,36 @@ class ThreadServiceImpl internal constructor(private val clientOptions: ClientOp } } + private val getMessagesHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getMessages( + params: ThreadGetMessagesParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("threadId", params.threadId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "omni-ai", "threads", params._pathParam(0), "messages") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getMessagesHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val getThreadByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageService.kt deleted file mode 100644 index 40283951..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageService.kt +++ /dev/null @@ -1,179 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.omniai.threads - -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.omniai.threads.messages.MessageCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageCreateMessageResponse -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** - * Thread-centric AI assistant for conversational trading. Create threads to start conversations, - * poll response objects for in-progress output, and read finalized messages from thread history. - * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. - */ -interface MessageService { - - /** - * 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): MessageService - - /** - * Continue an existing conversation thread. - * - * Appends a new user message to the thread and starts an assistant response. Only one response - * may be active per thread at a time — if the previous turn is still in progress, this endpoint - * returns **409 Conflict**. Wait for the active response to reach a terminal status before - * submitting the next turn. - * - * Poll the returned `response_id` via `GET /omni-ai/responses/{response_id}` for assistant - * output. - */ - fun createMessage( - threadId: String, - params: MessageCreateMessageParams, - ): MessageCreateMessageResponse = createMessage(threadId, params, RequestOptions.none()) - - /** @see createMessage */ - fun createMessage( - threadId: String, - params: MessageCreateMessageParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): MessageCreateMessageResponse = - createMessage(params.toBuilder().threadId(threadId).build(), requestOptions) - - /** @see createMessage */ - fun createMessage(params: MessageCreateMessageParams): MessageCreateMessageResponse = - createMessage(params, RequestOptions.none()) - - /** @see createMessage */ - fun createMessage( - params: MessageCreateMessageParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): MessageCreateMessageResponse - - /** - * List finalized messages in a thread. - * - * Returns **finalized** messages in chronological order. Messages from in-progress assistant - * turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET - * /omni-ai/responses/{response_id}` for live output. - * - * If the last finalized message has role `USER`, an active response likely exists and should be - * polled separately. - */ - fun getMessages( - threadId: String, - params: MessageGetMessagesParams, - ): MessageGetMessagesResponse = getMessages(threadId, params, RequestOptions.none()) - - /** @see getMessages */ - fun getMessages( - threadId: String, - params: MessageGetMessagesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): MessageGetMessagesResponse = - getMessages(params.toBuilder().threadId(threadId).build(), requestOptions) - - /** @see getMessages */ - fun getMessages(params: MessageGetMessagesParams): MessageGetMessagesResponse = - getMessages(params, RequestOptions.none()) - - /** @see getMessages */ - fun getMessages( - params: MessageGetMessagesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): MessageGetMessagesResponse - - /** A view of [MessageService] 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): MessageService.WithRawResponse - - /** - * Returns a raw HTTP response for `post /v1/omni-ai/threads/{thread_id}/messages`, but is - * otherwise the same as [MessageService.createMessage]. - */ - @MustBeClosed - fun createMessage( - threadId: String, - params: MessageCreateMessageParams, - ): HttpResponseFor = - createMessage(threadId, params, RequestOptions.none()) - - /** @see createMessage */ - @MustBeClosed - fun createMessage( - threadId: String, - params: MessageCreateMessageParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - createMessage(params.toBuilder().threadId(threadId).build(), requestOptions) - - /** @see createMessage */ - @MustBeClosed - fun createMessage( - params: MessageCreateMessageParams - ): HttpResponseFor = - createMessage(params, RequestOptions.none()) - - /** @see createMessage */ - @MustBeClosed - fun createMessage( - params: MessageCreateMessageParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** - * Returns a raw HTTP response for `get /v1/omni-ai/threads/{thread_id}/messages`, but is - * otherwise the same as [MessageService.getMessages]. - */ - @MustBeClosed - fun getMessages( - threadId: String, - params: MessageGetMessagesParams, - ): HttpResponseFor = - getMessages(threadId, params, RequestOptions.none()) - - /** @see getMessages */ - @MustBeClosed - fun getMessages( - threadId: String, - params: MessageGetMessagesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getMessages(params.toBuilder().threadId(threadId).build(), requestOptions) - - /** @see getMessages */ - @MustBeClosed - fun getMessages( - params: MessageGetMessagesParams - ): HttpResponseFor = getMessages(params, RequestOptions.none()) - - /** @see getMessages */ - @MustBeClosed - fun getMessages( - params: MessageGetMessagesParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageServiceImpl.kt deleted file mode 100644 index 6426620c..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageServiceImpl.kt +++ /dev/null @@ -1,132 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.omniai.threads - -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.prepare -import com.clear_street.api.models.v1.omniai.threads.messages.MessageCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageCreateMessageResponse -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** - * Thread-centric AI assistant for conversational trading. Create threads to start conversations, - * poll response objects for in-progress output, and read finalized messages from thread history. - * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. - */ -class MessageServiceImpl internal constructor(private val clientOptions: ClientOptions) : - MessageService { - - private val withRawResponse: MessageService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): MessageService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): MessageService = - MessageServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun createMessage( - params: MessageCreateMessageParams, - requestOptions: RequestOptions, - ): MessageCreateMessageResponse = - // post /v1/omni-ai/threads/{thread_id}/messages - withRawResponse().createMessage(params, requestOptions).parse() - - override fun getMessages( - params: MessageGetMessagesParams, - requestOptions: RequestOptions, - ): MessageGetMessagesResponse = - // get /v1/omni-ai/threads/{thread_id}/messages - withRawResponse().getMessages(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - MessageService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): MessageService.WithRawResponse = - MessageServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val createMessageHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun createMessage( - params: MessageCreateMessageParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("threadId", params.threadId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "omni-ai", "threads", params._pathParam(0), "messages") - .body(json(clientOptions.jsonMapper, params._body())) - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { createMessageHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - - private val getMessagesHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun getMessages( - params: MessageGetMessagesParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("threadId", params.threadId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "omni-ai", "threads", params._pathParam(0), "messages") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getMessagesHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemService.kt deleted file mode 100644 index 34681f41..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemService.kt +++ /dev/null @@ -1,157 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.watchlists - -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.watchlists.items.ItemAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemAddWatchlistItemResponse -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemResponse -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Create and manage watchlists. */ -interface ItemService { - - /** - * 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): ItemService - - /** Add an instrument to a watchlist */ - fun addWatchlistItem( - watchlistId: String, - params: ItemAddWatchlistItemParams, - ): ItemAddWatchlistItemResponse = addWatchlistItem(watchlistId, params, RequestOptions.none()) - - /** @see addWatchlistItem */ - fun addWatchlistItem( - watchlistId: String, - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): ItemAddWatchlistItemResponse = - addWatchlistItem(params.toBuilder().watchlistId(watchlistId).build(), requestOptions) - - /** @see addWatchlistItem */ - fun addWatchlistItem(params: ItemAddWatchlistItemParams): ItemAddWatchlistItemResponse = - addWatchlistItem(params, RequestOptions.none()) - - /** @see addWatchlistItem */ - fun addWatchlistItem( - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): ItemAddWatchlistItemResponse - - /** Delete an instrument from a watchlist */ - fun deleteWatchlistItem( - itemId: String, - params: ItemDeleteWatchlistItemParams, - ): ItemDeleteWatchlistItemResponse = deleteWatchlistItem(itemId, params, RequestOptions.none()) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - itemId: String, - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): ItemDeleteWatchlistItemResponse = - deleteWatchlistItem(params.toBuilder().itemId(itemId).build(), requestOptions) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams - ): ItemDeleteWatchlistItemResponse = deleteWatchlistItem(params, RequestOptions.none()) - - /** @see deleteWatchlistItem */ - fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): ItemDeleteWatchlistItemResponse - - /** A view of [ItemService] 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): ItemService.WithRawResponse - - /** - * Returns a raw HTTP response for `post /v1/watchlists/{watchlist_id}/items`, but is - * otherwise the same as [ItemService.addWatchlistItem]. - */ - @MustBeClosed - fun addWatchlistItem( - watchlistId: String, - params: ItemAddWatchlistItemParams, - ): HttpResponseFor = - addWatchlistItem(watchlistId, params, RequestOptions.none()) - - /** @see addWatchlistItem */ - @MustBeClosed - fun addWatchlistItem( - watchlistId: String, - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - addWatchlistItem(params.toBuilder().watchlistId(watchlistId).build(), requestOptions) - - /** @see addWatchlistItem */ - @MustBeClosed - fun addWatchlistItem( - params: ItemAddWatchlistItemParams - ): HttpResponseFor = - addWatchlistItem(params, RequestOptions.none()) - - /** @see addWatchlistItem */ - @MustBeClosed - fun addWatchlistItem( - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** - * Returns a raw HTTP response for `delete /v1/watchlists/{watchlist_id}/items/{item_id}`, - * but is otherwise the same as [ItemService.deleteWatchlistItem]. - */ - @MustBeClosed - fun deleteWatchlistItem( - itemId: String, - params: ItemDeleteWatchlistItemParams, - ): HttpResponseFor = - deleteWatchlistItem(itemId, params, RequestOptions.none()) - - /** @see deleteWatchlistItem */ - @MustBeClosed - fun deleteWatchlistItem( - itemId: String, - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - deleteWatchlistItem(params.toBuilder().itemId(itemId).build(), requestOptions) - - /** @see deleteWatchlistItem */ - @MustBeClosed - fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams - ): HttpResponseFor = - deleteWatchlistItem(params, RequestOptions.none()) - - /** @see deleteWatchlistItem */ - @MustBeClosed - fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemServiceImpl.kt deleted file mode 100644 index e4e85dbf..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemServiceImpl.kt +++ /dev/null @@ -1,133 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.watchlists - -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.prepare -import com.clear_street.api.models.v1.watchlists.items.ItemAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemAddWatchlistItemResponse -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemResponse -import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull - -/** Create and manage watchlists. */ -class ItemServiceImpl internal constructor(private val clientOptions: ClientOptions) : ItemService { - - private val withRawResponse: ItemService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): ItemService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): ItemService = - ItemServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun addWatchlistItem( - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions, - ): ItemAddWatchlistItemResponse = - // post /v1/watchlists/{watchlist_id}/items - withRawResponse().addWatchlistItem(params, requestOptions).parse() - - override fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions, - ): ItemDeleteWatchlistItemResponse = - // delete /v1/watchlists/{watchlist_id}/items/{item_id} - withRawResponse().deleteWatchlistItem(params, requestOptions).parse() - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - ItemService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): ItemService.WithRawResponse = - ItemServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val addWatchlistItemHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun addWatchlistItem( - params: ItemAddWatchlistItemParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("watchlistId", params.watchlistId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "watchlists", params._pathParam(0), "items") - .body(json(clientOptions.jsonMapper, params._body())) - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { addWatchlistItemHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - - private val deleteWatchlistItemHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - override fun deleteWatchlistItem( - params: ItemDeleteWatchlistItemParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("itemId", params.itemId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.DELETE) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments( - "v1", - "watchlists", - params._pathParam(0), - "items", - params._pathParam(1), - ) - .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { deleteWatchlistItemHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/V1WebsocketHandlerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/V1WebsocketHandlerParamsTest.kt deleted file mode 100644 index f4e94bdf..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/V1WebsocketHandlerParamsTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1 - -import org.junit.jupiter.api.Test - -internal class V1WebsocketHandlerParamsTest { - - @Test - fun create() { - V1WebsocketHandlerParams.builder().build() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesSodTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSodTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesSodTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSodTest.kt index d6d33030..38f59854 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesSodTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSodTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesTest.kt index 38d6aacf..bda0f16d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/AccountBalancesTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt similarity index 75% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt index 681a5a35..44126153 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class BalanceGetAccountBalancesParamsTest { +internal class AccountGetAccountBalancesParamsTest { @Test fun create() { - BalanceGetAccountBalancesParams.builder() + AccountGetAccountBalancesParams.builder() .accountId(0L) .topMarginContributorsLimit(1) .build() @@ -18,7 +18,7 @@ internal class BalanceGetAccountBalancesParamsTest { @Test fun pathParams() { - val params = BalanceGetAccountBalancesParams.builder().accountId(0L).build() + val params = AccountGetAccountBalancesParams.builder().accountId(0L).build() assertThat(params._pathParam(0)).isEqualTo("0") // out-of-bound path param @@ -28,7 +28,7 @@ internal class BalanceGetAccountBalancesParamsTest { @Test fun queryParams() { val params = - BalanceGetAccountBalancesParams.builder() + AccountGetAccountBalancesParams.builder() .accountId(0L) .topMarginContributorsLimit(1) .build() @@ -41,7 +41,7 @@ internal class BalanceGetAccountBalancesParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = BalanceGetAccountBalancesParams.builder().accountId(0L).build() + val params = AccountGetAccountBalancesParams.builder().accountId(0L).build() val queryParams = params._queryParams() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt index 2bc9e976..78949cd8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/BalanceGetAccountBalancesResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -11,12 +11,12 @@ import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class BalanceGetAccountBalancesResponseTest { +internal class AccountGetAccountBalancesResponseTest { @Test fun create() { - val balanceGetAccountBalancesResponse = - BalanceGetAccountBalancesResponse.builder() + val accountGetAccountBalancesResponse = + AccountGetAccountBalancesResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -102,7 +102,7 @@ internal class BalanceGetAccountBalancesResponseTest { ) .build() - assertThat(balanceGetAccountBalancesResponse.metadata()) + assertThat(accountGetAccountBalancesResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -113,7 +113,7 @@ internal class BalanceGetAccountBalancesResponseTest { .totalPages(0) .build() ) - assertThat(balanceGetAccountBalancesResponse.error()) + assertThat(accountGetAccountBalancesResponse.error()) .contains( ApiError.builder() .code(400) @@ -125,7 +125,7 @@ internal class BalanceGetAccountBalancesResponseTest { ) .build() ) - assertThat(balanceGetAccountBalancesResponse.data()) + assertThat(accountGetAccountBalancesResponse.data()) .isEqualTo( AccountBalances.builder() .accountId(19816L) @@ -191,8 +191,8 @@ internal class BalanceGetAccountBalancesResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val balanceGetAccountBalancesResponse = - BalanceGetAccountBalancesResponse.builder() + val accountGetAccountBalancesResponse = + AccountGetAccountBalancesResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -278,13 +278,13 @@ internal class BalanceGetAccountBalancesResponseTest { ) .build() - val roundtrippedBalanceGetAccountBalancesResponse = + val roundtrippedAccountGetAccountBalancesResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(balanceGetAccountBalancesResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(accountGetAccountBalancesResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedBalanceGetAccountBalancesResponse) - .isEqualTo(balanceGetAccountBalancesResponse) + assertThat(roundtrippedAccountGetAccountBalancesResponse) + .isEqualTo(accountGetAccountBalancesResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt index 134d9f69..b8b66eab 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.portfoliohistory +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.http.QueryParams import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class PortfolioHistoryGetPortfolioHistoryParamsTest { +internal class AccountGetPortfolioHistoryParamsTest { @Test fun create() { - PortfolioHistoryGetPortfolioHistoryParams.builder() + AccountGetPortfolioHistoryParams.builder() .accountId(0L) .startDate(LocalDate.parse("2019-12-27")) .endDate(LocalDate.parse("2019-12-27")) @@ -21,7 +21,7 @@ internal class PortfolioHistoryGetPortfolioHistoryParamsTest { @Test fun pathParams() { val params = - PortfolioHistoryGetPortfolioHistoryParams.builder() + AccountGetPortfolioHistoryParams.builder() .accountId(0L) .startDate(LocalDate.parse("2019-12-27")) .build() @@ -34,7 +34,7 @@ internal class PortfolioHistoryGetPortfolioHistoryParamsTest { @Test fun queryParams() { val params = - PortfolioHistoryGetPortfolioHistoryParams.builder() + AccountGetPortfolioHistoryParams.builder() .accountId(0L) .startDate(LocalDate.parse("2019-12-27")) .endDate(LocalDate.parse("2019-12-27")) @@ -54,7 +54,7 @@ internal class PortfolioHistoryGetPortfolioHistoryParamsTest { @Test fun queryParamsWithoutOptionalFields() { val params = - PortfolioHistoryGetPortfolioHistoryParams.builder() + AccountGetPortfolioHistoryParams.builder() .accountId(0L) .startDate(LocalDate.parse("2019-12-27")) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt index 134f5578..ab9fc4b3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryGetPortfolioHistoryResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.portfoliohistory +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -11,12 +11,12 @@ import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class PortfolioHistoryGetPortfolioHistoryResponseTest { +internal class AccountGetPortfolioHistoryResponseTest { @Test fun create() { - val portfolioHistoryGetPortfolioHistoryResponse = - PortfolioHistoryGetPortfolioHistoryResponse.builder() + val accountGetPortfolioHistoryResponse = + AccountGetPortfolioHistoryResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -58,7 +58,7 @@ internal class PortfolioHistoryGetPortfolioHistoryResponseTest { ) .build() - assertThat(portfolioHistoryGetPortfolioHistoryResponse.metadata()) + assertThat(accountGetPortfolioHistoryResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -69,7 +69,7 @@ internal class PortfolioHistoryGetPortfolioHistoryResponseTest { .totalPages(0) .build() ) - assertThat(portfolioHistoryGetPortfolioHistoryResponse.error()) + assertThat(accountGetPortfolioHistoryResponse.error()) .contains( ApiError.builder() .code(400) @@ -81,7 +81,7 @@ internal class PortfolioHistoryGetPortfolioHistoryResponseTest { ) .build() ) - assertThat(portfolioHistoryGetPortfolioHistoryResponse.data()) + assertThat(accountGetPortfolioHistoryResponse.data()) .isEqualTo( PortfolioHistoryResponse.builder() .addSegment( @@ -105,8 +105,8 @@ internal class PortfolioHistoryGetPortfolioHistoryResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val portfolioHistoryGetPortfolioHistoryResponse = - PortfolioHistoryGetPortfolioHistoryResponse.builder() + val accountGetPortfolioHistoryResponse = + AccountGetPortfolioHistoryResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -148,13 +148,13 @@ internal class PortfolioHistoryGetPortfolioHistoryResponseTest { ) .build() - val roundtrippedPortfolioHistoryGetPortfolioHistoryResponse = + val roundtrippedAccountGetPortfolioHistoryResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(portfolioHistoryGetPortfolioHistoryResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(accountGetPortfolioHistoryResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedPortfolioHistoryGetPortfolioHistoryResponse) - .isEqualTo(portfolioHistoryGetPortfolioHistoryResponse) + assertThat(roundtrippedAccountGetPortfolioHistoryResponse) + .isEqualTo(accountGetPortfolioHistoryResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsTest.kt index 6e749916..fa066b88 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsUsageTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsageTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsUsageTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsageTest.kt index a18281bf..34486168 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginDetailsUsageTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsageTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginTopContributorTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributorTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginTopContributorTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributorTest.kt index 162f5bee..658d59eb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/balances/MarginTopContributorTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributorTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.balances +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponseTest.kt index de67ee41..c78e3ef6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistoryResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.portfoliohistory +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistorySegmentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegmentTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistorySegmentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegmentTest.kt index acf7d1bb..ca7236ea 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/portfoliohistory/PortfolioHistorySegmentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegmentTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.portfoliohistory +package com.clear_street.api.models.v1.accounts import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt new file mode 100644 index 00000000..44709a8a --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt @@ -0,0 +1,13 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.apiversion + +import org.junit.jupiter.api.Test + +internal class ApiVersionGetVersionParamsTest { + + @Test + fun create() { + ApiVersionGetVersionParams.builder().build() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt index dc0f6e7e..d98c5a5f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.version +package com.clear_street.api.models.v1.apiversion import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -10,12 +10,12 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class VersionGetVersionResponseTest { +internal class ApiVersionGetVersionResponseTest { @Test fun create() { - val versionGetVersionResponse = - VersionGetVersionResponse.builder() + val apiVersionGetVersionResponse = + ApiVersionGetVersionResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -40,7 +40,7 @@ internal class VersionGetVersionResponseTest { .data(Version.builder().version("version").build()) .build() - assertThat(versionGetVersionResponse.metadata()) + assertThat(apiVersionGetVersionResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -51,7 +51,7 @@ internal class VersionGetVersionResponseTest { .totalPages(0) .build() ) - assertThat(versionGetVersionResponse.error()) + assertThat(apiVersionGetVersionResponse.error()) .contains( ApiError.builder() .code(400) @@ -63,15 +63,15 @@ internal class VersionGetVersionResponseTest { ) .build() ) - assertThat(versionGetVersionResponse.data()) + assertThat(apiVersionGetVersionResponse.data()) .isEqualTo(Version.builder().version("version").build()) } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val versionGetVersionResponse = - VersionGetVersionResponse.builder() + val apiVersionGetVersionResponse = + ApiVersionGetVersionResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -96,12 +96,12 @@ internal class VersionGetVersionResponseTest { .data(Version.builder().version("version").build()) .build() - val roundtrippedVersionGetVersionResponse = + val roundtrippedApiVersionGetVersionResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(versionGetVersionResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(apiVersionGetVersionResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedVersionGetVersionResponse).isEqualTo(versionGetVersionResponse) + assertThat(roundtrippedApiVersionGetVersionResponse).isEqualTo(apiVersionGetVersionResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/VersionTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/VersionTest.kt index f9f0fdd7..7311269f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/VersionTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.version +package com.clear_street.api.models.v1.apiversion import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParamsTest.kt new file mode 100644 index 00000000..a5e25b08 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParamsTest.kt @@ -0,0 +1,13 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.calendar + +import org.junit.jupiter.api.Test + +internal class CalendarGetClockParamsTest { + + @Test + fun create() { + CalendarGetClockParams.builder().build() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponseTest.kt similarity index 84% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponseTest.kt index d1441728..cfd24ac4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.clock +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -11,12 +11,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class ClockGetClockResponseTest { +internal class CalendarGetClockResponseTest { @Test fun create() { - val clockGetClockResponse = - ClockGetClockResponse.builder() + val calendarGetClockResponse = + CalendarGetClockResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -45,7 +45,7 @@ internal class ClockGetClockResponseTest { ) .build() - assertThat(clockGetClockResponse.metadata()) + assertThat(calendarGetClockResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -56,7 +56,7 @@ internal class ClockGetClockResponseTest { .totalPages(0) .build() ) - assertThat(clockGetClockResponse.error()) + assertThat(calendarGetClockResponse.error()) .contains( ApiError.builder() .code(400) @@ -68,7 +68,7 @@ internal class ClockGetClockResponseTest { ) .build() ) - assertThat(clockGetClockResponse.data()) + assertThat(calendarGetClockResponse.data()) .isEqualTo( ClockDetail.builder() .clock(OffsetDateTime.parse("2025-03-01T03:35:00.000000000Z")) @@ -79,8 +79,8 @@ internal class ClockGetClockResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val clockGetClockResponse = - ClockGetClockResponse.builder() + val calendarGetClockResponse = + CalendarGetClockResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -109,12 +109,12 @@ internal class ClockGetClockResponseTest { ) .build() - val roundtrippedClockGetClockResponse = + val roundtrippedCalendarGetClockResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(clockGetClockResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(calendarGetClockResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedClockGetClockResponse).isEqualTo(clockGetClockResponse) + assertThat(roundtrippedCalendarGetClockResponse).isEqualTo(calendarGetClockResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt similarity index 73% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt index e0627e29..0e57ac7d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class MarketHourGetMarketHoursCalendarParamsTest { +internal class CalendarGetMarketHoursCalendarParamsTest { @Test fun create() { - MarketHourGetMarketHoursCalendarParams.builder() + CalendarGetMarketHoursCalendarParams.builder() .date("date") .market(MarketType.US_EQUITIES) .build() @@ -19,7 +19,7 @@ internal class MarketHourGetMarketHoursCalendarParamsTest { @Test fun queryParams() { val params = - MarketHourGetMarketHoursCalendarParams.builder() + CalendarGetMarketHoursCalendarParams.builder() .date("date") .market(MarketType.US_EQUITIES) .build() @@ -34,7 +34,7 @@ internal class MarketHourGetMarketHoursCalendarParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = MarketHourGetMarketHoursCalendarParams.builder().date("date").build() + val params = CalendarGetMarketHoursCalendarParams.builder().date("date").build() val queryParams = params._queryParams() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt index e2d5d926..895f0bc5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHourGetMarketHoursCalendarResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -12,12 +12,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class MarketHourGetMarketHoursCalendarResponseTest { +internal class CalendarGetMarketHoursCalendarResponseTest { @Test fun create() { - val marketHourGetMarketHoursCalendarResponse = - MarketHourGetMarketHoursCalendarResponse.builder() + val calendarGetMarketHoursCalendarResponse = + CalendarGetMarketHoursCalendarResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -113,7 +113,7 @@ internal class MarketHourGetMarketHoursCalendarResponseTest { ) .build() - assertThat(marketHourGetMarketHoursCalendarResponse.metadata()) + assertThat(calendarGetMarketHoursCalendarResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -124,7 +124,7 @@ internal class MarketHourGetMarketHoursCalendarResponseTest { .totalPages(0) .build() ) - assertThat(marketHourGetMarketHoursCalendarResponse.error()) + assertThat(calendarGetMarketHoursCalendarResponse.error()) .contains( ApiError.builder() .code(400) @@ -136,7 +136,7 @@ internal class MarketHourGetMarketHoursCalendarResponseTest { ) .build() ) - assertThat(marketHourGetMarketHoursCalendarResponse.data()) + assertThat(calendarGetMarketHoursCalendarResponse.data()) .containsExactly( MarketHoursDetail.builder() .currentTime(OffsetDateTime.parse("2025-10-15T14:30:00-04:00")) @@ -214,8 +214,8 @@ internal class MarketHourGetMarketHoursCalendarResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val marketHourGetMarketHoursCalendarResponse = - MarketHourGetMarketHoursCalendarResponse.builder() + val calendarGetMarketHoursCalendarResponse = + CalendarGetMarketHoursCalendarResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -311,13 +311,13 @@ internal class MarketHourGetMarketHoursCalendarResponseTest { ) .build() - val roundtrippedMarketHourGetMarketHoursCalendarResponse = + val roundtrippedCalendarGetMarketHoursCalendarResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(marketHourGetMarketHoursCalendarResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(calendarGetMarketHoursCalendarResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedMarketHourGetMarketHoursCalendarResponse) - .isEqualTo(marketHourGetMarketHoursCalendarResponse) + assertThat(roundtrippedCalendarGetMarketHoursCalendarResponse) + .isEqualTo(calendarGetMarketHoursCalendarResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/ClockDetailTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockDetailTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/ClockDetailTest.kt index ece56ed9..3c640b27 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/ClockDetailTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.clock +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHoursDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetailTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHoursDetailTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetailTest.kt index 7ee09cf7..94d75d05 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketHoursDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetailTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketStatusTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketStatusTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketStatusTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketStatusTest.kt index 40de162f..ff07934c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/MarketStatusTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketStatusTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/SessionScheduleTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/SessionScheduleTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/SessionScheduleTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/SessionScheduleTest.kt index a3be483c..8fea9741 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/SessionScheduleTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/SessionScheduleTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/TradingSessionsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/TradingSessionsTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/TradingSessionsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/TradingSessionsTest.kt index d0568512..b156a37e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendars/markethours/TradingSessionsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/TradingSessionsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendars.markethours +package com.clear_street.api.models.v1.calendar import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockParamsTest.kt deleted file mode 100644 index 3324239b..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/clock/ClockGetClockParamsTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.clock - -import org.junit.jupiter.api.Test - -internal class ClockGetClockParamsTest { - - @Test - fun create() { - ClockGetClockParams.builder().build() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystDistributionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistributionTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystDistributionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistributionTest.kt index 117c8287..fe7e11cd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystDistributionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistributionTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentAllEventsDataTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentAllEventsDataTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt index 9a1f8eed..dc5a1b77 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentAllEventsDataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.instruments.InstrumentEarnings import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/InstrumentAnalystConsensusTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/InstrumentAnalystConsensusTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt index 08fb4322..8270919c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/InstrumentAnalystConsensusTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.instruments.AnalystRating import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/InstrumentBalanceSheetStatementTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/InstrumentBalanceSheetStatementTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt index ee9a5dae..98a98cfd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/InstrumentBalanceSheetStatementTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.balancesheets +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/InstrumentCashFlowStatementTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/InstrumentCashFlowStatementTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt index 1a0a1623..f081e6bd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/InstrumentCashFlowStatementTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.cashflowstatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt similarity index 80% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt index 3d81c89d..23b5fb77 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class EventGetAllInstrumentEventsParamsTest { +internal class InstrumentDataGetAllInstrumentEventsParamsTest { @Test fun create() { - EventGetAllInstrumentEventsParams.builder() + InstrumentDataGetAllInstrumentEventsParams.builder() .addEventType(AllEventsEventType.EARNINGS) .fromDate("from_date") .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -21,7 +21,7 @@ internal class EventGetAllInstrumentEventsParamsTest { @Test fun queryParams() { val params = - EventGetAllInstrumentEventsParams.builder() + InstrumentDataGetAllInstrumentEventsParams.builder() .addEventType(AllEventsEventType.EARNINGS) .fromDate("from_date") .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -43,7 +43,7 @@ internal class EventGetAllInstrumentEventsParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = EventGetAllInstrumentEventsParams.builder().build() + val params = InstrumentDataGetAllInstrumentEventsParams.builder().build() val queryParams = params._queryParams() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt index f41b6846..a8e8a3ea 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetAllInstrumentEventsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt @@ -1,24 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.instruments.InstrumentEarnings import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class EventGetAllInstrumentEventsResponseTest { +internal class InstrumentDataGetAllInstrumentEventsResponseTest { @Test fun create() { - val eventGetAllInstrumentEventsResponse = - EventGetAllInstrumentEventsResponse.builder() + val instrumentDataGetAllInstrumentEventsResponse = + InstrumentDataGetAllInstrumentEventsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -103,7 +102,7 @@ internal class EventGetAllInstrumentEventsResponseTest { ) .build() - assertThat(eventGetAllInstrumentEventsResponse.metadata()) + assertThat(instrumentDataGetAllInstrumentEventsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -114,7 +113,7 @@ internal class EventGetAllInstrumentEventsResponseTest { .totalPages(0) .build() ) - assertThat(eventGetAllInstrumentEventsResponse.error()) + assertThat(instrumentDataGetAllInstrumentEventsResponse.error()) .contains( ApiError.builder() .code(400) @@ -126,7 +125,7 @@ internal class EventGetAllInstrumentEventsResponseTest { ) .build() ) - assertThat(eventGetAllInstrumentEventsResponse.data()) + assertThat(instrumentDataGetAllInstrumentEventsResponse.data()) .isEqualTo( InstrumentAllEventsData.builder() .addEventDate( @@ -193,8 +192,8 @@ internal class EventGetAllInstrumentEventsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val eventGetAllInstrumentEventsResponse = - EventGetAllInstrumentEventsResponse.builder() + val instrumentDataGetAllInstrumentEventsResponse = + InstrumentDataGetAllInstrumentEventsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -279,13 +278,13 @@ internal class EventGetAllInstrumentEventsResponseTest { ) .build() - val roundtrippedEventGetAllInstrumentEventsResponse = + val roundtrippedInstrumentDataGetAllInstrumentEventsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(eventGetAllInstrumentEventsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(instrumentDataGetAllInstrumentEventsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedEventGetAllInstrumentEventsResponse) - .isEqualTo(eventGetAllInstrumentEventsResponse) + assertThat(roundtrippedInstrumentDataGetAllInstrumentEventsResponse) + .isEqualTo(instrumentDataGetAllInstrumentEventsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt similarity index 78% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt index 29faf0f9..93682ff2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.http.QueryParams import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class AnalystReportingGetInstrumentAnalystConsensusParamsTest { +internal class InstrumentDataGetInstrumentAnalystConsensusParamsTest { @Test fun create() { - AnalystReportingGetInstrumentAnalystConsensusParams.builder() + InstrumentDataGetInstrumentAnalystConsensusParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .from(LocalDate.parse("2019-12-27")) .to(LocalDate.parse("2019-12-27")) @@ -21,7 +21,7 @@ internal class AnalystReportingGetInstrumentAnalystConsensusParamsTest { @Test fun pathParams() { val params = - AnalystReportingGetInstrumentAnalystConsensusParams.builder() + InstrumentDataGetInstrumentAnalystConsensusParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -33,7 +33,7 @@ internal class AnalystReportingGetInstrumentAnalystConsensusParamsTest { @Test fun queryParams() { val params = - AnalystReportingGetInstrumentAnalystConsensusParams.builder() + InstrumentDataGetInstrumentAnalystConsensusParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .from(LocalDate.parse("2019-12-27")) .to(LocalDate.parse("2019-12-27")) @@ -50,7 +50,7 @@ internal class AnalystReportingGetInstrumentAnalystConsensusParamsTest { @Test fun queryParamsWithoutOptionalFields() { val params = - AnalystReportingGetInstrumentAnalystConsensusParams.builder() + InstrumentDataGetInstrumentAnalystConsensusParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt similarity index 83% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt index 6ca33339..ca3487f9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/AnalystReportingGetInstrumentAnalystConsensusResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt @@ -1,23 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.instruments.AnalystRating import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class AnalystReportingGetInstrumentAnalystConsensusResponseTest { +internal class InstrumentDataGetInstrumentAnalystConsensusResponseTest { @Test fun create() { - val analystReportingGetInstrumentAnalystConsensusResponse = - AnalystReportingGetInstrumentAnalystConsensusResponse.builder() + val instrumentDataGetInstrumentAnalystConsensusResponse = + InstrumentDataGetInstrumentAnalystConsensusResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -64,7 +63,7 @@ internal class AnalystReportingGetInstrumentAnalystConsensusResponseTest { ) .build() - assertThat(analystReportingGetInstrumentAnalystConsensusResponse.metadata()) + assertThat(instrumentDataGetInstrumentAnalystConsensusResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -75,7 +74,7 @@ internal class AnalystReportingGetInstrumentAnalystConsensusResponseTest { .totalPages(0) .build() ) - assertThat(analystReportingGetInstrumentAnalystConsensusResponse.error()) + assertThat(instrumentDataGetInstrumentAnalystConsensusResponse.error()) .contains( ApiError.builder() .code(400) @@ -87,7 +86,7 @@ internal class AnalystReportingGetInstrumentAnalystConsensusResponseTest { ) .build() ) - assertThat(analystReportingGetInstrumentAnalystConsensusResponse.data()) + assertThat(instrumentDataGetInstrumentAnalystConsensusResponse.data()) .isEqualTo( InstrumentAnalystConsensus.builder() .date(LocalDate.parse("2024-11-15")) @@ -116,8 +115,8 @@ internal class AnalystReportingGetInstrumentAnalystConsensusResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val analystReportingGetInstrumentAnalystConsensusResponse = - AnalystReportingGetInstrumentAnalystConsensusResponse.builder() + val instrumentDataGetInstrumentAnalystConsensusResponse = + InstrumentDataGetInstrumentAnalystConsensusResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -164,15 +163,13 @@ internal class AnalystReportingGetInstrumentAnalystConsensusResponseTest { ) .build() - val roundtrippedAnalystReportingGetInstrumentAnalystConsensusResponse = + val roundtrippedInstrumentDataGetInstrumentAnalystConsensusResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString( - analystReportingGetInstrumentAnalystConsensusResponse - ), - jacksonTypeRef(), + jsonMapper.writeValueAsString(instrumentDataGetInstrumentAnalystConsensusResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedAnalystReportingGetInstrumentAnalystConsensusResponse) - .isEqualTo(analystReportingGetInstrumentAnalystConsensusResponse) + assertThat(roundtrippedInstrumentDataGetInstrumentAnalystConsensusResponse) + .isEqualTo(instrumentDataGetInstrumentAnalystConsensusResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt similarity index 79% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt index 6c469c17..ef017c2d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.cashflowstatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CashFlowStatementGetInstrumentCashFlowStatementsParamsTest { +internal class InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest { @Test fun create() { - CashFlowStatementGetInstrumentCashFlowStatementsParams.builder() + InstrumentDataGetInstrumentBalanceSheetStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fromDate("from_date") .pageSize(1L) @@ -22,7 +22,7 @@ internal class CashFlowStatementGetInstrumentCashFlowStatementsParamsTest { @Test fun pathParams() { val params = - CashFlowStatementGetInstrumentCashFlowStatementsParams.builder() + InstrumentDataGetInstrumentBalanceSheetStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -34,7 +34,7 @@ internal class CashFlowStatementGetInstrumentCashFlowStatementsParamsTest { @Test fun queryParams() { val params = - CashFlowStatementGetInstrumentCashFlowStatementsParams.builder() + InstrumentDataGetInstrumentBalanceSheetStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fromDate("from_date") .pageSize(1L) @@ -58,7 +58,7 @@ internal class CashFlowStatementGetInstrumentCashFlowStatementsParamsTest { @Test fun queryParamsWithoutOptionalFields() { val params = - CashFlowStatementGetInstrumentCashFlowStatementsParams.builder() + InstrumentDataGetInstrumentBalanceSheetStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt index 18a1a373..4bfcdcab 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt @@ -1,24 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.balancesheets +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest { +internal class InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest { @Test fun create() { - val balanceSheetGetInstrumentBalanceSheetStatementsResponse = - BalanceSheetGetInstrumentBalanceSheetStatementsResponse.builder() + val instrumentDataGetInstrumentBalanceSheetStatementsResponse = + InstrumentDataGetInstrumentBalanceSheetStatementsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -106,7 +105,7 @@ internal class BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest { ) .build() - assertThat(balanceSheetGetInstrumentBalanceSheetStatementsResponse.metadata()) + assertThat(instrumentDataGetInstrumentBalanceSheetStatementsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -117,7 +116,7 @@ internal class BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest { .totalPages(0) .build() ) - assertThat(balanceSheetGetInstrumentBalanceSheetStatementsResponse.error()) + assertThat(instrumentDataGetInstrumentBalanceSheetStatementsResponse.error()) .contains( ApiError.builder() .code(400) @@ -129,7 +128,7 @@ internal class BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest { ) .build() ) - assertThat(balanceSheetGetInstrumentBalanceSheetStatementsResponse.data()) + assertThat(instrumentDataGetInstrumentBalanceSheetStatementsResponse.data()) .containsExactly( InstrumentBalanceSheetStatement.builder() .acceptedDate(OffsetDateTime.parse("2025-05-02T14:30:00Z")) @@ -199,8 +198,8 @@ internal class BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val balanceSheetGetInstrumentBalanceSheetStatementsResponse = - BalanceSheetGetInstrumentBalanceSheetStatementsResponse.builder() + val instrumentDataGetInstrumentBalanceSheetStatementsResponse = + InstrumentDataGetInstrumentBalanceSheetStatementsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -288,15 +287,15 @@ internal class BalanceSheetGetInstrumentBalanceSheetStatementsResponseTest { ) .build() - val roundtrippedBalanceSheetGetInstrumentBalanceSheetStatementsResponse = + val roundtrippedInstrumentDataGetInstrumentBalanceSheetStatementsResponse = jsonMapper.readValue( jsonMapper.writeValueAsString( - balanceSheetGetInstrumentBalanceSheetStatementsResponse + instrumentDataGetInstrumentBalanceSheetStatementsResponse ), - jacksonTypeRef(), + jacksonTypeRef(), ) - assertThat(roundtrippedBalanceSheetGetInstrumentBalanceSheetStatementsResponse) - .isEqualTo(balanceSheetGetInstrumentBalanceSheetStatementsResponse) + assertThat(roundtrippedInstrumentDataGetInstrumentBalanceSheetStatementsResponse) + .isEqualTo(instrumentDataGetInstrumentBalanceSheetStatementsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt similarity index 80% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt index fcc3c3b0..5b658464 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.incomestatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class IncomeStatementGetInstrumentIncomeStatementsParamsTest { +internal class InstrumentDataGetInstrumentCashFlowStatementsParamsTest { @Test fun create() { - IncomeStatementGetInstrumentIncomeStatementsParams.builder() + InstrumentDataGetInstrumentCashFlowStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fromDate("from_date") .pageSize(1L) @@ -22,7 +22,7 @@ internal class IncomeStatementGetInstrumentIncomeStatementsParamsTest { @Test fun pathParams() { val params = - IncomeStatementGetInstrumentIncomeStatementsParams.builder() + InstrumentDataGetInstrumentCashFlowStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -34,7 +34,7 @@ internal class IncomeStatementGetInstrumentIncomeStatementsParamsTest { @Test fun queryParams() { val params = - IncomeStatementGetInstrumentIncomeStatementsParams.builder() + InstrumentDataGetInstrumentCashFlowStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fromDate("from_date") .pageSize(1L) @@ -58,7 +58,7 @@ internal class IncomeStatementGetInstrumentIncomeStatementsParamsTest { @Test fun queryParamsWithoutOptionalFields() { val params = - IncomeStatementGetInstrumentIncomeStatementsParams.builder() + InstrumentDataGetInstrumentCashFlowStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt index 3978f254..70306741 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/cashflowstatements/CashFlowStatementGetInstrumentCashFlowStatementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt @@ -1,24 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.cashflowstatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CashFlowStatementGetInstrumentCashFlowStatementsResponseTest { +internal class InstrumentDataGetInstrumentCashFlowStatementsResponseTest { @Test fun create() { - val cashFlowStatementGetInstrumentCashFlowStatementsResponse = - CashFlowStatementGetInstrumentCashFlowStatementsResponse.builder() + val instrumentDataGetInstrumentCashFlowStatementsResponse = + InstrumentDataGetInstrumentCashFlowStatementsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -91,7 +90,7 @@ internal class CashFlowStatementGetInstrumentCashFlowStatementsResponseTest { ) .build() - assertThat(cashFlowStatementGetInstrumentCashFlowStatementsResponse.metadata()) + assertThat(instrumentDataGetInstrumentCashFlowStatementsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -102,7 +101,7 @@ internal class CashFlowStatementGetInstrumentCashFlowStatementsResponseTest { .totalPages(0) .build() ) - assertThat(cashFlowStatementGetInstrumentCashFlowStatementsResponse.error()) + assertThat(instrumentDataGetInstrumentCashFlowStatementsResponse.error()) .contains( ApiError.builder() .code(400) @@ -114,7 +113,7 @@ internal class CashFlowStatementGetInstrumentCashFlowStatementsResponseTest { ) .build() ) - assertThat(cashFlowStatementGetInstrumentCashFlowStatementsResponse.data()) + assertThat(instrumentDataGetInstrumentCashFlowStatementsResponse.data()) .containsExactly( InstrumentCashFlowStatement.builder() .acceptedDate(OffsetDateTime.parse("2025-05-02T14:30:00Z")) @@ -169,8 +168,8 @@ internal class CashFlowStatementGetInstrumentCashFlowStatementsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val cashFlowStatementGetInstrumentCashFlowStatementsResponse = - CashFlowStatementGetInstrumentCashFlowStatementsResponse.builder() + val instrumentDataGetInstrumentCashFlowStatementsResponse = + InstrumentDataGetInstrumentCashFlowStatementsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -243,15 +242,15 @@ internal class CashFlowStatementGetInstrumentCashFlowStatementsResponseTest { ) .build() - val roundtrippedCashFlowStatementGetInstrumentCashFlowStatementsResponse = + val roundtrippedInstrumentDataGetInstrumentCashFlowStatementsResponse = jsonMapper.readValue( jsonMapper.writeValueAsString( - cashFlowStatementGetInstrumentCashFlowStatementsResponse + instrumentDataGetInstrumentCashFlowStatementsResponse ), - jacksonTypeRef(), + jacksonTypeRef(), ) - assertThat(roundtrippedCashFlowStatementGetInstrumentCashFlowStatementsResponse) - .isEqualTo(cashFlowStatementGetInstrumentCashFlowStatementsResponse) + assertThat(roundtrippedInstrumentDataGetInstrumentCashFlowStatementsResponse) + .isEqualTo(instrumentDataGetInstrumentCashFlowStatementsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt index 7ea8bac3..bd6a487c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class EventGetInstrumentEventsParamsTest { +internal class InstrumentDataGetInstrumentEventsParamsTest { @Test fun create() { - EventGetInstrumentEventsParams.builder() + InstrumentDataGetInstrumentEventsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fromDate("from_date") .toDate("to_date") @@ -20,7 +20,7 @@ internal class EventGetInstrumentEventsParamsTest { @Test fun pathParams() { val params = - EventGetInstrumentEventsParams.builder() + InstrumentDataGetInstrumentEventsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -32,7 +32,7 @@ internal class EventGetInstrumentEventsParamsTest { @Test fun queryParams() { val params = - EventGetInstrumentEventsParams.builder() + InstrumentDataGetInstrumentEventsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fromDate("from_date") .toDate("to_date") @@ -52,7 +52,7 @@ internal class EventGetInstrumentEventsParamsTest { @Test fun queryParamsWithoutOptionalFields() { val params = - EventGetInstrumentEventsParams.builder() + InstrumentDataGetInstrumentEventsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt index 568a1693..d874354c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/EventGetInstrumentEventsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt @@ -1,23 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.instruments.InstrumentEarnings import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class EventGetInstrumentEventsResponseTest { +internal class InstrumentDataGetInstrumentEventsResponseTest { @Test fun create() { - val eventGetInstrumentEventsResponse = - EventGetInstrumentEventsResponse.builder() + val instrumentDataGetInstrumentEventsResponse = + InstrumentDataGetInstrumentEventsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -77,7 +76,7 @@ internal class EventGetInstrumentEventsResponseTest { ) .build() - assertThat(eventGetInstrumentEventsResponse.metadata()) + assertThat(instrumentDataGetInstrumentEventsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -88,7 +87,7 @@ internal class EventGetInstrumentEventsResponseTest { .totalPages(0) .build() ) - assertThat(eventGetInstrumentEventsResponse.error()) + assertThat(instrumentDataGetInstrumentEventsResponse.error()) .contains( ApiError.builder() .code(400) @@ -100,7 +99,7 @@ internal class EventGetInstrumentEventsResponseTest { ) .build() ) - assertThat(eventGetInstrumentEventsResponse.data()) + assertThat(instrumentDataGetInstrumentEventsResponse.data()) .isEqualTo( InstrumentEventsData.builder() .addDividend( @@ -142,8 +141,8 @@ internal class EventGetInstrumentEventsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val eventGetInstrumentEventsResponse = - EventGetInstrumentEventsResponse.builder() + val instrumentDataGetInstrumentEventsResponse = + InstrumentDataGetInstrumentEventsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -203,13 +202,13 @@ internal class EventGetInstrumentEventsResponseTest { ) .build() - val roundtrippedEventGetInstrumentEventsResponse = + val roundtrippedInstrumentDataGetInstrumentEventsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(eventGetInstrumentEventsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(instrumentDataGetInstrumentEventsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedEventGetInstrumentEventsResponse) - .isEqualTo(eventGetInstrumentEventsResponse) + assertThat(roundtrippedInstrumentDataGetInstrumentEventsResponse) + .isEqualTo(instrumentDataGetInstrumentEventsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt similarity index 70% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt index c93778c0..165ffb7c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.fundamentals +package com.clear_street.api.models.v1.instrumentdata import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class FundamentalGetInstrumentFundamentalsParamsTest { +internal class InstrumentDataGetInstrumentFundamentalsParamsTest { @Test fun create() { - FundamentalGetInstrumentFundamentalsParams.builder() + InstrumentDataGetInstrumentFundamentalsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -17,7 +17,7 @@ internal class FundamentalGetInstrumentFundamentalsParamsTest { @Test fun pathParams() { val params = - FundamentalGetInstrumentFundamentalsParams.builder() + InstrumentDataGetInstrumentFundamentalsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt index 4f18de44..74f48692 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/FundamentalGetInstrumentFundamentalsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.fundamentals +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -11,12 +11,12 @@ import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class FundamentalGetInstrumentFundamentalsResponseTest { +internal class InstrumentDataGetInstrumentFundamentalsResponseTest { @Test fun create() { - val fundamentalGetInstrumentFundamentalsResponse = - FundamentalGetInstrumentFundamentalsResponse.builder() + val instrumentDataGetInstrumentFundamentalsResponse = + InstrumentDataGetInstrumentFundamentalsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -60,7 +60,7 @@ internal class FundamentalGetInstrumentFundamentalsResponseTest { ) .build() - assertThat(fundamentalGetInstrumentFundamentalsResponse.metadata()) + assertThat(instrumentDataGetInstrumentFundamentalsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -71,7 +71,7 @@ internal class FundamentalGetInstrumentFundamentalsResponseTest { .totalPages(0) .build() ) - assertThat(fundamentalGetInstrumentFundamentalsResponse.error()) + assertThat(instrumentDataGetInstrumentFundamentalsResponse.error()) .contains( ApiError.builder() .code(400) @@ -83,7 +83,7 @@ internal class FundamentalGetInstrumentFundamentalsResponseTest { ) .build() ) - assertThat(fundamentalGetInstrumentFundamentalsResponse.data()) + assertThat(instrumentDataGetInstrumentFundamentalsResponse.data()) .isEqualTo( InstrumentFundamentals.builder() .averageVolume(76000000L) @@ -109,8 +109,8 @@ internal class FundamentalGetInstrumentFundamentalsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val fundamentalGetInstrumentFundamentalsResponse = - FundamentalGetInstrumentFundamentalsResponse.builder() + val instrumentDataGetInstrumentFundamentalsResponse = + InstrumentDataGetInstrumentFundamentalsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -154,13 +154,13 @@ internal class FundamentalGetInstrumentFundamentalsResponseTest { ) .build() - val roundtrippedFundamentalGetInstrumentFundamentalsResponse = + val roundtrippedInstrumentDataGetInstrumentFundamentalsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(fundamentalGetInstrumentFundamentalsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(instrumentDataGetInstrumentFundamentalsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedFundamentalGetInstrumentFundamentalsResponse) - .isEqualTo(fundamentalGetInstrumentFundamentalsResponse) + assertThat(roundtrippedInstrumentDataGetInstrumentFundamentalsResponse) + .isEqualTo(instrumentDataGetInstrumentFundamentalsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt similarity index 80% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt index b3874834..c72d9748 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/balancesheets/BalanceSheetGetInstrumentBalanceSheetStatementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.balancesheets +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class BalanceSheetGetInstrumentBalanceSheetStatementsParamsTest { +internal class InstrumentDataGetInstrumentIncomeStatementsParamsTest { @Test fun create() { - BalanceSheetGetInstrumentBalanceSheetStatementsParams.builder() + InstrumentDataGetInstrumentIncomeStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fromDate("from_date") .pageSize(1L) @@ -22,7 +22,7 @@ internal class BalanceSheetGetInstrumentBalanceSheetStatementsParamsTest { @Test fun pathParams() { val params = - BalanceSheetGetInstrumentBalanceSheetStatementsParams.builder() + InstrumentDataGetInstrumentIncomeStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -34,7 +34,7 @@ internal class BalanceSheetGetInstrumentBalanceSheetStatementsParamsTest { @Test fun queryParams() { val params = - BalanceSheetGetInstrumentBalanceSheetStatementsParams.builder() + InstrumentDataGetInstrumentIncomeStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fromDate("from_date") .pageSize(1L) @@ -58,7 +58,7 @@ internal class BalanceSheetGetInstrumentBalanceSheetStatementsParamsTest { @Test fun queryParamsWithoutOptionalFields() { val params = - BalanceSheetGetInstrumentBalanceSheetStatementsParams.builder() + InstrumentDataGetInstrumentIncomeStatementsParams.builder() .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt similarity index 89% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt index 7c15d7d4..54c9aa91 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/IncomeStatementGetInstrumentIncomeStatementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt @@ -1,24 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.incomestatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class IncomeStatementGetInstrumentIncomeStatementsResponseTest { +internal class InstrumentDataGetInstrumentIncomeStatementsResponseTest { @Test fun create() { - val incomeStatementGetInstrumentIncomeStatementsResponse = - IncomeStatementGetInstrumentIncomeStatementsResponse.builder() + val instrumentDataGetInstrumentIncomeStatementsResponse = + InstrumentDataGetInstrumentIncomeStatementsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -83,7 +82,7 @@ internal class IncomeStatementGetInstrumentIncomeStatementsResponseTest { ) .build() - assertThat(incomeStatementGetInstrumentIncomeStatementsResponse.metadata()) + assertThat(instrumentDataGetInstrumentIncomeStatementsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -94,7 +93,7 @@ internal class IncomeStatementGetInstrumentIncomeStatementsResponseTest { .totalPages(0) .build() ) - assertThat(incomeStatementGetInstrumentIncomeStatementsResponse.error()) + assertThat(instrumentDataGetInstrumentIncomeStatementsResponse.error()) .contains( ApiError.builder() .code(400) @@ -106,7 +105,7 @@ internal class IncomeStatementGetInstrumentIncomeStatementsResponseTest { ) .build() ) - assertThat(incomeStatementGetInstrumentIncomeStatementsResponse.data()) + assertThat(instrumentDataGetInstrumentIncomeStatementsResponse.data()) .containsExactly( InstrumentIncomeStatement.builder() .acceptedDate(OffsetDateTime.parse("2025-05-02T14:30:00Z")) @@ -153,8 +152,8 @@ internal class IncomeStatementGetInstrumentIncomeStatementsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val incomeStatementGetInstrumentIncomeStatementsResponse = - IncomeStatementGetInstrumentIncomeStatementsResponse.builder() + val instrumentDataGetInstrumentIncomeStatementsResponse = + InstrumentDataGetInstrumentIncomeStatementsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -219,13 +218,13 @@ internal class IncomeStatementGetInstrumentIncomeStatementsResponseTest { ) .build() - val roundtrippedIncomeStatementGetInstrumentIncomeStatementsResponse = + val roundtrippedInstrumentDataGetInstrumentIncomeStatementsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(incomeStatementGetInstrumentIncomeStatementsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(instrumentDataGetInstrumentIncomeStatementsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedIncomeStatementGetInstrumentIncomeStatementsResponse) - .isEqualTo(incomeStatementGetInstrumentIncomeStatementsResponse) + assertThat(roundtrippedInstrumentDataGetInstrumentIncomeStatementsResponse) + .isEqualTo(instrumentDataGetInstrumentIncomeStatementsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentDividendEventTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentDividendEventTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt index 7678af08..1a590f4f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentDividendEventTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentEarningsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarningsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentEarningsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarningsTest.kt index f6de2380..42fe6bad 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentEarningsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarningsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventEnvelopeTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventEnvelopeTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt index ebac09ea..f993e7a0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventEnvelopeTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.instruments.InstrumentEarnings import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventIpoItemTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventIpoItemTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt index b83dcbb0..c207afd6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventIpoItemTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsByDateTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsByDateTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt index 81d1c4f6..ea7ee02a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsByDateTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.instruments.InstrumentEarnings import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsDataTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsDataTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt index 383c8461..bace7354 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentEventsDataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.instruments.InstrumentEarnings import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/InstrumentFundamentalsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/InstrumentFundamentalsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt index 3e3a57c9..e7f8aa6c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/fundamentals/InstrumentFundamentalsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.fundamentals +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/InstrumentIncomeStatementTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/InstrumentIncomeStatementTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt index e9ca8832..6f757ef6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/incomestatements/InstrumentIncomeStatementTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.incomestatements +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.instruments.FiscalPeriodType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentSplitEventTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentSplitEventTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt index e6a2a09b..f9788215 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/events/InstrumentSplitEventTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.events +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/PriceTargetTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTargetTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/PriceTargetTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTargetTest.kt index 48da2f0e..f1c79694 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/analystreporting/PriceTargetTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTargetTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.analystreporting +package com.clear_street.api.models.v1.instrumentdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt index 8ed61f04..f7a01a7b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.dailysummary +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt similarity index 59% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt index 93a58fab..94f882be 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.dailysummary +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class DailySummaryGetDailySummariesParamsTest { +internal class MarketDataGetDailySummariesParamsTest { @Test fun create() { - DailySummaryGetDailySummariesParams.builder().instrumentIds("instrument_ids").build() + MarketDataGetDailySummariesParams.builder().instrumentIds("instrument_ids").build() } @Test fun queryParams() { val params = - DailySummaryGetDailySummariesParams.builder().instrumentIds("instrument_ids").build() + MarketDataGetDailySummariesParams.builder().instrumentIds("instrument_ids").build() val queryParams = params._queryParams() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt similarity index 83% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt index 9430393d..5bfca5d0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/dailysummary/DailySummaryGetDailySummariesResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.dailysummary +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -11,12 +11,12 @@ import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class DailySummaryGetDailySummariesResponseTest { +internal class MarketDataGetDailySummariesResponseTest { @Test fun create() { - val dailySummaryGetDailySummariesResponse = - DailySummaryGetDailySummariesResponse.builder() + val marketDataGetDailySummariesResponse = + MarketDataGetDailySummariesResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -51,7 +51,7 @@ internal class DailySummaryGetDailySummariesResponseTest { ) .build() - assertThat(dailySummaryGetDailySummariesResponse.metadata()) + assertThat(marketDataGetDailySummariesResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -62,7 +62,7 @@ internal class DailySummaryGetDailySummariesResponseTest { .totalPages(0) .build() ) - assertThat(dailySummaryGetDailySummariesResponse.error()) + assertThat(marketDataGetDailySummariesResponse.error()) .contains( ApiError.builder() .code(400) @@ -74,7 +74,7 @@ internal class DailySummaryGetDailySummariesResponseTest { ) .build() ) - assertThat(dailySummaryGetDailySummariesResponse.data()) + assertThat(marketDataGetDailySummariesResponse.data()) .containsExactly( DailySummary.builder() .instrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") @@ -91,8 +91,8 @@ internal class DailySummaryGetDailySummariesResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val dailySummaryGetDailySummariesResponse = - DailySummaryGetDailySummariesResponse.builder() + val marketDataGetDailySummariesResponse = + MarketDataGetDailySummariesResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -127,13 +127,13 @@ internal class DailySummaryGetDailySummariesResponseTest { ) .build() - val roundtrippedDailySummaryGetDailySummariesResponse = + val roundtrippedMarketDataGetDailySummariesResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(dailySummaryGetDailySummariesResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(marketDataGetDailySummariesResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedDailySummaryGetDailySummariesResponse) - .isEqualTo(dailySummaryGetDailySummariesResponse) + assertThat(roundtrippedMarketDataGetDailySummariesResponse) + .isEqualTo(marketDataGetDailySummariesResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt similarity index 76% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt index 9a58b4c7..d7a3953b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class SnapshotGetSnapshotsParamsTest { +internal class MarketDataGetSnapshotsParamsTest { @Test fun create() { - SnapshotGetSnapshotsParams.builder() + MarketDataGetSnapshotsParams.builder() .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -18,7 +18,7 @@ internal class SnapshotGetSnapshotsParamsTest { @Test fun queryParams() { val params = - SnapshotGetSnapshotsParams.builder() + MarketDataGetSnapshotsParams.builder() .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -34,7 +34,7 @@ internal class SnapshotGetSnapshotsParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = SnapshotGetSnapshotsParams.builder().build() + val params = MarketDataGetSnapshotsParams.builder().build() val queryParams = params._queryParams() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt index f471a6d3..96e5c01b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotGetSnapshotsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -10,12 +10,12 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class SnapshotGetSnapshotsResponseTest { +internal class MarketDataGetSnapshotsResponseTest { @Test fun create() { - val snapshotGetSnapshotsResponse = - SnapshotGetSnapshotsResponse.builder() + val marketDataGetSnapshotsResponse = + MarketDataGetSnapshotsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -64,7 +64,7 @@ internal class SnapshotGetSnapshotsResponseTest { ) .build() - assertThat(snapshotGetSnapshotsResponse.metadata()) + assertThat(marketDataGetSnapshotsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -75,7 +75,7 @@ internal class SnapshotGetSnapshotsResponseTest { .totalPages(0) .build() ) - assertThat(snapshotGetSnapshotsResponse.error()) + assertThat(marketDataGetSnapshotsResponse.error()) .contains( ApiError.builder() .code(400) @@ -87,7 +87,7 @@ internal class SnapshotGetSnapshotsResponseTest { ) .build() ) - assertThat(snapshotGetSnapshotsResponse.data()) + assertThat(marketDataGetSnapshotsResponse.data()) .containsExactly( MarketDataSnapshot.builder() .instrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") @@ -118,8 +118,8 @@ internal class SnapshotGetSnapshotsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val snapshotGetSnapshotsResponse = - SnapshotGetSnapshotsResponse.builder() + val marketDataGetSnapshotsResponse = + MarketDataGetSnapshotsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -168,12 +168,13 @@ internal class SnapshotGetSnapshotsResponseTest { ) .build() - val roundtrippedSnapshotGetSnapshotsResponse = + val roundtrippedMarketDataGetSnapshotsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(snapshotGetSnapshotsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(marketDataGetSnapshotsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedSnapshotGetSnapshotsResponse).isEqualTo(snapshotGetSnapshotsResponse) + assertThat(roundtrippedMarketDataGetSnapshotsResponse) + .isEqualTo(marketDataGetSnapshotsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/MarketDataSnapshotTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/MarketDataSnapshotTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt index decb2a42..11ffc9a2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/MarketDataSnapshotTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotLastTradeTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotLastTradeTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt index 85d00bff..45fde2a6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotLastTradeTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotQuoteTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotQuoteTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt index 93cf6b36..82e7c64c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotQuoteTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotSessionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotSessionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt index ad460c13..b3d53e56 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/marketdata/snapshot/SnapshotSessionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.marketdata.snapshot +package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt index 7a77f7e1..5b2b628e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt index 61c9adc4..0df1f74f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsGetNewsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsInstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsInstrumentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt index 7becf643..274b629c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsInstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsItemTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItemTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsItemTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItemTest.kt index 59963e11..a1c6521b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/news/NewsItemTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItemTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.news +package com.clear_street.api.models.v1.instrumentdata.news import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt similarity index 82% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt index c2d74048..c8c83e40 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt @@ -1,18 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.options +package com.clear_street.api.models.v1.instruments import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.models.v1.instruments.ContractType import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class OptionGetOptionContractsParamsTest { +internal class InstrumentGetOptionContractsParamsTest { @Test fun create() { - OptionGetOptionContractsParams.builder() + InstrumentGetOptionContractsParams.builder() .contractType(ContractType.CALL) .expiry(LocalDate.parse("2019-12-27")) .pageSize(1L) @@ -25,7 +24,7 @@ internal class OptionGetOptionContractsParamsTest { @Test fun queryParams() { val params = - OptionGetOptionContractsParams.builder() + InstrumentGetOptionContractsParams.builder() .contractType(ContractType.CALL) .expiry(LocalDate.parse("2019-12-27")) .pageSize(1L) @@ -51,7 +50,7 @@ internal class OptionGetOptionContractsParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = OptionGetOptionContractsParams.builder().build() + val params = InstrumentGetOptionContractsParams.builder().build() val queryParams = params._queryParams() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt index 1e103dd5..da0f09c3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/options/OptionGetOptionContractsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt @@ -1,26 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments.options +package com.clear_street.api.models.v1.instruments import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.instruments.ContractType -import com.clear_street.api.models.v1.instruments.ExerciseStyle -import com.clear_street.api.models.v1.instruments.ListingType -import com.clear_street.api.models.v1.instruments.OptionsContract import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class OptionGetOptionContractsResponseTest { +internal class InstrumentGetOptionContractsResponseTest { @Test fun create() { - val optionGetOptionContractsResponse = - OptionGetOptionContractsResponse.builder() + val instrumentGetOptionContractsResponse = + InstrumentGetOptionContractsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -63,7 +59,7 @@ internal class OptionGetOptionContractsResponseTest { ) .build() - assertThat(optionGetOptionContractsResponse.metadata()) + assertThat(instrumentGetOptionContractsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -74,7 +70,7 @@ internal class OptionGetOptionContractsResponseTest { .totalPages(0) .build() ) - assertThat(optionGetOptionContractsResponse.error()) + assertThat(instrumentGetOptionContractsResponse.error()) .contains( ApiError.builder() .code(400) @@ -86,7 +82,7 @@ internal class OptionGetOptionContractsResponseTest { ) .build() ) - assertThat(optionGetOptionContractsResponse.data()) + assertThat(instrumentGetOptionContractsResponse.data()) .containsExactly( OptionsContract.builder() .id("b6f4b5e2-94a8-4fe4-9a85-2b4a81d30cc5") @@ -111,8 +107,8 @@ internal class OptionGetOptionContractsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val optionGetOptionContractsResponse = - OptionGetOptionContractsResponse.builder() + val instrumentGetOptionContractsResponse = + InstrumentGetOptionContractsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -155,13 +151,13 @@ internal class OptionGetOptionContractsResponseTest { ) .build() - val roundtrippedOptionGetOptionContractsResponse = + val roundtrippedInstrumentGetOptionContractsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(optionGetOptionContractsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(instrumentGetOptionContractsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedOptionGetOptionContractsResponse) - .isEqualTo(optionGetOptionContractsResponse) + assertThat(roundtrippedInstrumentGetOptionContractsResponse) + .isEqualTo(instrumentGetOptionContractsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt index 133c4b2b..77469978 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt @@ -4,12 +4,12 @@ package com.clear_street.api.models.v1.omniai import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.NewOrderRequest -import com.clear_street.api.models.v1.accounts.orders.PositionEffect -import com.clear_street.api.models.v1.accounts.orders.RequestOrderType -import com.clear_street.api.models.v1.accounts.orders.RequestTimeInForce -import com.clear_street.api.models.v1.accounts.orders.Side -import com.clear_street.api.models.v1.accounts.orders.TrailingOffsetType +import com.clear_street.api.models.v1.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt index 295cd12c..1369f9b3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt @@ -3,6 +3,8 @@ package com.clear_street.api.models.v1.omniai import com.clear_street.api.core.jsonMapper +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementAgreementKey +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderActionTest.kt index 3ed889d1..f61c3b84 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderActionTest.kt @@ -3,7 +3,7 @@ package com.clear_street.api.models.v1.omniai import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.accounts.orders.CancelOrderRequest +import com.clear_street.api.models.v1.orders.CancelOrderRequest import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt index d4a9b5ab..740a5f2e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt @@ -4,12 +4,12 @@ package com.clear_street.api.models.v1.omniai import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.NewOrderRequest -import com.clear_street.api.models.v1.accounts.orders.PositionEffect -import com.clear_street.api.models.v1.accounts.orders.RequestOrderType -import com.clear_street.api.models.v1.accounts.orders.RequestTimeInForce -import com.clear_street.api.models.v1.accounts.orders.Side -import com.clear_street.api.models.v1.accounts.orders.TrailingOffsetType +import com.clear_street.api.models.v1.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt index 7deb541e..22b3fd8b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt @@ -6,13 +6,13 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.CancelOrderRequest -import com.clear_street.api.models.v1.accounts.orders.NewOrderRequest -import com.clear_street.api.models.v1.accounts.orders.PositionEffect -import com.clear_street.api.models.v1.accounts.orders.RequestOrderType -import com.clear_street.api.models.v1.accounts.orders.RequestTimeInForce -import com.clear_street.api.models.v1.accounts.orders.Side -import com.clear_street.api.models.v1.accounts.orders.TrailingOffsetType +import com.clear_street.api.models.v1.orders.CancelOrderRequest +import com.clear_street.api.models.v1.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt index f9ee317f..5252a067 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt @@ -6,12 +6,14 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.NewOrderRequest -import com.clear_street.api.models.v1.accounts.orders.PositionEffect -import com.clear_street.api.models.v1.accounts.orders.RequestOrderType -import com.clear_street.api.models.v1.accounts.orders.RequestTimeInForce -import com.clear_street.api.models.v1.accounts.orders.Side -import com.clear_street.api.models.v1.accounts.orders.TrailingOffsetType +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementAgreementKey +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode +import com.clear_street.api.models.v1.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsParamsTest.kt deleted file mode 100644 index a615b1ad..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsParamsTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.omniai.entitlementagreements - -import org.junit.jupiter.api.Test - -internal class EntitlementAgreementGetEntitlementAgreementsParamsTest { - - @Test - fun create() { - EntitlementAgreementGetEntitlementAgreementsParams.builder().build() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementResourceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementResourceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt index d38a692a..e60698ef 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementResourceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt @@ -1,10 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlementagreements +package com.clear_street.api.models.v1.omniai.entitlements import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.omniai.EntitlementAgreementKey -import com.clear_street.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt index 9fdb5d45..23c797d8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt @@ -2,7 +2,6 @@ package com.clear_street.api.models.v1.omniai.entitlements -import com.clear_street.api.models.v1.omniai.EntitlementCode import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt index 244d1695..524e7783 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt new file mode 100644 index 00000000..85516ef4 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt @@ -0,0 +1,13 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.omniai.entitlements + +import org.junit.jupiter.api.Test + +internal class EntitlementGetEntitlementAgreementsParamsTest { + + @Test + fun create() { + EntitlementGetEntitlementAgreementsParams.builder().build() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt similarity index 79% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt index 74468b10..9533e8df 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlementagreements/EntitlementAgreementGetEntitlementAgreementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt @@ -1,23 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlementagreements +package com.clear_street.api.models.v1.omniai.entitlements import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.EntitlementAgreementKey -import com.clear_street.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class EntitlementAgreementGetEntitlementAgreementsResponseTest { +internal class EntitlementGetEntitlementAgreementsResponseTest { @Test fun create() { - val entitlementAgreementGetEntitlementAgreementsResponse = - EntitlementAgreementGetEntitlementAgreementsResponse.builder() + val entitlementGetEntitlementAgreementsResponse = + EntitlementGetEntitlementAgreementsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -52,7 +50,7 @@ internal class EntitlementAgreementGetEntitlementAgreementsResponseTest { ) .build() - assertThat(entitlementAgreementGetEntitlementAgreementsResponse.metadata()) + assertThat(entitlementGetEntitlementAgreementsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -63,7 +61,7 @@ internal class EntitlementAgreementGetEntitlementAgreementsResponseTest { .totalPages(0) .build() ) - assertThat(entitlementAgreementGetEntitlementAgreementsResponse.error()) + assertThat(entitlementGetEntitlementAgreementsResponse.error()) .contains( ApiError.builder() .code(400) @@ -75,7 +73,7 @@ internal class EntitlementAgreementGetEntitlementAgreementsResponseTest { ) .build() ) - assertThat(entitlementAgreementGetEntitlementAgreementsResponse.data()) + assertThat(entitlementGetEntitlementAgreementsResponse.data()) .containsExactly( EntitlementAgreementResource.builder() .agreementId("agreement_id") @@ -92,8 +90,8 @@ internal class EntitlementAgreementGetEntitlementAgreementsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val entitlementAgreementGetEntitlementAgreementsResponse = - EntitlementAgreementGetEntitlementAgreementsResponse.builder() + val entitlementGetEntitlementAgreementsResponse = + EntitlementGetEntitlementAgreementsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -128,13 +126,13 @@ internal class EntitlementAgreementGetEntitlementAgreementsResponseTest { ) .build() - val roundtrippedEntitlementAgreementGetEntitlementAgreementsResponse = + val roundtrippedEntitlementGetEntitlementAgreementsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(entitlementAgreementGetEntitlementAgreementsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(entitlementGetEntitlementAgreementsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedEntitlementAgreementGetEntitlementAgreementsResponse) - .isEqualTo(entitlementAgreementGetEntitlementAgreementsResponse) + assertThat(roundtrippedEntitlementGetEntitlementAgreementsResponse) + .isEqualTo(entitlementGetEntitlementAgreementsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt index 9fa0d900..da6fd30c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt index 88a099e5..4c7c2cfb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt @@ -3,7 +3,6 @@ package com.clear_street.api.models.v1.omniai.entitlements import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateFeedbackResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateFeedbackResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt index 24108386..d96ab9c3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateFeedbackResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.messages import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt index 858078fe..8ebd2b33 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt @@ -6,12 +6,12 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.ErrorStatus -import com.clear_street.api.models.v1.omniai.Message -import com.clear_street.api.models.v1.omniai.MessageContent -import com.clear_street.api.models.v1.omniai.MessageContentPart -import com.clear_street.api.models.v1.omniai.MessageOutcome -import com.clear_street.api.models.v1.omniai.MessageRole +import com.clear_street.api.models.v1.omniai.responses.ErrorStatus +import com.clear_street.api.models.v1.omniai.threads.Message +import com.clear_street.api.models.v1.omniai.threads.MessageContent +import com.clear_street.api.models.v1.omniai.threads.MessageContentPart +import com.clear_street.api.models.v1.omniai.threads.MessageOutcome +import com.clear_street.api.models.v1.omniai.threads.MessageRole import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt index 05327425..9f396733 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.CreateFeedbackResponse import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CancelResponsePayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CancelResponsePayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt index 8d61d54f..b1ac18c8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CancelResponsePayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ErrorStatusTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatusTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ErrorStatusTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatusTest.kt index cdb72bc7..23fefc68 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ErrorStatusTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatusTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt index c770e6f0..4815a785 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.CancelResponsePayload import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentPartTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt index ed4a371d..be3a2403 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt @@ -1,17 +1,28 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.NewOrderRequest -import com.clear_street.api.models.v1.accounts.orders.PositionEffect -import com.clear_street.api.models.v1.accounts.orders.RequestOrderType -import com.clear_street.api.models.v1.accounts.orders.RequestTimeInForce -import com.clear_street.api.models.v1.accounts.orders.Side -import com.clear_street.api.models.v1.accounts.orders.TrailingOffsetType +import com.clear_street.api.models.v1.omniai.ActionButton +import com.clear_street.api.models.v1.omniai.ChartPayload +import com.clear_street.api.models.v1.omniai.ChartPoint +import com.clear_street.api.models.v1.omniai.ChartSeries +import com.clear_street.api.models.v1.omniai.DataChart +import com.clear_street.api.models.v1.omniai.PrefillOrderAction +import com.clear_street.api.models.v1.omniai.PromptButtonAction +import com.clear_street.api.models.v1.omniai.StructuredAction +import com.clear_street.api.models.v1.omniai.StructuredActionButtonAction +import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload +import com.clear_street.api.models.v1.omniai.SymbolChart +import com.clear_street.api.models.v1.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentTest.kt index 197b7b2e..8f2ba194 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseContentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt index 5ed8ea5a..e2a747c8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt @@ -6,11 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.ErrorStatus -import com.clear_street.api.models.v1.omniai.Response -import com.clear_street.api.models.v1.omniai.ResponseContent -import com.clear_street.api.models.v1.omniai.ResponseContentPart -import com.clear_street.api.models.v1.omniai.ResponseStatus import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseTest.kt index 85a48c99..8010504d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateMessageResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateMessageResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponseTest.kt index 54fa6393..6e388eb2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateMessageResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateThreadResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateThreadResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponseTest.kt index cb405b04..b9d34749 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/CreateThreadResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageContentPartTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt index 07dfe269..2849a3ba 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt @@ -1,17 +1,28 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.NewOrderRequest -import com.clear_street.api.models.v1.accounts.orders.PositionEffect -import com.clear_street.api.models.v1.accounts.orders.RequestOrderType -import com.clear_street.api.models.v1.accounts.orders.RequestTimeInForce -import com.clear_street.api.models.v1.accounts.orders.Side -import com.clear_street.api.models.v1.accounts.orders.TrailingOffsetType +import com.clear_street.api.models.v1.omniai.ActionButton +import com.clear_street.api.models.v1.omniai.ChartPayload +import com.clear_street.api.models.v1.omniai.ChartPoint +import com.clear_street.api.models.v1.omniai.ChartSeries +import com.clear_street.api.models.v1.omniai.DataChart +import com.clear_street.api.models.v1.omniai.PrefillOrderAction +import com.clear_street.api.models.v1.omniai.PromptButtonAction +import com.clear_street.api.models.v1.omniai.StructuredAction +import com.clear_street.api.models.v1.omniai.StructuredActionButtonAction +import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload +import com.clear_street.api.models.v1.omniai.SymbolChart +import com.clear_street.api.models.v1.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageContentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageContentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentTest.kt index 2c709422..76450642 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageContentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageTest.kt index db4a288f..32e84cf1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/MessageTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageTest.kt @@ -1,9 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper +import com.clear_street.api.models.v1.omniai.responses.ErrorStatus import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt similarity index 74% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt index ad016807..7dfdf172 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt @@ -1,27 +1,27 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads.messages +package com.clear_street.api.models.v1.omniai.threads import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class MessageCreateMessageParamsTest { +internal class ThreadCreateMessageParamsTest { @Test fun create() { - MessageCreateMessageParams.builder() + ThreadCreateMessageParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(19816L) .text("Compare that to AMD.") - .addCapability(MessageCreateMessageParams.Capability.PREFILL_ORDER) + .addCapability(ThreadCreateMessageParams.Capability.PREFILL_ORDER) .build() } @Test fun pathParams() { val params = - MessageCreateMessageParams.builder() + ThreadCreateMessageParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(19816L) .text("Compare that to AMD.") @@ -35,11 +35,11 @@ internal class MessageCreateMessageParamsTest { @Test fun body() { val params = - MessageCreateMessageParams.builder() + ThreadCreateMessageParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(19816L) .text("Compare that to AMD.") - .addCapability(MessageCreateMessageParams.Capability.PREFILL_ORDER) + .addCapability(ThreadCreateMessageParams.Capability.PREFILL_ORDER) .build() val body = params._body() @@ -47,13 +47,13 @@ internal class MessageCreateMessageParamsTest { assertThat(body.accountId()).isEqualTo(19816L) assertThat(body.text()).isEqualTo("Compare that to AMD.") assertThat(body.capabilities().getOrNull()) - .containsExactly(MessageCreateMessageParams.Capability.PREFILL_ORDER) + .containsExactly(ThreadCreateMessageParams.Capability.PREFILL_ORDER) } @Test fun bodyWithoutOptionalFields() { val params = - MessageCreateMessageParams.builder() + ThreadCreateMessageParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(19816L) .text("Compare that to AMD.") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt similarity index 83% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt index 9f799e32..3386b33c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageCreateMessageResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt @@ -1,22 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads.messages +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.CreateMessageResponse import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class MessageCreateMessageResponseTest { +internal class ThreadCreateMessageResponseTest { @Test fun create() { - val messageCreateMessageResponse = - MessageCreateMessageResponse.builder() + val threadCreateMessageResponse = + ThreadCreateMessageResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -47,7 +46,7 @@ internal class MessageCreateMessageResponseTest { ) .build() - assertThat(messageCreateMessageResponse.metadata()) + assertThat(threadCreateMessageResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -58,7 +57,7 @@ internal class MessageCreateMessageResponseTest { .totalPages(0) .build() ) - assertThat(messageCreateMessageResponse.error()) + assertThat(threadCreateMessageResponse.error()) .contains( ApiError.builder() .code(400) @@ -70,7 +69,7 @@ internal class MessageCreateMessageResponseTest { ) .build() ) - assertThat(messageCreateMessageResponse.data()) + assertThat(threadCreateMessageResponse.data()) .isEqualTo( CreateMessageResponse.builder() .responseId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -83,8 +82,8 @@ internal class MessageCreateMessageResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val messageCreateMessageResponse = - MessageCreateMessageResponse.builder() + val threadCreateMessageResponse = + ThreadCreateMessageResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -115,12 +114,12 @@ internal class MessageCreateMessageResponseTest { ) .build() - val roundtrippedMessageCreateMessageResponse = + val roundtrippedThreadCreateMessageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(messageCreateMessageResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(threadCreateMessageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedMessageCreateMessageResponse).isEqualTo(messageCreateMessageResponse) + assertThat(roundtrippedThreadCreateMessageResponse).isEqualTo(threadCreateMessageResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt index 52ff7550..9d28b6aa 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.CreateThreadResponse import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt index 55c2673d..1495cee2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads.messages +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class MessageGetMessagesParamsTest { +internal class ThreadGetMessagesParamsTest { @Test fun create() { - MessageGetMessagesParams.builder() + ThreadGetMessagesParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .pageSize(1L) @@ -21,7 +21,7 @@ internal class MessageGetMessagesParamsTest { @Test fun pathParams() { val params = - MessageGetMessagesParams.builder() + ThreadGetMessagesParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .build() @@ -34,7 +34,7 @@ internal class MessageGetMessagesParamsTest { @Test fun queryParams() { val params = - MessageGetMessagesParams.builder() + ThreadGetMessagesParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .pageSize(1L) @@ -56,7 +56,7 @@ internal class MessageGetMessagesParamsTest { @Test fun queryParamsWithoutOptionalFields() { val params = - MessageGetMessagesParams.builder() + ThreadGetMessagesParams.builder() .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountId(0L) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt similarity index 86% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt index 6fbbaea3..b2aff257 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/messages/MessageGetMessagesResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt @@ -1,27 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads.messages +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.ErrorStatus -import com.clear_street.api.models.v1.omniai.Message -import com.clear_street.api.models.v1.omniai.MessageContent -import com.clear_street.api.models.v1.omniai.MessageContentPart -import com.clear_street.api.models.v1.omniai.MessageOutcome -import com.clear_street.api.models.v1.omniai.MessageRole +import com.clear_street.api.models.v1.omniai.responses.ErrorStatus import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class MessageGetMessagesResponseTest { +internal class ThreadGetMessagesResponseTest { @Test fun create() { - val messageGetMessagesResponse = - MessageGetMessagesResponse.builder() + val threadGetMessagesResponse = + ThreadGetMessagesResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -72,7 +67,7 @@ internal class MessageGetMessagesResponseTest { ) .build() - assertThat(messageGetMessagesResponse.metadata()) + assertThat(threadGetMessagesResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -83,7 +78,7 @@ internal class MessageGetMessagesResponseTest { .totalPages(0) .build() ) - assertThat(messageGetMessagesResponse.error()) + assertThat(threadGetMessagesResponse.error()) .contains( ApiError.builder() .code(400) @@ -95,7 +90,7 @@ internal class MessageGetMessagesResponseTest { ) .build() ) - assertThat(messageGetMessagesResponse.data()) + assertThat(threadGetMessagesResponse.data()) .containsExactly( Message.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -128,8 +123,8 @@ internal class MessageGetMessagesResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val messageGetMessagesResponse = - MessageGetMessagesResponse.builder() + val threadGetMessagesResponse = + ThreadGetMessagesResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -180,12 +175,12 @@ internal class MessageGetMessagesResponseTest { ) .build() - val roundtrippedMessageGetMessagesResponse = + val roundtrippedThreadGetMessagesResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(messageGetMessagesResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(threadGetMessagesResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedMessageGetMessagesResponse).isEqualTo(messageGetMessagesResponse) + assertThat(roundtrippedThreadGetMessagesResponse).isEqualTo(threadGetMessagesResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt index ec2519e0..e28d1abd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.Thread import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt index 63b02bfb..0f7c1058 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt @@ -6,11 +6,11 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.ErrorStatus -import com.clear_street.api.models.v1.omniai.Response -import com.clear_street.api.models.v1.omniai.ResponseContent -import com.clear_street.api.models.v1.omniai.ResponseContentPart -import com.clear_street.api.models.v1.omniai.ResponseStatus +import com.clear_street.api.models.v1.omniai.responses.ErrorStatus +import com.clear_street.api.models.v1.omniai.responses.Response +import com.clear_street.api.models.v1.omniai.responses.ResponseContent +import com.clear_street.api.models.v1.omniai.responses.ResponseContentPart +import com.clear_street.api.models.v1.omniai.responses.ResponseStatus import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt index 7aa28496..d785db27 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.Thread import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ThreadTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ThreadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadTest.kt index 7690a3e2..d17f34ec 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ThreadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/CancelOrderRequestTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequestTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/CancelOrderRequestTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequestTest.kt index fcccaa3c..bd9eb1de 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/CancelOrderRequestTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequestTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/NewOrderRequestTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/NewOrderRequestTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt index b74e4061..bf67375c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/NewOrderRequestTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt index 27a69d17..9ea9e9c5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt index 29b15442..a0f9d904 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelAllOpenOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt index 36b82efc..0900ee59 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt index c14d6ce7..86758cbc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderCancelOpenOrderResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt index e9ce53dc..f674ac2a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt index 03338e5c..0b86ff00 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrderByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParamsTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParamsTest.kt index 61fd765a..2307279d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.http.QueryParams import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponseTest.kt index 006bad4d..d43a10bf 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderGetOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParamsTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParamsTest.kt index dded5894..89ed29f7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponseTest.kt index 06ad506d..e0b410de 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderReplaceOrderResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt index 22313259..b5db541e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.models.v1.SecurityType import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt index 225d84ad..78a315ac 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderSubmitOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderTest.kt index 31a71aa2..1bd4cbb5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/orders/OrderTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.orders +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt similarity index 73% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt index 3912aed7..7fcfe222 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InstructionCancelPositionInstructionParamsTest { +internal class PositionCancelPositionInstructionParamsTest { @Test fun create() { - InstructionCancelPositionInstructionParams.builder() + PositionCancelPositionInstructionParams.builder() .accountId(0L) .instructionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -18,7 +18,7 @@ internal class InstructionCancelPositionInstructionParamsTest { @Test fun pathParams() { val params = - InstructionCancelPositionInstructionParams.builder() + PositionCancelPositionInstructionParams.builder() .accountId(0L) .instructionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt index 85ef87f7..493e7f0e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionCancelPositionInstructionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -11,12 +11,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InstructionCancelPositionInstructionResponseTest { +internal class PositionCancelPositionInstructionResponseTest { @Test fun create() { - val instructionCancelPositionInstructionResponse = - InstructionCancelPositionInstructionResponse.builder() + val positionCancelPositionInstructionResponse = + PositionCancelPositionInstructionResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -57,7 +57,7 @@ internal class InstructionCancelPositionInstructionResponseTest { ) .build() - assertThat(instructionCancelPositionInstructionResponse.metadata()) + assertThat(positionCancelPositionInstructionResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -68,7 +68,7 @@ internal class InstructionCancelPositionInstructionResponseTest { .totalPages(0) .build() ) - assertThat(instructionCancelPositionInstructionResponse.error()) + assertThat(positionCancelPositionInstructionResponse.error()) .contains( ApiError.builder() .code(400) @@ -80,7 +80,7 @@ internal class InstructionCancelPositionInstructionResponseTest { ) .build() ) - assertThat(instructionCancelPositionInstructionResponse.data()) + assertThat(positionCancelPositionInstructionResponse.data()) .isEqualTo( PositionInstruction.builder() .id("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") @@ -103,8 +103,8 @@ internal class InstructionCancelPositionInstructionResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val instructionCancelPositionInstructionResponse = - InstructionCancelPositionInstructionResponse.builder() + val positionCancelPositionInstructionResponse = + PositionCancelPositionInstructionResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -145,13 +145,13 @@ internal class InstructionCancelPositionInstructionResponseTest { ) .build() - val roundtrippedInstructionCancelPositionInstructionResponse = + val roundtrippedPositionCancelPositionInstructionResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(instructionCancelPositionInstructionResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(positionCancelPositionInstructionResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInstructionCancelPositionInstructionResponse) - .isEqualTo(instructionCancelPositionInstructionResponse) + assertThat(roundtrippedPositionCancelPositionInstructionResponse) + .isEqualTo(positionCancelPositionInstructionResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParamsTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParamsTest.kt index 74c8583e..d0a63be1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponseTest.kt index 20f6e07b..6a98a4f3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponseTest.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.Order -import com.clear_street.api.models.v1.accounts.orders.OrderStatus -import com.clear_street.api.models.v1.accounts.orders.OrderType -import com.clear_street.api.models.v1.accounts.orders.QueueState -import com.clear_street.api.models.v1.accounts.orders.Side -import com.clear_street.api.models.v1.accounts.orders.TimeInForce -import com.clear_street.api.models.v1.accounts.orders.TrailingOffsetType +import com.clear_street.api.models.v1.orders.Order +import com.clear_street.api.models.v1.orders.OrderStatus +import com.clear_street.api.models.v1.orders.OrderType +import com.clear_street.api.models.v1.orders.QueueState +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TimeInForce +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParamsTest.kt index ea5a2c05..f00129ae 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponseTest.kt index b10bec21..5c3b59d2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionClosePositionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponseTest.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.Order -import com.clear_street.api.models.v1.accounts.orders.OrderStatus -import com.clear_street.api.models.v1.accounts.orders.OrderType -import com.clear_street.api.models.v1.accounts.orders.QueueState -import com.clear_street.api.models.v1.accounts.orders.Side -import com.clear_street.api.models.v1.accounts.orders.TimeInForce -import com.clear_street.api.models.v1.accounts.orders.TrailingOffsetType +import com.clear_street.api.models.v1.orders.Order +import com.clear_street.api.models.v1.orders.OrderStatus +import com.clear_street.api.models.v1.orders.OrderType +import com.clear_street.api.models.v1.orders.QueueState +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TimeInForce +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt similarity index 72% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt index 5a38d905..a5208304 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InstructionGetPositionInstructionsParamsTest { +internal class PositionGetPositionInstructionsParamsTest { @Test fun create() { - InstructionGetPositionInstructionsParams.builder() + PositionGetPositionInstructionsParams.builder() .accountId(0L) .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -18,7 +18,7 @@ internal class InstructionGetPositionInstructionsParamsTest { @Test fun pathParams() { - val params = InstructionGetPositionInstructionsParams.builder().accountId(0L).build() + val params = PositionGetPositionInstructionsParams.builder().accountId(0L).build() assertThat(params._pathParam(0)).isEqualTo("0") // out-of-bound path param @@ -28,7 +28,7 @@ internal class InstructionGetPositionInstructionsParamsTest { @Test fun queryParams() { val params = - InstructionGetPositionInstructionsParams.builder() + PositionGetPositionInstructionsParams.builder() .accountId(0L) .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -45,7 +45,7 @@ internal class InstructionGetPositionInstructionsParamsTest { @Test fun queryParamsWithoutOptionalFields() { - val params = InstructionGetPositionInstructionsParams.builder().accountId(0L).build() + val params = PositionGetPositionInstructionsParams.builder().accountId(0L).build() val queryParams = params._queryParams() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt index 3063d076..9986eb23 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -11,12 +11,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InstructionSubmitPositionInstructionsResponseTest { +internal class PositionGetPositionInstructionsResponseTest { @Test fun create() { - val instructionSubmitPositionInstructionsResponse = - InstructionSubmitPositionInstructionsResponse.builder() + val positionGetPositionInstructionsResponse = + PositionGetPositionInstructionsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -57,7 +57,7 @@ internal class InstructionSubmitPositionInstructionsResponseTest { ) .build() - assertThat(instructionSubmitPositionInstructionsResponse.metadata()) + assertThat(positionGetPositionInstructionsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -68,7 +68,7 @@ internal class InstructionSubmitPositionInstructionsResponseTest { .totalPages(0) .build() ) - assertThat(instructionSubmitPositionInstructionsResponse.error()) + assertThat(positionGetPositionInstructionsResponse.error()) .contains( ApiError.builder() .code(400) @@ -80,7 +80,7 @@ internal class InstructionSubmitPositionInstructionsResponseTest { ) .build() ) - assertThat(instructionSubmitPositionInstructionsResponse.data()) + assertThat(positionGetPositionInstructionsResponse.data()) .containsExactly( PositionInstruction.builder() .id("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") @@ -103,8 +103,8 @@ internal class InstructionSubmitPositionInstructionsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val instructionSubmitPositionInstructionsResponse = - InstructionSubmitPositionInstructionsResponse.builder() + val positionGetPositionInstructionsResponse = + PositionGetPositionInstructionsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -145,13 +145,13 @@ internal class InstructionSubmitPositionInstructionsResponseTest { ) .build() - val roundtrippedInstructionSubmitPositionInstructionsResponse = + val roundtrippedPositionGetPositionInstructionsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(instructionSubmitPositionInstructionsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(positionGetPositionInstructionsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInstructionSubmitPositionInstructionsResponse) - .isEqualTo(instructionSubmitPositionInstructionsResponse) + assertThat(roundtrippedPositionGetPositionInstructionsResponse) + .isEqualTo(positionGetPositionInstructionsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParamsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParamsTest.kt index 2b9d1cf4..8c398824 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponseTest.kt index 806882ca..c0000d83 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionGetPositionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt index ed985330..ccdc705b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/PositionInstructionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt similarity index 74% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt index 32083583..69410b41 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionSubmitPositionInstructionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InstructionSubmitPositionInstructionsParamsTest { +internal class PositionSubmitPositionInstructionsParamsTest { @Test fun create() { - InstructionSubmitPositionInstructionsParams.builder() + PositionSubmitPositionInstructionsParams.builder() .accountId(0L) .addInstruction( - InstructionSubmitPositionInstructionsParams.Instruction.builder() + PositionSubmitPositionInstructionsParams.Instruction.builder() .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") .quantity("1") @@ -25,10 +25,10 @@ internal class InstructionSubmitPositionInstructionsParamsTest { @Test fun pathParams() { val params = - InstructionSubmitPositionInstructionsParams.builder() + PositionSubmitPositionInstructionsParams.builder() .accountId(0L) .addInstruction( - InstructionSubmitPositionInstructionsParams.Instruction.builder() + PositionSubmitPositionInstructionsParams.Instruction.builder() .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") .quantity("1") @@ -44,10 +44,10 @@ internal class InstructionSubmitPositionInstructionsParamsTest { @Test fun body() { val params = - InstructionSubmitPositionInstructionsParams.builder() + PositionSubmitPositionInstructionsParams.builder() .accountId(0L) .addInstruction( - InstructionSubmitPositionInstructionsParams.Instruction.builder() + PositionSubmitPositionInstructionsParams.Instruction.builder() .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") .quantity("1") @@ -60,7 +60,7 @@ internal class InstructionSubmitPositionInstructionsParamsTest { assertThat(body) .containsExactly( - InstructionSubmitPositionInstructionsParams.Instruction.builder() + PositionSubmitPositionInstructionsParams.Instruction.builder() .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") .quantity("1") @@ -72,10 +72,10 @@ internal class InstructionSubmitPositionInstructionsParamsTest { @Test fun bodyWithoutOptionalFields() { val params = - InstructionSubmitPositionInstructionsParams.builder() + PositionSubmitPositionInstructionsParams.builder() .accountId(0L) .addInstruction( - InstructionSubmitPositionInstructionsParams.Instruction.builder() + PositionSubmitPositionInstructionsParams.Instruction.builder() .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") .quantity("1") @@ -87,7 +87,7 @@ internal class InstructionSubmitPositionInstructionsParamsTest { assertThat(body) .containsExactly( - InstructionSubmitPositionInstructionsParams.Instruction.builder() + PositionSubmitPositionInstructionsParams.Instruction.builder() .instructionType(PositionInstructionType.EXERCISE) .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") .quantity("1") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt similarity index 87% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt index 7a405418..d64cad89 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/instructions/InstructionGetPositionInstructionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions.instructions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -11,12 +11,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InstructionGetPositionInstructionsResponseTest { +internal class PositionSubmitPositionInstructionsResponseTest { @Test fun create() { - val instructionGetPositionInstructionsResponse = - InstructionGetPositionInstructionsResponse.builder() + val positionSubmitPositionInstructionsResponse = + PositionSubmitPositionInstructionsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -57,7 +57,7 @@ internal class InstructionGetPositionInstructionsResponseTest { ) .build() - assertThat(instructionGetPositionInstructionsResponse.metadata()) + assertThat(positionSubmitPositionInstructionsResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -68,7 +68,7 @@ internal class InstructionGetPositionInstructionsResponseTest { .totalPages(0) .build() ) - assertThat(instructionGetPositionInstructionsResponse.error()) + assertThat(positionSubmitPositionInstructionsResponse.error()) .contains( ApiError.builder() .code(400) @@ -80,7 +80,7 @@ internal class InstructionGetPositionInstructionsResponseTest { ) .build() ) - assertThat(instructionGetPositionInstructionsResponse.data()) + assertThat(positionSubmitPositionInstructionsResponse.data()) .containsExactly( PositionInstruction.builder() .id("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") @@ -103,8 +103,8 @@ internal class InstructionGetPositionInstructionsResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val instructionGetPositionInstructionsResponse = - InstructionGetPositionInstructionsResponse.builder() + val positionSubmitPositionInstructionsResponse = + PositionSubmitPositionInstructionsResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -145,13 +145,13 @@ internal class InstructionGetPositionInstructionsResponseTest { ) .build() - val roundtrippedInstructionGetPositionInstructionsResponse = + val roundtrippedPositionSubmitPositionInstructionsResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(instructionGetPositionInstructionsResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(positionSubmitPositionInstructionsResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInstructionGetPositionInstructionsResponse) - .isEqualTo(instructionGetPositionInstructionsResponse) + assertThat(roundtrippedPositionSubmitPositionInstructionsResponse) + .isEqualTo(positionSubmitPositionInstructionsResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionTest.kt index af9a1c38..347b2353 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/positions/PositionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts.positions +package com.clear_street.api.models.v1.positions import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionParamsTest.kt deleted file mode 100644 index 4e1ccfa4..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/version/VersionGetVersionParamsTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.version - -import org.junit.jupiter.api.Test - -internal class VersionGetVersionParamsTest { - - @Test - fun create() { - VersionGetVersionParams.builder().build() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/AddWatchlistItemDataTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemDataTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/AddWatchlistItemDataTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemDataTest.kt index f430a699..448267a1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/AddWatchlistItemDataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemDataTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt similarity index 80% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt index f228cdb2..6466d1cd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class ItemAddWatchlistItemParamsTest { +internal class WatchlistAddWatchlistItemParamsTest { @Test fun create() { - ItemAddWatchlistItemParams.builder() + WatchlistAddWatchlistItemParams.builder() .watchlistId("550e8400-e29b-41d4-a716-446655440000") .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -18,7 +18,7 @@ internal class ItemAddWatchlistItemParamsTest { @Test fun pathParams() { val params = - ItemAddWatchlistItemParams.builder() + WatchlistAddWatchlistItemParams.builder() .watchlistId("550e8400-e29b-41d4-a716-446655440000") .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() @@ -31,7 +31,7 @@ internal class ItemAddWatchlistItemParamsTest { @Test fun body() { val params = - ItemAddWatchlistItemParams.builder() + WatchlistAddWatchlistItemParams.builder() .watchlistId("550e8400-e29b-41d4-a716-446655440000") .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt index 481c9be6..0d9e7ac0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemAddWatchlistItemResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper @@ -10,12 +10,12 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class ItemAddWatchlistItemResponseTest { +internal class WatchlistAddWatchlistItemResponseTest { @Test fun create() { - val itemAddWatchlistItemResponse = - ItemAddWatchlistItemResponse.builder() + val watchlistAddWatchlistItemResponse = + WatchlistAddWatchlistItemResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -44,7 +44,7 @@ internal class ItemAddWatchlistItemResponseTest { ) .build() - assertThat(itemAddWatchlistItemResponse.metadata()) + assertThat(watchlistAddWatchlistItemResponse.metadata()) .isEqualTo( ResponseMetadata.builder() .requestId("request_id") @@ -55,7 +55,7 @@ internal class ItemAddWatchlistItemResponseTest { .totalPages(0) .build() ) - assertThat(itemAddWatchlistItemResponse.error()) + assertThat(watchlistAddWatchlistItemResponse.error()) .contains( ApiError.builder() .code(400) @@ -67,7 +67,7 @@ internal class ItemAddWatchlistItemResponseTest { ) .build() ) - assertThat(itemAddWatchlistItemResponse.data()) + assertThat(watchlistAddWatchlistItemResponse.data()) .isEqualTo( AddWatchlistItemData.builder() .itemId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -78,8 +78,8 @@ internal class ItemAddWatchlistItemResponseTest { @Test fun roundtrip() { val jsonMapper = jsonMapper() - val itemAddWatchlistItemResponse = - ItemAddWatchlistItemResponse.builder() + val watchlistAddWatchlistItemResponse = + WatchlistAddWatchlistItemResponse.builder() .metadata( ResponseMetadata.builder() .requestId("request_id") @@ -108,12 +108,13 @@ internal class ItemAddWatchlistItemResponseTest { ) .build() - val roundtrippedItemAddWatchlistItemResponse = + val roundtrippedWatchlistAddWatchlistItemResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(itemAddWatchlistItemResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(watchlistAddWatchlistItemResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedItemAddWatchlistItemResponse).isEqualTo(itemAddWatchlistItemResponse) + assertThat(roundtrippedWatchlistAddWatchlistItemResponse) + .isEqualTo(watchlistAddWatchlistItemResponse) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt index 0f63995c..bbc8b6a9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt index a63ff413..cdd42792 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistCreateWatchlistResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt similarity index 79% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt index 1cb57de3..a033264e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists.items +package com.clear_street.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class ItemDeleteWatchlistItemParamsTest { +internal class WatchlistDeleteWatchlistItemParamsTest { @Test fun create() { - ItemDeleteWatchlistItemParams.builder() + WatchlistDeleteWatchlistItemParams.builder() .watchlistId("550e8400-e29b-41d4-a716-446655440000") .itemId("660e8400-e29b-41d4-a716-446655440001") .build() @@ -18,7 +18,7 @@ internal class ItemDeleteWatchlistItemParamsTest { @Test fun pathParams() { val params = - ItemDeleteWatchlistItemParams.builder() + WatchlistDeleteWatchlistItemParams.builder() .watchlistId("550e8400-e29b-41d4-a716-446655440000") .itemId("660e8400-e29b-41d4-a716-446655440001") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt new file mode 100644 index 00000000..21f01dbb --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.watchlist + +import com.clear_street.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class WatchlistDeleteWatchlistItemResponseTest { + + @Test + fun create() { + val watchlistDeleteWatchlistItemResponse = + WatchlistDeleteWatchlistItemResponse.builder().build() + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val watchlistDeleteWatchlistItemResponse = + WatchlistDeleteWatchlistItemResponse.builder().build() + + val roundtrippedWatchlistDeleteWatchlistItemResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(watchlistDeleteWatchlistItemResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedWatchlistDeleteWatchlistItemResponse) + .isEqualTo(watchlistDeleteWatchlistItemResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt index a3a517a2..1443629e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt index 0a78fae2..bff1b8eb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDetailTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt index edbeca16..ad623278 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntryTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistEntryTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntryTest.kt index bec148fa..c8851685 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntryTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt index 9bb226c2..8412fc6b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index cdbe61e9..4bc6f623 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt index f4ae6694..74b4a276 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt index 6cf480f8..3541d5b1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistGetWatchlistsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistItemEntryTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt index cccdddfa..82da69e5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlists +package com.clear_street.api.models.v1.watchlist import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemResponseTest.kt deleted file mode 100644 index 55186132..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemResponseTest.kt +++ /dev/null @@ -1,31 +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.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class ItemDeleteWatchlistItemResponseTest { - - @Test - fun create() { - val itemDeleteWatchlistItemResponse = ItemDeleteWatchlistItemResponse.builder().build() - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val itemDeleteWatchlistItemResponse = ItemDeleteWatchlistItemResponse.builder().build() - - val roundtrippedItemDeleteWatchlistItemResponse = - jsonMapper.readValue( - jsonMapper.writeValueAsString(itemDeleteWatchlistItemResponse), - jacksonTypeRef(), - ) - - assertThat(roundtrippedItemDeleteWatchlistItemResponse) - .isEqualTo(itemDeleteWatchlistItemResponse) - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt new file mode 100644 index 00000000..c0842912 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt @@ -0,0 +1,13 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.websocket + +import org.junit.jupiter.api.Test + +internal class WebsocketWebsocketHandlerParamsTest { + + @Test + fun create() { + WebsocketWebsocketHandlerParams.builder().build() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncTest.kt index c0a2aa8b..ced98004 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncTest.kt @@ -3,14 +3,35 @@ package com.clear_street.api.services.async.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesParams import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams import com.clear_street.api.models.v1.accounts.RiskSettings +import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test internal class AccountServiceAsyncTest { + @Disabled("Mock server tests are disabled") + @Test + fun getAccountBalances() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val accountServiceAsync = client.v1().accounts() + + val responseFuture = + accountServiceAsync.getAccountBalances( + AccountGetAccountBalancesParams.builder() + .accountId(0L) + .topMarginContributorsLimit(1) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getAccountById() { @@ -41,6 +62,25 @@ internal class AccountServiceAsyncTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getPortfolioHistory() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val accountServiceAsync = client.v1().accounts() + + val responseFuture = + accountServiceAsync.getPortfolioHistory( + AccountGetPortfolioHistoryParams.builder() + .accountId(0L) + .startDate(LocalDate.parse("2019-12-27")) + .endDate(LocalDate.parse("2019-12-27")) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun patchAccountById() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncTest.kt similarity index 74% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncTest.kt index 95f10cc8..9bcb894c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncTest.kt @@ -6,15 +6,15 @@ import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -internal class VersionServiceAsyncTest { +internal class ApiVersionServiceAsyncTest { @Disabled("Mock server tests are disabled") @Test fun getVersion() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val versionServiceAsync = client.v1().version() + val apiVersionServiceAsync = client.v1().apiVersion() - val responseFuture = versionServiceAsync.getVersion() + val responseFuture = apiVersionServiceAsync.getVersion() val response = responseFuture.get() response.validate() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncTest.kt new file mode 100644 index 00000000..13848a37 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncTest.kt @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.async.v1 + +import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clear_street.api.models.v1.calendar.MarketType +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + +internal class CalendarServiceAsyncTest { + + @Disabled("Mock server tests are disabled") + @Test + fun getClock() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val calendarServiceAsync = client.v1().calendar() + + val responseFuture = calendarServiceAsync.getClock() + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getMarketHoursCalendar() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val calendarServiceAsync = client.v1().calendar() + + val responseFuture = + calendarServiceAsync.getMarketHoursCalendar( + CalendarGetMarketHoursCalendarParams.builder() + .date("date") + .market(MarketType.US_EQUITIES) + .build() + ) + + val response = responseFuture.get() + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsyncTest.kt deleted file mode 100644 index b3d12524..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsyncTest.kt +++ /dev/null @@ -1,22 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class ClockServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getClock() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val clockServiceAsync = client.v1().clock() - - val responseFuture = clockServiceAsync.getClock() - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncTest.kt new file mode 100644 index 00000000..30c23a4c --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncTest.kt @@ -0,0 +1,154 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.async.v1 + +import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clear_street.api.models.v1.instrumentdata.AllEventsEventType +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import java.time.LocalDate +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + +internal class InstrumentDataServiceAsyncTest { + + @Disabled("Mock server tests are disabled") + @Test + fun getAllInstrumentEvents() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val instrumentDataServiceAsync = client.v1().instrumentData() + + val responseFuture = + instrumentDataServiceAsync.getAllInstrumentEvents( + InstrumentDataGetAllInstrumentEventsParams.builder() + .addEventType(AllEventsEventType.EARNINGS) + .fromDate("from_date") + .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .toDate("to_date") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentAnalystConsensus() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val instrumentDataServiceAsync = client.v1().instrumentData() + + val responseFuture = + instrumentDataServiceAsync.getInstrumentAnalystConsensus( + InstrumentDataGetInstrumentAnalystConsensusParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .from(LocalDate.parse("2019-12-27")) + .to(LocalDate.parse("2019-12-27")) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentBalanceSheetStatements() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val instrumentDataServiceAsync = client.v1().instrumentData() + + val responseFuture = + instrumentDataServiceAsync.getInstrumentBalanceSheetStatements( + InstrumentDataGetInstrumentBalanceSheetStatementsParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fromDate("from_date") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .toDate("to_date") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentCashFlowStatements() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val instrumentDataServiceAsync = client.v1().instrumentData() + + val responseFuture = + instrumentDataServiceAsync.getInstrumentCashFlowStatements( + InstrumentDataGetInstrumentCashFlowStatementsParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fromDate("from_date") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .toDate("to_date") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentEvents() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val instrumentDataServiceAsync = client.v1().instrumentData() + + val responseFuture = + instrumentDataServiceAsync.getInstrumentEvents( + InstrumentDataGetInstrumentEventsParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fromDate("from_date") + .toDate("to_date") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentFundamentals() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val instrumentDataServiceAsync = client.v1().instrumentData() + + val responseFuture = + instrumentDataServiceAsync.getInstrumentFundamentals( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentIncomeStatements() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val instrumentDataServiceAsync = client.v1().instrumentData() + + val responseFuture = + instrumentDataServiceAsync.getInstrumentIncomeStatements( + InstrumentDataGetInstrumentIncomeStatementsParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fromDate("from_date") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .toDate("to_date") + .build() + ) + + val response = responseFuture.get() + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt index 0eaa78ac..ababb83d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt @@ -3,9 +3,12 @@ package com.clear_street.api.services.async.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clear_street.api.models.v1.instruments.ContractType import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdParams import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams +import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -55,6 +58,28 @@ internal class InstrumentServiceAsyncTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getOptionContracts() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val instrumentServiceAsync = client.v1().instruments() + + val responseFuture = + instrumentServiceAsync.getOptionContracts( + InstrumentGetOptionContractsParams.builder() + .contractType(ContractType.CALL) + .expiry(LocalDate.parse("2019-12-27")) + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .underlier("underlier") + .underlyingInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun searchInstruments() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt similarity index 84% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt index ed5cc520..050359d7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/OrderServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.accounts +package com.clear_street.api.services.async.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.accounts.orders.PositionEffect -import com.clear_street.api.models.v1.accounts.orders.RequestOrderType -import com.clear_street.api.models.v1.accounts.orders.RequestTimeInForce -import com.clear_street.api.models.v1.accounts.orders.Side +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams +import com.clear_street.api.models.v1.orders.OrderGetOrdersParams +import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side import java.time.OffsetDateTime import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -24,7 +24,7 @@ internal class OrderServiceAsyncTest { @Test fun cancelAllOpenOrders() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val orderServiceAsync = client.v1().accounts().orders() + val orderServiceAsync = client.v1().orders() val responseFuture = orderServiceAsync.cancelAllOpenOrders( @@ -45,7 +45,7 @@ internal class OrderServiceAsyncTest { @Test fun cancelOpenOrder() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val orderServiceAsync = client.v1().accounts().orders() + val orderServiceAsync = client.v1().orders() val responseFuture = orderServiceAsync.cancelOpenOrder( @@ -60,7 +60,7 @@ internal class OrderServiceAsyncTest { @Test fun getOrderById() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val orderServiceAsync = client.v1().accounts().orders() + val orderServiceAsync = client.v1().orders() val responseFuture = orderServiceAsync.getOrderById( @@ -75,7 +75,7 @@ internal class OrderServiceAsyncTest { @Test fun getOrders() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val orderServiceAsync = client.v1().accounts().orders() + val orderServiceAsync = client.v1().orders() val responseFuture = orderServiceAsync.getOrders( @@ -101,7 +101,7 @@ internal class OrderServiceAsyncTest { @Test fun replaceOrder() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val orderServiceAsync = client.v1().accounts().orders() + val orderServiceAsync = client.v1().orders() val responseFuture = orderServiceAsync.replaceOrder( @@ -123,7 +123,7 @@ internal class OrderServiceAsyncTest { @Test fun submitOrders() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val orderServiceAsync = client.v1().accounts().orders() + val orderServiceAsync = client.v1().orders() val responseFuture = orderServiceAsync.submitOrders( diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncTest.kt new file mode 100644 index 00000000..68464bdf --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncTest.kt @@ -0,0 +1,134 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.async.v1 + +import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clear_street.api.models.v1.positions.PositionClosePositionParams +import com.clear_street.api.models.v1.positions.PositionClosePositionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionsParams +import com.clear_street.api.models.v1.positions.PositionInstructionType +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + +internal class PositionServiceAsyncTest { + + @Disabled("Mock server tests are disabled") + @Test + fun cancelPositionInstruction() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val positionServiceAsync = client.v1().positions() + + val responseFuture = + positionServiceAsync.cancelPositionInstruction( + PositionCancelPositionInstructionParams.builder() + .accountId(0L) + .instructionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun closePosition() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val positionServiceAsync = client.v1().positions() + + val responseFuture = + positionServiceAsync.closePosition( + PositionClosePositionParams.builder() + .accountId(0L) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .cancelOrders(false) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun closePositions() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val positionServiceAsync = client.v1().positions() + + val responseFuture = + positionServiceAsync.closePositions( + PositionClosePositionsParams.builder().accountId(0L).cancelOrders(false).build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getPositionInstructions() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val positionServiceAsync = client.v1().positions() + + val responseFuture = + positionServiceAsync.getPositionInstructions( + PositionGetPositionInstructionsParams.builder() + .accountId(0L) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getPositions() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val positionServiceAsync = client.v1().positions() + + val responseFuture = + positionServiceAsync.getPositions( + PositionGetPositionsParams.builder() + .accountId(0L) + .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .sortBy(PositionGetPositionsParams.SortBy.SYMBOL) + .sortDirection(PositionGetPositionsParams.SortDirection.ASC) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun submitPositionInstructions() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val positionServiceAsync = client.v1().positions() + + val responseFuture = + positionServiceAsync.submitPositionInstructions( + PositionSubmitPositionInstructionsParams.builder() + .accountId(0L) + .addInstruction( + PositionSubmitPositionInstructionsParams.Instruction.builder() + .instructionType(PositionInstructionType.EXERCISE) + .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") + .quantity("1") + .instructionId("ui-20260424-001") + .build() + ) + .build() + ) + + val response = responseFuture.get() + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncTest.kt index 006fb75a..6e94f28d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncTest.kt @@ -3,18 +3,38 @@ package com.clear_street.api.services.async.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.watchlists.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsParams +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test internal class WatchlistServiceAsyncTest { + @Disabled("Mock server tests are disabled") + @Test + fun addWatchlistItem() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val watchlistServiceAsync = client.v1().watchlist() + + val responseFuture = + watchlistServiceAsync.addWatchlistItem( + WatchlistAddWatchlistItemParams.builder() + .watchlistId("550e8400-e29b-41d4-a716-446655440000") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun createWatchlist() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val watchlistServiceAsync = client.v1().watchlists() + val watchlistServiceAsync = client.v1().watchlist() val responseFuture = watchlistServiceAsync.createWatchlist( @@ -29,7 +49,7 @@ internal class WatchlistServiceAsyncTest { @Test fun deleteWatchlist() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val watchlistServiceAsync = client.v1().watchlists() + val watchlistServiceAsync = client.v1().watchlist() val responseFuture = watchlistServiceAsync.deleteWatchlist("550e8400-e29b-41d4-a716-446655440000") @@ -38,11 +58,29 @@ internal class WatchlistServiceAsyncTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun deleteWatchlistItem() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val watchlistServiceAsync = client.v1().watchlist() + + val responseFuture = + watchlistServiceAsync.deleteWatchlistItem( + WatchlistDeleteWatchlistItemParams.builder() + .watchlistId("550e8400-e29b-41d4-a716-446655440000") + .itemId("660e8400-e29b-41d4-a716-446655440001") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getWatchlistById() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val watchlistServiceAsync = client.v1().watchlists() + val watchlistServiceAsync = client.v1().watchlist() val responseFuture = watchlistServiceAsync.getWatchlistById("550e8400-e29b-41d4-a716-446655440000") @@ -55,7 +93,7 @@ internal class WatchlistServiceAsyncTest { @Test fun getWatchlists() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val watchlistServiceAsync = client.v1().watchlists() + val watchlistServiceAsync = client.v1().watchlist() val responseFuture = watchlistServiceAsync.getWatchlists( diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/V1ServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncTest.kt similarity index 66% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/V1ServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncTest.kt index 950476ea..9b3199ff 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/V1ServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncTest.kt @@ -1,20 +1,20 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async +package com.clear_street.api.services.async.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -internal class V1ServiceAsyncTest { +internal class WebsocketServiceAsyncTest { @Disabled("Mock server tests are disabled") @Test fun websocketHandler() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val v1ServiceAsync = client.v1() + val websocketServiceAsync = client.v1().websocket() - val future = v1ServiceAsync.websocketHandler() + val future = websocketServiceAsync.websocketHandler() val response = future.get() } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsyncTest.kt deleted file mode 100644 index dc2e59c6..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsyncTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.accounts - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.accounts.balances.BalanceGetAccountBalancesParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class BalanceServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getAccountBalances() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val balanceServiceAsync = client.v1().accounts().balances() - - val responseFuture = - balanceServiceAsync.getAccountBalances( - BalanceGetAccountBalancesParams.builder() - .accountId(0L) - .topMarginContributorsLimit(1) - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsyncTest.kt deleted file mode 100644 index c228ef2d..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsyncTest.kt +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.accounts - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.accounts.portfoliohistory.PortfolioHistoryGetPortfolioHistoryParams -import java.time.LocalDate -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class PortfolioHistoryServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getPortfolioHistory() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val portfolioHistoryServiceAsync = client.v1().accounts().portfolioHistory() - - val responseFuture = - portfolioHistoryServiceAsync.getPortfolioHistory( - PortfolioHistoryGetPortfolioHistoryParams.builder() - .accountId(0L) - .startDate(LocalDate.parse("2019-12-27")) - .endDate(LocalDate.parse("2019-12-27")) - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsyncTest.kt deleted file mode 100644 index 41e2fc0c..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsyncTest.kt +++ /dev/null @@ -1,69 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.accounts - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionParams -import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionsParams -import com.clear_street.api.models.v1.accounts.positions.PositionGetPositionsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class PositionServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun closePosition() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val positionServiceAsync = client.v1().accounts().positions() - - val responseFuture = - positionServiceAsync.closePosition( - PositionClosePositionParams.builder() - .accountId(0L) - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .cancelOrders(false) - .build() - ) - - val response = responseFuture.get() - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun closePositions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val positionServiceAsync = client.v1().accounts().positions() - - val responseFuture = - positionServiceAsync.closePositions( - PositionClosePositionsParams.builder().accountId(0L).cancelOrders(false).build() - ) - - val response = responseFuture.get() - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getPositions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val positionServiceAsync = client.v1().accounts().positions() - - val responseFuture = - positionServiceAsync.getPositions( - PositionGetPositionsParams.builder() - .accountId(0L) - .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .sortBy(PositionGetPositionsParams.SortBy.SYMBOL) - .sortDirection(PositionGetPositionsParams.SortDirection.ASC) - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsyncTest.kt deleted file mode 100644 index 21534888..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsyncTest.kt +++ /dev/null @@ -1,75 +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.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionCancelPositionInstructionParams -import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionGetPositionInstructionsParams -import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionSubmitPositionInstructionsParams -import com.clear_street.api.models.v1.accounts.positions.instructions.PositionInstructionType -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class InstructionServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun cancelPositionInstruction() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val instructionServiceAsync = client.v1().accounts().positions().instructions() - - val responseFuture = - instructionServiceAsync.cancelPositionInstruction( - InstructionCancelPositionInstructionParams.builder() - .accountId(0L) - .instructionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - val response = responseFuture.get() - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getPositionInstructions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val instructionServiceAsync = client.v1().accounts().positions().instructions() - - val responseFuture = - instructionServiceAsync.getPositionInstructions( - InstructionGetPositionInstructionsParams.builder() - .accountId(0L) - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - val response = responseFuture.get() - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun submitPositionInstructions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val instructionServiceAsync = client.v1().accounts().positions().instructions() - - val responseFuture = - instructionServiceAsync.submitPositionInstructions( - InstructionSubmitPositionInstructionsParams.builder() - .accountId(0L) - .addInstruction( - InstructionSubmitPositionInstructionsParams.Instruction.builder() - .instructionType(PositionInstructionType.EXERCISE) - .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .quantity("1") - .instructionId("ui-20260424-001") - .build() - ) - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsyncTest.kt deleted file mode 100644 index 75d457a8..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsyncTest.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.calendars - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.calendars.markethours.MarketHourGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendars.markethours.MarketType -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class MarketHourServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getMarketHoursCalendar() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val marketHourServiceAsync = client.v1().calendars().marketHours() - - val responseFuture = - marketHourServiceAsync.getMarketHoursCalendar( - MarketHourGetMarketHoursCalendarParams.builder() - .date("date") - .market(MarketType.US_EQUITIES) - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt new file mode 100644 index 00000000..afceaa34 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt @@ -0,0 +1,44 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.async.v1.instrumentdata + +import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + +internal class MarketDataServiceAsyncTest { + + @Disabled("Mock server tests are disabled") + @Test + fun getDailySummaries() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val marketDataServiceAsync = client.v1().instrumentData().marketData() + + val responseFuture = + marketDataServiceAsync.getDailySummaries( + MarketDataGetDailySummariesParams.builder().instrumentIds("instrument_ids").build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getSnapshots() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val marketDataServiceAsync = client.v1().instrumentData().marketData() + + val responseFuture = + marketDataServiceAsync.getSnapshots( + MarketDataGetSnapshotsParams.builder() + .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + val response = responseFuture.get() + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/NewsServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt similarity index 84% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/NewsServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt index 0df01438..4fee1f0d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/NewsServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clear_street.api.services.async.v1.instrumentdata import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.news.NewsGetNewsParams +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -13,7 +13,7 @@ internal class NewsServiceAsyncTest { @Test fun getNews() { val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val newsServiceAsync = client.v1().news() + val newsServiceAsync = client.v1().instrumentData().news() val responseFuture = newsServiceAsync.getNews( diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsyncTest.kt deleted file mode 100644 index 5e619b2a..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsyncTest.kt +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instruments.analystreporting.AnalystReportingGetInstrumentAnalystConsensusParams -import java.time.LocalDate -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class AnalystReportingServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentAnalystConsensus() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val analystReportingServiceAsync = client.v1().instruments().analystReporting() - - val responseFuture = - analystReportingServiceAsync.getInstrumentAnalystConsensus( - AnalystReportingGetInstrumentAnalystConsensusParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .from(LocalDate.parse("2019-12-27")) - .to(LocalDate.parse("2019-12-27")) - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsyncTest.kt deleted file mode 100644 index c3eca36b..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsyncTest.kt +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instruments.balancesheets.BalanceSheetGetInstrumentBalanceSheetStatementsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class BalanceSheetServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentBalanceSheetStatements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val balanceSheetServiceAsync = client.v1().instruments().balanceSheets() - - val responseFuture = - balanceSheetServiceAsync.getInstrumentBalanceSheetStatements( - BalanceSheetGetInstrumentBalanceSheetStatementsParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fromDate("from_date") - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .toDate("to_date") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsyncTest.kt deleted file mode 100644 index 09383305..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/CashFlowStatementServiceAsyncTest.kt +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instruments.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class CashFlowStatementServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentCashFlowStatements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val cashFlowStatementServiceAsync = client.v1().instruments().cashFlowStatements() - - val responseFuture = - cashFlowStatementServiceAsync.getInstrumentCashFlowStatements( - CashFlowStatementGetInstrumentCashFlowStatementsParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fromDate("from_date") - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .toDate("to_date") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsyncTest.kt deleted file mode 100644 index d9e82bc5..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/EventServiceAsyncTest.kt +++ /dev/null @@ -1,52 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instruments.events.AllEventsEventType -import com.clear_street.api.models.v1.instruments.events.EventGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class EventServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getAllInstrumentEvents() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val eventServiceAsync = client.v1().instruments().events() - - val responseFuture = - eventServiceAsync.getAllInstrumentEvents( - EventGetAllInstrumentEventsParams.builder() - .addEventType(AllEventsEventType.EARNINGS) - .fromDate("from_date") - .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .toDate("to_date") - .build() - ) - - val response = responseFuture.get() - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentEvents() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val eventServiceAsync = client.v1().instruments().events() - - val responseFuture = - eventServiceAsync.getInstrumentEvents( - EventGetInstrumentEventsParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fromDate("from_date") - .toDate("to_date") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsyncTest.kt deleted file mode 100644 index 5551f2bd..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/FundamentalServiceAsyncTest.kt +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class FundamentalServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentFundamentals() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val fundamentalServiceAsync = client.v1().instruments().fundamentals() - - val responseFuture = - fundamentalServiceAsync.getInstrumentFundamentals( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsyncTest.kt deleted file mode 100644 index 96f5eabc..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/IncomeStatementServiceAsyncTest.kt +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instruments.incomestatements.IncomeStatementGetInstrumentIncomeStatementsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class IncomeStatementServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentIncomeStatements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val incomeStatementServiceAsync = client.v1().instruments().incomeStatements() - - val responseFuture = - incomeStatementServiceAsync.getInstrumentIncomeStatements( - IncomeStatementGetInstrumentIncomeStatementsParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fromDate("from_date") - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .toDate("to_date") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsyncTest.kt deleted file mode 100644 index 19561ed0..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instruments/OptionServiceAsyncTest.kt +++ /dev/null @@ -1,35 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instruments.ContractType -import com.clear_street.api.models.v1.instruments.options.OptionGetOptionContractsParams -import java.time.LocalDate -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class OptionServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getOptionContracts() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val optionServiceAsync = client.v1().instruments().options() - - val responseFuture = - optionServiceAsync.getOptionContracts( - OptionGetOptionContractsParams.builder() - .contractType(ContractType.CALL) - .expiry(LocalDate.parse("2019-12-27")) - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .underlier("underlier") - .underlyingInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsyncTest.kt deleted file mode 100644 index b348f5d7..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/marketdata/DailySummaryServiceAsyncTest.kt +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.marketdata - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.marketdata.dailysummary.DailySummaryGetDailySummariesParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class DailySummaryServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getDailySummaries() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val dailySummaryServiceAsync = client.v1().marketData().dailySummary() - - val responseFuture = - dailySummaryServiceAsync.getDailySummaries( - DailySummaryGetDailySummariesParams.builder() - .instrumentIds("instrument_ids") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsyncTest.kt deleted file mode 100644 index 02a5f715..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/marketdata/SnapshotServiceAsyncTest.kt +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.marketdata - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.marketdata.snapshot.SnapshotGetSnapshotsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class SnapshotServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getSnapshots() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val snapshotServiceAsync = client.v1().marketData().snapshot() - - val responseFuture = - snapshotServiceAsync.getSnapshots( - SnapshotGetSnapshotsParams.builder() - .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsyncTest.kt deleted file mode 100644 index a36b3a9e..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementAgreementServiceAsyncTest.kt +++ /dev/null @@ -1,22 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.omniai - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class EntitlementAgreementServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getEntitlementAgreements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val entitlementAgreementServiceAsync = client.v1().omniAi().entitlementAgreements() - - val responseFuture = entitlementAgreementServiceAsync.getEntitlementAgreements() - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt index 0594fbd0..0a6bdc75 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt @@ -3,7 +3,7 @@ package com.clear_street.api.services.async.v1.omniai import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.omniai.EntitlementCode +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams import org.junit.jupiter.api.Disabled @@ -43,6 +43,18 @@ internal class EntitlementServiceAsyncTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getEntitlementAgreements() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val entitlementServiceAsync = client.v1().omniAi().entitlements() + + val responseFuture = entitlementServiceAsync.getEntitlementAgreements() + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getEntitlements() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt index 8bd9e55d..b6ca96b3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt @@ -3,7 +3,9 @@ package com.clear_street.api.services.async.v1.omniai import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageParams import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams @@ -12,6 +14,26 @@ import org.junit.jupiter.api.Test internal class ThreadServiceAsyncTest { + @Disabled("Mock server tests are disabled") + @Test + fun createMessage() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val threadServiceAsync = client.v1().omniAi().threads() + + val responseFuture = + threadServiceAsync.createMessage( + ThreadCreateMessageParams.builder() + .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountId(19816L) + .text("Compare that to AMD.") + .addCapability(ThreadCreateMessageParams.Capability.PREFILL_ORDER) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun createThread() { @@ -39,6 +61,26 @@ internal class ThreadServiceAsyncTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getMessages() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val threadServiceAsync = client.v1().omniAi().threads() + + val responseFuture = + threadServiceAsync.getMessages( + ThreadGetMessagesParams.builder() + .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountId(0L) + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getThreadById() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsyncTest.kt deleted file mode 100644 index 270b5ac5..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/threads/MessageServiceAsyncTest.kt +++ /dev/null @@ -1,52 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.omniai.threads - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.omniai.threads.messages.MessageCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class MessageServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun createMessage() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val messageServiceAsync = client.v1().omniAi().threads().messages() - - val responseFuture = - messageServiceAsync.createMessage( - MessageCreateMessageParams.builder() - .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .accountId(19816L) - .text("Compare that to AMD.") - .addCapability(MessageCreateMessageParams.Capability.PREFILL_ORDER) - .build() - ) - - val response = responseFuture.get() - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getMessages() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val messageServiceAsync = client.v1().omniAi().threads().messages() - - val responseFuture = - messageServiceAsync.getMessages( - MessageGetMessagesParams.builder() - .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .accountId(0L) - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsyncTest.kt deleted file mode 100644 index c8fd7d92..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/watchlists/ItemServiceAsyncTest.kt +++ /dev/null @@ -1,48 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.async.v1.watchlists - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.watchlists.items.ItemAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class ItemServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun addWatchlistItem() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val itemServiceAsync = client.v1().watchlists().items() - - val responseFuture = - itemServiceAsync.addWatchlistItem( - ItemAddWatchlistItemParams.builder() - .watchlistId("550e8400-e29b-41d4-a716-446655440000") - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - val response = responseFuture.get() - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun deleteWatchlistItem() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() - val itemServiceAsync = client.v1().watchlists().items() - - val responseFuture = - itemServiceAsync.deleteWatchlistItem( - ItemDeleteWatchlistItemParams.builder() - .watchlistId("550e8400-e29b-41d4-a716-446655440000") - .itemId("660e8400-e29b-41d4-a716-446655440001") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/V1ServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/V1ServiceTest.kt deleted file mode 100644 index 369b392f..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/V1ServiceTest.kt +++ /dev/null @@ -1,19 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class V1ServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun websocketHandler() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val v1Service = client.v1() - - v1Service.websocketHandler() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceTest.kt index 009eaf70..8029a512 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceTest.kt @@ -3,14 +3,34 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesParams import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams +import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams import com.clear_street.api.models.v1.accounts.RiskSettings +import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test internal class AccountServiceTest { + @Disabled("Mock server tests are disabled") + @Test + fun getAccountBalances() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val accountService = client.v1().accounts() + + val response = + accountService.getAccountBalances( + AccountGetAccountBalancesParams.builder() + .accountId(0L) + .topMarginContributorsLimit(1) + .build() + ) + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getAccountById() { @@ -39,6 +59,24 @@ internal class AccountServiceTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getPortfolioHistory() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val accountService = client.v1().accounts() + + val response = + accountService.getPortfolioHistory( + AccountGetPortfolioHistoryParams.builder() + .accountId(0L) + .startDate(LocalDate.parse("2019-12-27")) + .endDate(LocalDate.parse("2019-12-27")) + .build() + ) + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun patchAccountById() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/VersionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceTest.kt similarity index 74% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/VersionServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceTest.kt index bd7e1414..f1179b50 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/VersionServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceTest.kt @@ -6,15 +6,15 @@ import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -internal class VersionServiceTest { +internal class ApiVersionServiceTest { @Disabled("Mock server tests are disabled") @Test fun getVersion() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val versionService = client.v1().version() + val apiVersionService = client.v1().apiVersion() - val response = versionService.getVersion() + val response = apiVersionService.getVersion() response.validate() } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceTest.kt new file mode 100644 index 00000000..2c6c4468 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceTest.kt @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1 + +import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clear_street.api.models.v1.calendar.MarketType +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + +internal class CalendarServiceTest { + + @Disabled("Mock server tests are disabled") + @Test + fun getClock() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val calendarService = client.v1().calendar() + + val response = calendarService.getClock() + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getMarketHoursCalendar() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val calendarService = client.v1().calendar() + + val response = + calendarService.getMarketHoursCalendar( + CalendarGetMarketHoursCalendarParams.builder() + .date("date") + .market(MarketType.US_EQUITIES) + .build() + ) + + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceTest.kt new file mode 100644 index 00000000..f631c275 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceTest.kt @@ -0,0 +1,145 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1 + +import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clear_street.api.models.v1.instrumentdata.AllEventsEventType +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import java.time.LocalDate +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + +internal class InstrumentDataServiceTest { + + @Disabled("Mock server tests are disabled") + @Test + fun getAllInstrumentEvents() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val instrumentDataService = client.v1().instrumentData() + + val response = + instrumentDataService.getAllInstrumentEvents( + InstrumentDataGetAllInstrumentEventsParams.builder() + .addEventType(AllEventsEventType.EARNINGS) + .fromDate("from_date") + .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .toDate("to_date") + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentAnalystConsensus() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val instrumentDataService = client.v1().instrumentData() + + val response = + instrumentDataService.getInstrumentAnalystConsensus( + InstrumentDataGetInstrumentAnalystConsensusParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .from(LocalDate.parse("2019-12-27")) + .to(LocalDate.parse("2019-12-27")) + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentBalanceSheetStatements() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val instrumentDataService = client.v1().instrumentData() + + val response = + instrumentDataService.getInstrumentBalanceSheetStatements( + InstrumentDataGetInstrumentBalanceSheetStatementsParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fromDate("from_date") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .toDate("to_date") + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentCashFlowStatements() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val instrumentDataService = client.v1().instrumentData() + + val response = + instrumentDataService.getInstrumentCashFlowStatements( + InstrumentDataGetInstrumentCashFlowStatementsParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fromDate("from_date") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .toDate("to_date") + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentEvents() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val instrumentDataService = client.v1().instrumentData() + + val response = + instrumentDataService.getInstrumentEvents( + InstrumentDataGetInstrumentEventsParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fromDate("from_date") + .toDate("to_date") + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentFundamentals() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val instrumentDataService = client.v1().instrumentData() + + val response = + instrumentDataService.getInstrumentFundamentals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getInstrumentIncomeStatements() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val instrumentDataService = client.v1().instrumentData() + + val response = + instrumentDataService.getInstrumentIncomeStatements( + InstrumentDataGetInstrumentIncomeStatementsParams.builder() + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fromDate("from_date") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .toDate("to_date") + .build() + ) + + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt index 31f5eb25..7dfaacc6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt @@ -3,9 +3,12 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clear_street.api.models.v1.instruments.ContractType import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdParams import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams +import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams +import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -53,6 +56,27 @@ internal class InstrumentServiceTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getOptionContracts() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val instrumentService = client.v1().instruments() + + val response = + instrumentService.getOptionContracts( + InstrumentGetOptionContractsParams.builder() + .contractType(ContractType.CALL) + .expiry(LocalDate.parse("2019-12-27")) + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .underlier("underlier") + .underlyingInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun searchInstruments() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt similarity index 84% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt index f1589469..35b3a9bb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/OrderServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.accounts +package com.clear_street.api.services.blocking.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.accounts.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.accounts.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.accounts.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.accounts.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.accounts.orders.PositionEffect -import com.clear_street.api.models.v1.accounts.orders.RequestOrderType -import com.clear_street.api.models.v1.accounts.orders.RequestTimeInForce -import com.clear_street.api.models.v1.accounts.orders.Side +import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams +import com.clear_street.api.models.v1.orders.OrderGetOrdersParams +import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams +import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side import java.time.OffsetDateTime import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -24,7 +24,7 @@ internal class OrderServiceTest { @Test fun cancelAllOpenOrders() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val orderService = client.v1().accounts().orders() + val orderService = client.v1().orders() val response = orderService.cancelAllOpenOrders( @@ -44,7 +44,7 @@ internal class OrderServiceTest { @Test fun cancelOpenOrder() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val orderService = client.v1().accounts().orders() + val orderService = client.v1().orders() val response = orderService.cancelOpenOrder( @@ -58,7 +58,7 @@ internal class OrderServiceTest { @Test fun getOrderById() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val orderService = client.v1().accounts().orders() + val orderService = client.v1().orders() val response = orderService.getOrderById( @@ -72,7 +72,7 @@ internal class OrderServiceTest { @Test fun getOrders() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val orderService = client.v1().accounts().orders() + val orderService = client.v1().orders() val response = orderService.getOrders( @@ -97,7 +97,7 @@ internal class OrderServiceTest { @Test fun replaceOrder() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val orderService = client.v1().accounts().orders() + val orderService = client.v1().orders() val response = orderService.replaceOrder( @@ -118,7 +118,7 @@ internal class OrderServiceTest { @Test fun submitOrders() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val orderService = client.v1().accounts().orders() + val orderService = client.v1().orders() val response = orderService.submitOrders( diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceTest.kt new file mode 100644 index 00000000..bd56576f --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceTest.kt @@ -0,0 +1,128 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1 + +import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clear_street.api.models.v1.positions.PositionClosePositionParams +import com.clear_street.api.models.v1.positions.PositionClosePositionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clear_street.api.models.v1.positions.PositionGetPositionsParams +import com.clear_street.api.models.v1.positions.PositionInstructionType +import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + +internal class PositionServiceTest { + + @Disabled("Mock server tests are disabled") + @Test + fun cancelPositionInstruction() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val positionService = client.v1().positions() + + val response = + positionService.cancelPositionInstruction( + PositionCancelPositionInstructionParams.builder() + .accountId(0L) + .instructionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun closePosition() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val positionService = client.v1().positions() + + val response = + positionService.closePosition( + PositionClosePositionParams.builder() + .accountId(0L) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .cancelOrders(false) + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun closePositions() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val positionService = client.v1().positions() + + val response = + positionService.closePositions( + PositionClosePositionsParams.builder().accountId(0L).cancelOrders(false).build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getPositionInstructions() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val positionService = client.v1().positions() + + val response = + positionService.getPositionInstructions( + PositionGetPositionInstructionsParams.builder() + .accountId(0L) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getPositions() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val positionService = client.v1().positions() + + val response = + positionService.getPositions( + PositionGetPositionsParams.builder() + .accountId(0L) + .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .sortBy(PositionGetPositionsParams.SortBy.SYMBOL) + .sortDirection(PositionGetPositionsParams.SortDirection.ASC) + .build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun submitPositionInstructions() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val positionService = client.v1().positions() + + val response = + positionService.submitPositionInstructions( + PositionSubmitPositionInstructionsParams.builder() + .accountId(0L) + .addInstruction( + PositionSubmitPositionInstructionsParams.Instruction.builder() + .instructionType(PositionInstructionType.EXERCISE) + .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") + .quantity("1") + .instructionId("ui-20260424-001") + .build() + ) + .build() + ) + + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceTest.kt index 69b71b3d..2d393748 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceTest.kt @@ -3,18 +3,37 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.watchlists.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlists.WatchlistGetWatchlistsParams +import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test internal class WatchlistServiceTest { + @Disabled("Mock server tests are disabled") + @Test + fun addWatchlistItem() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val watchlistService = client.v1().watchlist() + + val response = + watchlistService.addWatchlistItem( + WatchlistAddWatchlistItemParams.builder() + .watchlistId("550e8400-e29b-41d4-a716-446655440000") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun createWatchlist() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val watchlistService = client.v1().watchlists() + val watchlistService = client.v1().watchlist() val response = watchlistService.createWatchlist( @@ -28,18 +47,35 @@ internal class WatchlistServiceTest { @Test fun deleteWatchlist() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val watchlistService = client.v1().watchlists() + val watchlistService = client.v1().watchlist() val response = watchlistService.deleteWatchlist("550e8400-e29b-41d4-a716-446655440000") response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun deleteWatchlistItem() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val watchlistService = client.v1().watchlist() + + val response = + watchlistService.deleteWatchlistItem( + WatchlistDeleteWatchlistItemParams.builder() + .watchlistId("550e8400-e29b-41d4-a716-446655440000") + .itemId("660e8400-e29b-41d4-a716-446655440001") + .build() + ) + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getWatchlistById() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val watchlistService = client.v1().watchlists() + val watchlistService = client.v1().watchlist() val response = watchlistService.getWatchlistById("550e8400-e29b-41d4-a716-446655440000") @@ -50,7 +86,7 @@ internal class WatchlistServiceTest { @Test fun getWatchlists() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val watchlistService = client.v1().watchlists() + val watchlistService = client.v1().watchlist() val response = watchlistService.getWatchlists( diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ClockServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceTest.kt similarity index 69% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ClockServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceTest.kt index 4a66a3bb..444f9510 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ClockServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceTest.kt @@ -6,16 +6,14 @@ import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test -internal class ClockServiceTest { +internal class WebsocketServiceTest { @Disabled("Mock server tests are disabled") @Test - fun getClock() { + fun websocketHandler() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val clockService = client.v1().clock() + val websocketService = client.v1().websocket() - val response = clockService.getClock() - - response.validate() + websocketService.websocketHandler() } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceServiceTest.kt deleted file mode 100644 index 9c3ea638..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/BalanceServiceTest.kt +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.accounts - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.accounts.balances.BalanceGetAccountBalancesParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class BalanceServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getAccountBalances() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val balanceService = client.v1().accounts().balances() - - val response = - balanceService.getAccountBalances( - BalanceGetAccountBalancesParams.builder() - .accountId(0L) - .topMarginContributorsLimit(1) - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryServiceTest.kt deleted file mode 100644 index 44a048b3..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/PortfolioHistoryServiceTest.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.accounts - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.accounts.portfoliohistory.PortfolioHistoryGetPortfolioHistoryParams -import java.time.LocalDate -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class PortfolioHistoryServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getPortfolioHistory() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val portfolioHistoryService = client.v1().accounts().portfolioHistory() - - val response = - portfolioHistoryService.getPortfolioHistory( - PortfolioHistoryGetPortfolioHistoryParams.builder() - .accountId(0L) - .startDate(LocalDate.parse("2019-12-27")) - .endDate(LocalDate.parse("2019-12-27")) - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionServiceTest.kt deleted file mode 100644 index 22d3e448..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/PositionServiceTest.kt +++ /dev/null @@ -1,66 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.accounts - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionParams -import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionsParams -import com.clear_street.api.models.v1.accounts.positions.PositionGetPositionsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class PositionServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun closePosition() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val positionService = client.v1().accounts().positions() - - val response = - positionService.closePosition( - PositionClosePositionParams.builder() - .accountId(0L) - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .cancelOrders(false) - .build() - ) - - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun closePositions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val positionService = client.v1().accounts().positions() - - val response = - positionService.closePositions( - PositionClosePositionsParams.builder().accountId(0L).cancelOrders(false).build() - ) - - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getPositions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val positionService = client.v1().accounts().positions() - - val response = - positionService.getPositions( - PositionGetPositionsParams.builder() - .accountId(0L) - .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .sortBy(PositionGetPositionsParams.SortBy.SYMBOL) - .sortDirection(PositionGetPositionsParams.SortDirection.ASC) - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionServiceTest.kt deleted file mode 100644 index 2e125162..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/accounts/positions/InstructionServiceTest.kt +++ /dev/null @@ -1,72 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.accounts.positions - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionCancelPositionInstructionParams -import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionGetPositionInstructionsParams -import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionSubmitPositionInstructionsParams -import com.clear_street.api.models.v1.accounts.positions.instructions.PositionInstructionType -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class InstructionServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun cancelPositionInstruction() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val instructionService = client.v1().accounts().positions().instructions() - - val response = - instructionService.cancelPositionInstruction( - InstructionCancelPositionInstructionParams.builder() - .accountId(0L) - .instructionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getPositionInstructions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val instructionService = client.v1().accounts().positions().instructions() - - val response = - instructionService.getPositionInstructions( - InstructionGetPositionInstructionsParams.builder() - .accountId(0L) - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun submitPositionInstructions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val instructionService = client.v1().accounts().positions().instructions() - - val response = - instructionService.submitPositionInstructions( - InstructionSubmitPositionInstructionsParams.builder() - .accountId(0L) - .addInstruction( - InstructionSubmitPositionInstructionsParams.Instruction.builder() - .instructionType(PositionInstructionType.EXERCISE) - .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02") - .quantity("1") - .instructionId("ui-20260424-001") - .build() - ) - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourServiceTest.kt deleted file mode 100644 index b9e11f5a..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/calendars/MarketHourServiceTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.calendars - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.calendars.markethours.MarketHourGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendars.markethours.MarketType -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class MarketHourServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getMarketHoursCalendar() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val marketHourService = client.v1().calendars().marketHours() - - val response = - marketHourService.getMarketHoursCalendar( - MarketHourGetMarketHoursCalendarParams.builder() - .date("date") - .market(MarketType.US_EQUITIES) - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt new file mode 100644 index 00000000..1a37fd1f --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1.instrumentdata + +import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test + +internal class MarketDataServiceTest { + + @Disabled("Mock server tests are disabled") + @Test + fun getDailySummaries() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val marketDataService = client.v1().instrumentData().marketData() + + val response = + marketDataService.getDailySummaries( + MarketDataGetDailySummariesParams.builder().instrumentIds("instrument_ids").build() + ) + + response.validate() + } + + @Disabled("Mock server tests are disabled") + @Test + fun getSnapshots() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val marketDataService = client.v1().instrumentData().marketData() + + val response = + marketDataService.getSnapshots( + MarketDataGetSnapshotsParams.builder() + .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/NewsServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt similarity index 84% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/NewsServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt index 8ebd4fa2..ebd122e6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/NewsServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clear_street.api.services.blocking.v1.instrumentdata import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.news.NewsGetNewsParams +import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -13,7 +13,7 @@ internal class NewsServiceTest { @Test fun getNews() { val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val newsService = client.v1().news() + val newsService = client.v1().instrumentData().news() val response = newsService.getNews( diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingServiceTest.kt deleted file mode 100644 index 49851231..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/AnalystReportingServiceTest.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instruments.analystreporting.AnalystReportingGetInstrumentAnalystConsensusParams -import java.time.LocalDate -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class AnalystReportingServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentAnalystConsensus() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val analystReportingService = client.v1().instruments().analystReporting() - - val response = - analystReportingService.getInstrumentAnalystConsensus( - AnalystReportingGetInstrumentAnalystConsensusParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .from(LocalDate.parse("2019-12-27")) - .to(LocalDate.parse("2019-12-27")) - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetServiceTest.kt deleted file mode 100644 index 6206f6b6..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/BalanceSheetServiceTest.kt +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instruments.balancesheets.BalanceSheetGetInstrumentBalanceSheetStatementsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class BalanceSheetServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentBalanceSheetStatements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val balanceSheetService = client.v1().instruments().balanceSheets() - - val response = - balanceSheetService.getInstrumentBalanceSheetStatements( - BalanceSheetGetInstrumentBalanceSheetStatementsParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fromDate("from_date") - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .toDate("to_date") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementServiceTest.kt deleted file mode 100644 index 2dc837dd..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/CashFlowStatementServiceTest.kt +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instruments.cashflowstatements.CashFlowStatementGetInstrumentCashFlowStatementsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class CashFlowStatementServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentCashFlowStatements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val cashFlowStatementService = client.v1().instruments().cashFlowStatements() - - val response = - cashFlowStatementService.getInstrumentCashFlowStatements( - CashFlowStatementGetInstrumentCashFlowStatementsParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fromDate("from_date") - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .toDate("to_date") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventServiceTest.kt deleted file mode 100644 index a7a868aa..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/EventServiceTest.kt +++ /dev/null @@ -1,50 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instruments.events.AllEventsEventType -import com.clear_street.api.models.v1.instruments.events.EventGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instruments.events.EventGetInstrumentEventsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class EventServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getAllInstrumentEvents() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val eventService = client.v1().instruments().events() - - val response = - eventService.getAllInstrumentEvents( - EventGetAllInstrumentEventsParams.builder() - .addEventType(AllEventsEventType.EARNINGS) - .fromDate("from_date") - .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .toDate("to_date") - .build() - ) - - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentEvents() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val eventService = client.v1().instruments().events() - - val response = - eventService.getInstrumentEvents( - EventGetInstrumentEventsParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fromDate("from_date") - .toDate("to_date") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalServiceTest.kt deleted file mode 100644 index bd076515..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/FundamentalServiceTest.kt +++ /dev/null @@ -1,22 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class FundamentalServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentFundamentals() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val fundamentalService = client.v1().instruments().fundamentals() - - val response = - fundamentalService.getInstrumentFundamentals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementServiceTest.kt deleted file mode 100644 index 522e306f..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/IncomeStatementServiceTest.kt +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instruments.incomestatements.IncomeStatementGetInstrumentIncomeStatementsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class IncomeStatementServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getInstrumentIncomeStatements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val incomeStatementService = client.v1().instruments().incomeStatements() - - val response = - incomeStatementService.getInstrumentIncomeStatements( - IncomeStatementGetInstrumentIncomeStatementsParams.builder() - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .fromDate("from_date") - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .toDate("to_date") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionServiceTest.kt deleted file mode 100644 index 6b87eec5..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instruments/OptionServiceTest.kt +++ /dev/null @@ -1,34 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.instruments - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instruments.ContractType -import com.clear_street.api.models.v1.instruments.options.OptionGetOptionContractsParams -import java.time.LocalDate -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class OptionServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getOptionContracts() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val optionService = client.v1().instruments().options() - - val response = - optionService.getOptionContracts( - OptionGetOptionContractsParams.builder() - .contractType(ContractType.CALL) - .expiry(LocalDate.parse("2019-12-27")) - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .underlier("underlier") - .underlyingInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryServiceTest.kt deleted file mode 100644 index af4df6bb..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/marketdata/DailySummaryServiceTest.kt +++ /dev/null @@ -1,27 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.marketdata - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.marketdata.dailysummary.DailySummaryGetDailySummariesParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class DailySummaryServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getDailySummaries() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val dailySummaryService = client.v1().marketData().dailySummary() - - val response = - dailySummaryService.getDailySummaries( - DailySummaryGetDailySummariesParams.builder() - .instrumentIds("instrument_ids") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotServiceTest.kt deleted file mode 100644 index 74165a0e..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/marketdata/SnapshotServiceTest.kt +++ /dev/null @@ -1,27 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.marketdata - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.marketdata.snapshot.SnapshotGetSnapshotsParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class SnapshotServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getSnapshots() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val snapshotService = client.v1().marketData().snapshot() - - val response = - snapshotService.getSnapshots( - SnapshotGetSnapshotsParams.builder() - .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementServiceTest.kt deleted file mode 100644 index d8bc9e40..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementAgreementServiceTest.kt +++ /dev/null @@ -1,21 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.omniai - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class EntitlementAgreementServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun getEntitlementAgreements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val entitlementAgreementService = client.v1().omniAi().entitlementAgreements() - - val response = entitlementAgreementService.getEntitlementAgreements() - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt index d2768f51..f5a15f1b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt @@ -3,7 +3,7 @@ package com.clear_street.api.services.blocking.v1.omniai import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.omniai.EntitlementCode +import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams import org.junit.jupiter.api.Disabled @@ -41,6 +41,17 @@ internal class EntitlementServiceTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getEntitlementAgreements() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val entitlementService = client.v1().omniAi().entitlements() + + val response = entitlementService.getEntitlementAgreements() + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getEntitlements() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceTest.kt index 2b638e15..35102114 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceTest.kt @@ -3,7 +3,9 @@ package com.clear_street.api.services.blocking.v1.omniai import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageParams import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams +import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams @@ -12,6 +14,25 @@ import org.junit.jupiter.api.Test internal class ThreadServiceTest { + @Disabled("Mock server tests are disabled") + @Test + fun createMessage() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val threadService = client.v1().omniAi().threads() + + val response = + threadService.createMessage( + ThreadCreateMessageParams.builder() + .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountId(19816L) + .text("Compare that to AMD.") + .addCapability(ThreadCreateMessageParams.Capability.PREFILL_ORDER) + .build() + ) + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun createThread() { @@ -38,6 +59,25 @@ internal class ThreadServiceTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getMessages() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val threadService = client.v1().omniAi().threads() + + val response = + threadService.getMessages( + ThreadGetMessagesParams.builder() + .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .accountId(0L) + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .build() + ) + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getThreadById() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageServiceTest.kt deleted file mode 100644 index da2ca1ce..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/threads/MessageServiceTest.kt +++ /dev/null @@ -1,50 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.omniai.threads - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.omniai.threads.messages.MessageCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.messages.MessageGetMessagesParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class MessageServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun createMessage() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val messageService = client.v1().omniAi().threads().messages() - - val response = - messageService.createMessage( - MessageCreateMessageParams.builder() - .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .accountId(19816L) - .text("Compare that to AMD.") - .addCapability(MessageCreateMessageParams.Capability.PREFILL_ORDER) - .build() - ) - - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getMessages() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val messageService = client.v1().omniAi().threads().messages() - - val response = - messageService.getMessages( - MessageGetMessagesParams.builder() - .threadId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .accountId(0L) - .pageSize(1L) - .pageToken("U3RhaW5sZXNzIHJvY2tz") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemServiceTest.kt deleted file mode 100644 index 037a714b..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/watchlists/ItemServiceTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1.watchlists - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.watchlists.items.ItemAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlists.items.ItemDeleteWatchlistItemParams -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class ItemServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun addWatchlistItem() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val itemService = client.v1().watchlists().items() - - val response = - itemService.addWatchlistItem( - ItemAddWatchlistItemParams.builder() - .watchlistId("550e8400-e29b-41d4-a716-446655440000") - .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - response.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun deleteWatchlistItem() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() - val itemService = client.v1().watchlists().items() - - val response = - itemService.deleteWatchlistItem( - ItemDeleteWatchlistItemParams.builder() - .watchlistId("550e8400-e29b-41d4-a716-446655440000") - .itemId("660e8400-e29b-41d4-a716-446655440001") - .build() - ) - - response.validate() - } -} diff --git a/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt b/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt index 39a7bb12..31a81723 100644 --- a/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt +++ b/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt @@ -4,13 +4,21 @@ package com.clear_street.api.proguard import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient import com.clear_street.api.core.jsonMapper +import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.accounts.Account import com.clear_street.api.models.v1.accounts.AccountStatus import com.clear_street.api.models.v1.accounts.AccountSubtype import com.clear_street.api.models.v1.accounts.AccountType -import com.clear_street.api.models.v1.omniai.MessageContentPart +import com.clear_street.api.models.v1.omniai.PrefillOrderAction +import com.clear_street.api.models.v1.orders.NewOrderRequest +import com.clear_street.api.models.v1.orders.PositionEffect +import com.clear_street.api.models.v1.orders.RequestOrderType +import com.clear_street.api.models.v1.orders.RequestTimeInForce +import com.clear_street.api.models.v1.orders.Side +import com.clear_street.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate +import java.time.OffsetDateTime import kotlin.reflect.full.memberFunctions import kotlin.reflect.jvm.javaMethod import org.assertj.core.api.Assertions.assertThat @@ -81,23 +89,42 @@ internal class ProGuardCompatibilityTest { } @Test - fun messageContentPartRoundtrip() { + fun prefillOrderActionRoundtrip() { val jsonMapper = jsonMapper() - val messageContentPart = - MessageContentPart.ofUnionMember0( - MessageContentPart.UnionMember0.builder() - .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + val prefillOrderAction = + PrefillOrderAction.ofPrefillNewOrderAction( + PrefillOrderAction.PrefillNewOrderAction.builder() + .addOrder( + NewOrderRequest.builder() + .instrumentType(SecurityType.COMMON_STOCK) + .orderType(RequestOrderType.LIMIT) + .quantity("100") + .side(Side.BUY) + .timeInForce(RequestTimeInForce.DAY) + .id("my-ref-id-20251001-002") + .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) + .extendedHours(true) + .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .limitOffset("0.10") + .limitPrice("150.00") + .positionEffect(PositionEffect.OPEN) + .stopPrice("135.00") + .symbol("AAPL") + .trailingOffset("1.25") + .trailingOffsetType(TrailingOffsetType.PRICE) + .build() + ) + .actionType(PrefillOrderAction.PrefillNewOrderAction.ActionType.NEW) .build() ) - val roundtrippedMessageContentPart = + val roundtrippedPrefillOrderAction = jsonMapper.readValue( - jsonMapper.writeValueAsString(messageContentPart), - jacksonTypeRef(), + jsonMapper.writeValueAsString(prefillOrderAction), + jacksonTypeRef(), ) - assertThat(roundtrippedMessageContentPart).isEqualTo(messageContentPart) + assertThat(roundtrippedPrefillOrderAction).isEqualTo(prefillOrderAction) } @Test From 3343acc55b8cd665f3a710728320141eb64a2674 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 23:26:36 +0000 Subject: [PATCH 04/51] feat(api): api update --- .stats.yml | 4 ++-- .../models/v1/accounts/AccountGetAccountsParams.kt | 10 ++++++---- .../v1/accounts/AccountGetPortfolioHistoryParams.kt | 2 ++ ...ntDataGetInstrumentBalanceSheetStatementsParams.kt | 10 ++++++---- ...rumentDataGetInstrumentCashFlowStatementsParams.kt | 10 ++++++---- ...strumentDataGetInstrumentIncomeStatementsParams.kt | 10 ++++++---- .../v1/instrumentdata/news/NewsGetNewsParams.kt | 10 ++++++---- .../v1/instruments/InstrumentGetInstrumentsParams.kt | 10 ++++++---- .../instruments/InstrumentGetOptionContractsParams.kt | 10 ++++++---- .../instruments/InstrumentSearchInstrumentsParams.kt | 10 ++++++---- .../v1/omniai/threads/ThreadGetMessagesParams.kt | 10 ++++++---- .../v1/omniai/threads/ThreadGetThreadsParams.kt | 10 ++++++---- .../api/models/v1/orders/OrderGetOrdersParams.kt | 10 ++++++---- .../v1/positions/PositionClosePositionParams.kt | 11 +++++++++++ .../v1/positions/PositionClosePositionsParams.kt | 11 +++++++++++ .../models/v1/positions/PositionGetPositionsParams.kt | 10 ++++++---- .../v1/watchlist/WatchlistGetWatchlistsParams.kt | 10 ++++++---- 17 files changed, 104 insertions(+), 54 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7ddeb65a..66809a7a 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-d4ce44176b84cd692b9f5e0223be418b98dbf0ba519c38f68553e78a11a50443.yml -openapi_spec_hash: 8d8961f1645fc8921b32ff8bb53fc333 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-f9f96b37eec9a07ff8c0b9c4cd73b8ee83ad13e1d16c03fcc12fccb26019e2db.yml +openapi_spec_hash: 2f8f34dfa3dd6ff80f2c4db312dc436d config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParams.kt index 9084995d..efd7a8f7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParams.kt @@ -18,11 +18,12 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -58,6 +59,7 @@ private constructor( additionalQueryParams = accountGetAccountsParams.additionalQueryParams.toBuilder() } + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -71,8 +73,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt index 70c8e152..b8f1f6f8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt @@ -23,6 +23,7 @@ private constructor( fun accountId(): Optional = Optional.ofNullable(accountId) + /** Start date for the portfolio history range, in YYYY-MM-DD format. */ fun startDate(): LocalDate = startDate /** Defaults to today in America/New_York when omitted. */ @@ -82,6 +83,7 @@ private constructor( /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) + /** Start date for the portfolio history range, in YYYY-MM-DD format. */ fun startDate(startDate: LocalDate) = apply { this.startDate = startDate } /** Defaults to today in America/New_York when omitted. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt index 70048b57..bf3c7af9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt @@ -36,11 +36,12 @@ private constructor( /** The start date for the query range, inclusive (YYYY-MM-DD). */ fun fromDate(): Optional = Optional.ofNullable(fromDate) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -108,6 +109,7 @@ private constructor( /** Alias for calling [Builder.fromDate] with `fromDate.orElse(null)`. */ fun fromDate(fromDate: Optional) = fromDate(fromDate.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -121,8 +123,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt index ece20624..3cb11cd2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt @@ -32,11 +32,12 @@ private constructor( /** The start date for the query range, inclusive (YYYY-MM-DD). */ fun fromDate(): Optional = Optional.ofNullable(fromDate) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -103,6 +104,7 @@ private constructor( /** Alias for calling [Builder.fromDate] with `fromDate.orElse(null)`. */ fun fromDate(fromDate: Optional) = fromDate(fromDate.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -116,8 +118,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt index 3d6f0fa8..0e428046 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt @@ -34,11 +34,12 @@ private constructor( /** The start date for the query range, inclusive (YYYY-MM-DD). */ fun fromDate(): Optional = Optional.ofNullable(fromDate) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -103,6 +104,7 @@ private constructor( /** Alias for calling [Builder.fromDate] with `fromDate.orElse(null)`. */ fun fromDate(fromDate: Optional) = fromDate(fromDate.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -116,8 +118,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt index e11d76fe..b00df7f2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt @@ -53,11 +53,12 @@ private constructor( /** Filter by news type. */ fun newsType(): Optional = Optional.ofNullable(newsType) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -172,6 +173,7 @@ private constructor( /** Alias for calling [Builder.newsType] with `newsType.orElse(null)`. */ fun newsType(newsType: Optional) = newsType(newsType.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -185,8 +187,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt index 315f405c..30292ce3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt @@ -59,11 +59,12 @@ private constructor( /** Filter by threshold security status */ fun isThresholdSecurity(): Optional = Optional.ofNullable(isThresholdSecurity) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -241,6 +242,7 @@ private constructor( fun isThresholdSecurity(isThresholdSecurity: Optional) = isThresholdSecurity(isThresholdSecurity.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -254,8 +256,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt index 4ce99215..90d0f4f9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt @@ -34,11 +34,12 @@ private constructor( /** Filter to contracts expiring on this date (YYYY-MM-DD) */ fun expiry(): Optional = Optional.ofNullable(expiry) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -106,6 +107,7 @@ private constructor( /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ fun expiry(expiry: Optional) = expiry(expiry.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -119,8 +121,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt index 70faff46..128b34b1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt @@ -57,11 +57,12 @@ private constructor( /** Include restricted instruments. Default true (penalized in ranking). */ fun includeRestricted(): Optional = Optional.ofNullable(includeRestricted) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -177,6 +178,7 @@ private constructor( fun includeRestricted(includeRestricted: Optional) = includeRestricted(includeRestricted.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -190,8 +192,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt index 31febbf5..8ae3860e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt @@ -35,11 +35,12 @@ private constructor( /** Account ID for the request */ fun accountId(): Long = accountId + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -92,6 +93,7 @@ private constructor( /** Account ID for the request */ fun accountId(accountId: Long) = apply { this.accountId = accountId } + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -105,8 +107,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt index b00ff538..6e5f58fe 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt @@ -29,11 +29,12 @@ private constructor( /** Account ID for the request */ fun accountId(): Long = accountId + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -79,6 +80,7 @@ private constructor( /** Account ID for the request */ fun accountId(accountId: Long) = apply { this.accountId = accountId } + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -92,8 +94,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt index ab4f6832..898f0e89 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt @@ -44,11 +44,12 @@ private constructor( /** Instrument type filter (e.g., COMMON_STOCK, OPTION) */ fun instrumentType(): Optional = Optional.ofNullable(instrumentType) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -160,6 +161,7 @@ private constructor( fun instrumentType(instrumentType: Optional) = instrumentType(instrumentType.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -173,8 +175,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt index 0bc1737f..d4617627 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt @@ -40,6 +40,8 @@ private constructor( fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** + * Whether to cancel existing open orders for the position before submitting closing orders. + * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ @@ -110,6 +112,9 @@ private constructor( */ fun body(body: Body) = apply { this.body = body.toBuilder() } + /** + * Whether to cancel existing open orders for the position before submitting closing orders. + */ fun cancelOrders(cancelOrders: Boolean?) = apply { body.cancelOrders(cancelOrders) } /** @@ -300,6 +305,8 @@ private constructor( ) : this(cancelOrders, mutableMapOf()) /** + * Whether to cancel existing open orders for the position before submitting closing orders. + * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ @@ -345,6 +352,10 @@ private constructor( additionalProperties = body.additionalProperties.toMutableMap() } + /** + * Whether to cancel existing open orders for the position before submitting closing + * orders. + */ fun cancelOrders(cancelOrders: Boolean?) = cancelOrders(JsonField.ofNullable(cancelOrders)) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt index 9b03f498..ea82bde0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt @@ -35,6 +35,8 @@ private constructor( fun accountId(): Optional = Optional.ofNullable(accountId) /** + * Whether to cancel existing open orders for the position before submitting closing orders. + * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ @@ -104,6 +106,9 @@ private constructor( */ fun body(body: Body) = apply { this.body = body.toBuilder() } + /** + * Whether to cancel existing open orders for the position before submitting closing orders. + */ fun cancelOrders(cancelOrders: Boolean?) = apply { body.cancelOrders(cancelOrders) } /** @@ -285,6 +290,8 @@ private constructor( ) : this(cancelOrders, mutableMapOf()) /** + * Whether to cancel existing open orders for the position before submitting closing orders. + * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ @@ -330,6 +337,10 @@ private constructor( additionalProperties = body.additionalProperties.toMutableMap() } + /** + * Whether to cancel existing open orders for the position before submitting closing + * orders. + */ fun cancelOrders(cancelOrders: Boolean?) = cancelOrders(JsonField.ofNullable(cancelOrders)) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt index 25e881e7..d0c96890 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt @@ -32,11 +32,12 @@ private constructor( /** Comma-separated OEMS instrument UUIDs */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -118,6 +119,7 @@ private constructor( instrumentIds = (instrumentIds ?: mutableListOf()).apply { add(instrumentId) } } + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -131,8 +133,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt index 4f7a1bd2..d43147bc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt @@ -18,11 +18,12 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. */ fun pageToken(): Optional = Optional.ofNullable(pageToken) @@ -60,6 +61,7 @@ private constructor( additionalQueryParams = watchlistGetWatchlistsParams.additionalQueryParams.toBuilder() } + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } /** @@ -73,8 +75,8 @@ private constructor( fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) /** - * Token for retrieving the next page of results. Contains encoded pagination state (limit + - * offset). When provided, page_size is ignored. + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. */ fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } From a1509bd7c76ee71dce218be2bf16a84590c8b3ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 02:25:13 +0000 Subject: [PATCH 05/51] ci: pin GitHub Actions to commit SHAs Pin all GitHub Actions referenced in generated workflows (both first-party `actions/*` and third-party) to immutable commit SHAs. Updating pinned actions is now a deliberate codegen-side bump rather than implicit on every workflow run. --- .github/workflows/ci.yml | 20 ++++++++++---------- .github/workflows/publish-sonatype.yml | 6 +++--- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) 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..d79ba1a6 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,7 +26,7 @@ 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: |- 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: | From f0a2b7412ea29abb0e250bf9a134d8c7e1b10914 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 11:10:37 +0000 Subject: [PATCH 06/51] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 66809a7a..42a3dadd 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-f9f96b37eec9a07ff8c0b9c4cd73b8ee83ad13e1d16c03fcc12fccb26019e2db.yml -openapi_spec_hash: 2f8f34dfa3dd6ff80f2c4db312dc436d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-fe48290f3ef03c444e8e7fb49bcd43da20b907c6062f4d5fa08337d5263b9949.yml +openapi_spec_hash: 0531d12a85772429177a855398d563b8 config_hash: 7033b484e7e1bbf72c997ac476b693f8 From 184c903c1c3a99b3f953dfd891db1830b3e2f649 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 22:53:52 +0000 Subject: [PATCH 07/51] feat(api): api update --- .stats.yml | 4 +- ...PositionCancelPositionInstructionParams.kt | 6 +- ...sitionCancelPositionInstructionResponse.kt | 8 +-- .../PositionGetPositionInstructionsParams.kt | 8 +-- .../v1/positions/PositionInstruction.kt | 67 ++++++++----------- .../v1/positions/PositionInstructionStatus.kt | 8 +-- .../v1/positions/PositionInstructionType.kt | 7 +- ...ositionSubmitPositionInstructionsParams.kt | 37 +++++----- .../services/async/v1/PositionServiceAsync.kt | 16 ++--- .../services/blocking/v1/PositionService.kt | 16 ++--- 10 files changed, 74 insertions(+), 103 deletions(-) diff --git a/.stats.yml b/.stats.yml index 42a3dadd..e09d52b8 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-fe48290f3ef03c444e8e7fb49bcd43da20b907c6062f4d5fa08337d5263b9949.yml -openapi_spec_hash: 0531d12a85772429177a855398d563b8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-a6982710449db4c46858991c2fafee80f45d47e783bd81c344732f3020a7f401.yml +openapi_spec_hash: 55d0707d00ccf354302b02b17e221373 config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt index 9e71bd3c..106e2e26 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt @@ -13,9 +13,9 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * 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. + * Cancel an outstanding position instruction by its server-assigned `id`. Returns the updated + * instruction with status `CANCEL_REQUESTED`. The terminal `CANCELLED` or `CANCEL_FAILED` state + * arrives asynchronously and is observable via subsequent GETs. */ class PositionCancelPositionInstructionParams private constructor( diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt index fcbf2d51..7283209d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt @@ -60,8 +60,7 @@ private constructor( fun error(): Optional = error.getOptional("error") /** - * The API representation of a single CSC instruction, combining the caller's request with the - * `oems-csc` lifecycle state. + * A position instruction and its current lifecycle state. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -163,10 +162,7 @@ private constructor( */ fun error(error: JsonField) = apply { this.error = error } - /** - * The API representation of a single CSC instruction, combining the caller's request with - * the `oems-csc` lifecycle state. - */ + /** A position instruction and its current lifecycle state. */ fun data(data: PositionInstruction) = data(JsonField.of(data)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt index 85a86ee8..e4297b8e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt @@ -10,8 +10,8 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * Returns the current lifecycle state of exercise / DNE / CEA instructions for the account. - * Optionally filter by a specific instrument. + * Returns the current lifecycle state of the account's position instructions. Optionally filter by + * a specific contract. */ class PositionGetPositionInstructionsParams private constructor( @@ -23,7 +23,7 @@ private constructor( fun accountId(): Optional = Optional.ofNullable(accountId) - /** Filter by OEMS instrument id or symbol (CMS / OSI). */ + /** Limit results to a single contract. Accepts the instrument id or the OSI symbol. */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** Additional headers to send with the request. */ @@ -76,7 +76,7 @@ private constructor( /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) - /** Filter by OEMS instrument id or symbol (CMS / OSI). */ + /** Limit results to a single contract. Accepts the instrument id or the OSI symbol. */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt index 756ea596..b390b6d9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt @@ -18,10 +18,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** - * The API representation of a single CSC instruction, combining the caller's request with the - * `oems-csc` lifecycle state. - */ +/** A position instruction and its current lifecycle state. */ class PositionInstruction @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -90,8 +87,7 @@ private constructor( ) /** - * Stable server-assigned id for the instruction (the engine instruction UUID). Used as the - * `{instruction_id}` path parameter on DELETE. + * Server-assigned id. Used as the path parameter on cancel. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -107,8 +103,8 @@ private constructor( fun accountId(): Long = accountId.getRequired("account_id") /** - * Caller-supplied instruction id (echoed from the submit request, or the server-generated - * fallback when the caller omitted one). + * Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback + * when none was supplied. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -116,7 +112,7 @@ private constructor( fun instructionId(): String = instructionId.getRequired("instruction_id") /** - * The instruction type as understood by this API. + * The action this instruction requests. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -124,7 +120,7 @@ private constructor( fun instructionType(): PositionInstructionType = instructionType.getRequired("instruction_type") /** - * OEMS instrument identifier the instruction is for. + * Identifier of the options contract this instruction acts on. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -132,7 +128,7 @@ private constructor( fun instrumentId(): String = instrumentId.getRequired("instrument_id") /** - * Quantity of contracts. + * Number of contracts included in the instruction. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -148,9 +144,7 @@ private constructor( fun status(): PositionInstructionStatus = status.getRequired("status") /** - * Trading symbol resolved from the instrument cache (OSI for options, since exercises are - * options-only). Empty if the instrument cannot be resolved (e.g. expired option). - * Display-only. + * Options symbol (OSI) for display. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -158,7 +152,8 @@ private constructor( fun symbol(): String = symbol.getRequired("symbol") /** - * Quantity accepted by OCC. Populated after `ACCEPTED`. + * Number of contracts accepted by the clearing venue. Populated once the instruction reaches + * `ACCEPTED`. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -166,7 +161,7 @@ private constructor( fun acceptedQuantity(): Optional = acceptedQuantity.getOptional("accepted_quantity") /** - * Row creation timestamp surfaced from `oems-csc`. + * When the instruction was first accepted by the service. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -174,7 +169,7 @@ private constructor( fun createdAt(): Optional = createdAt.getOptional("created_at") /** - * Inline error detail when a batch entry was rejected (omitted on success). + * Per-row error on a batch submission (omitted on success). * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -182,7 +177,7 @@ private constructor( fun error(): Optional = error.getOptional("error") /** - * Reason text populated on terminal reject / cancel-failed statuses. + * Explanation populated on terminal reject or cancel-failed statuses. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -190,7 +185,7 @@ private constructor( fun rejectionReason(): Optional = rejectionReason.getOptional("rejection_reason") /** - * Last update timestamp surfaced from `oems-csc`. + * When the instruction's lifecycle state last changed. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -373,10 +368,7 @@ private constructor( additionalProperties = positionInstruction.additionalProperties.toMutableMap() } - /** - * Stable server-assigned id for the instruction (the engine instruction UUID). Used as the - * `{instruction_id}` path parameter on DELETE. - */ + /** Server-assigned id. Used as the path parameter on cancel. */ fun id(id: String) = id(JsonField.of(id)) /** @@ -399,8 +391,8 @@ private constructor( fun accountId(accountId: JsonField) = apply { this.accountId = accountId } /** - * Caller-supplied instruction id (echoed from the submit request, or the server-generated - * fallback when the caller omitted one). + * Caller-supplied idempotency key echoed from the submit request; the server-assigned + * fallback when none was supplied. */ fun instructionId(instructionId: String) = instructionId(JsonField.of(instructionId)) @@ -415,7 +407,7 @@ private constructor( this.instructionId = instructionId } - /** The instruction type as understood by this API. */ + /** The action this instruction requests. */ fun instructionType(instructionType: PositionInstructionType) = instructionType(JsonField.of(instructionType)) @@ -430,7 +422,7 @@ private constructor( this.instructionType = instructionType } - /** OEMS instrument identifier the instruction is for. */ + /** Identifier of the options contract this instruction acts on. */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** @@ -444,7 +436,7 @@ private constructor( this.instrumentId = instrumentId } - /** Quantity of contracts. */ + /** Number of contracts included in the instruction. */ fun quantity(quantity: String) = quantity(JsonField.of(quantity)) /** @@ -467,11 +459,7 @@ private constructor( */ fun status(status: JsonField) = apply { this.status = status } - /** - * Trading symbol resolved from the instrument cache (OSI for options, since exercises are - * options-only). Empty if the instrument cannot be resolved (e.g. expired option). - * Display-only. - */ + /** Options symbol (OSI) for display. */ fun symbol(symbol: String) = symbol(JsonField.of(symbol)) /** @@ -482,7 +470,10 @@ private constructor( */ fun symbol(symbol: JsonField) = apply { this.symbol = symbol } - /** Quantity accepted by OCC. Populated after `ACCEPTED`. */ + /** + * Number of contracts accepted by the clearing venue. Populated once the instruction + * reaches `ACCEPTED`. + */ fun acceptedQuantity(acceptedQuantity: String?) = acceptedQuantity(JsonField.ofNullable(acceptedQuantity)) @@ -501,7 +492,7 @@ private constructor( this.acceptedQuantity = acceptedQuantity } - /** Row creation timestamp surfaced from `oems-csc`. */ + /** When the instruction was first accepted by the service. */ fun createdAt(createdAt: OffsetDateTime?) = createdAt(JsonField.ofNullable(createdAt)) /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */ @@ -516,7 +507,7 @@ private constructor( */ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - /** Inline error detail when a batch entry was rejected (omitted on success). */ + /** Per-row error on a batch submission (omitted on success). */ fun error(error: String?) = error(JsonField.ofNullable(error)) /** Alias for calling [Builder.error] with `error.orElse(null)`. */ @@ -530,7 +521,7 @@ private constructor( */ fun error(error: JsonField) = apply { this.error = error } - /** Reason text populated on terminal reject / cancel-failed statuses. */ + /** Explanation populated on terminal reject or cancel-failed statuses. */ fun rejectionReason(rejectionReason: String?) = rejectionReason(JsonField.ofNullable(rejectionReason)) @@ -549,7 +540,7 @@ private constructor( this.rejectionReason = rejectionReason } - /** Last update timestamp surfaced from `oems-csc`. */ + /** When the instruction's lifecycle state last changed. */ fun updatedAt(updatedAt: OffsetDateTime?) = updatedAt(JsonField.ofNullable(updatedAt)) /** Alias for calling [Builder.updatedAt] with `updatedAt.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt index 5b678c67..43e9c7dd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt @@ -7,13 +7,7 @@ import com.clear_street.api.core.JsonField import com.clear_street.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator -/** - * Public Active API lifecycle status for a position instruction. - * - * Maps 1:1 to the `oems-csc` wire enum while keeping the REST schema stable: api-gw owns - * serialization, OpenAPI generation, and the `Unknown` fallback for missing or unrecognized gRPC - * values. - */ +/** Lifecycle status of a position instruction. */ class PositionInstructionStatus @JsonCreator private constructor(private val value: JsonField) : Enum { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt index bafba775..35cdc46c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt @@ -7,12 +7,7 @@ import com.clear_street.api.core.JsonField import com.clear_street.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator -/** - * The instruction type a caller wants `oems-csc` to take against an options position. - * - * Maps onto FIX `PosTransType` (tag 709) + `PosMaintAction` (tag 712) + - * `ContraryInstructionIndicator` (tag 719) per `oems-csc`'s `classify_action`. - */ +/** The action to take against an options position. */ class PositionInstructionType @JsonCreator private constructor(private val value: JsonField) : Enum { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt index 4a1e540d..82902f76 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt @@ -22,9 +22,9 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * 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. + * Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise Advice) + * against the account. Each row is processed independently; a rejected row is returned with an + * error on the corresponding response entry without failing the batch. */ class PositionSubmitPositionInstructionsParams private constructor( @@ -237,10 +237,10 @@ private constructor( override fun _queryParams(): QueryParams = additionalQueryParams /** - * One exercise / DNE / CEA instruction requested by a client. + * A position instruction to submit. * - * Cancel is not an instruction type — use `DELETE - * /accounts/{account_id}/positions/instructions/{instruction_id}`. + * Use `DELETE /accounts/{account_id}/positions/instructions/{instruction_id}` to cancel an + * outstanding instruction. */ class Instruction @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -269,7 +269,7 @@ private constructor( ) : this(instructionType, instrumentId, quantity, instructionId, mutableMapOf()) /** - * Instruction type. + * The action to take. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -278,8 +278,7 @@ private constructor( instructionType.getRequired("instruction_type") /** - * OEMS instrument identifier. api-gw resolves this to `security_id` + `security_id_source` - * via the instrument cache before dispatching to `oems-csc`. Unknown ids return 404. + * Identifier of the options contract to act on. Unknown ids return 404. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -287,7 +286,7 @@ private constructor( fun instrumentId(): String = instrumentId.getRequired("instrument_id") /** - * Quantity of contracts to exercise / DNE / CEA. + * Number of contracts to include in the instruction. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -295,8 +294,8 @@ private constructor( fun quantity(): String = quantity.getRequired("quantity") /** - * Caller-supplied instruction id. Echoed back on the response and used as the FIX - * `pos_req_id` (tag 710) for idempotency. If omitted the server generates a UUID. + * Caller-supplied idempotency key. Echoed on the response. The server generates a unique id + * when omitted. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -385,7 +384,7 @@ private constructor( additionalProperties = instruction.additionalProperties.toMutableMap() } - /** Instruction type. */ + /** The action to take. */ fun instructionType(instructionType: PositionInstructionType) = instructionType(JsonField.of(instructionType)) @@ -400,11 +399,7 @@ private constructor( this.instructionType = instructionType } - /** - * OEMS instrument identifier. api-gw resolves this to `security_id` + - * `security_id_source` via the instrument cache before dispatching to `oems-csc`. - * Unknown ids return 404. - */ + /** Identifier of the options contract to act on. Unknown ids return 404. */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** @@ -418,7 +413,7 @@ private constructor( this.instrumentId = instrumentId } - /** Quantity of contracts to exercise / DNE / CEA. */ + /** Number of contracts to include in the instruction. */ fun quantity(quantity: String) = quantity(JsonField.of(quantity)) /** @@ -431,8 +426,8 @@ private constructor( fun quantity(quantity: JsonField) = apply { this.quantity = quantity } /** - * Caller-supplied instruction id. Echoed back on the response and used as the FIX - * `pos_req_id` (tag 710) for idempotency. If omitted the server generates a UUID. + * Caller-supplied idempotency key. Echoed on the response. The server generates a + * unique id when omitted. */ fun instructionId(instructionId: String?) = instructionId(JsonField.ofNullable(instructionId)) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt index 433e5aa7..894b655a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt @@ -36,9 +36,9 @@ interface PositionServiceAsync { fun withOptions(modifier: Consumer): PositionServiceAsync /** - * 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. + * Cancel an outstanding position instruction by its server-assigned `id`. Returns the updated + * instruction with status `CANCEL_REQUESTED`. The terminal `CANCELLED` or `CANCEL_FAILED` state + * arrives asynchronously and is observable via subsequent GETs. */ fun cancelPositionInstruction( instructionId: String, @@ -143,8 +143,8 @@ interface PositionServiceAsync { closePositions(accountId, PositionClosePositionsParams.none(), requestOptions) /** - * Returns the current lifecycle state of exercise / DNE / CEA instructions for the account. - * Optionally filter by a specific instrument. + * Returns the current lifecycle state of the account's position instructions. Optionally filter + * by a specific contract. */ fun getPositionInstructions( accountId: Long @@ -228,9 +228,9 @@ interface PositionServiceAsync { getPositions(accountId, PositionGetPositionsParams.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. + * Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise + * Advice) against the account. Each row is processed independently; a rejected row is returned + * with an error on the corresponding response entry without failing the batch. */ fun submitPositionInstructions( accountId: Long, diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt index 63bdd895..546f26dd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt @@ -36,9 +36,9 @@ interface PositionService { fun withOptions(modifier: Consumer): PositionService /** - * 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. + * Cancel an outstanding position instruction by its server-assigned `id`. Returns the updated + * instruction with status `CANCEL_REQUESTED`. The terminal `CANCELLED` or `CANCEL_FAILED` state + * arrives asynchronously and is observable via subsequent GETs. */ fun cancelPositionInstruction( instructionId: String, @@ -137,8 +137,8 @@ interface PositionService { closePositions(accountId, PositionClosePositionsParams.none(), requestOptions) /** - * Returns the current lifecycle state of exercise / DNE / CEA instructions for the account. - * Optionally filter by a specific instrument. + * Returns the current lifecycle state of the account's position instructions. Optionally filter + * by a specific contract. */ fun getPositionInstructions(accountId: Long): PositionGetPositionInstructionsResponse = getPositionInstructions(accountId, PositionGetPositionInstructionsParams.none()) @@ -218,9 +218,9 @@ interface PositionService { getPositions(accountId, PositionGetPositionsParams.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. + * Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise + * Advice) against the account. Each row is processed independently; a rejected row is returned + * with an error on the corresponding response entry without failing the batch. */ fun submitPositionInstructions( accountId: Long, From 70193360b94654f4dc6fdc940332d3c111ab6c0f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 13:33:26 +0000 Subject: [PATCH 08/51] feat(api): api update --- .stats.yml | 4 +- .../instrumentdata/InstrumentEventEnvelope.kt | 51 ++++++++++++++- .../v1/instrumentdata/InstrumentEventsData.kt | 63 +++++++++++++++++-- .../instrumentdata/InstrumentFundamentals.kt | 51 ++++++++++++++- .../InstrumentAllEventsDataTest.kt | 3 + ...tDataGetAllInstrumentEventsResponseTest.kt | 3 + ...mentDataGetInstrumentEventsResponseTest.kt | 3 + ...taGetInstrumentFundamentalsResponseTest.kt | 3 + .../InstrumentEventEnvelopeTest.kt | 3 + .../InstrumentEventsByDateTest.kt | 3 + .../InstrumentEventsDataTest.kt | 3 + .../InstrumentFundamentalsTest.kt | 3 + 12 files changed, 185 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index e09d52b8..bc19a0d2 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-a6982710449db4c46858991c2fafee80f45d47e783bd81c344732f3020a7f401.yml -openapi_spec_hash: 55d0707d00ccf354302b02b17e221373 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-c74842fb807d6c80209b6782b7dc3861757e6b6a909b5f4805c007736af6c391.yml +openapi_spec_hash: e71f751b695672e21c89d0920049e9dc config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt index f3e925a5..5146c47d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt @@ -28,6 +28,7 @@ private constructor( private val instrumentId: JsonField, private val ipoEventData: JsonField, private val name: JsonField, + private val reportingCurrency: JsonField, private val stockSplitEventData: JsonField, private val additionalProperties: MutableMap, ) { @@ -51,6 +52,9 @@ private constructor( @ExcludeMissing ipoEventData: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("reporting_currency") + @ExcludeMissing + reportingCurrency: JsonField = JsonMissing.of(), @JsonProperty("stock_split_event_data") @ExcludeMissing stockSplitEventData: JsonField = JsonMissing.of(), @@ -62,6 +66,7 @@ private constructor( instrumentId, ipoEventData, name, + reportingCurrency, stockSplitEventData, mutableMapOf(), ) @@ -125,6 +130,14 @@ private constructor( */ fun name(): Optional = name.getOptional("name") + /** + * The currency used for reporting financial data. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun reportingCurrency(): Optional = reportingCurrency.getOptional("reporting_currency") + /** * Stock split payload when type is STOCK_SPLIT. * @@ -193,6 +206,16 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [reportingCurrency]. + * + * Unlike [reportingCurrency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("reporting_currency") + @ExcludeMissing + fun _reportingCurrency(): JsonField = reportingCurrency + /** * Returns the raw JSON value of [stockSplitEventData]. * @@ -239,6 +262,7 @@ private constructor( private var instrumentId: JsonField = JsonMissing.of() private var ipoEventData: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var reportingCurrency: JsonField = JsonMissing.of() private var stockSplitEventData: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -251,6 +275,7 @@ private constructor( instrumentId = instrumentEventEnvelope.instrumentId ipoEventData = instrumentEventEnvelope.ipoEventData name = instrumentEventEnvelope.name + reportingCurrency = instrumentEventEnvelope.reportingCurrency stockSplitEventData = instrumentEventEnvelope.stockSplitEventData additionalProperties = instrumentEventEnvelope.additionalProperties.toMutableMap() } @@ -366,6 +391,25 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + /** The currency used for reporting financial data. */ + fun reportingCurrency(reportingCurrency: String?) = + reportingCurrency(JsonField.ofNullable(reportingCurrency)) + + /** Alias for calling [Builder.reportingCurrency] with `reportingCurrency.orElse(null)`. */ + fun reportingCurrency(reportingCurrency: Optional) = + reportingCurrency(reportingCurrency.getOrNull()) + + /** + * Sets [Builder.reportingCurrency] to an arbitrary JSON value. + * + * You should usually call [Builder.reportingCurrency] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun reportingCurrency(reportingCurrency: JsonField) = apply { + this.reportingCurrency = reportingCurrency + } + /** Stock split payload when type is STOCK_SPLIT. */ fun stockSplitEventData(stockSplitEventData: InstrumentSplitEvent?) = stockSplitEventData(JsonField.ofNullable(stockSplitEventData)) @@ -428,6 +472,7 @@ private constructor( instrumentId, ipoEventData, name, + reportingCurrency, stockSplitEventData, additionalProperties.toMutableMap(), ) @@ -455,6 +500,7 @@ private constructor( instrumentId() ipoEventData().ifPresent { it.validate() } name() + reportingCurrency() stockSplitEventData().ifPresent { it.validate() } validated = true } @@ -481,6 +527,7 @@ private constructor( (if (instrumentId.asKnown().isPresent) 1 else 0) + (ipoEventData.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + + (if (reportingCurrency.asKnown().isPresent) 1 else 0) + (stockSplitEventData.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { @@ -496,6 +543,7 @@ private constructor( instrumentId == other.instrumentId && ipoEventData == other.ipoEventData && name == other.name && + reportingCurrency == other.reportingCurrency && stockSplitEventData == other.stockSplitEventData && additionalProperties == other.additionalProperties } @@ -509,6 +557,7 @@ private constructor( instrumentId, ipoEventData, name, + reportingCurrency, stockSplitEventData, additionalProperties, ) @@ -517,5 +566,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentEventEnvelope{symbol=$symbol, type=$type, dividendEventData=$dividendEventData, earningsEventData=$earningsEventData, instrumentId=$instrumentId, ipoEventData=$ipoEventData, name=$name, stockSplitEventData=$stockSplitEventData, additionalProperties=$additionalProperties}" + "InstrumentEventEnvelope{symbol=$symbol, type=$type, dividendEventData=$dividendEventData, earningsEventData=$earningsEventData, instrumentId=$instrumentId, ipoEventData=$ipoEventData, name=$name, reportingCurrency=$reportingCurrency, stockSplitEventData=$stockSplitEventData, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt index 0a5aa19b..03afd190 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import java.util.Collections import java.util.Objects +import java.util.Optional import kotlin.jvm.optionals.getOrNull /** Grouped instrument events by type */ @@ -26,6 +27,7 @@ private constructor( private val earnings: JsonField>, private val instrumentId: JsonField, private val splits: JsonField>, + private val reportingCurrency: JsonField, private val additionalProperties: MutableMap, ) { @@ -43,7 +45,10 @@ private constructor( @JsonProperty("splits") @ExcludeMissing splits: JsonField> = JsonMissing.of(), - ) : this(dividends, earnings, instrumentId, splits, mutableMapOf()) + @JsonProperty("reporting_currency") + @ExcludeMissing + reportingCurrency: JsonField = JsonMissing.of(), + ) : this(dividends, earnings, instrumentId, splits, reportingCurrency, mutableMapOf()) /** * Dividend distribution events @@ -77,6 +82,14 @@ private constructor( */ fun splits(): List = splits.getRequired("splits") + /** + * The currency used for reporting financial data + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun reportingCurrency(): Optional = reportingCurrency.getOptional("reporting_currency") + /** * Returns the raw JSON value of [dividends]. * @@ -113,6 +126,16 @@ private constructor( @ExcludeMissing fun _splits(): JsonField> = splits + /** + * Returns the raw JSON value of [reportingCurrency]. + * + * Unlike [reportingCurrency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("reporting_currency") + @ExcludeMissing + fun _reportingCurrency(): JsonField = reportingCurrency + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -148,6 +171,7 @@ private constructor( private var earnings: JsonField>? = null private var instrumentId: JsonField? = null private var splits: JsonField>? = null + private var reportingCurrency: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -156,6 +180,7 @@ private constructor( earnings = instrumentEventsData.earnings.map { it.toMutableList() } instrumentId = instrumentEventsData.instrumentId splits = instrumentEventsData.splits.map { it.toMutableList() } + reportingCurrency = instrumentEventsData.reportingCurrency additionalProperties = instrumentEventsData.additionalProperties.toMutableMap() } @@ -251,6 +276,25 @@ private constructor( } } + /** The currency used for reporting financial data */ + fun reportingCurrency(reportingCurrency: String?) = + reportingCurrency(JsonField.ofNullable(reportingCurrency)) + + /** Alias for calling [Builder.reportingCurrency] with `reportingCurrency.orElse(null)`. */ + fun reportingCurrency(reportingCurrency: Optional) = + reportingCurrency(reportingCurrency.getOrNull()) + + /** + * Sets [Builder.reportingCurrency] to an arbitrary JSON value. + * + * You should usually call [Builder.reportingCurrency] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun reportingCurrency(reportingCurrency: JsonField) = apply { + this.reportingCurrency = reportingCurrency + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -291,6 +335,7 @@ private constructor( checkRequired("earnings", earnings).map { it.toImmutable() }, checkRequired("instrumentId", instrumentId), checkRequired("splits", splits).map { it.toImmutable() }, + reportingCurrency, additionalProperties.toMutableMap(), ) } @@ -314,6 +359,7 @@ private constructor( earnings().forEach { it.validate() } instrumentId() splits().forEach { it.validate() } + reportingCurrency() validated = true } @@ -335,7 +381,8 @@ private constructor( (dividends.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (earnings.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (instrumentId.asKnown().isPresent) 1 else 0) + - (splits.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (splits.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (reportingCurrency.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -347,15 +394,23 @@ private constructor( earnings == other.earnings && instrumentId == other.instrumentId && splits == other.splits && + reportingCurrency == other.reportingCurrency && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(dividends, earnings, instrumentId, splits, additionalProperties) + Objects.hash( + dividends, + earnings, + instrumentId, + splits, + reportingCurrency, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentEventsData{dividends=$dividends, earnings=$earnings, instrumentId=$instrumentId, splits=$splits, additionalProperties=$additionalProperties}" + "InstrumentEventsData{dividends=$dividends, earnings=$earnings, instrumentId=$instrumentId, splits=$splits, reportingCurrency=$reportingCurrency, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt index a96c2a1c..6f4454d9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt @@ -34,6 +34,7 @@ private constructor( private val marketCap: JsonField, private val previousClose: JsonField, private val priceToEarnings: JsonField, + private val reportingCurrency: JsonField, private val sector: JsonField, private val additionalProperties: MutableMap, ) { @@ -71,6 +72,9 @@ private constructor( @JsonProperty("price_to_earnings") @ExcludeMissing priceToEarnings: JsonField = JsonMissing.of(), + @JsonProperty("reporting_currency") + @ExcludeMissing + reportingCurrency: JsonField = JsonMissing.of(), @JsonProperty("sector") @ExcludeMissing sector: JsonField = JsonMissing.of(), ) : this( averageVolume, @@ -86,6 +90,7 @@ private constructor( marketCap, previousClose, priceToEarnings, + reportingCurrency, sector, mutableMapOf(), ) @@ -194,6 +199,14 @@ private constructor( */ fun priceToEarnings(): Optional = priceToEarnings.getOptional("price_to_earnings") + /** + * The currency used for reporting financial data + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun reportingCurrency(): Optional = reportingCurrency.getOptional("reporting_currency") + /** * The business sector of the instrument's issuer * @@ -309,6 +322,16 @@ private constructor( @ExcludeMissing fun _priceToEarnings(): JsonField = priceToEarnings + /** + * Returns the raw JSON value of [reportingCurrency]. + * + * Unlike [reportingCurrency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("reporting_currency") + @ExcludeMissing + fun _reportingCurrency(): JsonField = reportingCurrency + /** * Returns the raw JSON value of [sector]. * @@ -350,6 +373,7 @@ private constructor( private var marketCap: JsonField = JsonMissing.of() private var previousClose: JsonField = JsonMissing.of() private var priceToEarnings: JsonField = JsonMissing.of() + private var reportingCurrency: JsonField = JsonMissing.of() private var sector: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -368,6 +392,7 @@ private constructor( marketCap = instrumentFundamentals.marketCap previousClose = instrumentFundamentals.previousClose priceToEarnings = instrumentFundamentals.priceToEarnings + reportingCurrency = instrumentFundamentals.reportingCurrency sector = instrumentFundamentals.sector additionalProperties = instrumentFundamentals.additionalProperties.toMutableMap() } @@ -597,6 +622,25 @@ private constructor( this.priceToEarnings = priceToEarnings } + /** The currency used for reporting financial data */ + fun reportingCurrency(reportingCurrency: String?) = + reportingCurrency(JsonField.ofNullable(reportingCurrency)) + + /** Alias for calling [Builder.reportingCurrency] with `reportingCurrency.orElse(null)`. */ + fun reportingCurrency(reportingCurrency: Optional) = + reportingCurrency(reportingCurrency.getOrNull()) + + /** + * Sets [Builder.reportingCurrency] to an arbitrary JSON value. + * + * You should usually call [Builder.reportingCurrency] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun reportingCurrency(reportingCurrency: JsonField) = apply { + this.reportingCurrency = reportingCurrency + } + /** The business sector of the instrument's issuer */ fun sector(sector: String?) = sector(JsonField.ofNullable(sector)) @@ -650,6 +694,7 @@ private constructor( marketCap, previousClose, priceToEarnings, + reportingCurrency, sector, additionalProperties.toMutableMap(), ) @@ -683,6 +728,7 @@ private constructor( marketCap() previousClose() priceToEarnings() + reportingCurrency() sector() validated = true } @@ -715,6 +761,7 @@ private constructor( (if (marketCap.asKnown().isPresent) 1 else 0) + (if (previousClose.asKnown().isPresent) 1 else 0) + (if (priceToEarnings.asKnown().isPresent) 1 else 0) + + (if (reportingCurrency.asKnown().isPresent) 1 else 0) + (if (sector.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -736,6 +783,7 @@ private constructor( marketCap == other.marketCap && previousClose == other.previousClose && priceToEarnings == other.priceToEarnings && + reportingCurrency == other.reportingCurrency && sector == other.sector && additionalProperties == other.additionalProperties } @@ -755,6 +803,7 @@ private constructor( marketCap, previousClose, priceToEarnings, + reportingCurrency, sector, additionalProperties, ) @@ -763,5 +812,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentFundamentals{averageVolume=$averageVolume, beta=$beta, description=$description, dividendYield=$dividendYield, earningsPerShare=$earningsPerShare, fiftyTwoWeekHigh=$fiftyTwoWeekHigh, fiftyTwoWeekLow=$fiftyTwoWeekLow, industry=$industry, listDate=$listDate, logoUrl=$logoUrl, marketCap=$marketCap, previousClose=$previousClose, priceToEarnings=$priceToEarnings, sector=$sector, additionalProperties=$additionalProperties}" + "InstrumentFundamentals{averageVolume=$averageVolume, beta=$beta, description=$description, dividendYield=$dividendYield, earningsPerShare=$earningsPerShare, fiftyTwoWeekHigh=$fiftyTwoWeekHigh, fiftyTwoWeekLow=$fiftyTwoWeekLow, industry=$industry, listDate=$listDate, logoUrl=$logoUrl, marketCap=$marketCap, previousClose=$previousClose, priceToEarnings=$priceToEarnings, reportingCurrency=$reportingCurrency, sector=$sector, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt index dc5a1b77..b84781c1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt @@ -60,6 +60,7 @@ internal class InstrumentAllEventsDataTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) @@ -118,6 +119,7 @@ internal class InstrumentAllEventsDataTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) @@ -182,6 +184,7 @@ internal class InstrumentAllEventsDataTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt index a8e8a3ea..79913474 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt @@ -86,6 +86,7 @@ internal class InstrumentDataGetAllInstrumentEventsResponseTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) @@ -173,6 +174,7 @@ internal class InstrumentDataGetAllInstrumentEventsResponseTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) @@ -262,6 +264,7 @@ internal class InstrumentDataGetAllInstrumentEventsResponseTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt index d874354c..53624b06 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt @@ -72,6 +72,7 @@ internal class InstrumentDataGetInstrumentEventsResponseTest { .splitType("stock-split") .build() ) + .reportingCurrency("reporting_currency") .build() ) .build() @@ -134,6 +135,7 @@ internal class InstrumentDataGetInstrumentEventsResponseTest { .splitType("stock-split") .build() ) + .reportingCurrency("reporting_currency") .build() ) } @@ -198,6 +200,7 @@ internal class InstrumentDataGetInstrumentEventsResponseTest { .splitType("stock-split") .build() ) + .reportingCurrency("reporting_currency") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt index 74f48692..5ce62c0e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt @@ -55,6 +55,7 @@ internal class InstrumentDataGetInstrumentFundamentalsResponseTest { .marketCap("2800000000000") .previousClose("210.87") .priceToEarnings("30.5") + .reportingCurrency("USD") .sector("Technology") .build() ) @@ -101,6 +102,7 @@ internal class InstrumentDataGetInstrumentFundamentalsResponseTest { .marketCap("2800000000000") .previousClose("210.87") .priceToEarnings("30.5") + .reportingCurrency("USD") .sector("Technology") .build() ) @@ -149,6 +151,7 @@ internal class InstrumentDataGetInstrumentFundamentalsResponseTest { .marketCap("2800000000000") .previousClose("210.87") .priceToEarnings("30.5") + .reportingCurrency("USD") .sector("Technology") .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt index f993e7a0..608d9c1a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt @@ -53,6 +53,7 @@ internal class InstrumentEventEnvelopeTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) @@ -105,6 +106,7 @@ internal class InstrumentEventEnvelopeTest { .build() ) assertThat(instrumentEventEnvelope.name()).contains("name") + assertThat(instrumentEventEnvelope.reportingCurrency()).contains("reporting_currency") assertThat(instrumentEventEnvelope.stockSplitEventData()) .contains( InstrumentSplitEvent.builder() @@ -159,6 +161,7 @@ internal class InstrumentEventEnvelopeTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt index ea7ee02a..03b9a015 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt @@ -56,6 +56,7 @@ internal class InstrumentEventsByDateTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) @@ -110,6 +111,7 @@ internal class InstrumentEventsByDateTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) @@ -168,6 +170,7 @@ internal class InstrumentEventsByDateTest { .build() ) .name("name") + .reportingCurrency("reporting_currency") .stockSplitEventData( InstrumentSplitEvent.builder() .date(LocalDate.parse("2025-08-15")) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt index bace7354..ae1d01ff 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt @@ -46,6 +46,7 @@ internal class InstrumentEventsDataTest { .splitType("stock-split") .build() ) + .reportingCurrency("reporting_currency") .build() assertThat(instrumentEventsData.dividends()) @@ -84,6 +85,7 @@ internal class InstrumentEventsDataTest { .splitType("stock-split") .build() ) + assertThat(instrumentEventsData.reportingCurrency()).contains("reporting_currency") } @Test @@ -123,6 +125,7 @@ internal class InstrumentEventsDataTest { .splitType("stock-split") .build() ) + .reportingCurrency("reporting_currency") .build() val roundtrippedInstrumentEventsData = diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt index e7f8aa6c..def56adb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt @@ -29,6 +29,7 @@ internal class InstrumentFundamentalsTest { .marketCap("2800000000000") .previousClose("210.87") .priceToEarnings("30.5") + .reportingCurrency("USD") .sector("Technology") .build() @@ -48,6 +49,7 @@ internal class InstrumentFundamentalsTest { assertThat(instrumentFundamentals.marketCap()).contains("2800000000000") assertThat(instrumentFundamentals.previousClose()).contains("210.87") assertThat(instrumentFundamentals.priceToEarnings()).contains("30.5") + assertThat(instrumentFundamentals.reportingCurrency()).contains("USD") assertThat(instrumentFundamentals.sector()).contains("Technology") } @@ -71,6 +73,7 @@ internal class InstrumentFundamentalsTest { .marketCap("2800000000000") .previousClose("210.87") .priceToEarnings("30.5") + .reportingCurrency("USD") .sector("Technology") .build() From 58d0a01a409dd26f9a37311379a62bcd2da18915 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 18:41:36 +0000 Subject: [PATCH 09/51] feat(api): api update --- .stats.yml | 2 +- .../v1/positions/PositionInstruction.kt | 47 +++---------------- ...ositionSubmitPositionInstructionsParams.kt | 15 +++++- .../services/async/v1/PositionServiceAsync.kt | 15 +++++- .../services/blocking/v1/PositionService.kt | 15 +++++- ...onCancelPositionInstructionResponseTest.kt | 3 -- ...tionGetPositionInstructionsResponseTest.kt | 3 -- .../v1/positions/PositionInstructionTest.kt | 3 -- ...nSubmitPositionInstructionsResponseTest.kt | 3 -- 9 files changed, 47 insertions(+), 59 deletions(-) diff --git a/.stats.yml b/.stats.yml index bc19a0d2..564090ed 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-c74842fb807d6c80209b6782b7dc3861757e6b6a909b5f4805c007736af6c391.yml -openapi_spec_hash: e71f751b695672e21c89d0920049e9dc +openapi_spec_hash: cb7c92c4f6d4160cd1ac39faf12ef325 config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt index b390b6d9..d4388edb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt @@ -32,7 +32,6 @@ private constructor( private val symbol: JsonField, private val acceptedQuantity: JsonField, private val createdAt: JsonField, - private val error: JsonField, private val rejectionReason: JsonField, private val updatedAt: JsonField, private val additionalProperties: MutableMap, @@ -62,7 +61,6 @@ private constructor( @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), - @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), @JsonProperty("rejection_reason") @ExcludeMissing rejectionReason: JsonField = JsonMissing.of(), @@ -80,7 +78,6 @@ private constructor( symbol, acceptedQuantity, createdAt, - error, rejectionReason, updatedAt, mutableMapOf(), @@ -169,15 +166,9 @@ private constructor( fun createdAt(): Optional = createdAt.getOptional("created_at") /** - * Per-row error on a batch submission (omitted on success). - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun error(): Optional = error.getOptional("error") - - /** - * Explanation populated on terminal reject or cancel-failed statuses. + * Human-readable explanation populated on any non-success terminal status — `REJECTED`, + * `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level + * `error` field summarizes the batch; per-row detail continues to live here. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -275,13 +266,6 @@ private constructor( @ExcludeMissing fun _createdAt(): JsonField = createdAt - /** - * Returns the raw JSON value of [error]. - * - * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error - /** * Returns the raw JSON value of [rejectionReason]. * @@ -345,7 +329,6 @@ private constructor( private var symbol: JsonField? = null private var acceptedQuantity: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() - private var error: JsonField = JsonMissing.of() private var rejectionReason: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -362,7 +345,6 @@ private constructor( symbol = positionInstruction.symbol acceptedQuantity = positionInstruction.acceptedQuantity createdAt = positionInstruction.createdAt - error = positionInstruction.error rejectionReason = positionInstruction.rejectionReason updatedAt = positionInstruction.updatedAt additionalProperties = positionInstruction.additionalProperties.toMutableMap() @@ -507,21 +489,11 @@ private constructor( */ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - /** Per-row error on a batch submission (omitted on success). */ - fun error(error: String?) = error(JsonField.ofNullable(error)) - - /** Alias for calling [Builder.error] with `error.orElse(null)`. */ - fun error(error: Optional) = error(error.getOrNull()) - /** - * Sets [Builder.error] to an arbitrary JSON value. - * - * You should usually call [Builder.error] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. + * Human-readable explanation populated on any non-success terminal status — `REJECTED`, + * `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level + * `error` field summarizes the batch; per-row detail continues to live here. */ - fun error(error: JsonField) = apply { this.error = error } - - /** Explanation populated on terminal reject or cancel-failed statuses. */ fun rejectionReason(rejectionReason: String?) = rejectionReason(JsonField.ofNullable(rejectionReason)) @@ -605,7 +577,6 @@ private constructor( checkRequired("symbol", symbol), acceptedQuantity, createdAt, - error, rejectionReason, updatedAt, additionalProperties.toMutableMap(), @@ -637,7 +608,6 @@ private constructor( symbol() acceptedQuantity() createdAt() - error() rejectionReason() updatedAt() validated = true @@ -668,7 +638,6 @@ private constructor( (if (symbol.asKnown().isPresent) 1 else 0) + (if (acceptedQuantity.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + - (if (error.asKnown().isPresent) 1 else 0) + (if (rejectionReason.asKnown().isPresent) 1 else 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) @@ -688,7 +657,6 @@ private constructor( symbol == other.symbol && acceptedQuantity == other.acceptedQuantity && createdAt == other.createdAt && - error == other.error && rejectionReason == other.rejectionReason && updatedAt == other.updatedAt && additionalProperties == other.additionalProperties @@ -706,7 +674,6 @@ private constructor( symbol, acceptedQuantity, createdAt, - error, rejectionReason, updatedAt, additionalProperties, @@ -716,5 +683,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PositionInstruction{id=$id, accountId=$accountId, instructionId=$instructionId, instructionType=$instructionType, instrumentId=$instrumentId, quantity=$quantity, status=$status, symbol=$symbol, acceptedQuantity=$acceptedQuantity, createdAt=$createdAt, error=$error, rejectionReason=$rejectionReason, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "PositionInstruction{id=$id, accountId=$accountId, instructionId=$instructionId, instructionType=$instructionType, instrumentId=$instrumentId, quantity=$quantity, status=$status, symbol=$symbol, acceptedQuantity=$acceptedQuantity, createdAt=$createdAt, rejectionReason=$rejectionReason, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt index 82902f76..f49672fa 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt @@ -23,8 +23,19 @@ import kotlin.jvm.optionals.getOrNull /** * Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise Advice) - * against the account. Each row is processed independently; a rejected row is returned with an - * error on the corresponding response entry without failing the batch. + * against the account. + * + * Batch semantics: + * - **All rows accepted** → `200 OK`. Every row is in `data` with `status = SENT`. + * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry + * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` + * summarizes the batch failure. + * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying + * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA on a + * non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. + * + * Pre-flight validation (unknown `instrument_id`, unencodable `quantity`) short-circuits the whole + * batch with a `4xx` before any row is submitted. */ class PositionSubmitPositionInstructionsParams private constructor( diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt index 894b655a..74e7faf0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt @@ -229,8 +229,19 @@ interface PositionServiceAsync { /** * Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise - * Advice) against the account. Each row is processed independently; a rejected row is returned - * with an error on the corresponding response entry without failing the batch. + * Advice) against the account. + * + * Batch semantics: + * - **All rows accepted** → `200 OK`. Every row is in `data` with `status = SENT`. + * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry + * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` + * summarizes the batch failure. + * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying + * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA + * on a non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. + * + * Pre-flight validation (unknown `instrument_id`, unencodable `quantity`) short-circuits the + * whole batch with a `4xx` before any row is submitted. */ fun submitPositionInstructions( accountId: Long, diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt index 546f26dd..a0102ab4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt @@ -219,8 +219,19 @@ interface PositionService { /** * Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise - * Advice) against the account. Each row is processed independently; a rejected row is returned - * with an error on the corresponding response entry without failing the batch. + * Advice) against the account. + * + * Batch semantics: + * - **All rows accepted** → `200 OK`. Every row is in `data` with `status = SENT`. + * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry + * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` + * summarizes the batch failure. + * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying + * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA + * on a non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. + * + * Pre-flight validation (unknown `instrument_id`, unencodable `quantity`) short-circuits the + * whole batch with a `4xx` before any row is submitted. */ fun submitPositionInstructions( accountId: Long, diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt index 493e7f0e..16e823bc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt @@ -50,7 +50,6 @@ internal class PositionCancelPositionInstructionResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() @@ -93,7 +92,6 @@ internal class PositionCancelPositionInstructionResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() @@ -138,7 +136,6 @@ internal class PositionCancelPositionInstructionResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt index 9986eb23..1bfc832a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt @@ -50,7 +50,6 @@ internal class PositionGetPositionInstructionsResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() @@ -93,7 +92,6 @@ internal class PositionGetPositionInstructionsResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() @@ -138,7 +136,6 @@ internal class PositionGetPositionInstructionsResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt index ccdc705b..ead7e172 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt @@ -24,7 +24,6 @@ internal class PositionInstructionTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() @@ -42,7 +41,6 @@ internal class PositionInstructionTest { assertThat(positionInstruction.acceptedQuantity()).isEmpty assertThat(positionInstruction.createdAt()) .contains(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - assertThat(positionInstruction.error()).contains("error") assertThat(positionInstruction.rejectionReason()).isEmpty assertThat(positionInstruction.updatedAt()) .contains(OffsetDateTime.parse("2026-04-24T14:30:00Z")) @@ -63,7 +61,6 @@ internal class PositionInstructionTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt index d64cad89..cf94d912 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt @@ -50,7 +50,6 @@ internal class PositionSubmitPositionInstructionsResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() @@ -93,7 +92,6 @@ internal class PositionSubmitPositionInstructionsResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() @@ -138,7 +136,6 @@ internal class PositionSubmitPositionInstructionsResponseTest { .symbol("AAPL 280121C00195000") .acceptedQuantity(null) .createdAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) - .error("error") .rejectionReason(null) .updatedAt(OffsetDateTime.parse("2026-04-24T14:30:00Z")) .build() From be976e39b6a9e0e20b07ef1cdc526425d6d6136b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 16 May 2026 02:07:13 +0000 Subject: [PATCH 10/51] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 564090ed..ba323f40 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-c74842fb807d6c80209b6782b7dc3861757e6b6a909b5f4805c007736af6c391.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-6ceedecd193a0ac338912471b60eca9dc07679b714827d99d61354977c52faf0.yml openapi_spec_hash: cb7c92c4f6d4160cd1ac39faf12ef325 config_hash: 7033b484e7e1bbf72c997ac476b693f8 From 2e39797c7fe89f9d24c0003055b70d7a2b4ac56e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 21:17:34 +0000 Subject: [PATCH 11/51] feat(api): api update --- .stats.yml | 4 ++-- .../v1/positions/PositionInstructionStatus.kt | 18 +++++++++++++++++- ...PositionSubmitPositionInstructionsParams.kt | 3 --- .../services/async/v1/PositionServiceAsync.kt | 3 --- .../services/blocking/v1/PositionService.kt | 3 --- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.stats.yml b/.stats.yml index ba323f40..603d396a 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-6ceedecd193a0ac338912471b60eca9dc07679b714827d99d61354977c52faf0.yml -openapi_spec_hash: cb7c92c4f6d4160cd1ac39faf12ef325 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-4f48ac7269a004af68374d8457493961418d0b523c7bb580eec5dd5578045b93.yml +openapi_spec_hash: 34f38af6e792c052bb0897880f76743a config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt index 43e9c7dd..2a29821a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt @@ -7,7 +7,23 @@ import com.clear_street.api.core.JsonField import com.clear_street.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator -/** Lifecycle status of a position instruction. */ +/** + * Lifecycle status of a position instruction. + * - `SENT`: accepted and forwarded to the clearing venue. + * - `ACCEPTED`: terminal — accepted by the clearing venue. + * - `REJECTED`: terminal rejection from the clearing venue; `rejection_reason` carries the + * venue-reported detail. + * - `ENGINE_REJECTED`: terminal rejection raised before the instruction reached the clearing venue; + * `rejection_reason` carries the detail. Typical causes: duplicate `instruction_id`, + * `DO_NOT_EXERCISE` / `CONTRARY_EXERCISE` submitted on a non-expiry day, insufficient position, + * or an instrument that does not resolve. + * - `CANCEL_REQUESTED`: cancel accepted; final cancel state pending. + * - `CANCELLED`: terminal — cancel completed. + * - `CANCEL_FAILED`: cancel could not be completed; operator attention required. `rejection_reason` + * carries the detail. + * - `UNKNOWN`: status could not be mapped from the upstream service. Not expected in practice; + * surfaces a service version skew. + */ class PositionInstructionStatus @JsonCreator private constructor(private val value: JsonField) : Enum { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt index f49672fa..d9e470fc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt @@ -33,9 +33,6 @@ import kotlin.jvm.optionals.getOrNull * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA on a * non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. - * - * Pre-flight validation (unknown `instrument_id`, unencodable `quantity`) short-circuits the whole - * batch with a `4xx` before any row is submitted. */ class PositionSubmitPositionInstructionsParams private constructor( diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt index 74e7faf0..f0f6b9cd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt @@ -239,9 +239,6 @@ interface PositionServiceAsync { * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA * on a non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. - * - * Pre-flight validation (unknown `instrument_id`, unencodable `quantity`) short-circuits the - * whole batch with a `4xx` before any row is submitted. */ fun submitPositionInstructions( accountId: Long, diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt index a0102ab4..b7a40bce 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt @@ -229,9 +229,6 @@ interface PositionService { * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA * on a non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. - * - * Pre-flight validation (unknown `instrument_id`, unencodable `quantity`) short-circuits the - * whole batch with a `4xx` before any row is submitted. */ fun submitPositionInstructions( accountId: Long, From 8f4518082165cde883d69b2711426dbd719ad0de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 14:02:06 +0000 Subject: [PATCH 12/51] feat(api): api update --- .stats.yml | 4 +- .../marketdata/SnapshotLastTrade.kt | 52 ++++++++++++++++--- .../MarketDataGetSnapshotsResponseTest.kt | 6 +-- .../marketdata/MarketDataSnapshotTest.kt | 6 +-- .../marketdata/SnapshotLastTradeTest.kt | 5 +- 5 files changed, 57 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 603d396a..6765e042 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-4f48ac7269a004af68374d8457493961418d0b523c7bb580eec5dd5578045b93.yml -openapi_spec_hash: 34f38af6e792c052bb0897880f76743a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-23aba5826444d6d90d94f4100c39ad816c92100112cdb9691e84c9b36da96e0d.yml +openapi_spec_hash: 71315e72a5f6bd47dd50ccdb300b0513 config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt index 32f2d0b8..e1f309a4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt @@ -20,13 +20,15 @@ class SnapshotLastTrade @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val price: JsonField, + private val size: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("price") @ExcludeMissing price: JsonField = JsonMissing.of() - ) : this(price, mutableMapOf()) + @JsonProperty("price") @ExcludeMissing price: JsonField = JsonMissing.of(), + @JsonProperty("size") @ExcludeMissing size: JsonField = JsonMissing.of(), + ) : this(price, size, mutableMapOf()) /** * Most recent last-sale eligible trade price. @@ -36,6 +38,14 @@ private constructor( */ fun price(): String = price.getRequired("price") + /** + * Share quantity of the most recent last-sale eligible trade. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun size(): Int = size.getRequired("size") + /** * Returns the raw JSON value of [price]. * @@ -43,6 +53,13 @@ private constructor( */ @JsonProperty("price") @ExcludeMissing fun _price(): JsonField = price + /** + * Returns the raw JSON value of [size]. + * + * Unlike [size], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("size") @ExcludeMissing fun _size(): JsonField = size + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -63,6 +80,7 @@ private constructor( * The following fields are required: * ```java * .price() + * .size() * ``` */ @JvmStatic fun builder() = Builder() @@ -72,11 +90,13 @@ private constructor( class Builder internal constructor() { private var price: JsonField? = null + private var size: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(snapshotLastTrade: SnapshotLastTrade) = apply { price = snapshotLastTrade.price + size = snapshotLastTrade.size additionalProperties = snapshotLastTrade.additionalProperties.toMutableMap() } @@ -91,6 +111,17 @@ private constructor( */ fun price(price: JsonField) = apply { this.price = price } + /** Share quantity of the most recent last-sale eligible trade. */ + fun size(size: Int) = size(JsonField.of(size)) + + /** + * Sets [Builder.size] to an arbitrary JSON value. + * + * You should usually call [Builder.size] with a well-typed [Int] value instead. This method + * is primarily for setting the field to an undocumented or not yet supported value. + */ + fun size(size: JsonField) = apply { this.size = size } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -118,12 +149,17 @@ private constructor( * The following fields are required: * ```java * .price() + * .size() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): SnapshotLastTrade = - SnapshotLastTrade(checkRequired("price", price), additionalProperties.toMutableMap()) + SnapshotLastTrade( + checkRequired("price", price), + checkRequired("size", size), + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -142,6 +178,7 @@ private constructor( } price() + size() validated = true } @@ -158,7 +195,9 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = (if (price.asKnown().isPresent) 1 else 0) + @JvmSynthetic + internal fun validity(): Int = + (if (price.asKnown().isPresent) 1 else 0) + (if (size.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -167,13 +206,14 @@ private constructor( return other is SnapshotLastTrade && price == other.price && + size == other.size && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(price, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(price, size, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "SnapshotLastTrade{price=$price, additionalProperties=$additionalProperties}" + "SnapshotLastTrade{price=$price, size=$size, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt index 96e5c01b..c85eee2b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt @@ -51,7 +51,7 @@ internal class MarketDataGetSnapshotsResponseTest { .bidSize(300) .build() ) - .lastTrade(SnapshotLastTrade.builder().price("210.12").build()) + .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) .name("Apple Inc.") .session( SnapshotSession.builder() @@ -102,7 +102,7 @@ internal class MarketDataGetSnapshotsResponseTest { .bidSize(300) .build() ) - .lastTrade(SnapshotLastTrade.builder().price("210.12").build()) + .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) .name("Apple Inc.") .session( SnapshotSession.builder() @@ -155,7 +155,7 @@ internal class MarketDataGetSnapshotsResponseTest { .bidSize(300) .build() ) - .lastTrade(SnapshotLastTrade.builder().price("210.12").build()) + .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) .name("Apple Inc.") .session( SnapshotSession.builder() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt index 11ffc9a2..4197adf9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt @@ -25,7 +25,7 @@ internal class MarketDataSnapshotTest { .bidSize(300) .build() ) - .lastTrade(SnapshotLastTrade.builder().price("210.12").build()) + .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) .name("Apple Inc.") .session( SnapshotSession.builder() @@ -51,7 +51,7 @@ internal class MarketDataSnapshotTest { .build() ) assertThat(marketDataSnapshot.lastTrade()) - .contains(SnapshotLastTrade.builder().price("210.12").build()) + .contains(SnapshotLastTrade.builder().price("210.12").size(100).build()) assertThat(marketDataSnapshot.name()).contains("Apple Inc.") assertThat(marketDataSnapshot.session()) .contains( @@ -80,7 +80,7 @@ internal class MarketDataSnapshotTest { .bidSize(300) .build() ) - .lastTrade(SnapshotLastTrade.builder().price("210.12").build()) + .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) .name("Apple Inc.") .session( SnapshotSession.builder() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt index 45fde2a6..c1c63ece 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt @@ -11,15 +11,16 @@ internal class SnapshotLastTradeTest { @Test fun create() { - val snapshotLastTrade = SnapshotLastTrade.builder().price("price").build() + val snapshotLastTrade = SnapshotLastTrade.builder().price("price").size(0).build() assertThat(snapshotLastTrade.price()).isEqualTo("price") + assertThat(snapshotLastTrade.size()).isEqualTo(0) } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val snapshotLastTrade = SnapshotLastTrade.builder().price("price").build() + val snapshotLastTrade = SnapshotLastTrade.builder().price("price").size(0).build() val roundtrippedSnapshotLastTrade = jsonMapper.readValue( From b382185f5e651b8933d9398d80a7c56a4b96b413 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 17:14:03 +0000 Subject: [PATCH 13/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/orders/NewOrderRequest.kt | 59 ++--------------- .../v1/orders/OrderSubmitOrdersParams.kt | 63 ++----------------- .../ContentPartStructuredActionPayloadTest.kt | 4 -- .../v1/omniai/PrefillNewOrderActionTest.kt | 4 -- .../v1/omniai/PrefillOrderActionTest.kt | 3 - .../models/v1/omniai/StructuredActionTest.kt | 3 - .../responses/ResponseContentPartTest.kt | 3 - .../omniai/threads/MessageContentPartTest.kt | 3 - .../models/v1/orders/NewOrderRequestTest.kt | 4 -- .../v1/orders/OrderSubmitOrdersParamsTest.kt | 19 ------ .../async/v1/OrderServiceAsyncTest.kt | 4 -- .../services/blocking/v1/OrderServiceTest.kt | 4 -- .../api/proguard/ProGuardCompatibilityTest.kt | 2 - 14 files changed, 10 insertions(+), 169 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6765e042..92877639 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-23aba5826444d6d90d94f4100c39ad816c92100112cdb9691e84c9b36da96e0d.yml -openapi_spec_hash: 71315e72a5f6bd47dd50ccdb300b0513 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-15d5c1560b55430ee7932b73dca379cd213158b660a170e4145d8c5d9ade7a82.yml +openapi_spec_hash: 0a173bc66a48c7612d02d64dbac7ae70 config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt index e0f44410..c33590f1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt @@ -8,7 +8,6 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -23,7 +22,6 @@ import kotlin.jvm.optionals.getOrNull class NewOrderRequest @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val instrumentType: JsonField, private val orderType: JsonField, private val quantity: JsonField, private val side: JsonField, @@ -44,9 +42,6 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("instrument_type") - @ExcludeMissing - instrumentType: JsonField = JsonMissing.of(), @JsonProperty("order_type") @ExcludeMissing orderType: JsonField = JsonMissing.of(), @@ -83,7 +78,6 @@ private constructor( @ExcludeMissing trailingOffsetType: JsonField = JsonMissing.of(), ) : this( - instrumentType, orderType, quantity, side, @@ -102,14 +96,6 @@ private constructor( mutableMapOf(), ) - /** - * Type of security - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun instrumentType(): SecurityType = instrumentType.getRequired("instrument_type") - /** * Type of order * @@ -193,8 +179,7 @@ private constructor( fun limitPrice(): Optional = limitPrice.getOptional("limit_price") /** - * Required when instrument_type is OPTION. Specifies whether the order opens or closes a - * position. + * Required for options. Specifies whether the order opens or closes a position. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -235,15 +220,6 @@ private constructor( fun trailingOffsetType(): Optional = trailingOffsetType.getOptional("trailing_offset_type") - /** - * Returns the raw JSON value of [instrumentType]. - * - * Unlike [instrumentType], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("instrument_type") - @ExcludeMissing - fun _instrumentType(): JsonField = instrumentType - /** * Returns the raw JSON value of [orderType]. * @@ -387,7 +363,6 @@ private constructor( * * The following fields are required: * ```java - * .instrumentType() * .orderType() * .quantity() * .side() @@ -400,7 +375,6 @@ private constructor( /** A builder for [NewOrderRequest]. */ class Builder internal constructor() { - private var instrumentType: JsonField? = null private var orderType: JsonField? = null private var quantity: JsonField? = null private var side: JsonField? = null @@ -420,7 +394,6 @@ private constructor( @JvmSynthetic internal fun from(newOrderRequest: NewOrderRequest) = apply { - instrumentType = newOrderRequest.instrumentType orderType = newOrderRequest.orderType quantity = newOrderRequest.quantity side = newOrderRequest.side @@ -439,21 +412,6 @@ private constructor( additionalProperties = newOrderRequest.additionalProperties.toMutableMap() } - /** Type of security */ - fun instrumentType(instrumentType: SecurityType) = - instrumentType(JsonField.of(instrumentType)) - - /** - * Sets [Builder.instrumentType] to an arbitrary JSON value. - * - * You should usually call [Builder.instrumentType] with a well-typed [SecurityType] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun instrumentType(instrumentType: JsonField) = apply { - this.instrumentType = instrumentType - } - /** Type of order */ fun orderType(orderType: RequestOrderType) = orderType(JsonField.of(orderType)) @@ -612,10 +570,7 @@ private constructor( */ fun limitPrice(limitPrice: JsonField) = apply { this.limitPrice = limitPrice } - /** - * Required when instrument_type is OPTION. Specifies whether the order opens or closes a - * position. - */ + /** Required for options. Specifies whether the order opens or closes a position. */ fun positionEffect(positionEffect: PositionEffect) = positionEffect(JsonField.of(positionEffect)) @@ -729,7 +684,6 @@ private constructor( * * The following fields are required: * ```java - * .instrumentType() * .orderType() * .quantity() * .side() @@ -740,7 +694,6 @@ private constructor( */ fun build(): NewOrderRequest = NewOrderRequest( - checkRequired("instrumentType", instrumentType), checkRequired("orderType", orderType), checkRequired("quantity", quantity), checkRequired("side", side), @@ -775,7 +728,6 @@ private constructor( return@apply } - instrumentType().validate() orderType().validate() quantity() side().validate() @@ -809,8 +761,7 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (instrumentType.asKnown().getOrNull()?.validity() ?: 0) + - (orderType.asKnown().getOrNull()?.validity() ?: 0) + + (orderType.asKnown().getOrNull()?.validity() ?: 0) + (if (quantity.asKnown().isPresent) 1 else 0) + (side.asKnown().getOrNull()?.validity() ?: 0) + (timeInForce.asKnown().getOrNull()?.validity() ?: 0) + @@ -832,7 +783,6 @@ private constructor( } return other is NewOrderRequest && - instrumentType == other.instrumentType && orderType == other.orderType && quantity == other.quantity && side == other.side && @@ -853,7 +803,6 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( - instrumentType, orderType, quantity, side, @@ -876,5 +825,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NewOrderRequest{instrumentType=$instrumentType, orderType=$orderType, quantity=$quantity, side=$side, timeInForce=$timeInForce, id=$id, expiresAt=$expiresAt, extendedHours=$extendedHours, instrumentId=$instrumentId, limitOffset=$limitOffset, limitPrice=$limitPrice, positionEffect=$positionEffect, stopPrice=$stopPrice, symbol=$symbol, trailingOffset=$trailingOffset, trailingOffsetType=$trailingOffsetType, additionalProperties=$additionalProperties}" + "NewOrderRequest{orderType=$orderType, quantity=$quantity, side=$side, timeInForce=$timeInForce, id=$id, expiresAt=$expiresAt, extendedHours=$extendedHours, instrumentId=$instrumentId, limitOffset=$limitOffset, limitPrice=$limitPrice, positionEffect=$positionEffect, stopPrice=$stopPrice, symbol=$symbol, trailingOffset=$trailingOffset, trailingOffsetType=$trailingOffsetType, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt index 628b765f..db031181 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt @@ -17,7 +17,6 @@ import com.clear_street.api.core.http.Headers import com.clear_street.api.core.http.QueryParams import com.clear_street.api.core.toImmutable import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -875,7 +874,6 @@ private constructor( class Leg @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val instrumentType: JsonField, private val ratio: JsonField, private val security: JsonField, private val side: JsonField, @@ -886,9 +884,6 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("instrument_type") - @ExcludeMissing - instrumentType: JsonField = JsonMissing.of(), @JsonProperty("ratio") @ExcludeMissing ratio: JsonField = JsonMissing.of(), @@ -900,16 +895,7 @@ private constructor( @JsonProperty("position_effect") @ExcludeMissing positionEffect: JsonField = JsonMissing.of(), - ) : this(instrumentType, ratio, security, side, id, positionEffect, mutableMapOf()) - - /** - * Security type for the leg. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type - * or is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun instrumentType(): SecurityType = instrumentType.getRequired("instrument_type") + ) : this(ratio, security, side, id, positionEffect, mutableMapOf()) /** * Ratio for the leg. @@ -955,16 +941,6 @@ private constructor( fun positionEffect(): Optional = positionEffect.getOptional("position_effect") - /** - * Returns the raw JSON value of [instrumentType]. - * - * Unlike [instrumentType], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("instrument_type") - @ExcludeMissing - fun _instrumentType(): JsonField = instrumentType - /** * Returns the raw JSON value of [ratio]. * @@ -1027,7 +1003,6 @@ private constructor( * * The following fields are required: * ```java - * .instrumentType() * .ratio() * .security() * .side() @@ -1039,7 +1014,6 @@ private constructor( /** A builder for [Leg]. */ class Builder internal constructor() { - private var instrumentType: JsonField? = null private var ratio: JsonField? = null private var security: JsonField? = null private var side: JsonField? = null @@ -1049,7 +1023,6 @@ private constructor( @JvmSynthetic internal fun from(leg: Leg) = apply { - instrumentType = leg.instrumentType ratio = leg.ratio security = leg.security side = leg.side @@ -1058,21 +1031,6 @@ private constructor( additionalProperties = leg.additionalProperties.toMutableMap() } - /** Security type for the leg. */ - fun instrumentType(instrumentType: SecurityType) = - instrumentType(JsonField.of(instrumentType)) - - /** - * Sets [Builder.instrumentType] to an arbitrary JSON value. - * - * You should usually call [Builder.instrumentType] with a well-typed - * [SecurityType] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun instrumentType(instrumentType: JsonField) = apply { - this.instrumentType = instrumentType - } - /** Ratio for the leg. */ fun ratio(ratio: String) = ratio(JsonField.of(ratio)) @@ -1175,7 +1133,6 @@ private constructor( * * The following fields are required: * ```java - * .instrumentType() * .ratio() * .security() * .side() @@ -1185,7 +1142,6 @@ private constructor( */ fun build(): Leg = Leg( - checkRequired("instrumentType", instrumentType), checkRequired("ratio", ratio), checkRequired("security", security), checkRequired("side", side), @@ -1212,7 +1168,6 @@ private constructor( return@apply } - instrumentType().validate() ratio() security() side().validate() @@ -1237,8 +1192,7 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (instrumentType.asKnown().getOrNull()?.validity() ?: 0) + - (if (ratio.asKnown().isPresent) 1 else 0) + + (if (ratio.asKnown().isPresent) 1 else 0) + (if (security.asKnown().isPresent) 1 else 0) + (side.asKnown().getOrNull()?.validity() ?: 0) + (if (id.asKnown().isPresent) 1 else 0) + @@ -1250,7 +1204,6 @@ private constructor( } return other is Leg && - instrumentType == other.instrumentType && ratio == other.ratio && security == other.security && side == other.side && @@ -1260,21 +1213,13 @@ private constructor( } private val hashCode: Int by lazy { - Objects.hash( - instrumentType, - ratio, - security, - side, - id, - positionEffect, - additionalProperties, - ) + Objects.hash(ratio, security, side, id, positionEffect, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Leg{instrumentType=$instrumentType, ratio=$ratio, security=$security, side=$side, id=$id, positionEffect=$positionEffect, additionalProperties=$additionalProperties}" + "Leg{ratio=$ratio, security=$security, side=$side, id=$id, positionEffect=$positionEffect, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt index 77469978..0f691ab9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt @@ -3,7 +3,6 @@ package com.clear_street.api.models.v1.omniai import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.orders.NewOrderRequest import com.clear_street.api.models.v1.orders.PositionEffect import com.clear_street.api.models.v1.orders.RequestOrderType @@ -27,7 +26,6 @@ internal class ContentPartStructuredActionPayloadTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) @@ -63,7 +61,6 @@ internal class ContentPartStructuredActionPayloadTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) @@ -104,7 +101,6 @@ internal class ContentPartStructuredActionPayloadTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt index 740a5f2e..33c08208 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt @@ -3,7 +3,6 @@ package com.clear_street.api.models.v1.omniai import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.orders.NewOrderRequest import com.clear_street.api.models.v1.orders.PositionEffect import com.clear_street.api.models.v1.orders.RequestOrderType @@ -23,7 +22,6 @@ internal class PrefillNewOrderActionTest { PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) @@ -46,7 +44,6 @@ internal class PrefillNewOrderActionTest { assertThat(prefillNewOrderAction.orders()) .containsExactly( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) @@ -73,7 +70,6 @@ internal class PrefillNewOrderActionTest { PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt index 22b3fd8b..448b3379 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt @@ -5,7 +5,6 @@ package com.clear_street.api.models.v1.omniai import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.orders.CancelOrderRequest import com.clear_street.api.models.v1.orders.NewOrderRequest import com.clear_street.api.models.v1.orders.PositionEffect @@ -29,7 +28,6 @@ internal class PrefillOrderActionTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) @@ -64,7 +62,6 @@ internal class PrefillOrderActionTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt index 5252a067..3f91bddc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt @@ -5,7 +5,6 @@ package com.clear_street.api.models.v1.omniai import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.omniai.entitlements.EntitlementAgreementKey import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode import com.clear_street.api.models.v1.orders.NewOrderRequest @@ -32,7 +31,6 @@ internal class StructuredActionTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) @@ -73,7 +71,6 @@ internal class StructuredActionTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt index be3a2403..2de53a1e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt @@ -5,7 +5,6 @@ package com.clear_street.api.models.v1.omniai.responses import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.omniai.ActionButton import com.clear_street.api.models.v1.omniai.ChartPayload import com.clear_street.api.models.v1.omniai.ChartPoint @@ -119,7 +118,6 @@ internal class ResponseContentPartTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) @@ -170,7 +168,6 @@ internal class ResponseContentPartTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt index 2849a3ba..9c640608 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt @@ -5,7 +5,6 @@ package com.clear_street.api.models.v1.omniai.threads import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.omniai.ActionButton import com.clear_street.api.models.v1.omniai.ChartPayload import com.clear_street.api.models.v1.omniai.ChartPoint @@ -80,7 +79,6 @@ internal class MessageContentPartTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) @@ -130,7 +128,6 @@ internal class MessageContentPartTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt index bf67375c..4e98f28c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt @@ -3,7 +3,6 @@ package com.clear_street.api.models.v1.orders import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -15,7 +14,6 @@ internal class NewOrderRequestTest { fun create() { val newOrderRequest = NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("25") .side(Side.BUY) @@ -33,7 +31,6 @@ internal class NewOrderRequestTest { .trailingOffsetType(TrailingOffsetType.PRICE) .build() - assertThat(newOrderRequest.instrumentType()).isEqualTo(SecurityType.COMMON_STOCK) assertThat(newOrderRequest.orderType()).isEqualTo(RequestOrderType.LIMIT) assertThat(newOrderRequest.quantity()).isEqualTo("25") assertThat(newOrderRequest.side()).isEqualTo(Side.BUY) @@ -57,7 +54,6 @@ internal class NewOrderRequestTest { val jsonMapper = jsonMapper() val newOrderRequest = NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("25") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt index b5db541e..972268e4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt @@ -2,7 +2,6 @@ package com.clear_street.api.models.v1.orders -import com.clear_street.api.models.v1.SecurityType import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -17,7 +16,6 @@ internal class OrderSubmitOrdersParamsTest { .legs( listOf( OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-447a-706f-996f-097254663f02") .side(Side.BUY) @@ -25,7 +23,6 @@ internal class OrderSubmitOrdersParamsTest { .positionEffect(PositionEffect.OPEN) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") .side(Side.SELL) @@ -33,7 +30,6 @@ internal class OrderSubmitOrdersParamsTest { .positionEffect(PositionEffect.OPEN) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") .side(Side.BUY) @@ -62,19 +58,16 @@ internal class OrderSubmitOrdersParamsTest { .legs( listOf( OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-447a-706f-996f-097254663f02") .side(Side.BUY) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") .side(Side.SELL) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") .side(Side.BUY) @@ -102,7 +95,6 @@ internal class OrderSubmitOrdersParamsTest { .legs( listOf( OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-447a-706f-996f-097254663f02") .side(Side.BUY) @@ -110,7 +102,6 @@ internal class OrderSubmitOrdersParamsTest { .positionEffect(PositionEffect.OPEN) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") .side(Side.SELL) @@ -118,7 +109,6 @@ internal class OrderSubmitOrdersParamsTest { .positionEffect(PositionEffect.OPEN) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") .side(Side.BUY) @@ -145,7 +135,6 @@ internal class OrderSubmitOrdersParamsTest { .legs( listOf( OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-447a-706f-996f-097254663f02") .side(Side.BUY) @@ -153,7 +142,6 @@ internal class OrderSubmitOrdersParamsTest { .positionEffect(PositionEffect.OPEN) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") .side(Side.SELL) @@ -161,7 +149,6 @@ internal class OrderSubmitOrdersParamsTest { .positionEffect(PositionEffect.OPEN) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") .side(Side.BUY) @@ -190,19 +177,16 @@ internal class OrderSubmitOrdersParamsTest { .legs( listOf( OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-447a-706f-996f-097254663f02") .side(Side.BUY) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") .side(Side.SELL) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") .side(Side.BUY) @@ -224,19 +208,16 @@ internal class OrderSubmitOrdersParamsTest { .legs( listOf( OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-447a-706f-996f-097254663f02") .side(Side.BUY) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") .side(Side.SELL) .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt index 050359d7..b9241d59 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt @@ -3,7 +3,6 @@ package com.clear_street.api.services.async.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams @@ -135,7 +134,6 @@ internal class OrderServiceAsyncTest { listOf( OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg .builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-447a-706f-996f-097254663f02") .side(Side.BUY) @@ -144,7 +142,6 @@ internal class OrderServiceAsyncTest { .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg .builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") .side(Side.SELL) @@ -153,7 +150,6 @@ internal class OrderServiceAsyncTest { .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg .builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") .side(Side.BUY) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt index 35b3a9bb..19806583 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt @@ -3,7 +3,6 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams @@ -130,7 +129,6 @@ internal class OrderServiceTest { listOf( OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg .builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-447a-706f-996f-097254663f02") .side(Side.BUY) @@ -139,7 +137,6 @@ internal class OrderServiceTest { .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg .builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") .side(Side.SELL) @@ -148,7 +145,6 @@ internal class OrderServiceTest { .build(), OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg .builder() - .instrumentType(SecurityType.OPTION) .ratio("ratio") .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") .side(Side.BUY) diff --git a/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt b/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt index 31a81723..617ae1d6 100644 --- a/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt +++ b/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt @@ -4,7 +4,6 @@ package com.clear_street.api.proguard import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType import com.clear_street.api.models.v1.accounts.Account import com.clear_street.api.models.v1.accounts.AccountStatus import com.clear_street.api.models.v1.accounts.AccountSubtype @@ -96,7 +95,6 @@ internal class ProGuardCompatibilityTest { PrefillOrderAction.PrefillNewOrderAction.builder() .addOrder( NewOrderRequest.builder() - .instrumentType(SecurityType.COMMON_STOCK) .orderType(RequestOrderType.LIMIT) .quantity("100") .side(Side.BUY) From 9e7caf6f7b42f52681c27bd6075b310e200918b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 May 2026 23:22:32 +0000 Subject: [PATCH 14/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/instruments/Instrument.kt | 47 ++++++++++++++++++- .../models/v1/instruments/InstrumentCore.kt | 47 ++++++++++++++++++- .../v1/instruments/InstrumentCoreTest.kt | 3 ++ ...InstrumentGetInstrumentByIdResponseTest.kt | 3 ++ .../InstrumentGetInstrumentsResponseTest.kt | 3 ++ ...InstrumentSearchInstrumentsResponseTest.kt | 3 ++ .../models/v1/instruments/InstrumentTest.kt | 3 ++ .../v1/watchlist/WatchlistDetailTest.kt | 3 ++ .../WatchlistGetWatchlistByIdResponseTest.kt | 3 ++ .../v1/watchlist/WatchlistItemEntryTest.kt | 3 ++ 11 files changed, 118 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 92877639..ec8f7e73 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-15d5c1560b55430ee7932b73dca379cd213158b660a170e4145d8c5d9ade7a82.yml -openapi_spec_hash: 0a173bc66a48c7612d02d64dbac7ae70 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-b0d2b462c485086f5fb3f3b1b537624ca6663e7e70b7ee7c2d48b53d91e44ca9.yml +openapi_spec_hash: ab337f3e4bbcc58da3b3c29e275bd63f config_hash: 7033b484e7e1bbf72c997ac476b693f8 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt index 71481021..93a6adf2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt @@ -29,6 +29,7 @@ private constructor( private val countryOfIssue: JsonField, private val currency: JsonField, private val easyToBorrow: JsonField, + private val isFractionable: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, private val isRestricted: JsonField, @@ -60,6 +61,9 @@ private constructor( @JsonProperty("easy_to_borrow") @ExcludeMissing easyToBorrow: JsonField = JsonMissing.of(), + @JsonProperty("is_fractionable") + @ExcludeMissing + isFractionable: JsonField = JsonMissing.of(), @JsonProperty("is_liquidation_only") @ExcludeMissing isLiquidationOnly: JsonField = JsonMissing.of(), @@ -109,6 +113,7 @@ private constructor( countryOfIssue, currency, easyToBorrow, + isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -162,6 +167,14 @@ private constructor( */ fun easyToBorrow(): Boolean = easyToBorrow.getRequired("easy_to_borrow") + /** + * Indicates if the instrument supports fractional-quantity orders + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun isFractionable(): Boolean = isFractionable.getRequired("is_fractionable") + /** * Indicates if the instrument is liquidation only and cannot be bought * @@ -342,6 +355,15 @@ private constructor( @ExcludeMissing fun _easyToBorrow(): JsonField = easyToBorrow + /** + * Returns the raw JSON value of [isFractionable]. + * + * Unlike [isFractionable], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("is_fractionable") + @ExcludeMissing + fun _isFractionable(): JsonField = isFractionable + /** * Returns the raw JSON value of [isLiquidationOnly]. * @@ -519,6 +541,7 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() + * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -539,6 +562,7 @@ private constructor( private var countryOfIssue: JsonField? = null private var currency: JsonField? = null private var easyToBorrow: JsonField? = null + private var isFractionable: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null private var isRestricted: JsonField? = null @@ -565,6 +589,7 @@ private constructor( countryOfIssue = instrument.countryOfIssue currency = instrument.currency easyToBorrow = instrument.easyToBorrow + isFractionable = instrument.isFractionable isLiquidationOnly = instrument.isLiquidationOnly isMarginable = instrument.isMarginable isRestricted = instrument.isRestricted @@ -636,6 +661,20 @@ private constructor( this.easyToBorrow = easyToBorrow } + /** Indicates if the instrument supports fractional-quantity orders */ + fun isFractionable(isFractionable: Boolean) = isFractionable(JsonField.of(isFractionable)) + + /** + * Sets [Builder.isFractionable] to an arbitrary JSON value. + * + * You should usually call [Builder.isFractionable] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun isFractionable(isFractionable: JsonField) = apply { + this.isFractionable = isFractionable + } + /** Indicates if the instrument is liquidation only and cannot be bought */ fun isLiquidationOnly(isLiquidationOnly: Boolean) = isLiquidationOnly(JsonField.of(isLiquidationOnly)) @@ -962,6 +1001,7 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() + * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -980,6 +1020,7 @@ private constructor( checkRequired("countryOfIssue", countryOfIssue), checkRequired("currency", currency), checkRequired("easyToBorrow", easyToBorrow), + checkRequired("isFractionable", isFractionable), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), checkRequired("isRestricted", isRestricted), @@ -1021,6 +1062,7 @@ private constructor( countryOfIssue() currency() easyToBorrow() + isFractionable() isLiquidationOnly() isMarginable() isRestricted() @@ -1061,6 +1103,7 @@ private constructor( (if (countryOfIssue.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (easyToBorrow.asKnown().isPresent) 1 else 0) + + (if (isFractionable.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + (if (isRestricted.asKnown().isPresent) 1 else 0) + @@ -1090,6 +1133,7 @@ private constructor( countryOfIssue == other.countryOfIssue && currency == other.currency && easyToBorrow == other.easyToBorrow && + isFractionable == other.isFractionable && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isRestricted == other.isRestricted && @@ -1117,6 +1161,7 @@ private constructor( countryOfIssue, currency, easyToBorrow, + isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -1142,5 +1187,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt index fd5134ce..eff6fc94 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt @@ -26,6 +26,7 @@ private constructor( private val countryOfIssue: JsonField, private val currency: JsonField, private val easyToBorrow: JsonField, + private val isFractionable: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, private val isRestricted: JsonField, @@ -56,6 +57,9 @@ private constructor( @JsonProperty("easy_to_borrow") @ExcludeMissing easyToBorrow: JsonField = JsonMissing.of(), + @JsonProperty("is_fractionable") + @ExcludeMissing + isFractionable: JsonField = JsonMissing.of(), @JsonProperty("is_liquidation_only") @ExcludeMissing isLiquidationOnly: JsonField = JsonMissing.of(), @@ -102,6 +106,7 @@ private constructor( countryOfIssue, currency, easyToBorrow, + isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -154,6 +159,14 @@ private constructor( */ fun easyToBorrow(): Boolean = easyToBorrow.getRequired("easy_to_borrow") + /** + * Indicates if the instrument supports fractional-quantity orders + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun isFractionable(): Boolean = isFractionable.getRequired("is_fractionable") + /** * Indicates if the instrument is liquidation only and cannot be bought * @@ -324,6 +337,15 @@ private constructor( @ExcludeMissing fun _easyToBorrow(): JsonField = easyToBorrow + /** + * Returns the raw JSON value of [isFractionable]. + * + * Unlike [isFractionable], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("is_fractionable") + @ExcludeMissing + fun _isFractionable(): JsonField = isFractionable + /** * Returns the raw JSON value of [isLiquidationOnly]. * @@ -491,6 +513,7 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() + * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -511,6 +534,7 @@ private constructor( private var countryOfIssue: JsonField? = null private var currency: JsonField? = null private var easyToBorrow: JsonField? = null + private var isFractionable: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null private var isRestricted: JsonField? = null @@ -536,6 +560,7 @@ private constructor( countryOfIssue = instrumentCore.countryOfIssue currency = instrumentCore.currency easyToBorrow = instrumentCore.easyToBorrow + isFractionable = instrumentCore.isFractionable isLiquidationOnly = instrumentCore.isLiquidationOnly isMarginable = instrumentCore.isMarginable isRestricted = instrumentCore.isRestricted @@ -606,6 +631,20 @@ private constructor( this.easyToBorrow = easyToBorrow } + /** Indicates if the instrument supports fractional-quantity orders */ + fun isFractionable(isFractionable: Boolean) = isFractionable(JsonField.of(isFractionable)) + + /** + * Sets [Builder.isFractionable] to an arbitrary JSON value. + * + * You should usually call [Builder.isFractionable] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun isFractionable(isFractionable: JsonField) = apply { + this.isFractionable = isFractionable + } + /** Indicates if the instrument is liquidation only and cannot be bought */ fun isLiquidationOnly(isLiquidationOnly: Boolean) = isLiquidationOnly(JsonField.of(isLiquidationOnly)) @@ -896,6 +935,7 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() + * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -914,6 +954,7 @@ private constructor( checkRequired("countryOfIssue", countryOfIssue), checkRequired("currency", currency), checkRequired("easyToBorrow", easyToBorrow), + checkRequired("isFractionable", isFractionable), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), checkRequired("isRestricted", isRestricted), @@ -954,6 +995,7 @@ private constructor( countryOfIssue() currency() easyToBorrow() + isFractionable() isLiquidationOnly() isMarginable() isRestricted() @@ -993,6 +1035,7 @@ private constructor( (if (countryOfIssue.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (easyToBorrow.asKnown().isPresent) 1 else 0) + + (if (isFractionable.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + (if (isRestricted.asKnown().isPresent) 1 else 0) + @@ -1021,6 +1064,7 @@ private constructor( countryOfIssue == other.countryOfIssue && currency == other.currency && easyToBorrow == other.easyToBorrow && + isFractionable == other.isFractionable && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isRestricted == other.isRestricted && @@ -1047,6 +1091,7 @@ private constructor( countryOfIssue, currency, easyToBorrow, + isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -1071,5 +1116,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt index aef50739..5376c195 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt @@ -19,6 +19,7 @@ internal class InstrumentCoreTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -42,6 +43,7 @@ internal class InstrumentCoreTest { assertThat(instrumentCore.countryOfIssue()).isEqualTo("US") assertThat(instrumentCore.currency()).isEqualTo("USD") assertThat(instrumentCore.easyToBorrow()).isEqualTo(true) + assertThat(instrumentCore.isFractionable()).isEqualTo(false) assertThat(instrumentCore.isLiquidationOnly()).isEqualTo(false) assertThat(instrumentCore.isMarginable()).isEqualTo(true) assertThat(instrumentCore.isRestricted()).isEqualTo(false) @@ -70,6 +72,7 @@ internal class InstrumentCoreTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index 55176862..ffaac209 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -45,6 +45,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -97,6 +98,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -151,6 +153,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index 465222dc..4ba23190 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -45,6 +45,7 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -96,6 +97,7 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -149,6 +151,7 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index d6280bc4..2bed08ce 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -45,6 +45,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -96,6 +97,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -149,6 +151,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt index 6e6688d0..6d504fde 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt @@ -20,6 +20,7 @@ internal class InstrumentTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -44,6 +45,7 @@ internal class InstrumentTest { assertThat(instrument.countryOfIssue()).isEqualTo("US") assertThat(instrument.currency()).isEqualTo("USD") assertThat(instrument.easyToBorrow()).isEqualTo(true) + assertThat(instrument.isFractionable()).isEqualTo(false) assertThat(instrument.isLiquidationOnly()).isEqualTo(false) assertThat(instrument.isMarginable()).isEqualTo(true) assertThat(instrument.isRestricted()).isEqualTo(false) @@ -74,6 +76,7 @@ internal class InstrumentTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt index ad623278..f364f353 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -30,6 +30,7 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -70,6 +71,7 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -113,6 +115,7 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index 4bc6f623..1998b558 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -56,6 +56,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -122,6 +123,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -190,6 +192,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt index 82da69e5..66c7f641 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -26,6 +26,7 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -59,6 +60,7 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -95,6 +97,7 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) From 5446c8aad3ba14922f13eca080d9fdb38758cb8e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 18:38:47 +0000 Subject: [PATCH 15/51] feat(api): manual updates --- .stats.yml | 6 +- .../api/models/ResponseMetadata.kt | 8 +- .../api/models/v1/instruments/Instrument.kt | 47 +--- .../models/v1/instruments/InstrumentCore.kt | 47 +--- .../api/models/v1/omniai/ChartPayload.kt | 52 +--- .../v1/omniai/OpenEntitlementConsentAction.kt | 204 +++++++------- .../api/models/v1/omniai/SymbolChart.kt | 217 -------------- .../EntitlementCreateEntitlementsParams.kt | 266 ++++++++---------- .../omniai/threads/ThreadGetMessagesParams.kt | 6 +- .../services/async/v1/OmniAiServiceAsync.kt | 16 +- .../async/v1/OmniAiServiceAsyncImpl.kt | 16 +- .../v1/omniai/EntitlementServiceAsync.kt | 2 +- .../v1/omniai/EntitlementServiceAsyncImpl.kt | 2 +- .../async/v1/omniai/MessageServiceAsync.kt | 2 +- .../v1/omniai/MessageServiceAsyncImpl.kt | 2 +- .../async/v1/omniai/ResponseServiceAsync.kt | 2 +- .../v1/omniai/ResponseServiceAsyncImpl.kt | 2 +- .../async/v1/omniai/ThreadServiceAsync.kt | 9 +- .../async/v1/omniai/ThreadServiceAsyncImpl.kt | 2 +- .../api/services/blocking/v1/OmniAiService.kt | 16 +- .../services/blocking/v1/OmniAiServiceImpl.kt | 16 +- .../blocking/v1/omniai/EntitlementService.kt | 2 +- .../v1/omniai/EntitlementServiceImpl.kt | 2 +- .../blocking/v1/omniai/MessageService.kt | 2 +- .../blocking/v1/omniai/MessageServiceImpl.kt | 2 +- .../blocking/v1/omniai/ResponseService.kt | 2 +- .../blocking/v1/omniai/ResponseServiceImpl.kt | 2 +- .../blocking/v1/omniai/ThreadService.kt | 9 +- .../blocking/v1/omniai/ThreadServiceImpl.kt | 2 +- .../v1/instruments/InstrumentCoreTest.kt | 3 - ...InstrumentGetInstrumentByIdResponseTest.kt | 3 - .../InstrumentGetInstrumentsResponseTest.kt | 3 - ...InstrumentSearchInstrumentsResponseTest.kt | 3 - .../models/v1/instruments/InstrumentTest.kt | 3 - .../api/models/v1/omniai/ChartPayloadTest.kt | 25 +- .../v1/omniai/ContentPartChartPayloadTest.kt | 24 +- .../OpenEntitlementConsentActionTest.kt | 14 +- .../models/v1/omniai/StructuredActionTest.kt | 8 +- .../api/models/v1/omniai/SymbolChartTest.kt | 33 --- ...EntitlementCreateEntitlementsParamsTest.kt | 17 +- .../responses/ResponseContentPartTest.kt | 19 +- .../omniai/threads/MessageContentPartTest.kt | 19 +- .../v1/watchlist/WatchlistDetailTest.kt | 3 - .../WatchlistGetWatchlistByIdResponseTest.kt | 3 - .../v1/watchlist/WatchlistItemEntryTest.kt | 3 - .../v1/omniai/EntitlementServiceAsyncTest.kt | 6 +- .../v1/omniai/EntitlementServiceTest.kt | 6 +- 47 files changed, 353 insertions(+), 805 deletions(-) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/SymbolChart.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/SymbolChartTest.kt diff --git a/.stats.yml b/.stats.yml index ec8f7e73..66ce67a6 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-b0d2b462c485086f5fb3f3b1b537624ca6663e7e70b7ee7c2d48b53d91e44ca9.yml -openapi_spec_hash: ab337f3e4bbcc58da3b3c29e275bd63f -config_hash: 7033b484e7e1bbf72c997ac476b693f8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-700c0cd9fc93964b53ef1290d7c09c2b6d432070585478358a8b3f70307037d7.yml +openapi_spec_hash: 553b1f838a26f0a95ab83caacde5c8f7 +config_hash: 607831128be744fd1bd144b81cc41b63 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ResponseMetadata.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ResponseMetadata.kt index 703e15c2..42b47cfe 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ResponseMetadata.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ResponseMetadata.kt @@ -64,7 +64,7 @@ private constructor( fun requestId(): String = requestId.getRequired("request_id") /** - * Base64URL-encoded pagination token containing limit and offset + * Base64URL-encoded pagination token * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -80,7 +80,7 @@ private constructor( fun pageNumber(): Optional = pageNumber.getOptional("page_number") /** - * Base64URL-encoded pagination token containing limit and offset + * Base64URL-encoded pagination token * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -209,7 +209,7 @@ private constructor( */ fun requestId(requestId: JsonField) = apply { this.requestId = requestId } - /** Base64URL-encoded pagination token containing limit and offset */ + /** Base64URL-encoded pagination token */ fun nextPageToken(nextPageToken: String?) = nextPageToken(JsonField.ofNullable(nextPageToken)) @@ -249,7 +249,7 @@ private constructor( */ fun pageNumber(pageNumber: JsonField) = apply { this.pageNumber = pageNumber } - /** Base64URL-encoded pagination token containing limit and offset */ + /** Base64URL-encoded pagination token */ fun previousPageToken(previousPageToken: String?) = previousPageToken(JsonField.ofNullable(previousPageToken)) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt index 93a6adf2..71481021 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt @@ -29,7 +29,6 @@ private constructor( private val countryOfIssue: JsonField, private val currency: JsonField, private val easyToBorrow: JsonField, - private val isFractionable: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, private val isRestricted: JsonField, @@ -61,9 +60,6 @@ private constructor( @JsonProperty("easy_to_borrow") @ExcludeMissing easyToBorrow: JsonField = JsonMissing.of(), - @JsonProperty("is_fractionable") - @ExcludeMissing - isFractionable: JsonField = JsonMissing.of(), @JsonProperty("is_liquidation_only") @ExcludeMissing isLiquidationOnly: JsonField = JsonMissing.of(), @@ -113,7 +109,6 @@ private constructor( countryOfIssue, currency, easyToBorrow, - isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -167,14 +162,6 @@ private constructor( */ fun easyToBorrow(): Boolean = easyToBorrow.getRequired("easy_to_borrow") - /** - * Indicates if the instrument supports fractional-quantity orders - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun isFractionable(): Boolean = isFractionable.getRequired("is_fractionable") - /** * Indicates if the instrument is liquidation only and cannot be bought * @@ -355,15 +342,6 @@ private constructor( @ExcludeMissing fun _easyToBorrow(): JsonField = easyToBorrow - /** - * Returns the raw JSON value of [isFractionable]. - * - * Unlike [isFractionable], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("is_fractionable") - @ExcludeMissing - fun _isFractionable(): JsonField = isFractionable - /** * Returns the raw JSON value of [isLiquidationOnly]. * @@ -541,7 +519,6 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() - * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -562,7 +539,6 @@ private constructor( private var countryOfIssue: JsonField? = null private var currency: JsonField? = null private var easyToBorrow: JsonField? = null - private var isFractionable: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null private var isRestricted: JsonField? = null @@ -589,7 +565,6 @@ private constructor( countryOfIssue = instrument.countryOfIssue currency = instrument.currency easyToBorrow = instrument.easyToBorrow - isFractionable = instrument.isFractionable isLiquidationOnly = instrument.isLiquidationOnly isMarginable = instrument.isMarginable isRestricted = instrument.isRestricted @@ -661,20 +636,6 @@ private constructor( this.easyToBorrow = easyToBorrow } - /** Indicates if the instrument supports fractional-quantity orders */ - fun isFractionable(isFractionable: Boolean) = isFractionable(JsonField.of(isFractionable)) - - /** - * Sets [Builder.isFractionable] to an arbitrary JSON value. - * - * You should usually call [Builder.isFractionable] with a well-typed [Boolean] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun isFractionable(isFractionable: JsonField) = apply { - this.isFractionable = isFractionable - } - /** Indicates if the instrument is liquidation only and cannot be bought */ fun isLiquidationOnly(isLiquidationOnly: Boolean) = isLiquidationOnly(JsonField.of(isLiquidationOnly)) @@ -1001,7 +962,6 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() - * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -1020,7 +980,6 @@ private constructor( checkRequired("countryOfIssue", countryOfIssue), checkRequired("currency", currency), checkRequired("easyToBorrow", easyToBorrow), - checkRequired("isFractionable", isFractionable), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), checkRequired("isRestricted", isRestricted), @@ -1062,7 +1021,6 @@ private constructor( countryOfIssue() currency() easyToBorrow() - isFractionable() isLiquidationOnly() isMarginable() isRestricted() @@ -1103,7 +1061,6 @@ private constructor( (if (countryOfIssue.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (easyToBorrow.asKnown().isPresent) 1 else 0) + - (if (isFractionable.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + (if (isRestricted.asKnown().isPresent) 1 else 0) + @@ -1133,7 +1090,6 @@ private constructor( countryOfIssue == other.countryOfIssue && currency == other.currency && easyToBorrow == other.easyToBorrow && - isFractionable == other.isFractionable && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isRestricted == other.isRestricted && @@ -1161,7 +1117,6 @@ private constructor( countryOfIssue, currency, easyToBorrow, - isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -1187,5 +1142,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt index eff6fc94..fd5134ce 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt @@ -26,7 +26,6 @@ private constructor( private val countryOfIssue: JsonField, private val currency: JsonField, private val easyToBorrow: JsonField, - private val isFractionable: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, private val isRestricted: JsonField, @@ -57,9 +56,6 @@ private constructor( @JsonProperty("easy_to_borrow") @ExcludeMissing easyToBorrow: JsonField = JsonMissing.of(), - @JsonProperty("is_fractionable") - @ExcludeMissing - isFractionable: JsonField = JsonMissing.of(), @JsonProperty("is_liquidation_only") @ExcludeMissing isLiquidationOnly: JsonField = JsonMissing.of(), @@ -106,7 +102,6 @@ private constructor( countryOfIssue, currency, easyToBorrow, - isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -159,14 +154,6 @@ private constructor( */ fun easyToBorrow(): Boolean = easyToBorrow.getRequired("easy_to_borrow") - /** - * Indicates if the instrument supports fractional-quantity orders - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun isFractionable(): Boolean = isFractionable.getRequired("is_fractionable") - /** * Indicates if the instrument is liquidation only and cannot be bought * @@ -337,15 +324,6 @@ private constructor( @ExcludeMissing fun _easyToBorrow(): JsonField = easyToBorrow - /** - * Returns the raw JSON value of [isFractionable]. - * - * Unlike [isFractionable], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("is_fractionable") - @ExcludeMissing - fun _isFractionable(): JsonField = isFractionable - /** * Returns the raw JSON value of [isLiquidationOnly]. * @@ -513,7 +491,6 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() - * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -534,7 +511,6 @@ private constructor( private var countryOfIssue: JsonField? = null private var currency: JsonField? = null private var easyToBorrow: JsonField? = null - private var isFractionable: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null private var isRestricted: JsonField? = null @@ -560,7 +536,6 @@ private constructor( countryOfIssue = instrumentCore.countryOfIssue currency = instrumentCore.currency easyToBorrow = instrumentCore.easyToBorrow - isFractionable = instrumentCore.isFractionable isLiquidationOnly = instrumentCore.isLiquidationOnly isMarginable = instrumentCore.isMarginable isRestricted = instrumentCore.isRestricted @@ -631,20 +606,6 @@ private constructor( this.easyToBorrow = easyToBorrow } - /** Indicates if the instrument supports fractional-quantity orders */ - fun isFractionable(isFractionable: Boolean) = isFractionable(JsonField.of(isFractionable)) - - /** - * Sets [Builder.isFractionable] to an arbitrary JSON value. - * - * You should usually call [Builder.isFractionable] with a well-typed [Boolean] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun isFractionable(isFractionable: JsonField) = apply { - this.isFractionable = isFractionable - } - /** Indicates if the instrument is liquidation only and cannot be bought */ fun isLiquidationOnly(isLiquidationOnly: Boolean) = isLiquidationOnly(JsonField.of(isLiquidationOnly)) @@ -935,7 +896,6 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() - * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -954,7 +914,6 @@ private constructor( checkRequired("countryOfIssue", countryOfIssue), checkRequired("currency", currency), checkRequired("easyToBorrow", easyToBorrow), - checkRequired("isFractionable", isFractionable), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), checkRequired("isRestricted", isRestricted), @@ -995,7 +954,6 @@ private constructor( countryOfIssue() currency() easyToBorrow() - isFractionable() isLiquidationOnly() isMarginable() isRestricted() @@ -1035,7 +993,6 @@ private constructor( (if (countryOfIssue.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (easyToBorrow.asKnown().isPresent) 1 else 0) + - (if (isFractionable.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + (if (isRestricted.asKnown().isPresent) 1 else 0) + @@ -1064,7 +1021,6 @@ private constructor( countryOfIssue == other.countryOfIssue && currency == other.currency && easyToBorrow == other.easyToBorrow && - isFractionable == other.isFractionable && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isRestricted == other.isRestricted && @@ -1091,7 +1047,6 @@ private constructor( countryOfIssue, currency, easyToBorrow, - isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -1116,5 +1071,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPayload.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPayload.kt index e4220c0f..508b1e58 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPayload.kt @@ -26,7 +26,6 @@ private constructor( private val chartId: JsonField, private val actionButtons: JsonField>, private val dataChart: JsonField, - private val symbolChart: JsonField, private val additionalProperties: MutableMap, ) { @@ -39,10 +38,7 @@ private constructor( @JsonProperty("dataChart") @ExcludeMissing dataChart: JsonField = JsonMissing.of(), - @JsonProperty("symbolChart") - @ExcludeMissing - symbolChart: JsonField = JsonMissing.of(), - ) : this(chartId, actionButtons, dataChart, symbolChart, mutableMapOf()) + ) : this(chartId, actionButtons, dataChart, mutableMapOf()) /** * Stable chart identifier scoped to the content part. @@ -68,14 +64,6 @@ private constructor( */ fun dataChart(): Optional = dataChart.getOptional("dataChart") - /** - * Symbol-driven chart definition. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun symbolChart(): Optional = symbolChart.getOptional("symbolChart") - /** * Returns the raw JSON value of [chartId]. * @@ -99,15 +87,6 @@ private constructor( */ @JsonProperty("dataChart") @ExcludeMissing fun _dataChart(): JsonField = dataChart - /** - * Returns the raw JSON value of [symbolChart]. - * - * Unlike [symbolChart], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("symbolChart") - @ExcludeMissing - fun _symbolChart(): JsonField = symbolChart - @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -139,7 +118,6 @@ private constructor( private var chartId: JsonField? = null private var actionButtons: JsonField>? = null private var dataChart: JsonField = JsonMissing.of() - private var symbolChart: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -147,7 +125,6 @@ private constructor( chartId = chartPayload.chartId actionButtons = chartPayload.actionButtons.map { it.toMutableList() } dataChart = chartPayload.dataChart - symbolChart = chartPayload.symbolChart additionalProperties = chartPayload.additionalProperties.toMutableMap() } @@ -204,23 +181,6 @@ private constructor( */ fun dataChart(dataChart: JsonField) = apply { this.dataChart = dataChart } - /** Symbol-driven chart definition. */ - fun symbolChart(symbolChart: SymbolChart?) = symbolChart(JsonField.ofNullable(symbolChart)) - - /** Alias for calling [Builder.symbolChart] with `symbolChart.orElse(null)`. */ - fun symbolChart(symbolChart: Optional) = symbolChart(symbolChart.getOrNull()) - - /** - * Sets [Builder.symbolChart] to an arbitrary JSON value. - * - * You should usually call [Builder.symbolChart] with a well-typed [SymbolChart] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun symbolChart(symbolChart: JsonField) = apply { - this.symbolChart = symbolChart - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -257,7 +217,6 @@ private constructor( checkRequired("chartId", chartId), (actionButtons ?: JsonMissing.of()).map { it.toImmutable() }, dataChart, - symbolChart, additionalProperties.toMutableMap(), ) } @@ -280,7 +239,6 @@ private constructor( chartId() actionButtons().ifPresent { it.forEach { it.validate() } } dataChart().ifPresent { it.validate() } - symbolChart().ifPresent { it.validate() } validated = true } @@ -301,8 +259,7 @@ private constructor( internal fun validity(): Int = (if (chartId.asKnown().isPresent) 1 else 0) + (actionButtons.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (dataChart.asKnown().getOrNull()?.validity() ?: 0) + - (symbolChart.asKnown().getOrNull()?.validity() ?: 0) + (dataChart.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -313,16 +270,15 @@ private constructor( chartId == other.chartId && actionButtons == other.actionButtons && dataChart == other.dataChart && - symbolChart == other.symbolChart && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(chartId, actionButtons, dataChart, symbolChart, additionalProperties) + Objects.hash(chartId, actionButtons, dataChart, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "ChartPayload{chartId=$chartId, actionButtons=$actionButtons, dataChart=$dataChart, symbolChart=$symbolChart, additionalProperties=$additionalProperties}" + "ChartPayload{chartId=$chartId, actionButtons=$actionButtons, dataChart=$dataChart, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt index a19ea1ff..9d80553e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt @@ -24,26 +24,32 @@ import kotlin.jvm.optionals.getOrNull class OpenEntitlementConsentAction @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val accountIds: JsonField>, private val agreementKey: JsonField, + private val entitlementCodes: JsonField>, private val reason: JsonField, - private val requestedEntitlementCodes: JsonField>, - private val tradingAccountIds: JsonField>, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( + @JsonProperty("account_ids") + @ExcludeMissing + accountIds: JsonField> = JsonMissing.of(), @JsonProperty("agreement_key") @ExcludeMissing agreementKey: JsonField = JsonMissing.of(), - @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(), - @JsonProperty("requested_entitlement_codes") - @ExcludeMissing - requestedEntitlementCodes: JsonField> = JsonMissing.of(), - @JsonProperty("trading_account_ids") + @JsonProperty("entitlement_codes") @ExcludeMissing - tradingAccountIds: JsonField> = JsonMissing.of(), - ) : this(agreementKey, reason, requestedEntitlementCodes, tradingAccountIds, mutableMapOf()) + entitlementCodes: JsonField> = JsonMissing.of(), + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(), + ) : this(accountIds, agreementKey, entitlementCodes, reason, mutableMapOf()) + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun accountIds(): List = accountIds.getRequired("account_ids") /** * Stable entitlement agreement family key. @@ -57,20 +63,23 @@ private constructor( * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun reason(): String = reason.getRequired("reason") + fun entitlementCodes(): List = + entitlementCodes.getRequired("entitlement_codes") /** * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun requestedEntitlementCodes(): List = - requestedEntitlementCodes.getRequired("requested_entitlement_codes") + fun reason(): String = reason.getRequired("reason") /** - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * Returns the raw JSON value of [accountIds]. + * + * Unlike [accountIds], this method doesn't throw if the JSON field has an unexpected type. */ - fun tradingAccountIds(): List = tradingAccountIds.getRequired("trading_account_ids") + @JsonProperty("account_ids") + @ExcludeMissing + fun _accountIds(): JsonField> = accountIds /** * Returns the raw JSON value of [agreementKey]. @@ -82,31 +91,21 @@ private constructor( fun _agreementKey(): JsonField = agreementKey /** - * Returns the raw JSON value of [reason]. + * Returns the raw JSON value of [entitlementCodes]. * - * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason - - /** - * Returns the raw JSON value of [requestedEntitlementCodes]. - * - * Unlike [requestedEntitlementCodes], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [entitlementCodes], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("requested_entitlement_codes") + @JsonProperty("entitlement_codes") @ExcludeMissing - fun _requestedEntitlementCodes(): JsonField> = requestedEntitlementCodes + fun _entitlementCodes(): JsonField> = entitlementCodes /** - * Returns the raw JSON value of [tradingAccountIds]. + * Returns the raw JSON value of [reason]. * - * Unlike [tradingAccountIds], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("trading_account_ids") - @ExcludeMissing - fun _tradingAccountIds(): JsonField> = tradingAccountIds + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -127,10 +126,10 @@ private constructor( * * The following fields are required: * ```java + * .accountIds() * .agreementKey() + * .entitlementCodes() * .reason() - * .requestedEntitlementCodes() - * .tradingAccountIds() * ``` */ @JvmStatic fun builder() = Builder() @@ -139,23 +138,47 @@ private constructor( /** A builder for [OpenEntitlementConsentAction]. */ class Builder internal constructor() { + private var accountIds: JsonField>? = null private var agreementKey: JsonField? = null + private var entitlementCodes: JsonField>? = null private var reason: JsonField? = null - private var requestedEntitlementCodes: JsonField>? = null - private var tradingAccountIds: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(openEntitlementConsentAction: OpenEntitlementConsentAction) = apply { + accountIds = openEntitlementConsentAction.accountIds.map { it.toMutableList() } agreementKey = openEntitlementConsentAction.agreementKey + entitlementCodes = + openEntitlementConsentAction.entitlementCodes.map { it.toMutableList() } reason = openEntitlementConsentAction.reason - requestedEntitlementCodes = - openEntitlementConsentAction.requestedEntitlementCodes.map { it.toMutableList() } - tradingAccountIds = - openEntitlementConsentAction.tradingAccountIds.map { it.toMutableList() } additionalProperties = openEntitlementConsentAction.additionalProperties.toMutableMap() } + fun accountIds(accountIds: List) = accountIds(JsonField.of(accountIds)) + + /** + * Sets [Builder.accountIds] to an arbitrary JSON value. + * + * You should usually call [Builder.accountIds] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountIds(accountIds: JsonField>) = apply { + this.accountIds = accountIds.map { it.toMutableList() } + } + + /** + * Adds a single [Long] to [accountIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addAccountId(accountId: Long) = apply { + accountIds = + (accountIds ?: JsonField.of(mutableListOf())).also { + checkKnown("accountIds", it).add(accountId) + } + } + /** Stable entitlement agreement family key. */ fun agreementKey(agreementKey: EntitlementAgreementKey) = agreementKey(JsonField.of(agreementKey)) @@ -171,69 +194,41 @@ private constructor( this.agreementKey = agreementKey } - fun reason(reason: String) = reason(JsonField.of(reason)) - - /** - * Sets [Builder.reason] to an arbitrary JSON value. - * - * You should usually call [Builder.reason] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun reason(reason: JsonField) = apply { this.reason = reason } - - fun requestedEntitlementCodes(requestedEntitlementCodes: List) = - requestedEntitlementCodes(JsonField.of(requestedEntitlementCodes)) + fun entitlementCodes(entitlementCodes: List) = + entitlementCodes(JsonField.of(entitlementCodes)) /** - * Sets [Builder.requestedEntitlementCodes] to an arbitrary JSON value. + * Sets [Builder.entitlementCodes] to an arbitrary JSON value. * - * You should usually call [Builder.requestedEntitlementCodes] with a well-typed + * You should usually call [Builder.entitlementCodes] with a well-typed * `List` value instead. This method is primarily for setting the field to * an undocumented or not yet supported value. */ - fun requestedEntitlementCodes(requestedEntitlementCodes: JsonField>) = - apply { - this.requestedEntitlementCodes = - requestedEntitlementCodes.map { it.toMutableList() } - } + fun entitlementCodes(entitlementCodes: JsonField>) = apply { + this.entitlementCodes = entitlementCodes.map { it.toMutableList() } + } /** - * Adds a single [EntitlementCode] to [requestedEntitlementCodes]. + * Adds a single [EntitlementCode] to [entitlementCodes]. * * @throws IllegalStateException if the field was previously set to a non-list. */ - fun addRequestedEntitlementCode(requestedEntitlementCode: EntitlementCode) = apply { - requestedEntitlementCodes = - (requestedEntitlementCodes ?: JsonField.of(mutableListOf())).also { - checkKnown("requestedEntitlementCodes", it).add(requestedEntitlementCode) + fun addEntitlementCode(entitlementCode: EntitlementCode) = apply { + entitlementCodes = + (entitlementCodes ?: JsonField.of(mutableListOf())).also { + checkKnown("entitlementCodes", it).add(entitlementCode) } } - fun tradingAccountIds(tradingAccountIds: List) = - tradingAccountIds(JsonField.of(tradingAccountIds)) - - /** - * Sets [Builder.tradingAccountIds] to an arbitrary JSON value. - * - * You should usually call [Builder.tradingAccountIds] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun tradingAccountIds(tradingAccountIds: JsonField>) = apply { - this.tradingAccountIds = tradingAccountIds.map { it.toMutableList() } - } + fun reason(reason: String) = reason(JsonField.of(reason)) /** - * Adds a single [Long] to [tradingAccountIds]. + * Sets [Builder.reason] to an arbitrary JSON value. * - * @throws IllegalStateException if the field was previously set to a non-list. + * You should usually call [Builder.reason] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun addTradingAccountId(tradingAccountId: Long) = apply { - tradingAccountIds = - (tradingAccountIds ?: JsonField.of(mutableListOf())).also { - checkKnown("tradingAccountIds", it).add(tradingAccountId) - } - } + fun reason(reason: JsonField) = apply { this.reason = reason } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -261,22 +256,20 @@ private constructor( * * The following fields are required: * ```java + * .accountIds() * .agreementKey() + * .entitlementCodes() * .reason() - * .requestedEntitlementCodes() - * .tradingAccountIds() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): OpenEntitlementConsentAction = OpenEntitlementConsentAction( + checkRequired("accountIds", accountIds).map { it.toImmutable() }, checkRequired("agreementKey", agreementKey), + checkRequired("entitlementCodes", entitlementCodes).map { it.toImmutable() }, checkRequired("reason", reason), - checkRequired("requestedEntitlementCodes", requestedEntitlementCodes).map { - it.toImmutable() - }, - checkRequired("tradingAccountIds", tradingAccountIds).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) } @@ -296,10 +289,10 @@ private constructor( return@apply } + accountIds() agreementKey().validate() + entitlementCodes().forEach { it.validate() } reason() - requestedEntitlementCodes().forEach { it.validate() } - tradingAccountIds() validated = true } @@ -318,11 +311,10 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (agreementKey.asKnown().getOrNull()?.validity() ?: 0) + - (if (reason.asKnown().isPresent) 1 else 0) + - (requestedEntitlementCodes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } - ?: 0) + - (tradingAccountIds.asKnown().getOrNull()?.size ?: 0) + (accountIds.asKnown().getOrNull()?.size ?: 0) + + (agreementKey.asKnown().getOrNull()?.validity() ?: 0) + + (entitlementCodes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (reason.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -330,25 +322,19 @@ private constructor( } return other is OpenEntitlementConsentAction && + accountIds == other.accountIds && agreementKey == other.agreementKey && + entitlementCodes == other.entitlementCodes && reason == other.reason && - requestedEntitlementCodes == other.requestedEntitlementCodes && - tradingAccountIds == other.tradingAccountIds && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash( - agreementKey, - reason, - requestedEntitlementCodes, - tradingAccountIds, - additionalProperties, - ) + Objects.hash(accountIds, agreementKey, entitlementCodes, reason, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "OpenEntitlementConsentAction{agreementKey=$agreementKey, reason=$reason, requestedEntitlementCodes=$requestedEntitlementCodes, tradingAccountIds=$tradingAccountIds, additionalProperties=$additionalProperties}" + "OpenEntitlementConsentAction{accountIds=$accountIds, agreementKey=$agreementKey, entitlementCodes=$entitlementCodes, reason=$reason, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/SymbolChart.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/SymbolChart.kt deleted file mode 100644 index c32c8c8c..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/SymbolChart.kt +++ /dev/null @@ -1,217 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -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 com.fasterxml.jackson.annotation.JsonProperty -import java.util.Collections -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** Chart for a single symbol and timeframe. */ -class SymbolChart -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val symbol: JsonField, - private val timeframe: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("symbol") @ExcludeMissing symbol: JsonField = JsonMissing.of(), - @JsonProperty("timeframe") @ExcludeMissing timeframe: JsonField = JsonMissing.of(), - ) : this(symbol, timeframe, mutableMapOf()) - - /** - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun symbol(): String = symbol.getRequired("symbol") - - /** - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun timeframe(): Optional = timeframe.getOptional("timeframe") - - /** - * Returns the raw JSON value of [symbol]. - * - * Unlike [symbol], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("symbol") @ExcludeMissing fun _symbol(): JsonField = symbol - - /** - * Returns the raw JSON value of [timeframe]. - * - * Unlike [timeframe], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("timeframe") @ExcludeMissing fun _timeframe(): JsonField = timeframe - - @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 [SymbolChart]. - * - * The following fields are required: - * ```java - * .symbol() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [SymbolChart]. */ - class Builder internal constructor() { - - private var symbol: JsonField? = null - private var timeframe: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(symbolChart: SymbolChart) = apply { - symbol = symbolChart.symbol - timeframe = symbolChart.timeframe - additionalProperties = symbolChart.additionalProperties.toMutableMap() - } - - fun symbol(symbol: String) = symbol(JsonField.of(symbol)) - - /** - * Sets [Builder.symbol] to an arbitrary JSON value. - * - * You should usually call [Builder.symbol] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun symbol(symbol: JsonField) = apply { this.symbol = symbol } - - fun timeframe(timeframe: String?) = timeframe(JsonField.ofNullable(timeframe)) - - /** Alias for calling [Builder.timeframe] with `timeframe.orElse(null)`. */ - fun timeframe(timeframe: Optional) = timeframe(timeframe.getOrNull()) - - /** - * Sets [Builder.timeframe] to an arbitrary JSON value. - * - * You should usually call [Builder.timeframe] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun timeframe(timeframe: JsonField) = apply { this.timeframe = timeframe } - - 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 [SymbolChart]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .symbol() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): SymbolChart = - SymbolChart( - checkRequired("symbol", symbol), - timeframe, - 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(): SymbolChart = apply { - if (validated) { - return@apply - } - - symbol() - timeframe() - 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 = - (if (symbol.asKnown().isPresent) 1 else 0) + (if (timeframe.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SymbolChart && - symbol == other.symbol && - timeframe == other.timeframe && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(symbol, timeframe, additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "SymbolChart{symbol=$symbol, timeframe=$timeframe, additionalProperties=$additionalProperties}" -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt index c25bed67..d3a89ab1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt @@ -33,43 +33,41 @@ private constructor( * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun agreementId(): String = body.agreementId() + fun accountIds(): List = body.accountIds() /** * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun requestedEntitlementCodes(): List = body.requestedEntitlementCodes() + fun agreementId(): String = body.agreementId() /** * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun tradingAccountIds(): List = body.tradingAccountIds() + fun entitlementCodes(): List = body.entitlementCodes() /** - * Returns the raw JSON value of [agreementId]. + * Returns the raw JSON value of [accountIds]. * - * Unlike [agreementId], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [accountIds], this method doesn't throw if the JSON field has an unexpected type. */ - fun _agreementId(): JsonField = body._agreementId() + fun _accountIds(): JsonField> = body._accountIds() /** - * Returns the raw JSON value of [requestedEntitlementCodes]. + * Returns the raw JSON value of [agreementId]. * - * Unlike [requestedEntitlementCodes], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [agreementId], this method doesn't throw if the JSON field has an unexpected type. */ - fun _requestedEntitlementCodes(): JsonField> = - body._requestedEntitlementCodes() + fun _agreementId(): JsonField = body._agreementId() /** - * Returns the raw JSON value of [tradingAccountIds]. + * Returns the raw JSON value of [entitlementCodes]. * - * Unlike [tradingAccountIds], this method doesn't throw if the JSON field has an unexpected + * Unlike [entitlementCodes], this method doesn't throw if the JSON field has an unexpected * type. */ - fun _tradingAccountIds(): JsonField> = body._tradingAccountIds() + fun _entitlementCodes(): JsonField> = body._entitlementCodes() fun _additionalBodyProperties(): Map = body._additionalProperties() @@ -89,9 +87,9 @@ private constructor( * * The following fields are required: * ```java + * .accountIds() * .agreementId() - * .requestedEntitlementCodes() - * .tradingAccountIds() + * .entitlementCodes() * ``` */ @JvmStatic fun builder() = Builder() @@ -119,70 +117,63 @@ private constructor( * * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: + * - [accountIds] * - [agreementId] - * - [requestedEntitlementCodes] - * - [tradingAccountIds] + * - [entitlementCodes] */ fun body(body: Body) = apply { this.body = body.toBuilder() } - fun agreementId(agreementId: String) = apply { body.agreementId(agreementId) } + fun accountIds(accountIds: List) = apply { body.accountIds(accountIds) } /** - * Sets [Builder.agreementId] to an arbitrary JSON value. + * Sets [Builder.accountIds] to an arbitrary JSON value. * - * You should usually call [Builder.agreementId] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. + * You should usually call [Builder.accountIds] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun agreementId(agreementId: JsonField) = apply { body.agreementId(agreementId) } - - fun requestedEntitlementCodes(requestedEntitlementCodes: List) = apply { - body.requestedEntitlementCodes(requestedEntitlementCodes) - } + fun accountIds(accountIds: JsonField>) = apply { body.accountIds(accountIds) } /** - * Sets [Builder.requestedEntitlementCodes] to an arbitrary JSON value. + * Adds a single [Long] to [accountIds]. * - * You should usually call [Builder.requestedEntitlementCodes] with a well-typed - * `List` value instead. This method is primarily for setting the field to - * an undocumented or not yet supported value. + * @throws IllegalStateException if the field was previously set to a non-list. */ - fun requestedEntitlementCodes(requestedEntitlementCodes: JsonField>) = - apply { - body.requestedEntitlementCodes(requestedEntitlementCodes) - } + fun addAccountId(accountId: Long) = apply { body.addAccountId(accountId) } + + fun agreementId(agreementId: String) = apply { body.agreementId(agreementId) } /** - * Adds a single [EntitlementCode] to [requestedEntitlementCodes]. + * Sets [Builder.agreementId] to an arbitrary JSON value. * - * @throws IllegalStateException if the field was previously set to a non-list. + * You should usually call [Builder.agreementId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. */ - fun addRequestedEntitlementCode(requestedEntitlementCode: EntitlementCode) = apply { - body.addRequestedEntitlementCode(requestedEntitlementCode) - } + fun agreementId(agreementId: JsonField) = apply { body.agreementId(agreementId) } - fun tradingAccountIds(tradingAccountIds: List) = apply { - body.tradingAccountIds(tradingAccountIds) + fun entitlementCodes(entitlementCodes: List) = apply { + body.entitlementCodes(entitlementCodes) } /** - * Sets [Builder.tradingAccountIds] to an arbitrary JSON value. + * Sets [Builder.entitlementCodes] to an arbitrary JSON value. * - * You should usually call [Builder.tradingAccountIds] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. + * You should usually call [Builder.entitlementCodes] with a well-typed + * `List` value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. */ - fun tradingAccountIds(tradingAccountIds: JsonField>) = apply { - body.tradingAccountIds(tradingAccountIds) + fun entitlementCodes(entitlementCodes: JsonField>) = apply { + body.entitlementCodes(entitlementCodes) } /** - * Adds a single [Long] to [tradingAccountIds]. + * Adds a single [EntitlementCode] to [entitlementCodes]. * * @throws IllegalStateException if the field was previously set to a non-list. */ - fun addTradingAccountId(tradingAccountId: Long) = apply { - body.addTradingAccountId(tradingAccountId) + fun addEntitlementCode(entitlementCode: EntitlementCode) = apply { + body.addEntitlementCode(entitlementCode) } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { @@ -309,9 +300,9 @@ private constructor( * * The following fields are required: * ```java + * .accountIds() * .agreementId() - * .requestedEntitlementCodes() - * .tradingAccountIds() + * .entitlementCodes() * ``` * * @throws IllegalStateException if any required field is unset. @@ -333,73 +324,71 @@ private constructor( class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val accountIds: JsonField>, private val agreementId: JsonField, - private val requestedEntitlementCodes: JsonField>, - private val tradingAccountIds: JsonField>, + private val entitlementCodes: JsonField>, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( + @JsonProperty("account_ids") + @ExcludeMissing + accountIds: JsonField> = JsonMissing.of(), @JsonProperty("agreement_id") @ExcludeMissing agreementId: JsonField = JsonMissing.of(), - @JsonProperty("requested_entitlement_codes") - @ExcludeMissing - requestedEntitlementCodes: JsonField> = JsonMissing.of(), - @JsonProperty("trading_account_ids") + @JsonProperty("entitlement_codes") @ExcludeMissing - tradingAccountIds: JsonField> = JsonMissing.of(), - ) : this(agreementId, requestedEntitlementCodes, tradingAccountIds, mutableMapOf()) + entitlementCodes: JsonField> = JsonMissing.of(), + ) : this(accountIds, agreementId, entitlementCodes, mutableMapOf()) /** * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun agreementId(): String = agreementId.getRequired("agreement_id") + fun accountIds(): List = accountIds.getRequired("account_ids") /** * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun requestedEntitlementCodes(): List = - requestedEntitlementCodes.getRequired("requested_entitlement_codes") + fun agreementId(): String = agreementId.getRequired("agreement_id") /** * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun tradingAccountIds(): List = tradingAccountIds.getRequired("trading_account_ids") + fun entitlementCodes(): List = + entitlementCodes.getRequired("entitlement_codes") /** - * Returns the raw JSON value of [agreementId]. + * Returns the raw JSON value of [accountIds]. * - * Unlike [agreementId], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [accountIds], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("agreement_id") + @JsonProperty("account_ids") @ExcludeMissing - fun _agreementId(): JsonField = agreementId + fun _accountIds(): JsonField> = accountIds /** - * Returns the raw JSON value of [requestedEntitlementCodes]. + * Returns the raw JSON value of [agreementId]. * - * Unlike [requestedEntitlementCodes], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [agreementId], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("requested_entitlement_codes") + @JsonProperty("agreement_id") @ExcludeMissing - fun _requestedEntitlementCodes(): JsonField> = - requestedEntitlementCodes + fun _agreementId(): JsonField = agreementId /** - * Returns the raw JSON value of [tradingAccountIds]. + * Returns the raw JSON value of [entitlementCodes]. * - * Unlike [tradingAccountIds], this method doesn't throw if the JSON field has an unexpected + * Unlike [entitlementCodes], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("trading_account_ids") + @JsonProperty("entitlement_codes") @ExcludeMissing - fun _tradingAccountIds(): JsonField> = tradingAccountIds + fun _entitlementCodes(): JsonField> = entitlementCodes @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -420,9 +409,9 @@ private constructor( * * The following fields are required: * ```java + * .accountIds() * .agreementId() - * .requestedEntitlementCodes() - * .tradingAccountIds() + * .entitlementCodes() * ``` */ @JvmStatic fun builder() = Builder() @@ -431,85 +420,80 @@ private constructor( /** A builder for [Body]. */ class Builder internal constructor() { + private var accountIds: JsonField>? = null private var agreementId: JsonField? = null - private var requestedEntitlementCodes: JsonField>? = null - private var tradingAccountIds: JsonField>? = null + private var entitlementCodes: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { + accountIds = body.accountIds.map { it.toMutableList() } agreementId = body.agreementId - requestedEntitlementCodes = - body.requestedEntitlementCodes.map { it.toMutableList() } - tradingAccountIds = body.tradingAccountIds.map { it.toMutableList() } + entitlementCodes = body.entitlementCodes.map { it.toMutableList() } additionalProperties = body.additionalProperties.toMutableMap() } - fun agreementId(agreementId: String) = agreementId(JsonField.of(agreementId)) + fun accountIds(accountIds: List) = accountIds(JsonField.of(accountIds)) /** - * Sets [Builder.agreementId] to an arbitrary JSON value. + * Sets [Builder.accountIds] to an arbitrary JSON value. * - * You should usually call [Builder.agreementId] with a well-typed [String] value + * You should usually call [Builder.accountIds] with a well-typed `List` value * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun agreementId(agreementId: JsonField) = apply { - this.agreementId = agreementId + fun accountIds(accountIds: JsonField>) = apply { + this.accountIds = accountIds.map { it.toMutableList() } } - fun requestedEntitlementCodes(requestedEntitlementCodes: List) = - requestedEntitlementCodes(JsonField.of(requestedEntitlementCodes)) - /** - * Sets [Builder.requestedEntitlementCodes] to an arbitrary JSON value. + * Adds a single [Long] to [accountIds]. * - * You should usually call [Builder.requestedEntitlementCodes] with a well-typed - * `List` value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. + * @throws IllegalStateException if the field was previously set to a non-list. */ - fun requestedEntitlementCodes( - requestedEntitlementCodes: JsonField> - ) = apply { - this.requestedEntitlementCodes = - requestedEntitlementCodes.map { it.toMutableList() } + fun addAccountId(accountId: Long) = apply { + accountIds = + (accountIds ?: JsonField.of(mutableListOf())).also { + checkKnown("accountIds", it).add(accountId) + } } + fun agreementId(agreementId: String) = agreementId(JsonField.of(agreementId)) + /** - * Adds a single [EntitlementCode] to [requestedEntitlementCodes]. + * Sets [Builder.agreementId] to an arbitrary JSON value. * - * @throws IllegalStateException if the field was previously set to a non-list. + * You should usually call [Builder.agreementId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun addRequestedEntitlementCode(requestedEntitlementCode: EntitlementCode) = apply { - requestedEntitlementCodes = - (requestedEntitlementCodes ?: JsonField.of(mutableListOf())).also { - checkKnown("requestedEntitlementCodes", it).add(requestedEntitlementCode) - } + fun agreementId(agreementId: JsonField) = apply { + this.agreementId = agreementId } - fun tradingAccountIds(tradingAccountIds: List) = - tradingAccountIds(JsonField.of(tradingAccountIds)) + fun entitlementCodes(entitlementCodes: List) = + entitlementCodes(JsonField.of(entitlementCodes)) /** - * Sets [Builder.tradingAccountIds] to an arbitrary JSON value. + * Sets [Builder.entitlementCodes] to an arbitrary JSON value. * - * You should usually call [Builder.tradingAccountIds] with a well-typed `List` - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. + * You should usually call [Builder.entitlementCodes] with a well-typed + * `List` value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. */ - fun tradingAccountIds(tradingAccountIds: JsonField>) = apply { - this.tradingAccountIds = tradingAccountIds.map { it.toMutableList() } + fun entitlementCodes(entitlementCodes: JsonField>) = apply { + this.entitlementCodes = entitlementCodes.map { it.toMutableList() } } /** - * Adds a single [Long] to [tradingAccountIds]. + * Adds a single [EntitlementCode] to [entitlementCodes]. * * @throws IllegalStateException if the field was previously set to a non-list. */ - fun addTradingAccountId(tradingAccountId: Long) = apply { - tradingAccountIds = - (tradingAccountIds ?: JsonField.of(mutableListOf())).also { - checkKnown("tradingAccountIds", it).add(tradingAccountId) + fun addEntitlementCode(entitlementCode: EntitlementCode) = apply { + entitlementCodes = + (entitlementCodes ?: JsonField.of(mutableListOf())).also { + checkKnown("entitlementCodes", it).add(entitlementCode) } } @@ -539,20 +523,18 @@ private constructor( * * The following fields are required: * ```java + * .accountIds() * .agreementId() - * .requestedEntitlementCodes() - * .tradingAccountIds() + * .entitlementCodes() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): Body = Body( + checkRequired("accountIds", accountIds).map { it.toImmutable() }, checkRequired("agreementId", agreementId), - checkRequired("requestedEntitlementCodes", requestedEntitlementCodes).map { - it.toImmutable() - }, - checkRequired("tradingAccountIds", tradingAccountIds).map { it.toImmutable() }, + checkRequired("entitlementCodes", entitlementCodes).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) } @@ -573,9 +555,9 @@ private constructor( return@apply } + accountIds() agreementId() - requestedEntitlementCodes().forEach { it.validate() } - tradingAccountIds() + entitlementCodes().forEach { it.validate() } validated = true } @@ -595,10 +577,9 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (agreementId.asKnown().isPresent) 1 else 0) + - (requestedEntitlementCodes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } - ?: 0) + - (tradingAccountIds.asKnown().getOrNull()?.size ?: 0) + (accountIds.asKnown().getOrNull()?.size ?: 0) + + (if (agreementId.asKnown().isPresent) 1 else 0) + + (entitlementCodes.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -606,25 +587,20 @@ private constructor( } return other is Body && + accountIds == other.accountIds && agreementId == other.agreementId && - requestedEntitlementCodes == other.requestedEntitlementCodes && - tradingAccountIds == other.tradingAccountIds && + entitlementCodes == other.entitlementCodes && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash( - agreementId, - requestedEntitlementCodes, - tradingAccountIds, - additionalProperties, - ) + Objects.hash(accountIds, agreementId, entitlementCodes, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{agreementId=$agreementId, requestedEntitlementCodes=$requestedEntitlementCodes, tradingAccountIds=$tradingAccountIds, additionalProperties=$additionalProperties}" + "Body{accountIds=$accountIds, agreementId=$agreementId, entitlementCodes=$entitlementCodes, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt index 8ae3860e..967e47bb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt @@ -13,9 +13,9 @@ import kotlin.jvm.optionals.getOrNull /** * List finalized messages in a thread. * - * Returns **finalized** messages in chronological order. Messages from in-progress assistant turns - * are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET - * /omni-ai/responses/{response_id}` for live output. + * Returns the latest page of **finalized** messages by default, with messages within each page + * ordered chronologically. Messages from in-progress assistant turns are excluded — use `GET + * /omni-ai/threads/{thread_id}/response` or `GET /omni-ai/responses/{response_id}` for live output. * * If the last finalized message has role `USER`, an active response likely exists and should be * polled separately. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt index 7440265f..4f0e9a27 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt @@ -27,7 +27,7 @@ interface OmniAiServiceAsync { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ fun entitlements(): EntitlementServiceAsync @@ -35,7 +35,7 @@ interface OmniAiServiceAsync { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ fun messages(): MessageServiceAsync @@ -43,7 +43,7 @@ interface OmniAiServiceAsync { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ fun responses(): ResponseServiceAsync @@ -51,7 +51,7 @@ interface OmniAiServiceAsync { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ fun threads(): ThreadServiceAsync @@ -73,7 +73,7 @@ interface OmniAiServiceAsync { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ fun entitlements(): EntitlementServiceAsync.WithRawResponse @@ -81,7 +81,7 @@ interface OmniAiServiceAsync { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ fun messages(): MessageServiceAsync.WithRawResponse @@ -89,7 +89,7 @@ interface OmniAiServiceAsync { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ fun responses(): ResponseServiceAsync.WithRawResponse @@ -97,7 +97,7 @@ interface OmniAiServiceAsync { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ fun threads(): ThreadServiceAsync.WithRawResponse } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt index 79c12e45..1fc155cf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt @@ -39,7 +39,7 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ override fun entitlements(): EntitlementServiceAsync = entitlements @@ -47,7 +47,7 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ override fun messages(): MessageServiceAsync = messages @@ -55,7 +55,7 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ override fun responses(): ResponseServiceAsync = responses @@ -63,7 +63,7 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ override fun threads(): ThreadServiceAsync = threads @@ -97,7 +97,7 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ override fun entitlements(): EntitlementServiceAsync.WithRawResponse = entitlements @@ -105,7 +105,7 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ override fun messages(): MessageServiceAsync.WithRawResponse = messages @@ -113,7 +113,7 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ override fun responses(): ResponseServiceAsync.WithRawResponse = responses @@ -121,7 +121,7 @@ class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: Cli * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ override fun threads(): ThreadServiceAsync.WithRawResponse = threads } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt index b0e06a66..b08ade71 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt @@ -20,7 +20,7 @@ import java.util.function.Consumer * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ interface EntitlementServiceAsync { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt index 621c1a2c..b275dee1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt @@ -32,7 +32,7 @@ import kotlin.jvm.optionals.getOrNull * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ class EntitlementServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : EntitlementServiceAsync { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsync.kt index 1e787174..46b08f9b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsync.kt @@ -16,7 +16,7 @@ import java.util.function.Consumer * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ interface MessageServiceAsync { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt index 1901e7b8..ee5bb505 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt @@ -28,7 +28,7 @@ import kotlin.jvm.optionals.getOrNull * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ class MessageServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : MessageServiceAsync { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsync.kt index b46c305f..9ca8a67c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsync.kt @@ -16,7 +16,7 @@ import java.util.function.Consumer * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ interface ResponseServiceAsync { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt index 24274530..18e5ab5d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt @@ -28,7 +28,7 @@ import kotlin.jvm.optionals.getOrNull * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ class ResponseServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ResponseServiceAsync { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt index 62f06440..a104eba4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt @@ -24,7 +24,7 @@ import java.util.function.Consumer * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ interface ThreadServiceAsync { @@ -100,9 +100,10 @@ interface ThreadServiceAsync { /** * List finalized messages in a thread. * - * Returns **finalized** messages in chronological order. Messages from in-progress assistant - * turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET - * /omni-ai/responses/{response_id}` for live output. + * Returns the latest page of **finalized** messages by default, with messages within each page + * ordered chronologically. Messages from in-progress assistant turns are excluded — use `GET + * /omni-ai/threads/{thread_id}/response` or `GET /omni-ai/responses/{response_id}` for live + * output. * * If the last finalized message has role `USER`, an active response likely exists and should be * polled separately. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt index a7a0459a..511e0d09 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt @@ -36,7 +36,7 @@ import kotlin.jvm.optionals.getOrNull * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ class ThreadServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ThreadServiceAsync { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt index 177ba36b..01a1f254 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt @@ -27,7 +27,7 @@ interface OmniAiService { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ fun entitlements(): EntitlementService @@ -35,7 +35,7 @@ interface OmniAiService { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ fun messages(): MessageService @@ -43,7 +43,7 @@ interface OmniAiService { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ fun responses(): ResponseService @@ -51,7 +51,7 @@ interface OmniAiService { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ fun threads(): ThreadService @@ -69,7 +69,7 @@ interface OmniAiService { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ fun entitlements(): EntitlementService.WithRawResponse @@ -77,7 +77,7 @@ interface OmniAiService { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ fun messages(): MessageService.WithRawResponse @@ -85,7 +85,7 @@ interface OmniAiService { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ fun responses(): ResponseService.WithRawResponse @@ -93,7 +93,7 @@ interface OmniAiService { * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ fun threads(): ThreadService.WithRawResponse } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt index 5ced1e79..c9951220 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt @@ -37,7 +37,7 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ override fun entitlements(): EntitlementService = entitlements @@ -45,7 +45,7 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ override fun messages(): MessageService = messages @@ -53,7 +53,7 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ override fun responses(): ResponseService = responses @@ -61,7 +61,7 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages from * thread history. Thread/message/response endpoints require an explicit account_id. Entitlement - * endpoints are caller-scoped and use trading_account_ids. + * endpoints are caller-scoped and use account_ids. */ override fun threads(): ThreadService = threads @@ -95,7 +95,7 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ override fun entitlements(): EntitlementService.WithRawResponse = entitlements @@ -103,7 +103,7 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ override fun messages(): MessageService.WithRawResponse = messages @@ -111,7 +111,7 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ override fun responses(): ResponseService.WithRawResponse = responses @@ -119,7 +119,7 @@ class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOp * Thread-centric AI assistant for conversational trading. Create threads to start * conversations, poll response objects for in-progress output, and read finalized messages * from thread history. Thread/message/response endpoints require an explicit account_id. - * Entitlement endpoints are caller-scoped and use trading_account_ids. + * Entitlement endpoints are caller-scoped and use account_ids. */ override fun threads(): ThreadService.WithRawResponse = threads } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt index 145dd68e..74d8e4ac 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt @@ -20,7 +20,7 @@ import java.util.function.Consumer * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ interface EntitlementService { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt index 77a70643..414432eb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt @@ -31,7 +31,7 @@ import kotlin.jvm.optionals.getOrNull * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ class EntitlementServiceImpl internal constructor(private val clientOptions: ClientOptions) : EntitlementService { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageService.kt index 2bc2c34f..1c5d4612 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageService.kt @@ -16,7 +16,7 @@ import java.util.function.Consumer * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ interface MessageService { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceImpl.kt index 3d260909..c9a24e62 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceImpl.kt @@ -27,7 +27,7 @@ import kotlin.jvm.optionals.getOrNull * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ class MessageServiceImpl internal constructor(private val clientOptions: ClientOptions) : MessageService { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseService.kt index 5db31133..7f2abb24 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseService.kt @@ -16,7 +16,7 @@ import java.util.function.Consumer * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ interface ResponseService { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceImpl.kt index 11504ad3..ec221e24 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceImpl.kt @@ -27,7 +27,7 @@ import kotlin.jvm.optionals.getOrNull * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ class ResponseServiceImpl internal constructor(private val clientOptions: ClientOptions) : ResponseService { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt index 168d164c..83daceeb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt @@ -24,7 +24,7 @@ import java.util.function.Consumer * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ interface ThreadService { @@ -97,9 +97,10 @@ interface ThreadService { /** * List finalized messages in a thread. * - * Returns **finalized** messages in chronological order. Messages from in-progress assistant - * turns are excluded — use `GET /omni-ai/threads/{thread_id}/response` or `GET - * /omni-ai/responses/{response_id}` for live output. + * Returns the latest page of **finalized** messages by default, with messages within each page + * ordered chronologically. Messages from in-progress assistant turns are excluded — use `GET + * /omni-ai/threads/{thread_id}/response` or `GET /omni-ai/responses/{response_id}` for live + * output. * * If the last finalized message has role `USER`, an active response likely exists and should be * polled separately. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt index 44f03356..22ed3150 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt @@ -35,7 +35,7 @@ import kotlin.jvm.optionals.getOrNull * Thread-centric AI assistant for conversational trading. Create threads to start conversations, * poll response objects for in-progress output, and read finalized messages from thread history. * Thread/message/response endpoints require an explicit account_id. Entitlement endpoints are - * caller-scoped and use trading_account_ids. + * caller-scoped and use account_ids. */ class ThreadServiceImpl internal constructor(private val clientOptions: ClientOptions) : ThreadService { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt index 5376c195..aef50739 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt @@ -19,7 +19,6 @@ internal class InstrumentCoreTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -43,7 +42,6 @@ internal class InstrumentCoreTest { assertThat(instrumentCore.countryOfIssue()).isEqualTo("US") assertThat(instrumentCore.currency()).isEqualTo("USD") assertThat(instrumentCore.easyToBorrow()).isEqualTo(true) - assertThat(instrumentCore.isFractionable()).isEqualTo(false) assertThat(instrumentCore.isLiquidationOnly()).isEqualTo(false) assertThat(instrumentCore.isMarginable()).isEqualTo(true) assertThat(instrumentCore.isRestricted()).isEqualTo(false) @@ -72,7 +70,6 @@ internal class InstrumentCoreTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index ffaac209..55176862 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -45,7 +45,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -98,7 +97,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -153,7 +151,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index 4ba23190..465222dc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -45,7 +45,6 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -97,7 +96,6 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -151,7 +149,6 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index 2bed08ce..d6280bc4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -45,7 +45,6 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -97,7 +96,6 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -151,7 +149,6 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt index 6d504fde..6e6688d0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt @@ -20,7 +20,6 @@ internal class InstrumentTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -45,7 +44,6 @@ internal class InstrumentTest { assertThat(instrument.countryOfIssue()).isEqualTo("US") assertThat(instrument.currency()).isEqualTo("USD") assertThat(instrument.easyToBorrow()).isEqualTo(true) - assertThat(instrument.isFractionable()).isEqualTo(false) assertThat(instrument.isLiquidationOnly()).isEqualTo(false) assertThat(instrument.isMarginable()).isEqualTo(true) assertThat(instrument.isRestricted()).isEqualTo(false) @@ -76,7 +74,6 @@ internal class InstrumentTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPayloadTest.kt index 89deabeb..f2954f6f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPayloadTest.kt @@ -14,7 +14,7 @@ internal class ChartPayloadTest { fun create() { val chartPayload = ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -35,16 +35,16 @@ internal class ChartPayloadTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart(SymbolChart.builder().symbol("AAPL").timeframe("3M").build()) .build() - assertThat(chartPayload.chartId()).isEqualTo("chart_aapl_3m") + assertThat(chartPayload.chartId()).isEqualTo("chart_revenue_growth") assertThat(chartPayload.actionButtons().getOrNull()) .containsExactly( ActionButton.builder() @@ -67,14 +67,13 @@ internal class ChartPayloadTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - assertThat(chartPayload.symbolChart()) - .contains(SymbolChart.builder().symbol("AAPL").timeframe("3M").build()) } @Test @@ -82,7 +81,7 @@ internal class ChartPayloadTest { val jsonMapper = jsonMapper() val chartPayload = ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -103,13 +102,13 @@ internal class ChartPayloadTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart(SymbolChart.builder().symbol("AAPL").timeframe("3M").build()) .build() val roundtrippedChartPayload = diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayloadTest.kt index 1a64167c..38142e87 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayloadTest.kt @@ -15,7 +15,7 @@ internal class ContentPartChartPayloadTest { ContentPartChartPayload.builder() .payload( ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -36,13 +36,13 @@ internal class ContentPartChartPayloadTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart(SymbolChart.builder().symbol("AAPL").timeframe("3M").build()) .build() ) .build() @@ -50,7 +50,7 @@ internal class ContentPartChartPayloadTest { assertThat(contentPartChartPayload.payload()) .isEqualTo( ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -71,13 +71,13 @@ internal class ContentPartChartPayloadTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart(SymbolChart.builder().symbol("AAPL").timeframe("3M").build()) .build() ) } @@ -89,7 +89,7 @@ internal class ContentPartChartPayloadTest { ContentPartChartPayload.builder() .payload( ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -110,13 +110,13 @@ internal class ContentPartChartPayloadTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart(SymbolChart.builder().symbol("AAPL").timeframe("3M").build()) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt index 1369f9b3..97d3c23f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt @@ -15,19 +15,19 @@ internal class OpenEntitlementConsentActionTest { fun create() { val openEntitlementConsentAction = OpenEntitlementConsentAction.builder() + .addAccountId(100019L) .agreementKey(EntitlementAgreementKey.OMNI_ACCOUNT_DATA_ACCESS) + .addEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .reason("Portfolio analysis requires Omni consent to access account data.") - .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) - .addTradingAccountId(100019L) .build() + assertThat(openEntitlementConsentAction.accountIds()).containsExactly(100019L) assertThat(openEntitlementConsentAction.agreementKey()) .isEqualTo(EntitlementAgreementKey.OMNI_ACCOUNT_DATA_ACCESS) + assertThat(openEntitlementConsentAction.entitlementCodes()) + .containsExactly(EntitlementCode.OMNI_ACCOUNT_DATA) assertThat(openEntitlementConsentAction.reason()) .isEqualTo("Portfolio analysis requires Omni consent to access account data.") - assertThat(openEntitlementConsentAction.requestedEntitlementCodes()) - .containsExactly(EntitlementCode.OMNI_ACCOUNT_DATA) - assertThat(openEntitlementConsentAction.tradingAccountIds()).containsExactly(100019L) } @Test @@ -35,10 +35,10 @@ internal class OpenEntitlementConsentActionTest { val jsonMapper = jsonMapper() val openEntitlementConsentAction = OpenEntitlementConsentAction.builder() + .addAccountId(100019L) .agreementKey(EntitlementAgreementKey.OMNI_ACCOUNT_DATA_ACCESS) + .addEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .reason("Portfolio analysis requires Omni consent to access account data.") - .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) - .addTradingAccountId(100019L) .build() val roundtrippedOpenEntitlementConsentAction = diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt index 3f91bddc..748ed702 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt @@ -233,10 +233,10 @@ internal class StructuredActionTest { StructuredAction.OpenEntitlementConsent.builder() .openEntitlementConsent( OpenEntitlementConsentAction.builder() + .addAccountId(100019L) .agreementKey(EntitlementAgreementKey.OMNI_ACCOUNT_DATA_ACCESS) + .addEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .reason("Portfolio analysis requires Omni consent to access account data.") - .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) - .addTradingAccountId(100019L) .build() ) .build() @@ -257,12 +257,12 @@ internal class StructuredActionTest { StructuredAction.OpenEntitlementConsent.builder() .openEntitlementConsent( OpenEntitlementConsentAction.builder() + .addAccountId(100019L) .agreementKey(EntitlementAgreementKey.OMNI_ACCOUNT_DATA_ACCESS) + .addEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .reason( "Portfolio analysis requires Omni consent to access account data." ) - .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) - .addTradingAccountId(100019L) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/SymbolChartTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/SymbolChartTest.kt deleted file mode 100644 index 2371161a..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/SymbolChartTest.kt +++ /dev/null @@ -1,33 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class SymbolChartTest { - - @Test - fun create() { - val symbolChart = SymbolChart.builder().symbol("symbol").timeframe("timeframe").build() - - assertThat(symbolChart.symbol()).isEqualTo("symbol") - assertThat(symbolChart.timeframe()).contains("timeframe") - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val symbolChart = SymbolChart.builder().symbol("symbol").timeframe("timeframe").build() - - val roundtrippedSymbolChart = - jsonMapper.readValue( - jsonMapper.writeValueAsString(symbolChart), - jacksonTypeRef(), - ) - - assertThat(roundtrippedSymbolChart).isEqualTo(symbolChart) - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt index 23c797d8..2e8a796e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt @@ -10,10 +10,10 @@ internal class EntitlementCreateEntitlementsParamsTest { @Test fun create() { EntitlementCreateEntitlementsParams.builder() + .addAccountId(100019L) + .addAccountId(100021L) .agreementId("01JZ0000000000000000000000") - .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) - .addTradingAccountId(100019L) - .addTradingAccountId(100021L) + .addEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .build() } @@ -21,17 +21,16 @@ internal class EntitlementCreateEntitlementsParamsTest { fun body() { val params = EntitlementCreateEntitlementsParams.builder() + .addAccountId(100019L) + .addAccountId(100021L) .agreementId("01JZ0000000000000000000000") - .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) - .addTradingAccountId(100019L) - .addTradingAccountId(100021L) + .addEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .build() val body = params._body() + assertThat(body.accountIds()).containsExactly(100019L, 100021L) assertThat(body.agreementId()).isEqualTo("01JZ0000000000000000000000") - assertThat(body.requestedEntitlementCodes()) - .containsExactly(EntitlementCode.OMNI_ACCOUNT_DATA) - assertThat(body.tradingAccountIds()).containsExactly(100019L, 100021L) + assertThat(body.entitlementCodes()).containsExactly(EntitlementCode.OMNI_ACCOUNT_DATA) } } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt index 2de53a1e..b17931fb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt @@ -15,7 +15,6 @@ import com.clear_street.api.models.v1.omniai.PromptButtonAction import com.clear_street.api.models.v1.omniai.StructuredAction import com.clear_street.api.models.v1.omniai.StructuredActionButtonAction import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload -import com.clear_street.api.models.v1.omniai.SymbolChart import com.clear_street.api.models.v1.orders.NewOrderRequest import com.clear_street.api.models.v1.orders.PositionEffect import com.clear_street.api.models.v1.orders.RequestOrderType @@ -216,7 +215,7 @@ internal class ResponseContentPartTest { ResponseContentPart.UnionMember3.builder() .payload( ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -237,13 +236,13 @@ internal class ResponseContentPartTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart(SymbolChart.builder().symbol("AAPL").timeframe("3M").build()) .build() ) .type(ResponseContentPart.UnionMember3.Type.CHART) @@ -267,7 +266,7 @@ internal class ResponseContentPartTest { ResponseContentPart.UnionMember3.builder() .payload( ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -288,15 +287,13 @@ internal class ResponseContentPartTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart( - SymbolChart.builder().symbol("AAPL").timeframe("3M").build() - ) .build() ) .type(ResponseContentPart.UnionMember3.Type.CHART) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt index 9c640608..a7d8c5e7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt @@ -15,7 +15,6 @@ import com.clear_street.api.models.v1.omniai.PromptButtonAction import com.clear_street.api.models.v1.omniai.StructuredAction import com.clear_street.api.models.v1.omniai.StructuredActionButtonAction import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload -import com.clear_street.api.models.v1.omniai.SymbolChart import com.clear_street.api.models.v1.orders.NewOrderRequest import com.clear_street.api.models.v1.orders.PositionEffect import com.clear_street.api.models.v1.orders.RequestOrderType @@ -176,7 +175,7 @@ internal class MessageContentPartTest { MessageContentPart.UnionMember2.builder() .payload( ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -197,13 +196,13 @@ internal class MessageContentPartTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart(SymbolChart.builder().symbol("AAPL").timeframe("3M").build()) .build() ) .type(MessageContentPart.UnionMember2.Type.CHART) @@ -226,7 +225,7 @@ internal class MessageContentPartTest { MessageContentPart.UnionMember2.builder() .payload( ChartPayload.builder() - .chartId("chart_aapl_3m") + .chartId("chart_revenue_growth") .addActionButton( ActionButton.builder() .buttonId("btn_compare_aapl_spy") @@ -247,15 +246,13 @@ internal class MessageContentPartTest { DataChart.builder() .addSeries( ChartSeries.builder() - .name("name") - .addPoint(ChartPoint.builder().x("x").y(0.0).build()) + .name("Revenue") + .addPoint(ChartPoint.builder().x("Q1").y(100.0).build()) + .addPoint(ChartPoint.builder().x("Q2").y(150.0).build()) .build() ) .build() ) - .symbolChart( - SymbolChart.builder().symbol("AAPL").timeframe("3M").build() - ) .build() ) .type(MessageContentPart.UnionMember2.Type.CHART) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt index f364f353..ad623278 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -30,7 +30,6 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -71,7 +70,6 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -115,7 +113,6 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index 1998b558..4bc6f623 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -56,7 +56,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -123,7 +122,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -192,7 +190,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt index 66c7f641..82da69e5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -26,7 +26,6 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -60,7 +59,6 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -97,7 +95,6 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) - .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt index 0a6bdc75..b2e0c692 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt @@ -20,10 +20,10 @@ internal class EntitlementServiceAsyncTest { val responseFuture = entitlementServiceAsync.createEntitlements( EntitlementCreateEntitlementsParams.builder() + .addAccountId(100019L) + .addAccountId(100021L) .agreementId("01JZ0000000000000000000000") - .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) - .addTradingAccountId(100019L) - .addTradingAccountId(100021L) + .addEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt index f5a15f1b..eb262579 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt @@ -20,10 +20,10 @@ internal class EntitlementServiceTest { val response = entitlementService.createEntitlements( EntitlementCreateEntitlementsParams.builder() + .addAccountId(100019L) + .addAccountId(100021L) .agreementId("01JZ0000000000000000000000") - .addRequestedEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) - .addTradingAccountId(100019L) - .addTradingAccountId(100021L) + .addEntitlementCode(EntitlementCode.OMNI_ACCOUNT_DATA) .build() ) From dab98b491979d6adfeeae3e8c5d1d3988e9c79be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 22:46:18 +0000 Subject: [PATCH 16/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/instruments/Instrument.kt | 47 ++++++++++++++++++- .../models/v1/instruments/InstrumentCore.kt | 47 ++++++++++++++++++- .../v1/instruments/InstrumentCoreTest.kt | 3 ++ ...InstrumentGetInstrumentByIdResponseTest.kt | 3 ++ .../InstrumentGetInstrumentsResponseTest.kt | 3 ++ ...InstrumentSearchInstrumentsResponseTest.kt | 3 ++ .../models/v1/instruments/InstrumentTest.kt | 3 ++ .../v1/watchlist/WatchlistDetailTest.kt | 3 ++ .../WatchlistGetWatchlistByIdResponseTest.kt | 3 ++ .../v1/watchlist/WatchlistItemEntryTest.kt | 3 ++ 11 files changed, 118 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 66ce67a6..33b67cf9 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-700c0cd9fc93964b53ef1290d7c09c2b6d432070585478358a8b3f70307037d7.yml -openapi_spec_hash: 553b1f838a26f0a95ab83caacde5c8f7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-ff50b6c4f566d7554c733c573a86e295d52802650f25e16faa78cc82d77f5fc3.yml +openapi_spec_hash: b4037800b0a06f7f2f199c5ee3062fab config_hash: 607831128be744fd1bd144b81cc41b63 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt index 71481021..93a6adf2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt @@ -29,6 +29,7 @@ private constructor( private val countryOfIssue: JsonField, private val currency: JsonField, private val easyToBorrow: JsonField, + private val isFractionable: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, private val isRestricted: JsonField, @@ -60,6 +61,9 @@ private constructor( @JsonProperty("easy_to_borrow") @ExcludeMissing easyToBorrow: JsonField = JsonMissing.of(), + @JsonProperty("is_fractionable") + @ExcludeMissing + isFractionable: JsonField = JsonMissing.of(), @JsonProperty("is_liquidation_only") @ExcludeMissing isLiquidationOnly: JsonField = JsonMissing.of(), @@ -109,6 +113,7 @@ private constructor( countryOfIssue, currency, easyToBorrow, + isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -162,6 +167,14 @@ private constructor( */ fun easyToBorrow(): Boolean = easyToBorrow.getRequired("easy_to_borrow") + /** + * Indicates if the instrument supports fractional-quantity orders + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun isFractionable(): Boolean = isFractionable.getRequired("is_fractionable") + /** * Indicates if the instrument is liquidation only and cannot be bought * @@ -342,6 +355,15 @@ private constructor( @ExcludeMissing fun _easyToBorrow(): JsonField = easyToBorrow + /** + * Returns the raw JSON value of [isFractionable]. + * + * Unlike [isFractionable], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("is_fractionable") + @ExcludeMissing + fun _isFractionable(): JsonField = isFractionable + /** * Returns the raw JSON value of [isLiquidationOnly]. * @@ -519,6 +541,7 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() + * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -539,6 +562,7 @@ private constructor( private var countryOfIssue: JsonField? = null private var currency: JsonField? = null private var easyToBorrow: JsonField? = null + private var isFractionable: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null private var isRestricted: JsonField? = null @@ -565,6 +589,7 @@ private constructor( countryOfIssue = instrument.countryOfIssue currency = instrument.currency easyToBorrow = instrument.easyToBorrow + isFractionable = instrument.isFractionable isLiquidationOnly = instrument.isLiquidationOnly isMarginable = instrument.isMarginable isRestricted = instrument.isRestricted @@ -636,6 +661,20 @@ private constructor( this.easyToBorrow = easyToBorrow } + /** Indicates if the instrument supports fractional-quantity orders */ + fun isFractionable(isFractionable: Boolean) = isFractionable(JsonField.of(isFractionable)) + + /** + * Sets [Builder.isFractionable] to an arbitrary JSON value. + * + * You should usually call [Builder.isFractionable] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun isFractionable(isFractionable: JsonField) = apply { + this.isFractionable = isFractionable + } + /** Indicates if the instrument is liquidation only and cannot be bought */ fun isLiquidationOnly(isLiquidationOnly: Boolean) = isLiquidationOnly(JsonField.of(isLiquidationOnly)) @@ -962,6 +1001,7 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() + * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -980,6 +1020,7 @@ private constructor( checkRequired("countryOfIssue", countryOfIssue), checkRequired("currency", currency), checkRequired("easyToBorrow", easyToBorrow), + checkRequired("isFractionable", isFractionable), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), checkRequired("isRestricted", isRestricted), @@ -1021,6 +1062,7 @@ private constructor( countryOfIssue() currency() easyToBorrow() + isFractionable() isLiquidationOnly() isMarginable() isRestricted() @@ -1061,6 +1103,7 @@ private constructor( (if (countryOfIssue.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (easyToBorrow.asKnown().isPresent) 1 else 0) + + (if (isFractionable.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + (if (isRestricted.asKnown().isPresent) 1 else 0) + @@ -1090,6 +1133,7 @@ private constructor( countryOfIssue == other.countryOfIssue && currency == other.currency && easyToBorrow == other.easyToBorrow && + isFractionable == other.isFractionable && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isRestricted == other.isRestricted && @@ -1117,6 +1161,7 @@ private constructor( countryOfIssue, currency, easyToBorrow, + isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -1142,5 +1187,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt index fd5134ce..eff6fc94 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt @@ -26,6 +26,7 @@ private constructor( private val countryOfIssue: JsonField, private val currency: JsonField, private val easyToBorrow: JsonField, + private val isFractionable: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, private val isRestricted: JsonField, @@ -56,6 +57,9 @@ private constructor( @JsonProperty("easy_to_borrow") @ExcludeMissing easyToBorrow: JsonField = JsonMissing.of(), + @JsonProperty("is_fractionable") + @ExcludeMissing + isFractionable: JsonField = JsonMissing.of(), @JsonProperty("is_liquidation_only") @ExcludeMissing isLiquidationOnly: JsonField = JsonMissing.of(), @@ -102,6 +106,7 @@ private constructor( countryOfIssue, currency, easyToBorrow, + isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -154,6 +159,14 @@ private constructor( */ fun easyToBorrow(): Boolean = easyToBorrow.getRequired("easy_to_borrow") + /** + * Indicates if the instrument supports fractional-quantity orders + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun isFractionable(): Boolean = isFractionable.getRequired("is_fractionable") + /** * Indicates if the instrument is liquidation only and cannot be bought * @@ -324,6 +337,15 @@ private constructor( @ExcludeMissing fun _easyToBorrow(): JsonField = easyToBorrow + /** + * Returns the raw JSON value of [isFractionable]. + * + * Unlike [isFractionable], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("is_fractionable") + @ExcludeMissing + fun _isFractionable(): JsonField = isFractionable + /** * Returns the raw JSON value of [isLiquidationOnly]. * @@ -491,6 +513,7 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() + * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -511,6 +534,7 @@ private constructor( private var countryOfIssue: JsonField? = null private var currency: JsonField? = null private var easyToBorrow: JsonField? = null + private var isFractionable: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null private var isRestricted: JsonField? = null @@ -536,6 +560,7 @@ private constructor( countryOfIssue = instrumentCore.countryOfIssue currency = instrumentCore.currency easyToBorrow = instrumentCore.easyToBorrow + isFractionable = instrumentCore.isFractionable isLiquidationOnly = instrumentCore.isLiquidationOnly isMarginable = instrumentCore.isMarginable isRestricted = instrumentCore.isRestricted @@ -606,6 +631,20 @@ private constructor( this.easyToBorrow = easyToBorrow } + /** Indicates if the instrument supports fractional-quantity orders */ + fun isFractionable(isFractionable: Boolean) = isFractionable(JsonField.of(isFractionable)) + + /** + * Sets [Builder.isFractionable] to an arbitrary JSON value. + * + * You should usually call [Builder.isFractionable] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun isFractionable(isFractionable: JsonField) = apply { + this.isFractionable = isFractionable + } + /** Indicates if the instrument is liquidation only and cannot be bought */ fun isLiquidationOnly(isLiquidationOnly: Boolean) = isLiquidationOnly(JsonField.of(isLiquidationOnly)) @@ -896,6 +935,7 @@ private constructor( * .countryOfIssue() * .currency() * .easyToBorrow() + * .isFractionable() * .isLiquidationOnly() * .isMarginable() * .isRestricted() @@ -914,6 +954,7 @@ private constructor( checkRequired("countryOfIssue", countryOfIssue), checkRequired("currency", currency), checkRequired("easyToBorrow", easyToBorrow), + checkRequired("isFractionable", isFractionable), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), checkRequired("isRestricted", isRestricted), @@ -954,6 +995,7 @@ private constructor( countryOfIssue() currency() easyToBorrow() + isFractionable() isLiquidationOnly() isMarginable() isRestricted() @@ -993,6 +1035,7 @@ private constructor( (if (countryOfIssue.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + (if (easyToBorrow.asKnown().isPresent) 1 else 0) + + (if (isFractionable.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + (if (isRestricted.asKnown().isPresent) 1 else 0) + @@ -1021,6 +1064,7 @@ private constructor( countryOfIssue == other.countryOfIssue && currency == other.currency && easyToBorrow == other.easyToBorrow && + isFractionable == other.isFractionable && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isRestricted == other.isRestricted && @@ -1047,6 +1091,7 @@ private constructor( countryOfIssue, currency, easyToBorrow, + isFractionable, isLiquidationOnly, isMarginable, isRestricted, @@ -1071,5 +1116,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt index aef50739..5376c195 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt @@ -19,6 +19,7 @@ internal class InstrumentCoreTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -42,6 +43,7 @@ internal class InstrumentCoreTest { assertThat(instrumentCore.countryOfIssue()).isEqualTo("US") assertThat(instrumentCore.currency()).isEqualTo("USD") assertThat(instrumentCore.easyToBorrow()).isEqualTo(true) + assertThat(instrumentCore.isFractionable()).isEqualTo(false) assertThat(instrumentCore.isLiquidationOnly()).isEqualTo(false) assertThat(instrumentCore.isMarginable()).isEqualTo(true) assertThat(instrumentCore.isRestricted()).isEqualTo(false) @@ -70,6 +72,7 @@ internal class InstrumentCoreTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index 55176862..ffaac209 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -45,6 +45,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -97,6 +98,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -151,6 +153,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index 465222dc..4ba23190 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -45,6 +45,7 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -96,6 +97,7 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -149,6 +151,7 @@ internal class InstrumentGetInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index d6280bc4..2bed08ce 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -45,6 +45,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -96,6 +97,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -149,6 +151,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt index 6e6688d0..6d504fde 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt @@ -20,6 +20,7 @@ internal class InstrumentTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -44,6 +45,7 @@ internal class InstrumentTest { assertThat(instrument.countryOfIssue()).isEqualTo("US") assertThat(instrument.currency()).isEqualTo("USD") assertThat(instrument.easyToBorrow()).isEqualTo(true) + assertThat(instrument.isFractionable()).isEqualTo(false) assertThat(instrument.isLiquidationOnly()).isEqualTo(false) assertThat(instrument.isMarginable()).isEqualTo(true) assertThat(instrument.isRestricted()).isEqualTo(false) @@ -74,6 +76,7 @@ internal class InstrumentTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt index ad623278..f364f353 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -30,6 +30,7 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -70,6 +71,7 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -113,6 +115,7 @@ internal class WatchlistDetailTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index 4bc6f623..1998b558 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -56,6 +56,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -122,6 +123,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -190,6 +192,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt index 82da69e5..66c7f641 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -26,6 +26,7 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -59,6 +60,7 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) @@ -95,6 +97,7 @@ internal class WatchlistItemEntryTest { .countryOfIssue("US") .currency("USD") .easyToBorrow(true) + .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) .isRestricted(false) From baaf3af53e9cbf0b06b1b6e46d85e30f7396994a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 15:08:40 +0000 Subject: [PATCH 17/51] feat(api): api update --- .stats.yml | 8 +- .../api/models/v1/executions/Execution.kt | 476 ++++++++++++++++++ .../v1/orders/OrderGetExecutionsParams.kt | 314 ++++++++++++ .../v1/orders/OrderGetExecutionsResponse.kt | 284 +++++++++++ .../api/services/async/V1ServiceAsync.kt | 5 + .../api/services/async/V1ServiceAsyncImpl.kt | 14 + .../async/v1/ExecutionServiceAsync.kt | 36 ++ .../async/v1/ExecutionServiceAsyncImpl.kt | 30 ++ .../services/async/v1/OrderServiceAsync.kt | 85 ++++ .../async/v1/OrderServiceAsyncImpl.kt | 42 ++ .../api/services/blocking/V1Service.kt | 5 + .../api/services/blocking/V1ServiceImpl.kt | 12 + .../services/blocking/v1/ExecutionService.kt | 32 ++ .../blocking/v1/ExecutionServiceImpl.kt | 30 ++ .../api/services/blocking/v1/OrderService.kt | 84 ++++ .../services/blocking/v1/OrderServiceImpl.kt | 39 ++ .../api/models/v1/executions/ExecutionTest.kt | 62 +++ .../v1/orders/OrderGetExecutionsParamsTest.kt | 67 +++ .../orders/OrderGetExecutionsResponseTest.kt | 142 ++++++ .../async/v1/OrderServiceAsyncTest.kt | 23 + .../services/blocking/v1/OrderServiceTest.kt | 22 + 21 files changed, 1808 insertions(+), 4 deletions(-) create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/executions/Execution.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParams.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsync.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsyncImpl.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionService.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionServiceImpl.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/executions/ExecutionTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParamsTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt diff --git a/.stats.yml b/.stats.yml index 33b67cf9..a43ed7b5 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-ff50b6c4f566d7554c733c573a86e295d52802650f25e16faa78cc82d77f5fc3.yml -openapi_spec_hash: b4037800b0a06f7f2f199c5ee3062fab -config_hash: 607831128be744fd1bd144b81cc41b63 +configured_endpoints: 56 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-cc5e22d3d2366de648059352cdc55ddc45040a9f5cfee082acd41aaff474625a.yml +openapi_spec_hash: b70cddc271d78227a69687aebb585fbf +config_hash: 4af8059a4651858910b86c8602594cf1 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/executions/Execution.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/executions/Execution.kt new file mode 100644 index 00000000..790a6ba6 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/executions/Execution.kt @@ -0,0 +1,476 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.executions + +import com.clear_street.api.core.ExcludeMissing +import com.clear_street.api.core.JsonField +import com.clear_street.api.core.JsonMissing +import com.clear_street.api.core.JsonValue +import com.clear_street.api.core.checkRequired +import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clear_street.api.models.v1.orders.Side +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import kotlin.jvm.optionals.getOrNull + +/** Represents a single fill of an order for an account. */ +class Execution +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val instrumentId: JsonField, + private val orderId: JsonField, + private val price: JsonField, + private val quantity: JsonField, + private val side: JsonField, + private val symbol: JsonField, + private val transactionTime: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("instrument_id") + @ExcludeMissing + instrumentId: JsonField = JsonMissing.of(), + @JsonProperty("order_id") @ExcludeMissing orderId: JsonField = JsonMissing.of(), + @JsonProperty("price") @ExcludeMissing price: JsonField = JsonMissing.of(), + @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), + @JsonProperty("side") @ExcludeMissing side: JsonField = JsonMissing.of(), + @JsonProperty("symbol") @ExcludeMissing symbol: JsonField = JsonMissing.of(), + @JsonProperty("transaction_time") + @ExcludeMissing + transactionTime: JsonField = JsonMissing.of(), + ) : this( + id, + instrumentId, + orderId, + price, + quantity, + side, + symbol, + transactionTime, + mutableMapOf(), + ) + + /** + * Unique identifier for this execution report. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * OEMS instrument identifier. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun instrumentId(): String = instrumentId.getRequired("instrument_id") + + /** + * Identifier of the order this execution belongs to. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun orderId(): String = orderId.getRequired("order_id") + + /** + * Fill price. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun price(): String = price.getRequired("price") + + /** + * Filled quantity. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun quantity(): String = quantity.getRequired("quantity") + + /** + * Side of the fill. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun side(): Side = side.getRequired("side") + + /** + * Trading symbol. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun symbol(): String = symbol.getRequired("symbol") + + /** + * Transaction timestamp in nanosecond precision (UTC). + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun transactionTime(): OffsetDateTime = transactionTime.getRequired("transaction_time") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [instrumentId]. + * + * Unlike [instrumentId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("instrument_id") + @ExcludeMissing + fun _instrumentId(): JsonField = instrumentId + + /** + * Returns the raw JSON value of [orderId]. + * + * Unlike [orderId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("order_id") @ExcludeMissing fun _orderId(): JsonField = orderId + + /** + * Returns the raw JSON value of [price]. + * + * Unlike [price], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("price") @ExcludeMissing fun _price(): JsonField = price + + /** + * Returns the raw JSON value of [quantity]. + * + * Unlike [quantity], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("quantity") @ExcludeMissing fun _quantity(): JsonField = quantity + + /** + * Returns the raw JSON value of [side]. + * + * Unlike [side], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("side") @ExcludeMissing fun _side(): JsonField = side + + /** + * Returns the raw JSON value of [symbol]. + * + * Unlike [symbol], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("symbol") @ExcludeMissing fun _symbol(): JsonField = symbol + + /** + * Returns the raw JSON value of [transactionTime]. + * + * Unlike [transactionTime], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transaction_time") + @ExcludeMissing + fun _transactionTime(): JsonField = transactionTime + + @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 [Execution]. + * + * The following fields are required: + * ```java + * .id() + * .instrumentId() + * .orderId() + * .price() + * .quantity() + * .side() + * .symbol() + * .transactionTime() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Execution]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var instrumentId: JsonField? = null + private var orderId: JsonField? = null + private var price: JsonField? = null + private var quantity: JsonField? = null + private var side: JsonField? = null + private var symbol: JsonField? = null + private var transactionTime: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(execution: Execution) = apply { + id = execution.id + instrumentId = execution.instrumentId + orderId = execution.orderId + price = execution.price + quantity = execution.quantity + side = execution.side + symbol = execution.symbol + transactionTime = execution.transactionTime + additionalProperties = execution.additionalProperties.toMutableMap() + } + + /** Unique identifier for this execution report. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** OEMS instrument identifier. */ + fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) + + /** + * Sets [Builder.instrumentId] to an arbitrary JSON value. + * + * You should usually call [Builder.instrumentId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun instrumentId(instrumentId: JsonField) = apply { + this.instrumentId = instrumentId + } + + /** Identifier of the order this execution belongs to. */ + fun orderId(orderId: String) = orderId(JsonField.of(orderId)) + + /** + * Sets [Builder.orderId] to an arbitrary JSON value. + * + * You should usually call [Builder.orderId] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun orderId(orderId: JsonField) = apply { this.orderId = orderId } + + /** Fill price. */ + fun price(price: String) = price(JsonField.of(price)) + + /** + * Sets [Builder.price] to an arbitrary JSON value. + * + * You should usually call [Builder.price] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun price(price: JsonField) = apply { this.price = price } + + /** Filled quantity. */ + fun quantity(quantity: String) = quantity(JsonField.of(quantity)) + + /** + * Sets [Builder.quantity] to an arbitrary JSON value. + * + * You should usually call [Builder.quantity] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + + /** Side of the fill. */ + fun side(side: Side) = side(JsonField.of(side)) + + /** + * Sets [Builder.side] to an arbitrary JSON value. + * + * You should usually call [Builder.side] with a well-typed [Side] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun side(side: JsonField) = apply { this.side = side } + + /** Trading symbol. */ + fun symbol(symbol: String) = symbol(JsonField.of(symbol)) + + /** + * Sets [Builder.symbol] to an arbitrary JSON value. + * + * You should usually call [Builder.symbol] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun symbol(symbol: JsonField) = apply { this.symbol = symbol } + + /** Transaction timestamp in nanosecond precision (UTC). */ + fun transactionTime(transactionTime: OffsetDateTime) = + transactionTime(JsonField.of(transactionTime)) + + /** + * Sets [Builder.transactionTime] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionTime] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun transactionTime(transactionTime: JsonField) = apply { + this.transactionTime = transactionTime + } + + 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 [Execution]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .instrumentId() + * .orderId() + * .price() + * .quantity() + * .side() + * .symbol() + * .transactionTime() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Execution = + Execution( + checkRequired("id", id), + checkRequired("instrumentId", instrumentId), + checkRequired("orderId", orderId), + checkRequired("price", price), + checkRequired("quantity", quantity), + checkRequired("side", side), + checkRequired("symbol", symbol), + checkRequired("transactionTime", transactionTime), + 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(): Execution = apply { + if (validated) { + return@apply + } + + id() + instrumentId() + orderId() + price() + quantity() + side().validate() + symbol() + transactionTime() + 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 = + (if (id.asKnown().isPresent) 1 else 0) + + (if (instrumentId.asKnown().isPresent) 1 else 0) + + (if (orderId.asKnown().isPresent) 1 else 0) + + (if (price.asKnown().isPresent) 1 else 0) + + (if (quantity.asKnown().isPresent) 1 else 0) + + (side.asKnown().getOrNull()?.validity() ?: 0) + + (if (symbol.asKnown().isPresent) 1 else 0) + + (if (transactionTime.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Execution && + id == other.id && + instrumentId == other.instrumentId && + orderId == other.orderId && + price == other.price && + quantity == other.quantity && + side == other.side && + symbol == other.symbol && + transactionTime == other.transactionTime && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + instrumentId, + orderId, + price, + quantity, + side, + symbol, + transactionTime, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Execution{id=$id, instrumentId=$instrumentId, orderId=$orderId, price=$price, quantity=$quantity, side=$side, symbol=$symbol, transactionTime=$transactionTime, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParams.kt new file mode 100644 index 00000000..9dac9ce0 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParams.kt @@ -0,0 +1,314 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.orders + +import com.clear_street.api.core.Params +import com.clear_street.api.core.http.Headers +import com.clear_street.api.core.http.QueryParams +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Retrieves filled and partially-filled execution reports for the specified trading account, + * ordered by transaction time (nanosecond precision) descending. + */ +class OrderGetExecutionsParams +private constructor( + private val accountId: Long?, + private val from: OffsetDateTime?, + private val instrumentId: String?, + private val pageSize: Long?, + private val pageToken: String?, + private val to: OffsetDateTime?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun accountId(): Optional = Optional.ofNullable(accountId) + + /** The start date and time for the query range, inclusive (ISO 8601 format) */ + fun from(): Optional = Optional.ofNullable(from) + + /** + * Optional instrument to filter by. Accepts either a symbol (e.g. `AAPL`) or an OEMS instrument + * UUID. + */ + fun instrumentId(): Optional = Optional.ofNullable(instrumentId) + + /** The number of items to return per page. Only used when page_token is not provided. */ + fun pageSize(): Optional = Optional.ofNullable(pageSize) + + /** + * Token for retrieving the next or previous page of results. Contains encoded pagination state; + * when provided, page_size is ignored. + */ + fun pageToken(): Optional = Optional.ofNullable(pageToken) + + /** The end date and time for the query range, inclusive (ISO 8601 format) */ + fun to(): Optional = Optional.ofNullable(to) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): OrderGetExecutionsParams = builder().build() + + /** Returns a mutable builder for constructing an instance of [OrderGetExecutionsParams]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [OrderGetExecutionsParams]. */ + class Builder internal constructor() { + + private var accountId: Long? = null + private var from: OffsetDateTime? = null + private var instrumentId: String? = null + private var pageSize: Long? = null + private var pageToken: String? = null + private var to: OffsetDateTime? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(orderGetExecutionsParams: OrderGetExecutionsParams) = apply { + accountId = orderGetExecutionsParams.accountId + from = orderGetExecutionsParams.from + instrumentId = orderGetExecutionsParams.instrumentId + pageSize = orderGetExecutionsParams.pageSize + pageToken = orderGetExecutionsParams.pageToken + to = orderGetExecutionsParams.to + additionalHeaders = orderGetExecutionsParams.additionalHeaders.toBuilder() + additionalQueryParams = orderGetExecutionsParams.additionalQueryParams.toBuilder() + } + + fun accountId(accountId: Long?) = apply { this.accountId = accountId } + + /** + * Alias for [Builder.accountId]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun accountId(accountId: Long) = accountId(accountId as Long?) + + /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ + fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) + + /** The start date and time for the query range, inclusive (ISO 8601 format) */ + fun from(from: OffsetDateTime?) = apply { this.from = from } + + /** Alias for calling [Builder.from] with `from.orElse(null)`. */ + fun from(from: Optional) = from(from.getOrNull()) + + /** + * Optional instrument to filter by. Accepts either a symbol (e.g. `AAPL`) or an OEMS + * instrument UUID. + */ + fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } + + /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ + fun instrumentId(instrumentId: Optional) = instrumentId(instrumentId.getOrNull()) + + /** The number of items to return per page. Only used when page_token is not provided. */ + fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } + + /** + * Alias for [Builder.pageSize]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun pageSize(pageSize: Long) = pageSize(pageSize as Long?) + + /** Alias for calling [Builder.pageSize] with `pageSize.orElse(null)`. */ + fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) + + /** + * Token for retrieving the next or previous page of results. Contains encoded pagination + * state; when provided, page_size is ignored. + */ + fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } + + /** Alias for calling [Builder.pageToken] with `pageToken.orElse(null)`. */ + fun pageToken(pageToken: Optional) = pageToken(pageToken.getOrNull()) + + /** The end date and time for the query range, inclusive (ISO 8601 format) */ + fun to(to: OffsetDateTime?) = apply { this.to = to } + + /** Alias for calling [Builder.to] with `to.orElse(null)`. */ + fun to(to: Optional) = to(to.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [OrderGetExecutionsParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): OrderGetExecutionsParams = + OrderGetExecutionsParams( + accountId, + from, + instrumentId, + pageSize, + pageToken, + to, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> accountId?.toString() ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + from?.let { put("from", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) } + instrumentId?.let { put("instrument_id", it) } + pageSize?.let { put("page_size", it.toString()) } + pageToken?.let { put("page_token", it) } + to?.let { put("to", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) } + putAll(additionalQueryParams) + } + .build() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OrderGetExecutionsParams && + accountId == other.accountId && + from == other.from && + instrumentId == other.instrumentId && + pageSize == other.pageSize && + pageToken == other.pageToken && + to == other.to && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + accountId, + from, + instrumentId, + pageSize, + pageToken, + to, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "OrderGetExecutionsParams{accountId=$accountId, from=$from, instrumentId=$instrumentId, pageSize=$pageSize, pageToken=$pageToken, to=$to, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt new file mode 100644 index 00000000..535234cc --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt @@ -0,0 +1,284 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.orders + +import com.clear_street.api.core.ExcludeMissing +import com.clear_street.api.core.JsonField +import com.clear_street.api.core.JsonMissing +import com.clear_street.api.core.JsonValue +import com.clear_street.api.core.checkKnown +import com.clear_street.api.core.checkRequired +import com.clear_street.api.core.toImmutable +import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clear_street.api.models.ApiError +import com.clear_street.api.models.BaseResponse +import com.clear_street.api.models.ResponseMetadata +import com.clear_street.api.models.v1.executions.Execution +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class OrderGetExecutionsResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val metadata: JsonField, + private val error: JsonField, + private val data: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing data: JsonField> = JsonMissing.of(), + ) : this(metadata, error, data, mutableMapOf()) + + fun toBaseResponse(): BaseResponse = + BaseResponse.builder().metadata(metadata).error(error).build() + + /** + * Response metadata, including the request ID and optional pagination info. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): ResponseMetadata = metadata.getRequired("metadata") + + /** + * Structured error details when the request is unsuccessful. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun error(): Optional = error.getOptional("error") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [error]. + * + * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + @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 [OrderGetExecutionsResponse]. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [OrderGetExecutionsResponse]. */ + class Builder internal constructor() { + + private var metadata: JsonField? = null + private var error: JsonField = JsonMissing.of() + private var data: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(orderGetExecutionsResponse: OrderGetExecutionsResponse) = apply { + metadata = orderGetExecutionsResponse.metadata + error = orderGetExecutionsResponse.error + data = orderGetExecutionsResponse.data.map { it.toMutableList() } + additionalProperties = orderGetExecutionsResponse.additionalProperties.toMutableMap() + } + + /** Response metadata, including the request ID and optional pagination info. */ + fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [ResponseMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** Structured error details when the request is unsuccessful. */ + fun error(error: ApiError?) = error(JsonField.ofNullable(error)) + + /** Alias for calling [Builder.error] with `error.orElse(null)`. */ + fun error(error: Optional) = error(error.getOrNull()) + + /** + * Sets [Builder.error] to an arbitrary JSON value. + * + * You should usually call [Builder.error] with a well-typed [ApiError] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun error(error: JsonField) = apply { this.error = error } + + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [Execution] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: Execution) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + 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 [OrderGetExecutionsResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): OrderGetExecutionsResponse = + OrderGetExecutionsResponse( + checkRequired("metadata", metadata), + error, + checkRequired("data", data).map { it.toImmutable() }, + 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(): OrderGetExecutionsResponse = apply { + if (validated) { + return@apply + } + + metadata().validate() + error().ifPresent { it.validate() } + data().forEach { it.validate() } + 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 = + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (error.asKnown().getOrNull()?.validity() ?: 0) + + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OrderGetExecutionsResponse && + metadata == other.metadata && + error == other.error && + data == other.data && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(metadata, error, data, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "OrderGetExecutionsResponse{metadata=$metadata, error=$error, data=$data, 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 index 49d97fe6..e53dfe77 100644 --- 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 @@ -6,6 +6,7 @@ import com.clear_street.api.core.ClientOptions import com.clear_street.api.services.async.v1.AccountServiceAsync import com.clear_street.api.services.async.v1.ApiVersionServiceAsync import com.clear_street.api.services.async.v1.CalendarServiceAsync +import com.clear_street.api.services.async.v1.ExecutionServiceAsync import com.clear_street.api.services.async.v1.InstrumentDataServiceAsync import com.clear_street.api.services.async.v1.InstrumentServiceAsync import com.clear_street.api.services.async.v1.OmniAiServiceAsync @@ -38,6 +39,8 @@ interface V1ServiceAsync { /** Access clocks and financial calendars for market sessions and events. */ fun calendar(): CalendarServiceAsync + fun executions(): ExecutionServiceAsync + /** Retrieve instrument analytics, market data, news, and related reference data. */ fun instrumentData(): InstrumentDataServiceAsync @@ -77,6 +80,8 @@ interface V1ServiceAsync { /** Access clocks and financial calendars for market sessions and events. */ fun calendar(): CalendarServiceAsync.WithRawResponse + fun executions(): ExecutionServiceAsync.WithRawResponse + /** Retrieve instrument analytics, market data, news, and related reference data. */ fun instrumentData(): InstrumentDataServiceAsync.WithRawResponse 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 index c6b8265c..44b12612 100644 --- 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 @@ -9,6 +9,8 @@ import com.clear_street.api.services.async.v1.ApiVersionServiceAsync import com.clear_street.api.services.async.v1.ApiVersionServiceAsyncImpl 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.ExecutionServiceAsync +import com.clear_street.api.services.async.v1.ExecutionServiceAsyncImpl import com.clear_street.api.services.async.v1.InstrumentDataServiceAsync import com.clear_street.api.services.async.v1.InstrumentDataServiceAsyncImpl import com.clear_street.api.services.async.v1.InstrumentServiceAsync @@ -40,6 +42,10 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO private val calendar: CalendarServiceAsync by lazy { CalendarServiceAsyncImpl(clientOptions) } + private val executions: ExecutionServiceAsync by lazy { + ExecutionServiceAsyncImpl(clientOptions) + } + private val instrumentData: InstrumentDataServiceAsync by lazy { InstrumentDataServiceAsyncImpl(clientOptions) } @@ -76,6 +82,8 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** Access clocks and financial calendars for market sessions and events. */ override fun calendar(): CalendarServiceAsync = calendar + override fun executions(): ExecutionServiceAsync = executions + /** Retrieve instrument analytics, market data, news, and related reference data. */ override fun instrumentData(): InstrumentDataServiceAsync = instrumentData @@ -111,6 +119,10 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO CalendarServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val executions: ExecutionServiceAsync.WithRawResponse by lazy { + ExecutionServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + private val instrumentData: InstrumentDataServiceAsync.WithRawResponse by lazy { InstrumentDataServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -155,6 +167,8 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** Access clocks and financial calendars for market sessions and events. */ override fun calendar(): CalendarServiceAsync.WithRawResponse = calendar + override fun executions(): ExecutionServiceAsync.WithRawResponse = executions + /** Retrieve instrument analytics, market data, news, and related reference data. */ override fun instrumentData(): InstrumentDataServiceAsync.WithRawResponse = instrumentData diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsync.kt new file mode 100644 index 00000000..aff36a4c --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsync.kt @@ -0,0 +1,36 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.async.v1 + +import com.clear_street.api.core.ClientOptions +import java.util.function.Consumer + +interface ExecutionServiceAsync { + + /** + * 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): ExecutionServiceAsync + + /** + * A view of [ExecutionServiceAsync] 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 + ): ExecutionServiceAsync.WithRawResponse + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsyncImpl.kt new file mode 100644 index 00000000..08279194 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsyncImpl.kt @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.async.v1 + +import com.clear_street.api.core.ClientOptions +import java.util.function.Consumer + +class ExecutionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ExecutionServiceAsync { + + private val withRawResponse: ExecutionServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): ExecutionServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): ExecutionServiceAsync = + ExecutionServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + ExecutionServiceAsync.WithRawResponse { + + override fun withOptions( + modifier: Consumer + ): ExecutionServiceAsync.WithRawResponse = + ExecutionServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt index b49d75d3..1642420b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt @@ -9,6 +9,8 @@ import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams +import com.clear_street.api.models.v1.orders.OrderGetExecutionsResponse import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse import com.clear_street.api.models.v1.orders.OrderGetOrdersParams @@ -100,6 +102,46 @@ interface OrderServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** + * Retrieves filled and partially-filled execution reports for the specified trading account, + * ordered by transaction time (nanosecond precision) descending. + */ + fun getExecutions(accountId: Long): CompletableFuture = + getExecutions(accountId, OrderGetExecutionsParams.none()) + + /** @see getExecutions */ + fun getExecutions( + accountId: Long, + params: OrderGetExecutionsParams = OrderGetExecutionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getExecutions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getExecutions */ + fun getExecutions( + accountId: Long, + params: OrderGetExecutionsParams = OrderGetExecutionsParams.none(), + ): CompletableFuture = + getExecutions(accountId, params, RequestOptions.none()) + + /** @see getExecutions */ + fun getExecutions( + params: OrderGetExecutionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getExecutions */ + fun getExecutions( + params: OrderGetExecutionsParams + ): CompletableFuture = getExecutions(params, RequestOptions.none()) + + /** @see getExecutions */ + fun getExecutions( + accountId: Long, + requestOptions: RequestOptions, + ): CompletableFuture = + getExecutions(accountId, OrderGetExecutionsParams.none(), requestOptions) + /** Get Order By ID */ fun getOrderById( orderId: String, @@ -299,6 +341,49 @@ interface OrderServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> + /** + * Returns a raw HTTP response for `get /v1/accounts/{account_id}/executions`, but is + * otherwise the same as [OrderServiceAsync.getExecutions]. + */ + fun getExecutions( + accountId: Long + ): CompletableFuture> = + getExecutions(accountId, OrderGetExecutionsParams.none()) + + /** @see getExecutions */ + fun getExecutions( + accountId: Long, + params: OrderGetExecutionsParams = OrderGetExecutionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getExecutions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getExecutions */ + fun getExecutions( + accountId: Long, + params: OrderGetExecutionsParams = OrderGetExecutionsParams.none(), + ): CompletableFuture> = + getExecutions(accountId, params, RequestOptions.none()) + + /** @see getExecutions */ + fun getExecutions( + params: OrderGetExecutionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getExecutions */ + fun getExecutions( + params: OrderGetExecutionsParams + ): CompletableFuture> = + getExecutions(params, RequestOptions.none()) + + /** @see getExecutions */ + fun getExecutions( + accountId: Long, + requestOptions: RequestOptions, + ): CompletableFuture> = + getExecutions(accountId, OrderGetExecutionsParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /v1/accounts/{account_id}/orders/{order_id}`, but is * otherwise the same as [OrderServiceAsync.getOrderById]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt index 58af578e..a08890cb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt @@ -20,6 +20,8 @@ import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams +import com.clear_street.api.models.v1.orders.OrderGetExecutionsResponse import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse import com.clear_street.api.models.v1.orders.OrderGetOrdersParams @@ -59,6 +61,13 @@ class OrderServiceAsyncImpl internal constructor(private val clientOptions: Clie // delete /v1/accounts/{account_id}/orders/{order_id} withRawResponse().cancelOpenOrder(params, requestOptions).thenApply { it.parse() } + override fun getExecutions( + params: OrderGetExecutionsParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/accounts/{account_id}/executions + withRawResponse().getExecutions(params, requestOptions).thenApply { it.parse() } + override fun getOrderById( params: OrderGetOrderByIdParams, requestOptions: RequestOptions, @@ -174,6 +183,39 @@ class OrderServiceAsyncImpl internal constructor(private val clientOptions: Clie } } + private val getExecutionsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getExecutions( + params: OrderGetExecutionsParams, + 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), "executions") + .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 { getExecutionsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val getOrderByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt index 978a88f8..0d65c076 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt @@ -6,6 +6,7 @@ import com.clear_street.api.core.ClientOptions import com.clear_street.api.services.blocking.v1.AccountService import com.clear_street.api.services.blocking.v1.ApiVersionService import com.clear_street.api.services.blocking.v1.CalendarService +import com.clear_street.api.services.blocking.v1.ExecutionService import com.clear_street.api.services.blocking.v1.InstrumentDataService import com.clear_street.api.services.blocking.v1.InstrumentService import com.clear_street.api.services.blocking.v1.OmniAiService @@ -38,6 +39,8 @@ interface V1Service { /** Access clocks and financial calendars for market sessions and events. */ fun calendar(): CalendarService + fun executions(): ExecutionService + /** Retrieve instrument analytics, market data, news, and related reference data. */ fun instrumentData(): InstrumentDataService @@ -77,6 +80,8 @@ interface V1Service { /** Access clocks and financial calendars for market sessions and events. */ fun calendar(): CalendarService.WithRawResponse + fun executions(): ExecutionService.WithRawResponse + /** Retrieve instrument analytics, market data, news, and related reference data. */ fun instrumentData(): InstrumentDataService.WithRawResponse diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt index c27db079..7608aa32 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt @@ -9,6 +9,8 @@ import com.clear_street.api.services.blocking.v1.ApiVersionService import com.clear_street.api.services.blocking.v1.ApiVersionServiceImpl import com.clear_street.api.services.blocking.v1.CalendarService import com.clear_street.api.services.blocking.v1.CalendarServiceImpl +import com.clear_street.api.services.blocking.v1.ExecutionService +import com.clear_street.api.services.blocking.v1.ExecutionServiceImpl import com.clear_street.api.services.blocking.v1.InstrumentDataService import com.clear_street.api.services.blocking.v1.InstrumentDataServiceImpl import com.clear_street.api.services.blocking.v1.InstrumentService @@ -37,6 +39,8 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption private val calendar: CalendarService by lazy { CalendarServiceImpl(clientOptions) } + private val executions: ExecutionService by lazy { ExecutionServiceImpl(clientOptions) } + private val instrumentData: InstrumentDataService by lazy { InstrumentDataServiceImpl(clientOptions) } @@ -67,6 +71,8 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** Access clocks and financial calendars for market sessions and events. */ override fun calendar(): CalendarService = calendar + override fun executions(): ExecutionService = executions + /** Retrieve instrument analytics, market data, news, and related reference data. */ override fun instrumentData(): InstrumentDataService = instrumentData @@ -102,6 +108,10 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption CalendarServiceImpl.WithRawResponseImpl(clientOptions) } + private val executions: ExecutionService.WithRawResponse by lazy { + ExecutionServiceImpl.WithRawResponseImpl(clientOptions) + } + private val instrumentData: InstrumentDataService.WithRawResponse by lazy { InstrumentDataServiceImpl.WithRawResponseImpl(clientOptions) } @@ -146,6 +156,8 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** Access clocks and financial calendars for market sessions and events. */ override fun calendar(): CalendarService.WithRawResponse = calendar + override fun executions(): ExecutionService.WithRawResponse = executions + /** Retrieve instrument analytics, market data, news, and related reference data. */ override fun instrumentData(): InstrumentDataService.WithRawResponse = instrumentData diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionService.kt new file mode 100644 index 00000000..b91c5e59 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionService.kt @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1 + +import com.clear_street.api.core.ClientOptions +import java.util.function.Consumer + +interface ExecutionService { + + /** + * 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): ExecutionService + + /** A view of [ExecutionService] 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): ExecutionService.WithRawResponse + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionServiceImpl.kt new file mode 100644 index 00000000..918e5462 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionServiceImpl.kt @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.services.blocking.v1 + +import com.clear_street.api.core.ClientOptions +import java.util.function.Consumer + +class ExecutionServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ExecutionService { + + private val withRawResponse: ExecutionService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): ExecutionService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): ExecutionService = + ExecutionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + ExecutionService.WithRawResponse { + + override fun withOptions( + modifier: Consumer + ): ExecutionService.WithRawResponse = + ExecutionServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt index 97b6e5ac..b047bea2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt @@ -9,6 +9,8 @@ import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams +import com.clear_street.api.models.v1.orders.OrderGetExecutionsResponse import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse import com.clear_street.api.models.v1.orders.OrderGetOrdersParams @@ -96,6 +98,41 @@ interface OrderService { requestOptions: RequestOptions = RequestOptions.none(), ): OrderCancelOpenOrderResponse + /** + * Retrieves filled and partially-filled execution reports for the specified trading account, + * ordered by transaction time (nanosecond precision) descending. + */ + fun getExecutions(accountId: Long): OrderGetExecutionsResponse = + getExecutions(accountId, OrderGetExecutionsParams.none()) + + /** @see getExecutions */ + fun getExecutions( + accountId: Long, + params: OrderGetExecutionsParams = OrderGetExecutionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): OrderGetExecutionsResponse = + getExecutions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getExecutions */ + fun getExecutions( + accountId: Long, + params: OrderGetExecutionsParams = OrderGetExecutionsParams.none(), + ): OrderGetExecutionsResponse = getExecutions(accountId, params, RequestOptions.none()) + + /** @see getExecutions */ + fun getExecutions( + params: OrderGetExecutionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): OrderGetExecutionsResponse + + /** @see getExecutions */ + fun getExecutions(params: OrderGetExecutionsParams): OrderGetExecutionsResponse = + getExecutions(params, RequestOptions.none()) + + /** @see getExecutions */ + fun getExecutions(accountId: Long, requestOptions: RequestOptions): OrderGetExecutionsResponse = + getExecutions(accountId, OrderGetExecutionsParams.none(), requestOptions) + /** Get Order By ID */ fun getOrderById(orderId: String, params: OrderGetOrderByIdParams): OrderGetOrderByIdResponse = getOrderById(orderId, params, RequestOptions.none()) @@ -287,6 +324,53 @@ interface OrderService { requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + /** + * Returns a raw HTTP response for `get /v1/accounts/{account_id}/executions`, but is + * otherwise the same as [OrderService.getExecutions]. + */ + @MustBeClosed + fun getExecutions(accountId: Long): HttpResponseFor = + getExecutions(accountId, OrderGetExecutionsParams.none()) + + /** @see getExecutions */ + @MustBeClosed + fun getExecutions( + accountId: Long, + params: OrderGetExecutionsParams = OrderGetExecutionsParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getExecutions(params.toBuilder().accountId(accountId).build(), requestOptions) + + /** @see getExecutions */ + @MustBeClosed + fun getExecutions( + accountId: Long, + params: OrderGetExecutionsParams = OrderGetExecutionsParams.none(), + ): HttpResponseFor = + getExecutions(accountId, params, RequestOptions.none()) + + /** @see getExecutions */ + @MustBeClosed + fun getExecutions( + params: OrderGetExecutionsParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getExecutions */ + @MustBeClosed + fun getExecutions( + params: OrderGetExecutionsParams + ): HttpResponseFor = + getExecutions(params, RequestOptions.none()) + + /** @see getExecutions */ + @MustBeClosed + fun getExecutions( + accountId: Long, + requestOptions: RequestOptions, + ): HttpResponseFor = + getExecutions(accountId, OrderGetExecutionsParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /v1/accounts/{account_id}/orders/{order_id}`, but is * otherwise the same as [OrderService.getOrderById]. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt index 5e36e09d..c6fe8f0f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt @@ -20,6 +20,8 @@ import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams +import com.clear_street.api.models.v1.orders.OrderGetExecutionsResponse import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse import com.clear_street.api.models.v1.orders.OrderGetOrdersParams @@ -58,6 +60,13 @@ class OrderServiceImpl internal constructor(private val clientOptions: ClientOpt // delete /v1/accounts/{account_id}/orders/{order_id} withRawResponse().cancelOpenOrder(params, requestOptions).parse() + override fun getExecutions( + params: OrderGetExecutionsParams, + requestOptions: RequestOptions, + ): OrderGetExecutionsResponse = + // get /v1/accounts/{account_id}/executions + withRawResponse().getExecutions(params, requestOptions).parse() + override fun getOrderById( params: OrderGetOrderByIdParams, requestOptions: RequestOptions, @@ -167,6 +176,36 @@ class OrderServiceImpl internal constructor(private val clientOptions: ClientOpt } } + private val getExecutionsHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getExecutions( + params: OrderGetExecutionsParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // 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), "executions") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getExecutionsHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val getOrderByIdHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/executions/ExecutionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/executions/ExecutionTest.kt new file mode 100644 index 00000000..b2e34906 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/executions/ExecutionTest.kt @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.executions + +import com.clear_street.api.core.jsonMapper +import com.clear_street.api.models.v1.orders.Side +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ExecutionTest { + + @Test + fun create() { + val execution = + Execution.builder() + .id("019d216d-9857-7e23-ae01-edc07126c9e4") + .instrumentId("528ec5c3-cdbf-447c-b995-ec6c83cfbc02") + .orderId("01928b4d-c000-7000-8000-000000000001") + .price("150.25") + .quantity("100") + .side(Side.BUY) + .symbol("AAPL") + .transactionTime(OffsetDateTime.parse("2026-03-24T19:58:43.798000Z")) + .build() + + assertThat(execution.id()).isEqualTo("019d216d-9857-7e23-ae01-edc07126c9e4") + assertThat(execution.instrumentId()).isEqualTo("528ec5c3-cdbf-447c-b995-ec6c83cfbc02") + assertThat(execution.orderId()).isEqualTo("01928b4d-c000-7000-8000-000000000001") + assertThat(execution.price()).isEqualTo("150.25") + assertThat(execution.quantity()).isEqualTo("100") + assertThat(execution.side()).isEqualTo(Side.BUY) + assertThat(execution.symbol()).isEqualTo("AAPL") + assertThat(execution.transactionTime()) + .isEqualTo(OffsetDateTime.parse("2026-03-24T19:58:43.798000Z")) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val execution = + Execution.builder() + .id("019d216d-9857-7e23-ae01-edc07126c9e4") + .instrumentId("528ec5c3-cdbf-447c-b995-ec6c83cfbc02") + .orderId("01928b4d-c000-7000-8000-000000000001") + .price("150.25") + .quantity("100") + .side(Side.BUY) + .symbol("AAPL") + .transactionTime(OffsetDateTime.parse("2026-03-24T19:58:43.798000Z")) + .build() + + val roundtrippedExecution = + jsonMapper.readValue( + jsonMapper.writeValueAsString(execution), + jacksonTypeRef(), + ) + + assertThat(roundtrippedExecution).isEqualTo(execution) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParamsTest.kt new file mode 100644 index 00000000..fdbb15d2 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParamsTest.kt @@ -0,0 +1,67 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.orders + +import com.clear_street.api.core.http.QueryParams +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class OrderGetExecutionsParamsTest { + + @Test + fun create() { + OrderGetExecutionsParams.builder() + .accountId(0L) + .from(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .to(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + } + + @Test + fun pathParams() { + val params = OrderGetExecutionsParams.builder().accountId(0L).build() + + assertThat(params._pathParam(0)).isEqualTo("0") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun queryParams() { + val params = + OrderGetExecutionsParams.builder() + .accountId(0L) + .from(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .to(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("from", "2019-12-27T18:11:19.117Z") + .put("instrument_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put("page_size", "1") + .put("page_token", "U3RhaW5sZXNzIHJvY2tz") + .put("to", "2019-12-27T18:11:19.117Z") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = OrderGetExecutionsParams.builder().accountId(0L).build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt new file mode 100644 index 00000000..34c46dcb --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt @@ -0,0 +1,142 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.orders + +import com.clear_street.api.core.JsonValue +import com.clear_street.api.core.jsonMapper +import com.clear_street.api.models.ApiError +import com.clear_street.api.models.ResponseMetadata +import com.clear_street.api.models.v1.executions.Execution +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class OrderGetExecutionsResponseTest { + + @Test + fun create() { + val orderGetExecutionsResponse = + OrderGetExecutionsResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .addData( + Execution.builder() + .id("019d216d-9857-7e23-ae01-edc07126c9e4") + .instrumentId("528ec5c3-cdbf-447c-b995-ec6c83cfbc02") + .orderId("01928b4d-c000-7000-8000-000000000001") + .price("150.25") + .quantity("100") + .side(Side.BUY) + .symbol("AAPL") + .transactionTime(OffsetDateTime.parse("2026-03-24T19:58:43.798000Z")) + .build() + ) + .build() + + assertThat(orderGetExecutionsResponse.metadata()) + .isEqualTo( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + assertThat(orderGetExecutionsResponse.error()) + .contains( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + assertThat(orderGetExecutionsResponse.data()) + .containsExactly( + Execution.builder() + .id("019d216d-9857-7e23-ae01-edc07126c9e4") + .instrumentId("528ec5c3-cdbf-447c-b995-ec6c83cfbc02") + .orderId("01928b4d-c000-7000-8000-000000000001") + .price("150.25") + .quantity("100") + .side(Side.BUY) + .symbol("AAPL") + .transactionTime(OffsetDateTime.parse("2026-03-24T19:58:43.798000Z")) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val orderGetExecutionsResponse = + OrderGetExecutionsResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .addData( + Execution.builder() + .id("019d216d-9857-7e23-ae01-edc07126c9e4") + .instrumentId("528ec5c3-cdbf-447c-b995-ec6c83cfbc02") + .orderId("01928b4d-c000-7000-8000-000000000001") + .price("150.25") + .quantity("100") + .side(Side.BUY) + .symbol("AAPL") + .transactionTime(OffsetDateTime.parse("2026-03-24T19:58:43.798000Z")) + .build() + ) + .build() + + val roundtrippedOrderGetExecutionsResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(orderGetExecutionsResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedOrderGetExecutionsResponse).isEqualTo(orderGetExecutionsResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt index b9241d59..570bcd4e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt @@ -5,6 +5,7 @@ package com.clear_street.api.services.async.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams import com.clear_street.api.models.v1.orders.OrderGetOrdersParams import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams @@ -55,6 +56,28 @@ internal class OrderServiceAsyncTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getExecutions() { + val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val orderServiceAsync = client.v1().orders() + + val responseFuture = + orderServiceAsync.getExecutions( + OrderGetExecutionsParams.builder() + .accountId(0L) + .from(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .to(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getOrderById() { diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt index 19806583..fab2ceb6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt @@ -5,6 +5,7 @@ package com.clear_street.api.services.blocking.v1 import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams import com.clear_street.api.models.v1.orders.OrderGetOrdersParams import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams @@ -53,6 +54,27 @@ internal class OrderServiceTest { response.validate() } + @Disabled("Mock server tests are disabled") + @Test + fun getExecutions() { + val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val orderService = client.v1().orders() + + val response = + orderService.getExecutions( + OrderGetExecutionsParams.builder() + .accountId(0L) + .from(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .to(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + + response.validate() + } + @Disabled("Mock server tests are disabled") @Test fun getOrderById() { From ad4fdeeab858de30694e70533c9df67581cd7772 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 20:09:28 +0000 Subject: [PATCH 18/51] feat(api): api update --- .stats.yml | 4 ++-- README.md | 2 +- .../api/client/okhttp/ClearStreetOkHttpClient.kt | 6 +++--- .../api/client/okhttp/ClearStreetOkHttpClientAsync.kt | 6 +++--- .../kotlin/com/clear_street/api/core/ClientOptions.kt | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index a43ed7b5..d84e34e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-cc5e22d3d2366de648059352cdc55ddc45040a9f5cfee082acd41aaff474625a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-182a9335eababf2a9bd575e8cc15bd15d37f2eabf073816096ed68a4e61ea34e.yml openapi_spec_hash: b70cddc271d78227a69687aebb585fbf -config_hash: 4af8059a4651858910b86c8602594cf1 +config_hash: 0331c3de08993c40b93ae7bfbe1f2c37 diff --git a/README.md b/README.md index ccea62ea..4fe2bae5 100644 --- a/README.md +++ b/README.md @@ -427,7 +427,7 @@ import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient; ClearStreetClient client = ClearStreetOkHttpClient.builder() .fromEnv() - .staging() + .dev() .apiKey("My API Key") .build(); ``` 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/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt index a9a07ffa..9ccb92b3 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/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt @@ -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/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt index 5ed081c5..bbbfbb19 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/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt @@ -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-core/src/main/kotlin/com/clear_street/api/core/ClientOptions.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ClientOptions.kt index 2ba89687..e481c94c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ClientOptions.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ClientOptions.kt @@ -120,7 +120,7 @@ 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(): String = baseUrl ?: PRODUCTION_URL @@ -133,7 +133,7 @@ private constructor( const val PRODUCTION_URL = "https://api.clearstreet.com" - const val STAGING_URL = "https://oems-api-gw.dev-public.clst.co" + const val DEV_URL = "https://api-dev.clearstreet.com" /** * Returns a mutable builder for constructing an instance of [ClientOptions]. @@ -243,15 +243,15 @@ 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 { this.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() = baseUrl(STAGING_URL) + /** Sets [baseUrl] to `https://api-dev.clearstreet.com`. */ + fun dev() = baseUrl(DEV_URL) /** * Whether to call `validate` on every response before returning it. From b3524d440072d92f11a660228d50224568fe63a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 21:50:41 +0000 Subject: [PATCH 19/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/instruments/Instrument.kt | 44 ++++++++++++++++++- .../models/v1/instruments/InstrumentCore.kt | 44 ++++++++++++++++++- .../InstrumentGetInstrumentsParams.kt | 25 ++++++++++- .../InstrumentSearchInstrumentsParams.kt | 30 ++++++++++++- .../v1/instruments/InstrumentCoreTest.kt | 3 ++ ...InstrumentGetInstrumentByIdResponseTest.kt | 3 ++ .../InstrumentGetInstrumentsParamsTest.kt | 3 ++ .../InstrumentGetInstrumentsResponseTest.kt | 3 ++ .../InstrumentSearchInstrumentsParamsTest.kt | 3 ++ ...InstrumentSearchInstrumentsResponseTest.kt | 3 ++ .../models/v1/instruments/InstrumentTest.kt | 3 ++ .../v1/watchlist/WatchlistDetailTest.kt | 3 ++ .../WatchlistGetWatchlistByIdResponseTest.kt | 3 ++ .../v1/watchlist/WatchlistItemEntryTest.kt | 3 ++ .../async/v1/InstrumentServiceAsyncTest.kt | 2 + .../blocking/v1/InstrumentServiceTest.kt | 2 + 17 files changed, 175 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index d84e34e0..0fc72eb3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-182a9335eababf2a9bd575e8cc15bd15d37f2eabf073816096ed68a4e61ea34e.yml -openapi_spec_hash: b70cddc271d78227a69687aebb585fbf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-be17b02aba531f029b55604de8bd15b799d59d74b73fe4fc4fec16f47e8d2a48.yml +openapi_spec_hash: a681d0cdd57da1cf7912d16efbb03da4 config_hash: 0331c3de08993c40b93ae7bfbe1f2c37 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt index 93a6adf2..cdf81172 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt @@ -32,6 +32,7 @@ private constructor( private val isFractionable: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, + private val isPtp: JsonField, private val isRestricted: JsonField, private val isShortProhibited: JsonField, private val isThresholdSecurity: JsonField, @@ -70,6 +71,7 @@ private constructor( @JsonProperty("is_marginable") @ExcludeMissing isMarginable: JsonField = JsonMissing.of(), + @JsonProperty("is_ptp") @ExcludeMissing isPtp: JsonField = JsonMissing.of(), @JsonProperty("is_restricted") @ExcludeMissing isRestricted: JsonField = JsonMissing.of(), @@ -116,6 +118,7 @@ private constructor( isFractionable, isLiquidationOnly, isMarginable, + isPtp, isRestricted, isShortProhibited, isThresholdSecurity, @@ -191,6 +194,15 @@ private constructor( */ fun isMarginable(): Boolean = isMarginable.getRequired("is_marginable") + /** + * Indicates if the instrument is a publicly traded partnership (PTP). PTP sales are subject to + * a 10% withholding tax for non-US tax residents. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun isPtp(): Boolean = isPtp.getRequired("is_ptp") + /** * Indicates if the instrument is restricted from trading * @@ -383,6 +395,13 @@ private constructor( @ExcludeMissing fun _isMarginable(): JsonField = isMarginable + /** + * Returns the raw JSON value of [isPtp]. + * + * Unlike [isPtp], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("is_ptp") @ExcludeMissing fun _isPtp(): JsonField = isPtp + /** * Returns the raw JSON value of [isRestricted]. * @@ -544,6 +563,7 @@ private constructor( * .isFractionable() * .isLiquidationOnly() * .isMarginable() + * .isPtp() * .isRestricted() * .isShortProhibited() * .isThresholdSecurity() @@ -565,6 +585,7 @@ private constructor( private var isFractionable: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null + private var isPtp: JsonField? = null private var isRestricted: JsonField? = null private var isShortProhibited: JsonField? = null private var isThresholdSecurity: JsonField? = null @@ -592,6 +613,7 @@ private constructor( isFractionable = instrument.isFractionable isLiquidationOnly = instrument.isLiquidationOnly isMarginable = instrument.isMarginable + isPtp = instrument.isPtp isRestricted = instrument.isRestricted isShortProhibited = instrument.isShortProhibited isThresholdSecurity = instrument.isThresholdSecurity @@ -704,6 +726,20 @@ private constructor( this.isMarginable = isMarginable } + /** + * Indicates if the instrument is a publicly traded partnership (PTP). PTP sales are subject + * to a 10% withholding tax for non-US tax residents. + */ + fun isPtp(isPtp: Boolean) = isPtp(JsonField.of(isPtp)) + + /** + * Sets [Builder.isPtp] to an arbitrary JSON value. + * + * You should usually call [Builder.isPtp] with a well-typed [Boolean] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun isPtp(isPtp: JsonField) = apply { this.isPtp = isPtp } + /** Indicates if the instrument is restricted from trading */ fun isRestricted(isRestricted: Boolean) = isRestricted(JsonField.of(isRestricted)) @@ -1004,6 +1040,7 @@ private constructor( * .isFractionable() * .isLiquidationOnly() * .isMarginable() + * .isPtp() * .isRestricted() * .isShortProhibited() * .isThresholdSecurity() @@ -1023,6 +1060,7 @@ private constructor( checkRequired("isFractionable", isFractionable), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), + checkRequired("isPtp", isPtp), checkRequired("isRestricted", isRestricted), checkRequired("isShortProhibited", isShortProhibited), checkRequired("isThresholdSecurity", isThresholdSecurity), @@ -1065,6 +1103,7 @@ private constructor( isFractionable() isLiquidationOnly() isMarginable() + isPtp() isRestricted() isShortProhibited() isThresholdSecurity() @@ -1106,6 +1145,7 @@ private constructor( (if (isFractionable.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + + (if (isPtp.asKnown().isPresent) 1 else 0) + (if (isRestricted.asKnown().isPresent) 1 else 0) + (if (isShortProhibited.asKnown().isPresent) 1 else 0) + (if (isThresholdSecurity.asKnown().isPresent) 1 else 0) + @@ -1136,6 +1176,7 @@ private constructor( isFractionable == other.isFractionable && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && + isPtp == other.isPtp && isRestricted == other.isRestricted && isShortProhibited == other.isShortProhibited && isThresholdSecurity == other.isThresholdSecurity && @@ -1164,6 +1205,7 @@ private constructor( isFractionable, isLiquidationOnly, isMarginable, + isPtp, isRestricted, isShortProhibited, isThresholdSecurity, @@ -1187,5 +1229,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt index eff6fc94..4ef4d710 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt @@ -29,6 +29,7 @@ private constructor( private val isFractionable: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, + private val isPtp: JsonField, private val isRestricted: JsonField, private val isShortProhibited: JsonField, private val isThresholdSecurity: JsonField, @@ -66,6 +67,7 @@ private constructor( @JsonProperty("is_marginable") @ExcludeMissing isMarginable: JsonField = JsonMissing.of(), + @JsonProperty("is_ptp") @ExcludeMissing isPtp: JsonField = JsonMissing.of(), @JsonProperty("is_restricted") @ExcludeMissing isRestricted: JsonField = JsonMissing.of(), @@ -109,6 +111,7 @@ private constructor( isFractionable, isLiquidationOnly, isMarginable, + isPtp, isRestricted, isShortProhibited, isThresholdSecurity, @@ -183,6 +186,15 @@ private constructor( */ fun isMarginable(): Boolean = isMarginable.getRequired("is_marginable") + /** + * Indicates if the instrument is a publicly traded partnership (PTP). PTP sales are subject to + * a 10% withholding tax for non-US tax residents. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun isPtp(): Boolean = isPtp.getRequired("is_ptp") + /** * Indicates if the instrument is restricted from trading * @@ -365,6 +377,13 @@ private constructor( @ExcludeMissing fun _isMarginable(): JsonField = isMarginable + /** + * Returns the raw JSON value of [isPtp]. + * + * Unlike [isPtp], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("is_ptp") @ExcludeMissing fun _isPtp(): JsonField = isPtp + /** * Returns the raw JSON value of [isRestricted]. * @@ -516,6 +535,7 @@ private constructor( * .isFractionable() * .isLiquidationOnly() * .isMarginable() + * .isPtp() * .isRestricted() * .isShortProhibited() * .isThresholdSecurity() @@ -537,6 +557,7 @@ private constructor( private var isFractionable: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null + private var isPtp: JsonField? = null private var isRestricted: JsonField? = null private var isShortProhibited: JsonField? = null private var isThresholdSecurity: JsonField? = null @@ -563,6 +584,7 @@ private constructor( isFractionable = instrumentCore.isFractionable isLiquidationOnly = instrumentCore.isLiquidationOnly isMarginable = instrumentCore.isMarginable + isPtp = instrumentCore.isPtp isRestricted = instrumentCore.isRestricted isShortProhibited = instrumentCore.isShortProhibited isThresholdSecurity = instrumentCore.isThresholdSecurity @@ -674,6 +696,20 @@ private constructor( this.isMarginable = isMarginable } + /** + * Indicates if the instrument is a publicly traded partnership (PTP). PTP sales are subject + * to a 10% withholding tax for non-US tax residents. + */ + fun isPtp(isPtp: Boolean) = isPtp(JsonField.of(isPtp)) + + /** + * Sets [Builder.isPtp] to an arbitrary JSON value. + * + * You should usually call [Builder.isPtp] with a well-typed [Boolean] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun isPtp(isPtp: JsonField) = apply { this.isPtp = isPtp } + /** Indicates if the instrument is restricted from trading */ fun isRestricted(isRestricted: Boolean) = isRestricted(JsonField.of(isRestricted)) @@ -938,6 +974,7 @@ private constructor( * .isFractionable() * .isLiquidationOnly() * .isMarginable() + * .isPtp() * .isRestricted() * .isShortProhibited() * .isThresholdSecurity() @@ -957,6 +994,7 @@ private constructor( checkRequired("isFractionable", isFractionable), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), + checkRequired("isPtp", isPtp), checkRequired("isRestricted", isRestricted), checkRequired("isShortProhibited", isShortProhibited), checkRequired("isThresholdSecurity", isThresholdSecurity), @@ -998,6 +1036,7 @@ private constructor( isFractionable() isLiquidationOnly() isMarginable() + isPtp() isRestricted() isShortProhibited() isThresholdSecurity() @@ -1038,6 +1077,7 @@ private constructor( (if (isFractionable.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + + (if (isPtp.asKnown().isPresent) 1 else 0) + (if (isRestricted.asKnown().isPresent) 1 else 0) + (if (isShortProhibited.asKnown().isPresent) 1 else 0) + (if (isThresholdSecurity.asKnown().isPresent) 1 else 0) + @@ -1067,6 +1107,7 @@ private constructor( isFractionable == other.isFractionable && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && + isPtp == other.isPtp && isRestricted == other.isRestricted && isShortProhibited == other.isShortProhibited && isThresholdSecurity == other.isThresholdSecurity && @@ -1094,6 +1135,7 @@ private constructor( isFractionable, isLiquidationOnly, isMarginable, + isPtp, isRestricted, isShortProhibited, isThresholdSecurity, @@ -1116,5 +1158,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt index 30292ce3..c98d9f5a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt @@ -22,6 +22,7 @@ private constructor( private val instrumentType: InstrumentType?, private val isLiquidationOnly: Boolean?, private val isMarginable: Boolean?, + private val isPtp: Boolean?, private val isRestricted: Boolean?, private val isShortProhibited: Boolean?, private val isThresholdSecurity: Boolean?, @@ -50,6 +51,9 @@ private constructor( /** Filter by marginable status */ fun isMarginable(): Optional = Optional.ofNullable(isMarginable) + /** Filter by publicly traded partnership (PTP) status */ + fun isPtp(): Optional = Optional.ofNullable(isPtp) + /** Filter by restricted status */ fun isRestricted(): Optional = Optional.ofNullable(isRestricted) @@ -95,6 +99,7 @@ private constructor( private var instrumentType: InstrumentType? = null private var isLiquidationOnly: Boolean? = null private var isMarginable: Boolean? = null + private var isPtp: Boolean? = null private var isRestricted: Boolean? = null private var isShortProhibited: Boolean? = null private var isThresholdSecurity: Boolean? = null @@ -110,6 +115,7 @@ private constructor( instrumentType = instrumentGetInstrumentsParams.instrumentType isLiquidationOnly = instrumentGetInstrumentsParams.isLiquidationOnly isMarginable = instrumentGetInstrumentsParams.isMarginable + isPtp = instrumentGetInstrumentsParams.isPtp isRestricted = instrumentGetInstrumentsParams.isRestricted isShortProhibited = instrumentGetInstrumentsParams.isShortProhibited isThresholdSecurity = instrumentGetInstrumentsParams.isThresholdSecurity @@ -193,6 +199,19 @@ private constructor( /** Alias for calling [Builder.isMarginable] with `isMarginable.orElse(null)`. */ fun isMarginable(isMarginable: Optional) = isMarginable(isMarginable.getOrNull()) + /** Filter by publicly traded partnership (PTP) status */ + fun isPtp(isPtp: Boolean?) = apply { this.isPtp = isPtp } + + /** + * Alias for [Builder.isPtp]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun isPtp(isPtp: Boolean) = isPtp(isPtp as Boolean?) + + /** Alias for calling [Builder.isPtp] with `isPtp.orElse(null)`. */ + fun isPtp(isPtp: Optional) = isPtp(isPtp.getOrNull()) + /** Filter by restricted status */ fun isRestricted(isRestricted: Boolean?) = apply { this.isRestricted = isRestricted } @@ -374,6 +393,7 @@ private constructor( instrumentType, isLiquidationOnly, isMarginable, + isPtp, isRestricted, isShortProhibited, isThresholdSecurity, @@ -394,6 +414,7 @@ private constructor( instrumentType?.let { put("instrument_type", it.toString()) } isLiquidationOnly?.let { put("is_liquidation_only", it.toString()) } isMarginable?.let { put("is_marginable", it.toString()) } + isPtp?.let { put("is_ptp", it.toString()) } isRestricted?.let { put("is_restricted", it.toString()) } isShortProhibited?.let { put("is_short_prohibited", it.toString()) } isThresholdSecurity?.let { put("is_threshold_security", it.toString()) } @@ -577,6 +598,7 @@ private constructor( instrumentType == other.instrumentType && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && + isPtp == other.isPtp && isRestricted == other.isRestricted && isShortProhibited == other.isShortProhibited && isThresholdSecurity == other.isThresholdSecurity && @@ -593,6 +615,7 @@ private constructor( instrumentType, isLiquidationOnly, isMarginable, + isPtp, isRestricted, isShortProhibited, isThresholdSecurity, @@ -603,5 +626,5 @@ private constructor( ) override fun toString() = - "InstrumentGetInstrumentsParams{easyToBorrow=$easyToBorrow, instrumentIds=$instrumentIds, instrumentType=$instrumentType, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentGetInstrumentsParams{easyToBorrow=$easyToBorrow, instrumentIds=$instrumentIds, instrumentType=$instrumentType, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt index 128b34b1..6cb54caf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt @@ -28,6 +28,7 @@ private constructor( private val country: String?, private val currency: String?, private val includeInactive: Boolean?, + private val includePtp: Boolean?, private val includeRestricted: Boolean?, private val pageSize: Long?, private val pageToken: String?, @@ -54,6 +55,11 @@ private constructor( /** Include inactive instruments. Default false. */ fun includeInactive(): Optional = Optional.ofNullable(includeInactive) + /** + * Include publicly traded partnership (PTP) instruments. Default true (penalized in ranking). + */ + fun includePtp(): Optional = Optional.ofNullable(includePtp) + /** Include restricted instruments. Default true (penalized in ranking). */ fun includeRestricted(): Optional = Optional.ofNullable(includeRestricted) @@ -96,6 +102,7 @@ private constructor( private var country: String? = null private var currency: String? = null private var includeInactive: Boolean? = null + private var includePtp: Boolean? = null private var includeRestricted: Boolean? = null private var pageSize: Long? = null private var pageToken: String? = null @@ -110,6 +117,7 @@ private constructor( country = instrumentSearchInstrumentsParams.country currency = instrumentSearchInstrumentsParams.currency includeInactive = instrumentSearchInstrumentsParams.includeInactive + includePtp = instrumentSearchInstrumentsParams.includePtp includeRestricted = instrumentSearchInstrumentsParams.includeRestricted pageSize = instrumentSearchInstrumentsParams.pageSize pageToken = instrumentSearchInstrumentsParams.pageToken @@ -161,6 +169,22 @@ private constructor( fun includeInactive(includeInactive: Optional) = includeInactive(includeInactive.getOrNull()) + /** + * Include publicly traded partnership (PTP) instruments. Default true (penalized in + * ranking). + */ + fun includePtp(includePtp: Boolean?) = apply { this.includePtp = includePtp } + + /** + * Alias for [Builder.includePtp]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun includePtp(includePtp: Boolean) = includePtp(includePtp as Boolean?) + + /** Alias for calling [Builder.includePtp] with `includePtp.orElse(null)`. */ + fun includePtp(includePtp: Optional) = includePtp(includePtp.getOrNull()) + /** Include restricted instruments. Default true (penalized in ranking). */ fun includeRestricted(includeRestricted: Boolean?) = apply { this.includeRestricted = includeRestricted @@ -317,6 +341,7 @@ private constructor( country, currency, includeInactive, + includePtp, includeRestricted, pageSize, pageToken, @@ -335,6 +360,7 @@ private constructor( country?.let { put("country", it) } currency?.let { put("currency", it) } includeInactive?.let { put("include_inactive", it.toString()) } + includePtp?.let { put("include_ptp", it.toString()) } includeRestricted?.let { put("include_restricted", it.toString()) } pageSize?.let { put("page_size", it.toString()) } pageToken?.let { put("page_token", it) } @@ -353,6 +379,7 @@ private constructor( country == other.country && currency == other.currency && includeInactive == other.includeInactive && + includePtp == other.includePtp && includeRestricted == other.includeRestricted && pageSize == other.pageSize && pageToken == other.pageToken && @@ -367,6 +394,7 @@ private constructor( country, currency, includeInactive, + includePtp, includeRestricted, pageSize, pageToken, @@ -375,5 +403,5 @@ private constructor( ) override fun toString() = - "InstrumentSearchInstrumentsParams{q=$q, assetClass=$assetClass, country=$country, currency=$currency, includeInactive=$includeInactive, includeRestricted=$includeRestricted, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentSearchInstrumentsParams{q=$q, assetClass=$assetClass, country=$country, currency=$currency, includeInactive=$includeInactive, includePtp=$includePtp, includeRestricted=$includeRestricted, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt index 5376c195..7c528e30 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt @@ -22,6 +22,7 @@ internal class InstrumentCoreTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -46,6 +47,7 @@ internal class InstrumentCoreTest { assertThat(instrumentCore.isFractionable()).isEqualTo(false) assertThat(instrumentCore.isLiquidationOnly()).isEqualTo(false) assertThat(instrumentCore.isMarginable()).isEqualTo(true) + assertThat(instrumentCore.isPtp()).isEqualTo(false) assertThat(instrumentCore.isRestricted()).isEqualTo(false) assertThat(instrumentCore.isShortProhibited()).isEqualTo(false) assertThat(instrumentCore.isThresholdSecurity()).isEqualTo(false) @@ -75,6 +77,7 @@ internal class InstrumentCoreTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index ffaac209..760854db 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -48,6 +48,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -101,6 +102,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -156,6 +158,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt index 35c79816..32fa9f19 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt @@ -16,6 +16,7 @@ internal class InstrumentGetInstrumentsParamsTest { .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) + .isPtp(true) .isRestricted(true) .isShortProhibited(true) .isThresholdSecurity(true) @@ -33,6 +34,7 @@ internal class InstrumentGetInstrumentsParamsTest { .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) + .isPtp(true) .isRestricted(true) .isShortProhibited(true) .isThresholdSecurity(true) @@ -50,6 +52,7 @@ internal class InstrumentGetInstrumentsParamsTest { .put("instrument_type", "COMMON_STOCK") .put("is_liquidation_only", "true") .put("is_marginable", "true") + .put("is_ptp", "true") .put("is_restricted", "true") .put("is_short_prohibited", "true") .put("is_threshold_security", "true") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index 4ba23190..fa1d655f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -48,6 +48,7 @@ internal class InstrumentGetInstrumentsResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -100,6 +101,7 @@ internal class InstrumentGetInstrumentsResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -154,6 +156,7 @@ internal class InstrumentGetInstrumentsResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt index 3245ec77..87e17fe2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt @@ -16,6 +16,7 @@ internal class InstrumentSearchInstrumentsParamsTest { .country("country") .currency("currency") .includeInactive(true) + .includePtp(true) .includeRestricted(true) .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") @@ -31,6 +32,7 @@ internal class InstrumentSearchInstrumentsParamsTest { .country("country") .currency("currency") .includeInactive(true) + .includePtp(true) .includeRestricted(true) .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") @@ -46,6 +48,7 @@ internal class InstrumentSearchInstrumentsParamsTest { .put("country", "country") .put("currency", "currency") .put("include_inactive", "true") + .put("include_ptp", "true") .put("include_restricted", "true") .put("page_size", "1") .put("page_token", "U3RhaW5sZXNzIHJvY2tz") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index 2bed08ce..660c7453 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -48,6 +48,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -100,6 +101,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -154,6 +156,7 @@ internal class InstrumentSearchInstrumentsResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt index 6d504fde..7debd1b7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt @@ -23,6 +23,7 @@ internal class InstrumentTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -48,6 +49,7 @@ internal class InstrumentTest { assertThat(instrument.isFractionable()).isEqualTo(false) assertThat(instrument.isLiquidationOnly()).isEqualTo(false) assertThat(instrument.isMarginable()).isEqualTo(true) + assertThat(instrument.isPtp()).isEqualTo(false) assertThat(instrument.isRestricted()).isEqualTo(false) assertThat(instrument.isShortProhibited()).isEqualTo(false) assertThat(instrument.isThresholdSecurity()).isEqualTo(false) @@ -79,6 +81,7 @@ internal class InstrumentTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt index f364f353..3328cf7e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -33,6 +33,7 @@ internal class WatchlistDetailTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -74,6 +75,7 @@ internal class WatchlistDetailTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -118,6 +120,7 @@ internal class WatchlistDetailTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index 1998b558..8b2b2b1d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -59,6 +59,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -126,6 +127,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -195,6 +197,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt index 66c7f641..0428a3fb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -29,6 +29,7 @@ internal class WatchlistItemEntryTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -63,6 +64,7 @@ internal class WatchlistItemEntryTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) @@ -100,6 +102,7 @@ internal class WatchlistItemEntryTest { .isFractionable(false) .isLiquidationOnly(false) .isMarginable(true) + .isPtp(false) .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt index ababb83d..8967abfd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt @@ -46,6 +46,7 @@ internal class InstrumentServiceAsyncTest { .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) + .isPtp(true) .isRestricted(true) .isShortProhibited(true) .isThresholdSecurity(true) @@ -94,6 +95,7 @@ internal class InstrumentServiceAsyncTest { .country("country") .currency("currency") .includeInactive(true) + .includePtp(true) .includeRestricted(true) .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt index 7dfaacc6..3c3ee1de 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt @@ -45,6 +45,7 @@ internal class InstrumentServiceTest { .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) + .isPtp(true) .isRestricted(true) .isShortProhibited(true) .isThresholdSecurity(true) @@ -91,6 +92,7 @@ internal class InstrumentServiceTest { .country("country") .currency("currency") .includeInactive(true) + .includePtp(true) .includeRestricted(true) .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") From f8a8d67031fd0f332f7123300864f35aa1f9bd18 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 10:58:39 +0000 Subject: [PATCH 20/51] feat(api): api update --- .stats.yml | 4 +-- .../v1/{executions => orders}/Execution.kt | 3 +- .../v1/orders/OrderGetExecutionsResponse.kt | 1 - .../api/services/async/V1ServiceAsync.kt | 5 --- .../api/services/async/V1ServiceAsyncImpl.kt | 14 -------- .../async/v1/ExecutionServiceAsync.kt | 36 ------------------- .../async/v1/ExecutionServiceAsyncImpl.kt | 30 ---------------- .../api/services/blocking/V1Service.kt | 5 --- .../api/services/blocking/V1ServiceImpl.kt | 12 ------- .../services/blocking/v1/ExecutionService.kt | 32 ----------------- .../blocking/v1/ExecutionServiceImpl.kt | 30 ---------------- .../{executions => orders}/ExecutionTest.kt | 3 +- .../orders/OrderGetExecutionsResponseTest.kt | 1 - 13 files changed, 4 insertions(+), 172 deletions(-) rename clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/{executions => orders}/Execution.kt (99%) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionServiceImpl.kt rename clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/{executions => orders}/ExecutionTest.kt (95%) diff --git a/.stats.yml b/.stats.yml index 0fc72eb3..f2205915 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-be17b02aba531f029b55604de8bd15b799d59d74b73fe4fc4fec16f47e8d2a48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-f7a05c1ba96e1c7f6316d23c15822bc5f73c8323fbe57ce568b1cf0b2af70ce9.yml openapi_spec_hash: a681d0cdd57da1cf7912d16efbb03da4 -config_hash: 0331c3de08993c40b93ae7bfbe1f2c37 +config_hash: 5e9e1da75241e5697705b03d38f8f5d9 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/executions/Execution.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Execution.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/executions/Execution.kt rename to clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Execution.kt index 790a6ba6..5d8904c7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/executions/Execution.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Execution.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.executions +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.ExcludeMissing import com.clear_street.api.core.JsonField @@ -8,7 +8,6 @@ import com.clear_street.api.core.JsonMissing import com.clear_street.api.core.JsonValue import com.clear_street.api.core.checkRequired import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.orders.Side import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt index 535234cc..c1ad4014 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt @@ -13,7 +13,6 @@ import com.clear_street.api.errors.ClearStreetInvalidDataException import com.clear_street.api.models.ApiError import com.clear_street.api.models.BaseResponse import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.executions.Execution import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator 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 index e53dfe77..49d97fe6 100644 --- 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 @@ -6,7 +6,6 @@ import com.clear_street.api.core.ClientOptions import com.clear_street.api.services.async.v1.AccountServiceAsync import com.clear_street.api.services.async.v1.ApiVersionServiceAsync import com.clear_street.api.services.async.v1.CalendarServiceAsync -import com.clear_street.api.services.async.v1.ExecutionServiceAsync import com.clear_street.api.services.async.v1.InstrumentDataServiceAsync import com.clear_street.api.services.async.v1.InstrumentServiceAsync import com.clear_street.api.services.async.v1.OmniAiServiceAsync @@ -39,8 +38,6 @@ interface V1ServiceAsync { /** Access clocks and financial calendars for market sessions and events. */ fun calendar(): CalendarServiceAsync - fun executions(): ExecutionServiceAsync - /** Retrieve instrument analytics, market data, news, and related reference data. */ fun instrumentData(): InstrumentDataServiceAsync @@ -80,8 +77,6 @@ interface V1ServiceAsync { /** Access clocks and financial calendars for market sessions and events. */ fun calendar(): CalendarServiceAsync.WithRawResponse - fun executions(): ExecutionServiceAsync.WithRawResponse - /** Retrieve instrument analytics, market data, news, and related reference data. */ fun instrumentData(): InstrumentDataServiceAsync.WithRawResponse 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 index 44b12612..c6b8265c 100644 --- 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 @@ -9,8 +9,6 @@ import com.clear_street.api.services.async.v1.ApiVersionServiceAsync import com.clear_street.api.services.async.v1.ApiVersionServiceAsyncImpl 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.ExecutionServiceAsync -import com.clear_street.api.services.async.v1.ExecutionServiceAsyncImpl import com.clear_street.api.services.async.v1.InstrumentDataServiceAsync import com.clear_street.api.services.async.v1.InstrumentDataServiceAsyncImpl import com.clear_street.api.services.async.v1.InstrumentServiceAsync @@ -42,10 +40,6 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO private val calendar: CalendarServiceAsync by lazy { CalendarServiceAsyncImpl(clientOptions) } - private val executions: ExecutionServiceAsync by lazy { - ExecutionServiceAsyncImpl(clientOptions) - } - private val instrumentData: InstrumentDataServiceAsync by lazy { InstrumentDataServiceAsyncImpl(clientOptions) } @@ -82,8 +76,6 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** Access clocks and financial calendars for market sessions and events. */ override fun calendar(): CalendarServiceAsync = calendar - override fun executions(): ExecutionServiceAsync = executions - /** Retrieve instrument analytics, market data, news, and related reference data. */ override fun instrumentData(): InstrumentDataServiceAsync = instrumentData @@ -119,10 +111,6 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO CalendarServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val executions: ExecutionServiceAsync.WithRawResponse by lazy { - ExecutionServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - private val instrumentData: InstrumentDataServiceAsync.WithRawResponse by lazy { InstrumentDataServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -167,8 +155,6 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** Access clocks and financial calendars for market sessions and events. */ override fun calendar(): CalendarServiceAsync.WithRawResponse = calendar - override fun executions(): ExecutionServiceAsync.WithRawResponse = executions - /** Retrieve instrument analytics, market data, news, and related reference data. */ override fun instrumentData(): InstrumentDataServiceAsync.WithRawResponse = instrumentData diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsync.kt deleted file mode 100644 index aff36a4c..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsync.kt +++ /dev/null @@ -1,36 +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 java.util.function.Consumer - -interface ExecutionServiceAsync { - - /** - * 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): ExecutionServiceAsync - - /** - * A view of [ExecutionServiceAsync] 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 - ): ExecutionServiceAsync.WithRawResponse - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsyncImpl.kt deleted file mode 100644 index 08279194..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ExecutionServiceAsyncImpl.kt +++ /dev/null @@ -1,30 +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 java.util.function.Consumer - -class ExecutionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - ExecutionServiceAsync { - - private val withRawResponse: ExecutionServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): ExecutionServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): ExecutionServiceAsync = - ExecutionServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - ExecutionServiceAsync.WithRawResponse { - - override fun withOptions( - modifier: Consumer - ): ExecutionServiceAsync.WithRawResponse = - ExecutionServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt index 0d65c076..978a88f8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.ClientOptions import com.clear_street.api.services.blocking.v1.AccountService import com.clear_street.api.services.blocking.v1.ApiVersionService import com.clear_street.api.services.blocking.v1.CalendarService -import com.clear_street.api.services.blocking.v1.ExecutionService import com.clear_street.api.services.blocking.v1.InstrumentDataService import com.clear_street.api.services.blocking.v1.InstrumentService import com.clear_street.api.services.blocking.v1.OmniAiService @@ -39,8 +38,6 @@ interface V1Service { /** Access clocks and financial calendars for market sessions and events. */ fun calendar(): CalendarService - fun executions(): ExecutionService - /** Retrieve instrument analytics, market data, news, and related reference data. */ fun instrumentData(): InstrumentDataService @@ -80,8 +77,6 @@ interface V1Service { /** Access clocks and financial calendars for market sessions and events. */ fun calendar(): CalendarService.WithRawResponse - fun executions(): ExecutionService.WithRawResponse - /** Retrieve instrument analytics, market data, news, and related reference data. */ fun instrumentData(): InstrumentDataService.WithRawResponse diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt index 7608aa32..c27db079 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt @@ -9,8 +9,6 @@ import com.clear_street.api.services.blocking.v1.ApiVersionService import com.clear_street.api.services.blocking.v1.ApiVersionServiceImpl import com.clear_street.api.services.blocking.v1.CalendarService import com.clear_street.api.services.blocking.v1.CalendarServiceImpl -import com.clear_street.api.services.blocking.v1.ExecutionService -import com.clear_street.api.services.blocking.v1.ExecutionServiceImpl import com.clear_street.api.services.blocking.v1.InstrumentDataService import com.clear_street.api.services.blocking.v1.InstrumentDataServiceImpl import com.clear_street.api.services.blocking.v1.InstrumentService @@ -39,8 +37,6 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption private val calendar: CalendarService by lazy { CalendarServiceImpl(clientOptions) } - private val executions: ExecutionService by lazy { ExecutionServiceImpl(clientOptions) } - private val instrumentData: InstrumentDataService by lazy { InstrumentDataServiceImpl(clientOptions) } @@ -71,8 +67,6 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** Access clocks and financial calendars for market sessions and events. */ override fun calendar(): CalendarService = calendar - override fun executions(): ExecutionService = executions - /** Retrieve instrument analytics, market data, news, and related reference data. */ override fun instrumentData(): InstrumentDataService = instrumentData @@ -108,10 +102,6 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption CalendarServiceImpl.WithRawResponseImpl(clientOptions) } - private val executions: ExecutionService.WithRawResponse by lazy { - ExecutionServiceImpl.WithRawResponseImpl(clientOptions) - } - private val instrumentData: InstrumentDataService.WithRawResponse by lazy { InstrumentDataServiceImpl.WithRawResponseImpl(clientOptions) } @@ -156,8 +146,6 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** Access clocks and financial calendars for market sessions and events. */ override fun calendar(): CalendarService.WithRawResponse = calendar - override fun executions(): ExecutionService.WithRawResponse = executions - /** Retrieve instrument analytics, market data, news, and related reference data. */ override fun instrumentData(): InstrumentDataService.WithRawResponse = instrumentData diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionService.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionService.kt deleted file mode 100644 index b91c5e59..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionService.kt +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.core.ClientOptions -import java.util.function.Consumer - -interface ExecutionService { - - /** - * 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): ExecutionService - - /** A view of [ExecutionService] 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): ExecutionService.WithRawResponse - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionServiceImpl.kt deleted file mode 100644 index 918e5462..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ExecutionServiceImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.core.ClientOptions -import java.util.function.Consumer - -class ExecutionServiceImpl internal constructor(private val clientOptions: ClientOptions) : - ExecutionService { - - private val withRawResponse: ExecutionService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): ExecutionService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): ExecutionService = - ExecutionServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - ExecutionService.WithRawResponse { - - override fun withOptions( - modifier: Consumer - ): ExecutionService.WithRawResponse = - ExecutionServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/executions/ExecutionTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/ExecutionTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/executions/ExecutionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/ExecutionTest.kt index b2e34906..2df0cce6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/executions/ExecutionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/ExecutionTest.kt @@ -1,9 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.executions +package com.clear_street.api.models.v1.orders import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.orders.Side import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt index 34c46dcb..2b9fa412 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt @@ -6,7 +6,6 @@ import com.clear_street.api.core.JsonValue import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.executions.Execution import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat From fcef82d039b5c6bb7b50f16f45e4022356a92238 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 11:29:52 +0000 Subject: [PATCH 21/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/instruments/Instrument.kt | 88 +----------------- .../models/v1/instruments/InstrumentCore.kt | 89 +------------------ .../v1/instruments/InstrumentCoreTest.kt | 7 -- ...InstrumentGetInstrumentByIdResponseTest.kt | 6 -- .../InstrumentGetInstrumentsResponseTest.kt | 7 -- ...InstrumentSearchInstrumentsResponseTest.kt | 7 -- .../models/v1/instruments/InstrumentTest.kt | 6 -- .../v1/watchlist/WatchlistDetailTest.kt | 6 -- .../WatchlistGetWatchlistByIdResponseTest.kt | 6 -- .../v1/watchlist/WatchlistItemEntryTest.kt | 6 -- 11 files changed, 6 insertions(+), 226 deletions(-) diff --git a/.stats.yml b/.stats.yml index f2205915..74bab2e3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-f7a05c1ba96e1c7f6316d23c15822bc5f73c8323fbe57ce568b1cf0b2af70ce9.yml -openapi_spec_hash: a681d0cdd57da1cf7912d16efbb03da4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-263bf57e4abdb690f931dcaf4a36f7cf9dd68e36eb437b807c98155c8fce45e4.yml +openapi_spec_hash: df36041b7e9c04ab83ee6aff8a103d9f config_hash: 5e9e1da75241e5697705b03d38f8f5d9 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt index cdf81172..a19cce09 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt @@ -40,7 +40,6 @@ private constructor( private val symbol: JsonField, private val venue: JsonField, private val adv: JsonField, - private val expiry: JsonField, private val instrumentType: JsonField, private val longMarginRate: JsonField, private val name: JsonField, @@ -48,7 +47,6 @@ private constructor( private val optionsExpiryDates: JsonField>, private val previousClose: JsonField, private val shortMarginRate: JsonField, - private val strikePrice: JsonField, private val additionalProperties: MutableMap, ) { @@ -87,7 +85,6 @@ private constructor( @JsonProperty("symbol") @ExcludeMissing symbol: JsonField = JsonMissing.of(), @JsonProperty("venue") @ExcludeMissing venue: JsonField = JsonMissing.of(), @JsonProperty("adv") @ExcludeMissing adv: JsonField = JsonMissing.of(), - @JsonProperty("expiry") @ExcludeMissing expiry: JsonField = JsonMissing.of(), @JsonProperty("instrument_type") @ExcludeMissing instrumentType: JsonField = JsonMissing.of(), @@ -107,9 +104,6 @@ private constructor( @JsonProperty("short_margin_rate") @ExcludeMissing shortMarginRate: JsonField = JsonMissing.of(), - @JsonProperty("strike_price") - @ExcludeMissing - strikePrice: JsonField = JsonMissing.of(), ) : this( id, countryOfIssue, @@ -126,7 +120,6 @@ private constructor( symbol, venue, adv, - expiry, instrumentType, longMarginRate, name, @@ -134,7 +127,6 @@ private constructor( optionsExpiryDates, previousClose, shortMarginRate, - strikePrice, mutableMapOf(), ) @@ -259,14 +251,6 @@ private constructor( */ fun adv(): Optional = adv.getOptional("adv") - /** - * The expiration date for options instruments - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun expiry(): Optional = expiry.getOptional("expiry") - /** * The type of security (e.g., Common Stock, ETF) * @@ -327,14 +311,6 @@ private constructor( */ fun shortMarginRate(): Optional = shortMarginRate.getOptional("short_margin_rate") - /** - * The strike price for options instruments - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun strikePrice(): Optional = strikePrice.getOptional("strike_price") - /** * Returns the raw JSON value of [id]. * @@ -459,13 +435,6 @@ private constructor( */ @JsonProperty("adv") @ExcludeMissing fun _adv(): JsonField = adv - /** - * Returns the raw JSON value of [expiry]. - * - * Unlike [expiry], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("expiry") @ExcludeMissing fun _expiry(): JsonField = expiry - /** * Returns the raw JSON value of [instrumentType]. * @@ -528,15 +497,6 @@ private constructor( @ExcludeMissing fun _shortMarginRate(): JsonField = shortMarginRate - /** - * Returns the raw JSON value of [strikePrice]. - * - * Unlike [strikePrice], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("strike_price") - @ExcludeMissing - fun _strikePrice(): JsonField = strikePrice - @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -593,7 +553,6 @@ private constructor( private var symbol: JsonField? = null private var venue: JsonField? = null private var adv: JsonField = JsonMissing.of() - private var expiry: JsonField = JsonMissing.of() private var instrumentType: JsonField = JsonMissing.of() private var longMarginRate: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -601,7 +560,6 @@ private constructor( private var optionsExpiryDates: JsonField>? = null private var previousClose: JsonField = JsonMissing.of() private var shortMarginRate: JsonField = JsonMissing.of() - private var strikePrice: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -621,7 +579,6 @@ private constructor( symbol = instrument.symbol venue = instrument.venue adv = instrument.adv - expiry = instrument.expiry instrumentType = instrument.instrumentType longMarginRate = instrument.longMarginRate name = instrument.name @@ -629,7 +586,6 @@ private constructor( optionsExpiryDates = instrument.optionsExpiryDates.map { it.toMutableList() } previousClose = instrument.previousClose shortMarginRate = instrument.shortMarginRate - strikePrice = instrument.strikePrice additionalProperties = instrument.additionalProperties.toMutableMap() } @@ -832,21 +788,6 @@ private constructor( */ fun adv(adv: JsonField) = apply { this.adv = adv } - /** The expiration date for options instruments */ - fun expiry(expiry: LocalDate?) = expiry(JsonField.ofNullable(expiry)) - - /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ - fun expiry(expiry: Optional) = expiry(expiry.getOrNull()) - - /** - * Sets [Builder.expiry] to an arbitrary JSON value. - * - * You should usually call [Builder.expiry] with a well-typed [LocalDate] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun expiry(expiry: JsonField) = apply { this.expiry = expiry } - /** The type of security (e.g., Common Stock, ETF) */ fun instrumentType(instrumentType: SecurityType?) = instrumentType(JsonField.ofNullable(instrumentType)) @@ -992,21 +933,6 @@ private constructor( this.shortMarginRate = shortMarginRate } - /** The strike price for options instruments */ - fun strikePrice(strikePrice: String?) = strikePrice(JsonField.ofNullable(strikePrice)) - - /** Alias for calling [Builder.strikePrice] with `strikePrice.orElse(null)`. */ - fun strikePrice(strikePrice: Optional) = strikePrice(strikePrice.getOrNull()) - - /** - * Sets [Builder.strikePrice] to an arbitrary JSON value. - * - * You should usually call [Builder.strikePrice] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun strikePrice(strikePrice: JsonField) = apply { this.strikePrice = strikePrice } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1068,7 +994,6 @@ private constructor( checkRequired("symbol", symbol), checkRequired("venue", venue), adv, - expiry, instrumentType, longMarginRate, name, @@ -1076,7 +1001,6 @@ private constructor( (optionsExpiryDates ?: JsonMissing.of()).map { it.toImmutable() }, previousClose, shortMarginRate, - strikePrice, additionalProperties.toMutableMap(), ) } @@ -1111,7 +1035,6 @@ private constructor( symbol() venue() adv() - expiry() instrumentType().ifPresent { it.validate() } longMarginRate() name() @@ -1119,7 +1042,6 @@ private constructor( optionsExpiryDates() previousClose() shortMarginRate() - strikePrice() validated = true } @@ -1153,15 +1075,13 @@ private constructor( (if (symbol.asKnown().isPresent) 1 else 0) + (if (venue.asKnown().isPresent) 1 else 0) + (if (adv.asKnown().isPresent) 1 else 0) + - (if (expiry.asKnown().isPresent) 1 else 0) + (instrumentType.asKnown().getOrNull()?.validity() ?: 0) + (if (longMarginRate.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (notionalAdv.asKnown().isPresent) 1 else 0) + (optionsExpiryDates.asKnown().getOrNull()?.size ?: 0) + (if (previousClose.asKnown().isPresent) 1 else 0) + - (if (shortMarginRate.asKnown().isPresent) 1 else 0) + - (if (strikePrice.asKnown().isPresent) 1 else 0) + (if (shortMarginRate.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1184,7 +1104,6 @@ private constructor( symbol == other.symbol && venue == other.venue && adv == other.adv && - expiry == other.expiry && instrumentType == other.instrumentType && longMarginRate == other.longMarginRate && name == other.name && @@ -1192,7 +1111,6 @@ private constructor( optionsExpiryDates == other.optionsExpiryDates && previousClose == other.previousClose && shortMarginRate == other.shortMarginRate && - strikePrice == other.strikePrice && additionalProperties == other.additionalProperties } @@ -1213,7 +1131,6 @@ private constructor( symbol, venue, adv, - expiry, instrumentType, longMarginRate, name, @@ -1221,7 +1138,6 @@ private constructor( optionsExpiryDates, previousClose, shortMarginRate, - strikePrice, additionalProperties, ) } @@ -1229,5 +1145,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt index 4ef4d710..fcf84dfc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt @@ -13,7 +13,6 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import java.time.LocalDate import java.util.Collections import java.util.Objects import java.util.Optional @@ -37,14 +36,12 @@ private constructor( private val symbol: JsonField, private val venue: JsonField, private val adv: JsonField, - private val expiry: JsonField, private val instrumentType: JsonField, private val longMarginRate: JsonField, private val name: JsonField, private val notionalAdv: JsonField, private val previousClose: JsonField, private val shortMarginRate: JsonField, - private val strikePrice: JsonField, private val additionalProperties: MutableMap, ) { @@ -83,7 +80,6 @@ private constructor( @JsonProperty("symbol") @ExcludeMissing symbol: JsonField = JsonMissing.of(), @JsonProperty("venue") @ExcludeMissing venue: JsonField = JsonMissing.of(), @JsonProperty("adv") @ExcludeMissing adv: JsonField = JsonMissing.of(), - @JsonProperty("expiry") @ExcludeMissing expiry: JsonField = JsonMissing.of(), @JsonProperty("instrument_type") @ExcludeMissing instrumentType: JsonField = JsonMissing.of(), @@ -100,9 +96,6 @@ private constructor( @JsonProperty("short_margin_rate") @ExcludeMissing shortMarginRate: JsonField = JsonMissing.of(), - @JsonProperty("strike_price") - @ExcludeMissing - strikePrice: JsonField = JsonMissing.of(), ) : this( id, countryOfIssue, @@ -119,14 +112,12 @@ private constructor( symbol, venue, adv, - expiry, instrumentType, longMarginRate, name, notionalAdv, previousClose, shortMarginRate, - strikePrice, mutableMapOf(), ) @@ -251,14 +242,6 @@ private constructor( */ fun adv(): Optional = adv.getOptional("adv") - /** - * The expiration date for options instruments - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun expiry(): Optional = expiry.getOptional("expiry") - /** * The type of security (e.g., Common Stock, ETF) * @@ -309,14 +292,6 @@ private constructor( */ fun shortMarginRate(): Optional = shortMarginRate.getOptional("short_margin_rate") - /** - * The strike price for options instruments - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun strikePrice(): Optional = strikePrice.getOptional("strike_price") - /** * Returns the raw JSON value of [id]. * @@ -441,13 +416,6 @@ private constructor( */ @JsonProperty("adv") @ExcludeMissing fun _adv(): JsonField = adv - /** - * Returns the raw JSON value of [expiry]. - * - * Unlike [expiry], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("expiry") @ExcludeMissing fun _expiry(): JsonField = expiry - /** * Returns the raw JSON value of [instrumentType]. * @@ -500,15 +468,6 @@ private constructor( @ExcludeMissing fun _shortMarginRate(): JsonField = shortMarginRate - /** - * Returns the raw JSON value of [strikePrice]. - * - * Unlike [strikePrice], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("strike_price") - @ExcludeMissing - fun _strikePrice(): JsonField = strikePrice - @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -565,14 +524,12 @@ private constructor( private var symbol: JsonField? = null private var venue: JsonField? = null private var adv: JsonField = JsonMissing.of() - private var expiry: JsonField = JsonMissing.of() private var instrumentType: JsonField = JsonMissing.of() private var longMarginRate: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var notionalAdv: JsonField = JsonMissing.of() private var previousClose: JsonField = JsonMissing.of() private var shortMarginRate: JsonField = JsonMissing.of() - private var strikePrice: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -592,14 +549,12 @@ private constructor( symbol = instrumentCore.symbol venue = instrumentCore.venue adv = instrumentCore.adv - expiry = instrumentCore.expiry instrumentType = instrumentCore.instrumentType longMarginRate = instrumentCore.longMarginRate name = instrumentCore.name notionalAdv = instrumentCore.notionalAdv previousClose = instrumentCore.previousClose shortMarginRate = instrumentCore.shortMarginRate - strikePrice = instrumentCore.strikePrice additionalProperties = instrumentCore.additionalProperties.toMutableMap() } @@ -802,21 +757,6 @@ private constructor( */ fun adv(adv: JsonField) = apply { this.adv = adv } - /** The expiration date for options instruments */ - fun expiry(expiry: LocalDate?) = expiry(JsonField.ofNullable(expiry)) - - /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ - fun expiry(expiry: Optional) = expiry(expiry.getOrNull()) - - /** - * Sets [Builder.expiry] to an arbitrary JSON value. - * - * You should usually call [Builder.expiry] with a well-typed [LocalDate] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun expiry(expiry: JsonField) = apply { this.expiry = expiry } - /** The type of security (e.g., Common Stock, ETF) */ fun instrumentType(instrumentType: SecurityType?) = instrumentType(JsonField.ofNullable(instrumentType)) @@ -926,21 +866,6 @@ private constructor( this.shortMarginRate = shortMarginRate } - /** The strike price for options instruments */ - fun strikePrice(strikePrice: String?) = strikePrice(JsonField.ofNullable(strikePrice)) - - /** Alias for calling [Builder.strikePrice] with `strikePrice.orElse(null)`. */ - fun strikePrice(strikePrice: Optional) = strikePrice(strikePrice.getOrNull()) - - /** - * Sets [Builder.strikePrice] to an arbitrary JSON value. - * - * You should usually call [Builder.strikePrice] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun strikePrice(strikePrice: JsonField) = apply { this.strikePrice = strikePrice } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1002,14 +927,12 @@ private constructor( checkRequired("symbol", symbol), checkRequired("venue", venue), adv, - expiry, instrumentType, longMarginRate, name, notionalAdv, previousClose, shortMarginRate, - strikePrice, additionalProperties.toMutableMap(), ) } @@ -1044,14 +967,12 @@ private constructor( symbol() venue() adv() - expiry() instrumentType().ifPresent { it.validate() } longMarginRate() name() notionalAdv() previousClose() shortMarginRate() - strikePrice() validated = true } @@ -1085,14 +1006,12 @@ private constructor( (if (symbol.asKnown().isPresent) 1 else 0) + (if (venue.asKnown().isPresent) 1 else 0) + (if (adv.asKnown().isPresent) 1 else 0) + - (if (expiry.asKnown().isPresent) 1 else 0) + (instrumentType.asKnown().getOrNull()?.validity() ?: 0) + (if (longMarginRate.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (notionalAdv.asKnown().isPresent) 1 else 0) + (if (previousClose.asKnown().isPresent) 1 else 0) + - (if (shortMarginRate.asKnown().isPresent) 1 else 0) + - (if (strikePrice.asKnown().isPresent) 1 else 0) + (if (shortMarginRate.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1115,14 +1034,12 @@ private constructor( symbol == other.symbol && venue == other.venue && adv == other.adv && - expiry == other.expiry && instrumentType == other.instrumentType && longMarginRate == other.longMarginRate && name == other.name && notionalAdv == other.notionalAdv && previousClose == other.previousClose && shortMarginRate == other.shortMarginRate && - strikePrice == other.strikePrice && additionalProperties == other.additionalProperties } @@ -1143,14 +1060,12 @@ private constructor( symbol, venue, adv, - expiry, instrumentType, longMarginRate, name, notionalAdv, previousClose, shortMarginRate, - strikePrice, additionalProperties, ) } @@ -1158,5 +1073,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" + "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt index 7c528e30..ca6487d6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt @@ -5,7 +5,6 @@ package com.clear_street.api.models.v1.instruments import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -30,14 +29,12 @@ internal class InstrumentCoreTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() assertThat(instrumentCore.id()).isEqualTo("0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b") @@ -55,14 +52,12 @@ internal class InstrumentCoreTest { assertThat(instrumentCore.symbol()).isEqualTo("AAPL") assertThat(instrumentCore.venue()).isEqualTo("XNMS") assertThat(instrumentCore.adv()).contains("75000000") - assertThat(instrumentCore.expiry()).contains(LocalDate.parse("2024-12-20")) assertThat(instrumentCore.instrumentType()).contains(SecurityType.COMMON_STOCK) assertThat(instrumentCore.longMarginRate()).contains("0.25") assertThat(instrumentCore.name()).contains("Apple Inc.") assertThat(instrumentCore.notionalAdv()).contains("15815250000") assertThat(instrumentCore.previousClose()).contains("210.87") assertThat(instrumentCore.shortMarginRate()).contains("0.25") - assertThat(instrumentCore.strikePrice()).contains("150.00") } @Test @@ -85,14 +80,12 @@ internal class InstrumentCoreTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() val roundtrippedInstrumentCore = diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index 760854db..f2cb5242 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -56,7 +56,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -64,7 +63,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() @@ -110,7 +108,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -118,7 +115,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) } @@ -166,7 +162,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -174,7 +169,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index fa1d655f..a0687729 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -8,7 +8,6 @@ import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -56,14 +55,12 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() @@ -109,14 +106,12 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) } @@ -164,14 +159,12 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index 660c7453..7a8a3c51 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -8,7 +8,6 @@ import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -56,14 +55,12 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() @@ -109,14 +106,12 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) } @@ -164,14 +159,12 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt index 7debd1b7..e77272d0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt @@ -31,7 +31,6 @@ internal class InstrumentTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -39,7 +38,6 @@ internal class InstrumentTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() assertThat(instrument.id()).isEqualTo("0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b") @@ -57,7 +55,6 @@ internal class InstrumentTest { assertThat(instrument.symbol()).isEqualTo("AAPL") assertThat(instrument.venue()).isEqualTo("XNMS") assertThat(instrument.adv()).contains("75000000") - assertThat(instrument.expiry()).contains(LocalDate.parse("2024-12-20")) assertThat(instrument.instrumentType()).contains(SecurityType.COMMON_STOCK) assertThat(instrument.longMarginRate()).contains("0.25") assertThat(instrument.name()).contains("Apple Inc.") @@ -66,7 +63,6 @@ internal class InstrumentTest { .containsExactly(LocalDate.parse("2019-12-27")) assertThat(instrument.previousClose()).contains("210.87") assertThat(instrument.shortMarginRate()).contains("0.25") - assertThat(instrument.strikePrice()).contains("150.00") } @Test @@ -89,7 +85,6 @@ internal class InstrumentTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -97,7 +92,6 @@ internal class InstrumentTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() val roundtrippedInstrument = diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt index 3328cf7e..542bb8da 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -41,7 +41,6 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -49,7 +48,6 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() @@ -83,7 +81,6 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -91,7 +88,6 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() @@ -128,7 +124,6 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -136,7 +131,6 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index 8b2b2b1d..3ee37e0b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -67,7 +67,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -75,7 +74,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() @@ -135,7 +133,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -143,7 +140,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() @@ -205,7 +201,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -213,7 +208,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt index 0428a3fb..d12e3a34 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -37,7 +37,6 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -45,7 +44,6 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() @@ -72,7 +70,6 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -80,7 +77,6 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) } @@ -110,7 +106,6 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -118,7 +113,6 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") .build() ) .build() From 615197a8c2eb2d1b7cf41a24b18d23900494c631 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 11:45:32 +0000 Subject: [PATCH 22/51] feat(api): api update --- .stats.yml | 6 +- .../marketdata/MarketDataSnapshot.kt | 48 +- .../marketdata/SnapshotGreeks.kt | 448 ++++++++++++++++++ .../MarketDataGetSnapshotsResponseTest.kt | 37 ++ .../marketdata/MarketDataSnapshotTest.kt | 38 ++ .../marketdata/SnapshotGreeksTest.kt | 61 +++ 6 files changed, 634 insertions(+), 4 deletions(-) create mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt diff --git a/.stats.yml b/.stats.yml index 74bab2e3..e35ea8bc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-263bf57e4abdb690f931dcaf4a36f7cf9dd68e36eb437b807c98155c8fce45e4.yml -openapi_spec_hash: df36041b7e9c04ab83ee6aff8a103d9f -config_hash: 5e9e1da75241e5697705b03d38f8f5d9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-2c0d6cfb43e860f60af1da8c827bf3333ac8c0c91194ade01634d7da24ae4c5f.yml +openapi_spec_hash: 8946194d412b47335773e7d44d459616 +config_hash: 0fa938c5f41fe056f788e0c05a6ca2f7 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt index e51dda6e..f0cb4cfd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt @@ -24,6 +24,7 @@ private constructor( private val instrumentId: JsonField, private val symbol: JsonField, private val cumulativeVolume: JsonField, + private val greeks: JsonField, private val lastQuote: JsonField, private val lastTrade: JsonField, private val name: JsonField, @@ -40,6 +41,9 @@ private constructor( @JsonProperty("cumulative_volume") @ExcludeMissing cumulativeVolume: JsonField = JsonMissing.of(), + @JsonProperty("greeks") + @ExcludeMissing + greeks: JsonField = JsonMissing.of(), @JsonProperty("last_quote") @ExcludeMissing lastQuote: JsonField = JsonMissing.of(), @@ -54,6 +58,7 @@ private constructor( instrumentId, symbol, cumulativeVolume, + greeks, lastQuote, lastTrade, name, @@ -86,6 +91,15 @@ private constructor( */ fun cumulativeVolume(): Optional = cumulativeVolume.getOptional("cumulative_volume") + /** + * Theoretical price and Greeks for option instruments. `None` for equities, and for options + * whose Greeks have not yet been observed + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun greeks(): Optional = greeks.getOptional("greeks") + /** * Most recent quote if available. * @@ -144,6 +158,13 @@ private constructor( @ExcludeMissing fun _cumulativeVolume(): JsonField = cumulativeVolume + /** + * Returns the raw JSON value of [greeks]. + * + * Unlike [greeks], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("greeks") @ExcludeMissing fun _greeks(): JsonField = greeks + /** * Returns the raw JSON value of [lastQuote]. * @@ -208,6 +229,7 @@ private constructor( private var instrumentId: JsonField? = null private var symbol: JsonField? = null private var cumulativeVolume: JsonField = JsonMissing.of() + private var greeks: JsonField = JsonMissing.of() private var lastQuote: JsonField = JsonMissing.of() private var lastTrade: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -219,6 +241,7 @@ private constructor( instrumentId = marketDataSnapshot.instrumentId symbol = marketDataSnapshot.symbol cumulativeVolume = marketDataSnapshot.cumulativeVolume + greeks = marketDataSnapshot.greeks lastQuote = marketDataSnapshot.lastQuote lastTrade = marketDataSnapshot.lastTrade name = marketDataSnapshot.name @@ -280,6 +303,24 @@ private constructor( this.cumulativeVolume = cumulativeVolume } + /** + * Theoretical price and Greeks for option instruments. `None` for equities, and for options + * whose Greeks have not yet been observed + */ + fun greeks(greeks: SnapshotGreeks?) = greeks(JsonField.ofNullable(greeks)) + + /** Alias for calling [Builder.greeks] with `greeks.orElse(null)`. */ + fun greeks(greeks: Optional) = greeks(greeks.getOrNull()) + + /** + * Sets [Builder.greeks] to an arbitrary JSON value. + * + * You should usually call [Builder.greeks] with a well-typed [SnapshotGreeks] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun greeks(greeks: JsonField) = apply { this.greeks = greeks } + /** Most recent quote if available. */ fun lastQuote(lastQuote: SnapshotQuote?) = lastQuote(JsonField.ofNullable(lastQuote)) @@ -378,6 +419,7 @@ private constructor( checkRequired("instrumentId", instrumentId), checkRequired("symbol", symbol), cumulativeVolume, + greeks, lastQuote, lastTrade, name, @@ -404,6 +446,7 @@ private constructor( instrumentId() symbol() cumulativeVolume() + greeks().ifPresent { it.validate() } lastQuote().ifPresent { it.validate() } lastTrade().ifPresent { it.validate() } name() @@ -429,6 +472,7 @@ private constructor( (if (instrumentId.asKnown().isPresent) 1 else 0) + (if (symbol.asKnown().isPresent) 1 else 0) + (if (cumulativeVolume.asKnown().isPresent) 1 else 0) + + (greeks.asKnown().getOrNull()?.validity() ?: 0) + (lastQuote.asKnown().getOrNull()?.validity() ?: 0) + (lastTrade.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + @@ -443,6 +487,7 @@ private constructor( instrumentId == other.instrumentId && symbol == other.symbol && cumulativeVolume == other.cumulativeVolume && + greeks == other.greeks && lastQuote == other.lastQuote && lastTrade == other.lastTrade && name == other.name && @@ -455,6 +500,7 @@ private constructor( instrumentId, symbol, cumulativeVolume, + greeks, lastQuote, lastTrade, name, @@ -466,5 +512,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MarketDataSnapshot{instrumentId=$instrumentId, symbol=$symbol, cumulativeVolume=$cumulativeVolume, lastQuote=$lastQuote, lastTrade=$lastTrade, name=$name, session=$session, additionalProperties=$additionalProperties}" + "MarketDataSnapshot{instrumentId=$instrumentId, symbol=$symbol, cumulativeVolume=$cumulativeVolume, greeks=$greeks, lastQuote=$lastQuote, lastTrade=$lastTrade, name=$name, session=$session, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt new file mode 100644 index 00000000..d9c6ba10 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt @@ -0,0 +1,448 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.instrumentdata.marketdata + +import com.clear_street.api.core.ExcludeMissing +import com.clear_street.api.core.JsonField +import com.clear_street.api.core.JsonMissing +import com.clear_street.api.core.JsonValue +import com.clear_street.api.core.checkRequired +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 com.fasterxml.jackson.annotation.JsonProperty +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects + +/** + * Theoretical price and Greeks for an options snapshot. All values are **per share** as published + * by RENG; no contract multiplier is applied. + */ +class SnapshotGreeks +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val delta: JsonField, + private val gamma: JsonField, + private val iv: JsonField, + private val rho: JsonField, + private val theoPrice: JsonField, + private val theta: JsonField, + private val timestamp: JsonField, + private val vega: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("delta") @ExcludeMissing delta: JsonField = JsonMissing.of(), + @JsonProperty("gamma") @ExcludeMissing gamma: JsonField = JsonMissing.of(), + @JsonProperty("iv") @ExcludeMissing iv: JsonField = JsonMissing.of(), + @JsonProperty("rho") @ExcludeMissing rho: JsonField = JsonMissing.of(), + @JsonProperty("theo_price") @ExcludeMissing theoPrice: JsonField = JsonMissing.of(), + @JsonProperty("theta") @ExcludeMissing theta: JsonField = JsonMissing.of(), + @JsonProperty("timestamp") + @ExcludeMissing + timestamp: JsonField = JsonMissing.of(), + @JsonProperty("vega") @ExcludeMissing vega: JsonField = JsonMissing.of(), + ) : this(delta, gamma, iv, rho, theoPrice, theta, timestamp, vega, mutableMapOf()) + + /** + * Delta: ∂V/∂S, range \[-1, 1\]. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun delta(): String = delta.getRequired("delta") + + /** + * Gamma: ∂²V/∂S². + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun gamma(): String = gamma.getRequired("gamma") + + /** + * Implied volatility, annualized (`0.20` == 20%). + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun iv(): String = iv.getRequired("iv") + + /** + * Rho per 1.0 rate point. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun rho(): String = rho.getRequired("rho") + + /** + * Theoretical option price in USD per share. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun theoPrice(): String = theoPrice.getRequired("theo_price") + + /** + * Theta per trading day. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun theta(): String = theta.getRequired("theta") + + /** + * Event timestamp published by RENG. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun timestamp(): OffsetDateTime = timestamp.getRequired("timestamp") + + /** + * Vega per 1.0 vol point. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vega(): String = vega.getRequired("vega") + + /** + * Returns the raw JSON value of [delta]. + * + * Unlike [delta], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("delta") @ExcludeMissing fun _delta(): JsonField = delta + + /** + * Returns the raw JSON value of [gamma]. + * + * Unlike [gamma], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("gamma") @ExcludeMissing fun _gamma(): JsonField = gamma + + /** + * Returns the raw JSON value of [iv]. + * + * Unlike [iv], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("iv") @ExcludeMissing fun _iv(): JsonField = iv + + /** + * Returns the raw JSON value of [rho]. + * + * Unlike [rho], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("rho") @ExcludeMissing fun _rho(): JsonField = rho + + /** + * Returns the raw JSON value of [theoPrice]. + * + * Unlike [theoPrice], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("theo_price") @ExcludeMissing fun _theoPrice(): JsonField = theoPrice + + /** + * Returns the raw JSON value of [theta]. + * + * Unlike [theta], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("theta") @ExcludeMissing fun _theta(): JsonField = theta + + /** + * Returns the raw JSON value of [timestamp]. + * + * Unlike [timestamp], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("timestamp") + @ExcludeMissing + fun _timestamp(): JsonField = timestamp + + /** + * Returns the raw JSON value of [vega]. + * + * Unlike [vega], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vega") @ExcludeMissing fun _vega(): JsonField = vega + + @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 [SnapshotGreeks]. + * + * The following fields are required: + * ```java + * .delta() + * .gamma() + * .iv() + * .rho() + * .theoPrice() + * .theta() + * .timestamp() + * .vega() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [SnapshotGreeks]. */ + class Builder internal constructor() { + + private var delta: JsonField? = null + private var gamma: JsonField? = null + private var iv: JsonField? = null + private var rho: JsonField? = null + private var theoPrice: JsonField? = null + private var theta: JsonField? = null + private var timestamp: JsonField? = null + private var vega: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(snapshotGreeks: SnapshotGreeks) = apply { + delta = snapshotGreeks.delta + gamma = snapshotGreeks.gamma + iv = snapshotGreeks.iv + rho = snapshotGreeks.rho + theoPrice = snapshotGreeks.theoPrice + theta = snapshotGreeks.theta + timestamp = snapshotGreeks.timestamp + vega = snapshotGreeks.vega + additionalProperties = snapshotGreeks.additionalProperties.toMutableMap() + } + + /** Delta: ∂V/∂S, range \[-1, 1\]. */ + fun delta(delta: String) = delta(JsonField.of(delta)) + + /** + * Sets [Builder.delta] to an arbitrary JSON value. + * + * You should usually call [Builder.delta] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun delta(delta: JsonField) = apply { this.delta = delta } + + /** Gamma: ∂²V/∂S². */ + fun gamma(gamma: String) = gamma(JsonField.of(gamma)) + + /** + * Sets [Builder.gamma] to an arbitrary JSON value. + * + * You should usually call [Builder.gamma] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun gamma(gamma: JsonField) = apply { this.gamma = gamma } + + /** Implied volatility, annualized (`0.20` == 20%). */ + fun iv(iv: String) = iv(JsonField.of(iv)) + + /** + * Sets [Builder.iv] to an arbitrary JSON value. + * + * You should usually call [Builder.iv] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun iv(iv: JsonField) = apply { this.iv = iv } + + /** Rho per 1.0 rate point. */ + fun rho(rho: String) = rho(JsonField.of(rho)) + + /** + * Sets [Builder.rho] to an arbitrary JSON value. + * + * You should usually call [Builder.rho] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun rho(rho: JsonField) = apply { this.rho = rho } + + /** Theoretical option price in USD per share. */ + fun theoPrice(theoPrice: String) = theoPrice(JsonField.of(theoPrice)) + + /** + * Sets [Builder.theoPrice] to an arbitrary JSON value. + * + * You should usually call [Builder.theoPrice] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun theoPrice(theoPrice: JsonField) = apply { this.theoPrice = theoPrice } + + /** Theta per trading day. */ + fun theta(theta: String) = theta(JsonField.of(theta)) + + /** + * Sets [Builder.theta] to an arbitrary JSON value. + * + * You should usually call [Builder.theta] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun theta(theta: JsonField) = apply { this.theta = theta } + + /** Event timestamp published by RENG. */ + fun timestamp(timestamp: OffsetDateTime) = timestamp(JsonField.of(timestamp)) + + /** + * Sets [Builder.timestamp] to an arbitrary JSON value. + * + * You should usually call [Builder.timestamp] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun timestamp(timestamp: JsonField) = apply { this.timestamp = timestamp } + + /** Vega per 1.0 vol point. */ + fun vega(vega: String) = vega(JsonField.of(vega)) + + /** + * Sets [Builder.vega] to an arbitrary JSON value. + * + * You should usually call [Builder.vega] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun vega(vega: JsonField) = apply { this.vega = vega } + + 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 [SnapshotGreeks]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .delta() + * .gamma() + * .iv() + * .rho() + * .theoPrice() + * .theta() + * .timestamp() + * .vega() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): SnapshotGreeks = + SnapshotGreeks( + checkRequired("delta", delta), + checkRequired("gamma", gamma), + checkRequired("iv", iv), + checkRequired("rho", rho), + checkRequired("theoPrice", theoPrice), + checkRequired("theta", theta), + checkRequired("timestamp", timestamp), + checkRequired("vega", vega), + 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(): SnapshotGreeks = apply { + if (validated) { + return@apply + } + + delta() + gamma() + iv() + rho() + theoPrice() + theta() + timestamp() + vega() + 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 = + (if (delta.asKnown().isPresent) 1 else 0) + + (if (gamma.asKnown().isPresent) 1 else 0) + + (if (iv.asKnown().isPresent) 1 else 0) + + (if (rho.asKnown().isPresent) 1 else 0) + + (if (theoPrice.asKnown().isPresent) 1 else 0) + + (if (theta.asKnown().isPresent) 1 else 0) + + (if (timestamp.asKnown().isPresent) 1 else 0) + + (if (vega.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is SnapshotGreeks && + delta == other.delta && + gamma == other.gamma && + iv == other.iv && + rho == other.rho && + theoPrice == other.theoPrice && + theta == other.theta && + timestamp == other.timestamp && + vega == other.vega && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(delta, gamma, iv, rho, theoPrice, theta, timestamp, vega, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "SnapshotGreeks{delta=$delta, gamma=$gamma, iv=$iv, rho=$rho, theoPrice=$theoPrice, theta=$theta, timestamp=$timestamp, vega=$vega, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt index c85eee2b..27166463 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt @@ -7,6 +7,7 @@ import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -42,6 +43,18 @@ internal class MarketDataGetSnapshotsResponseTest { .instrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .symbol("AAPL") .cumulativeVolume(12345678L) + .greeks( + SnapshotGreeks.builder() + .delta("delta") + .gamma("gamma") + .iv("iv") + .rho("rho") + .theoPrice("theo_price") + .theta("theta") + .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .vega("vega") + .build() + ) .lastQuote( SnapshotQuote.builder() .ask("210.14") @@ -93,6 +106,18 @@ internal class MarketDataGetSnapshotsResponseTest { .instrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .symbol("AAPL") .cumulativeVolume(12345678L) + .greeks( + SnapshotGreeks.builder() + .delta("delta") + .gamma("gamma") + .iv("iv") + .rho("rho") + .theoPrice("theo_price") + .theta("theta") + .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .vega("vega") + .build() + ) .lastQuote( SnapshotQuote.builder() .ask("210.14") @@ -146,6 +171,18 @@ internal class MarketDataGetSnapshotsResponseTest { .instrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .symbol("AAPL") .cumulativeVolume(12345678L) + .greeks( + SnapshotGreeks.builder() + .delta("delta") + .gamma("gamma") + .iv("iv") + .rho("rho") + .theoPrice("theo_price") + .theta("theta") + .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .vega("vega") + .build() + ) .lastQuote( SnapshotQuote.builder() .ask("210.14") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt index 4197adf9..6640b1c1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt @@ -4,6 +4,7 @@ package com.clear_street.api.models.v1.instrumentdata.marketdata import com.clear_street.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -16,6 +17,18 @@ internal class MarketDataSnapshotTest { .instrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .symbol("AAPL") .cumulativeVolume(12345678L) + .greeks( + SnapshotGreeks.builder() + .delta("delta") + .gamma("gamma") + .iv("iv") + .rho("rho") + .theoPrice("theo_price") + .theta("theta") + .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .vega("vega") + .build() + ) .lastQuote( SnapshotQuote.builder() .ask("210.14") @@ -40,6 +53,19 @@ internal class MarketDataSnapshotTest { .isEqualTo("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") assertThat(marketDataSnapshot.symbol()).isEqualTo("AAPL") assertThat(marketDataSnapshot.cumulativeVolume()).contains(12345678L) + assertThat(marketDataSnapshot.greeks()) + .contains( + SnapshotGreeks.builder() + .delta("delta") + .gamma("gamma") + .iv("iv") + .rho("rho") + .theoPrice("theo_price") + .theta("theta") + .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .vega("vega") + .build() + ) assertThat(marketDataSnapshot.lastQuote()) .contains( SnapshotQuote.builder() @@ -71,6 +97,18 @@ internal class MarketDataSnapshotTest { .instrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .symbol("AAPL") .cumulativeVolume(12345678L) + .greeks( + SnapshotGreeks.builder() + .delta("delta") + .gamma("gamma") + .iv("iv") + .rho("rho") + .theoPrice("theo_price") + .theta("theta") + .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .vega("vega") + .build() + ) .lastQuote( SnapshotQuote.builder() .ask("210.14") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt new file mode 100644 index 00000000..f0ede8f2 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt @@ -0,0 +1,61 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clear_street.api.models.v1.instrumentdata.marketdata + +import com.clear_street.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class SnapshotGreeksTest { + + @Test + fun create() { + val snapshotGreeks = + SnapshotGreeks.builder() + .delta("delta") + .gamma("gamma") + .iv("iv") + .rho("rho") + .theoPrice("theo_price") + .theta("theta") + .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .vega("vega") + .build() + + assertThat(snapshotGreeks.delta()).isEqualTo("delta") + assertThat(snapshotGreeks.gamma()).isEqualTo("gamma") + assertThat(snapshotGreeks.iv()).isEqualTo("iv") + assertThat(snapshotGreeks.rho()).isEqualTo("rho") + assertThat(snapshotGreeks.theoPrice()).isEqualTo("theo_price") + assertThat(snapshotGreeks.theta()).isEqualTo("theta") + assertThat(snapshotGreeks.timestamp()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(snapshotGreeks.vega()).isEqualTo("vega") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val snapshotGreeks = + SnapshotGreeks.builder() + .delta("delta") + .gamma("gamma") + .iv("iv") + .rho("rho") + .theoPrice("theo_price") + .theta("theta") + .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .vega("vega") + .build() + + val roundtrippedSnapshotGreeks = + jsonMapper.readValue( + jsonMapper.writeValueAsString(snapshotGreeks), + jacksonTypeRef(), + ) + + assertThat(roundtrippedSnapshotGreeks).isEqualTo(snapshotGreeks) + } +} From 006fcf2befbd77f7bfeb45f04a839afa63763e6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 12:26:27 +0000 Subject: [PATCH 23/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/SecurityType.kt | 12 -- .../InstrumentGetInstrumentsParams.kt | 196 +----------------- .../orders/OrderCancelAllOpenOrdersParams.kt | 12 -- .../models/v1/orders/OrderGetOrdersParams.kt | 12 -- .../InstrumentGetInstrumentsParamsTest.kt | 3 - .../async/v1/InstrumentServiceAsyncTest.kt | 1 - .../blocking/v1/InstrumentServiceTest.kt | 1 - 8 files changed, 3 insertions(+), 238 deletions(-) diff --git a/.stats.yml b/.stats.yml index e35ea8bc..72deca62 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-2c0d6cfb43e860f60af1da8c827bf3333ac8c0c91194ade01634d7da24ae4c5f.yml -openapi_spec_hash: 8946194d412b47335773e7d44d459616 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-c81e8f5a9274089355dbf586d35e82c1baf08273faa8c3a4fc4eec7b126d804b.yml +openapi_spec_hash: 3e8c60eb7f8534bba85a0fe03976b836 config_hash: 0fa938c5f41fe056f788e0c05a6ca2f7 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/SecurityType.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/SecurityType.kt index 89c710a4..76ccb7c0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/SecurityType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/SecurityType.kt @@ -23,24 +23,18 @@ class SecurityType @JsonCreator private constructor(private val value: JsonField @JvmField val COMMON_STOCK = of("COMMON_STOCK") - @JvmField val PREFERRED_STOCK = of("PREFERRED_STOCK") - @JvmField val OPTION = of("OPTION") @JvmField val CASH = of("CASH") - @JvmField val OTHER = of("OTHER") - @JvmStatic fun of(value: String) = SecurityType(JsonField.of(value)) } /** An enum containing [SecurityType]'s known values. */ enum class Known { COMMON_STOCK, - PREFERRED_STOCK, OPTION, CASH, - OTHER, } /** @@ -54,10 +48,8 @@ class SecurityType @JsonCreator private constructor(private val value: JsonField */ enum class Value { COMMON_STOCK, - PREFERRED_STOCK, OPTION, CASH, - OTHER, /** An enum member indicating that [SecurityType] was instantiated with an unknown value. */ _UNKNOWN, } @@ -72,10 +64,8 @@ class SecurityType @JsonCreator private constructor(private val value: JsonField fun value(): Value = when (this) { COMMON_STOCK -> Value.COMMON_STOCK - PREFERRED_STOCK -> Value.PREFERRED_STOCK OPTION -> Value.OPTION CASH -> Value.CASH - OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -91,10 +81,8 @@ class SecurityType @JsonCreator private constructor(private val value: JsonField fun known(): Known = when (this) { COMMON_STOCK -> Known.COMMON_STOCK - PREFERRED_STOCK -> Known.PREFERRED_STOCK OPTION -> Known.OPTION CASH -> Known.CASH - OTHER -> Known.OTHER else -> throw ClearStreetInvalidDataException("Unknown SecurityType: $value") } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt index c98d9f5a..030cd4f3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt @@ -2,14 +2,10 @@ package com.clear_street.api.models.v1.instruments -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers import com.clear_street.api.core.http.QueryParams import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.fasterxml.jackson.annotation.JsonCreator import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -19,7 +15,6 @@ class InstrumentGetInstrumentsParams private constructor( private val easyToBorrow: Boolean?, private val instrumentIds: List?, - private val instrumentType: InstrumentType?, private val isLiquidationOnly: Boolean?, private val isMarginable: Boolean?, private val isPtp: Boolean?, @@ -38,13 +33,6 @@ private constructor( /** Comma-separated OEMS instrument UUIDs */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) - /** - * Filter by instrument type. OPTION is not supported on this endpoint; use GET - * /instruments/options/contracts to list option contracts. If omitted, returns all supported - * instrument types except options. - */ - fun instrumentType(): Optional = Optional.ofNullable(instrumentType) - /** Filter by liquidation only status */ fun isLiquidationOnly(): Optional = Optional.ofNullable(isLiquidationOnly) @@ -96,7 +84,6 @@ private constructor( private var easyToBorrow: Boolean? = null private var instrumentIds: MutableList? = null - private var instrumentType: InstrumentType? = null private var isLiquidationOnly: Boolean? = null private var isMarginable: Boolean? = null private var isPtp: Boolean? = null @@ -112,7 +99,6 @@ private constructor( internal fun from(instrumentGetInstrumentsParams: InstrumentGetInstrumentsParams) = apply { easyToBorrow = instrumentGetInstrumentsParams.easyToBorrow instrumentIds = instrumentGetInstrumentsParams.instrumentIds?.toMutableList() - instrumentType = instrumentGetInstrumentsParams.instrumentType isLiquidationOnly = instrumentGetInstrumentsParams.isLiquidationOnly isMarginable = instrumentGetInstrumentsParams.isMarginable isPtp = instrumentGetInstrumentsParams.isPtp @@ -156,19 +142,6 @@ private constructor( instrumentIds = (instrumentIds ?: mutableListOf()).apply { add(instrumentId) } } - /** - * Filter by instrument type. OPTION is not supported on this endpoint; use GET - * /instruments/options/contracts to list option contracts. If omitted, returns all - * supported instrument types except options. - */ - fun instrumentType(instrumentType: InstrumentType?) = apply { - this.instrumentType = instrumentType - } - - /** Alias for calling [Builder.instrumentType] with `instrumentType.orElse(null)`. */ - fun instrumentType(instrumentType: Optional) = - instrumentType(instrumentType.getOrNull()) - /** Filter by liquidation only status */ fun isLiquidationOnly(isLiquidationOnly: Boolean?) = apply { this.isLiquidationOnly = isLiquidationOnly @@ -390,7 +363,6 @@ private constructor( InstrumentGetInstrumentsParams( easyToBorrow, instrumentIds?.toImmutable(), - instrumentType, isLiquidationOnly, isMarginable, isPtp, @@ -411,7 +383,6 @@ private constructor( .apply { easyToBorrow?.let { put("easy_to_borrow", it.toString()) } instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } - instrumentType?.let { put("instrument_type", it.toString()) } isLiquidationOnly?.let { put("is_liquidation_only", it.toString()) } isMarginable?.let { put("is_marginable", it.toString()) } isPtp?.let { put("is_ptp", it.toString()) } @@ -424,169 +395,6 @@ private constructor( } .build() - /** - * Filter by instrument type. OPTION is not supported on this endpoint; use GET - * /instruments/options/contracts to list option contracts. If omitted, returns all supported - * instrument types except options. - */ - class InstrumentType @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val COMMON_STOCK = of("COMMON_STOCK") - - @JvmField val PREFERRED_STOCK = of("PREFERRED_STOCK") - - @JvmField val OPTION = of("OPTION") - - @JvmField val CASH = of("CASH") - - @JvmField val OTHER = of("OTHER") - - @JvmStatic fun of(value: String) = InstrumentType(JsonField.of(value)) - } - - /** An enum containing [InstrumentType]'s known values. */ - enum class Known { - COMMON_STOCK, - PREFERRED_STOCK, - OPTION, - CASH, - OTHER, - } - - /** - * An enum containing [InstrumentType]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [InstrumentType] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - COMMON_STOCK, - PREFERRED_STOCK, - OPTION, - CASH, - OTHER, - /** - * An enum member indicating that [InstrumentType] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. - */ - fun value(): Value = - when (this) { - COMMON_STOCK -> Value.COMMON_STOCK - PREFERRED_STOCK -> Value.PREFERRED_STOCK - OPTION -> Value.OPTION - CASH -> Value.CASH - OTHER -> Value.OTHER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. - * - * @throws ClearStreetInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - COMMON_STOCK -> Known.COMMON_STOCK - PREFERRED_STOCK -> Known.PREFERRED_STOCK - OPTION -> Known.OPTION - CASH -> Known.CASH - OTHER -> Known.OTHER - else -> throw ClearStreetInvalidDataException("Unknown InstrumentType: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. - * - * @throws ClearStreetInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - ClearStreetInvalidDataException("Value is not a String") - } - - 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(): InstrumentType = apply { - if (validated) { - return@apply - } - - known() - 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 = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InstrumentType && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -595,7 +403,6 @@ private constructor( return other is InstrumentGetInstrumentsParams && easyToBorrow == other.easyToBorrow && instrumentIds == other.instrumentIds && - instrumentType == other.instrumentType && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isPtp == other.isPtp && @@ -612,7 +419,6 @@ private constructor( Objects.hash( easyToBorrow, instrumentIds, - instrumentType, isLiquidationOnly, isMarginable, isPtp, @@ -626,5 +432,5 @@ private constructor( ) override fun toString() = - "InstrumentGetInstrumentsParams{easyToBorrow=$easyToBorrow, instrumentIds=$instrumentIds, instrumentType=$instrumentType, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentGetInstrumentsParams{easyToBorrow=$easyToBorrow, instrumentIds=$instrumentIds, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt index 4acb348e..2c6379b0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt @@ -318,24 +318,18 @@ private constructor( @JvmField val COMMON_STOCK = of("COMMON_STOCK") - @JvmField val PREFERRED_STOCK = of("PREFERRED_STOCK") - @JvmField val OPTION = of("OPTION") @JvmField val CASH = of("CASH") - @JvmField val OTHER = of("OTHER") - @JvmStatic fun of(value: String) = InstrumentType(JsonField.of(value)) } /** An enum containing [InstrumentType]'s known values. */ enum class Known { COMMON_STOCK, - PREFERRED_STOCK, OPTION, CASH, - OTHER, } /** @@ -349,10 +343,8 @@ private constructor( */ enum class Value { COMMON_STOCK, - PREFERRED_STOCK, OPTION, CASH, - OTHER, /** * An enum member indicating that [InstrumentType] was instantiated with an unknown * value. @@ -370,10 +362,8 @@ private constructor( fun value(): Value = when (this) { COMMON_STOCK -> Value.COMMON_STOCK - PREFERRED_STOCK -> Value.PREFERRED_STOCK OPTION -> Value.OPTION CASH -> Value.CASH - OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -389,10 +379,8 @@ private constructor( fun known(): Known = when (this) { COMMON_STOCK -> Known.COMMON_STOCK - PREFERRED_STOCK -> Known.PREFERRED_STOCK OPTION -> Known.OPTION CASH -> Known.CASH - OTHER -> Known.OTHER else -> throw ClearStreetInvalidDataException("Unknown InstrumentType: $value") } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt index 898f0e89..c8f08006 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt @@ -387,24 +387,18 @@ private constructor( @JvmField val COMMON_STOCK = of("COMMON_STOCK") - @JvmField val PREFERRED_STOCK = of("PREFERRED_STOCK") - @JvmField val OPTION = of("OPTION") @JvmField val CASH = of("CASH") - @JvmField val OTHER = of("OTHER") - @JvmStatic fun of(value: String) = InstrumentType(JsonField.of(value)) } /** An enum containing [InstrumentType]'s known values. */ enum class Known { COMMON_STOCK, - PREFERRED_STOCK, OPTION, CASH, - OTHER, } /** @@ -418,10 +412,8 @@ private constructor( */ enum class Value { COMMON_STOCK, - PREFERRED_STOCK, OPTION, CASH, - OTHER, /** * An enum member indicating that [InstrumentType] was instantiated with an unknown * value. @@ -439,10 +431,8 @@ private constructor( fun value(): Value = when (this) { COMMON_STOCK -> Value.COMMON_STOCK - PREFERRED_STOCK -> Value.PREFERRED_STOCK OPTION -> Value.OPTION CASH -> Value.CASH - OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -458,10 +448,8 @@ private constructor( fun known(): Known = when (this) { COMMON_STOCK -> Known.COMMON_STOCK - PREFERRED_STOCK -> Known.PREFERRED_STOCK OPTION -> Known.OPTION CASH -> Known.CASH - OTHER -> Known.OTHER else -> throw ClearStreetInvalidDataException("Unknown InstrumentType: $value") } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt index 32fa9f19..56c87f51 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt @@ -13,7 +13,6 @@ internal class InstrumentGetInstrumentsParamsTest { InstrumentGetInstrumentsParams.builder() .easyToBorrow(true) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) @@ -31,7 +30,6 @@ internal class InstrumentGetInstrumentsParamsTest { InstrumentGetInstrumentsParams.builder() .easyToBorrow(true) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) @@ -49,7 +47,6 @@ internal class InstrumentGetInstrumentsParamsTest { QueryParams.builder() .put("easy_to_borrow", "true") .put("instrument_ids[0]", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .put("instrument_type", "COMMON_STOCK") .put("is_liquidation_only", "true") .put("is_marginable", "true") .put("is_ptp", "true") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt index 8967abfd..ff3c30ec 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt @@ -43,7 +43,6 @@ internal class InstrumentServiceAsyncTest { InstrumentGetInstrumentsParams.builder() .easyToBorrow(true) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt index 3c3ee1de..6f7edee6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt @@ -42,7 +42,6 @@ internal class InstrumentServiceTest { InstrumentGetInstrumentsParams.builder() .easyToBorrow(true) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) From 9aa0a960e4dd0b18522dbe55080e11da8c098c08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 15:04:37 +0000 Subject: [PATCH 24/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/instruments/Instrument.kt | 47 +------------------ .../models/v1/instruments/InstrumentCore.kt | 47 +------------------ .../InstrumentGetInstrumentsParams.kt | 25 +--------- .../InstrumentSearchInstrumentsParams.kt | 29 +----------- .../models/v1/instruments/OptionsContract.kt | 47 +------------------ .../v1/instruments/InstrumentCoreTest.kt | 3 -- ...InstrumentGetInstrumentByIdResponseTest.kt | 3 -- .../InstrumentGetInstrumentsParamsTest.kt | 3 -- .../InstrumentGetInstrumentsResponseTest.kt | 3 -- ...nstrumentGetOptionContractsResponseTest.kt | 3 -- .../InstrumentSearchInstrumentsParamsTest.kt | 3 -- ...InstrumentSearchInstrumentsResponseTest.kt | 3 -- .../models/v1/instruments/InstrumentTest.kt | 3 -- .../v1/instruments/OptionsContractTest.kt | 3 -- .../v1/watchlist/WatchlistDetailTest.kt | 3 -- .../WatchlistGetWatchlistByIdResponseTest.kt | 3 -- .../v1/watchlist/WatchlistItemEntryTest.kt | 3 -- .../async/v1/InstrumentServiceAsyncTest.kt | 2 - .../blocking/v1/InstrumentServiceTest.kt | 2 - 20 files changed, 7 insertions(+), 232 deletions(-) diff --git a/.stats.yml b/.stats.yml index 72deca62..024d95b8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-c81e8f5a9274089355dbf586d35e82c1baf08273faa8c3a4fc4eec7b126d804b.yml -openapi_spec_hash: 3e8c60eb7f8534bba85a0fe03976b836 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-69dfe6b7ea07485ce7ac2b357d39405ddf11c98e09779527c87afef5f55b4055.yml +openapi_spec_hash: d308c8d8efc3d3d6ef8ecd3168e4505f config_hash: 0fa938c5f41fe056f788e0c05a6ca2f7 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt index a19cce09..4727a4f6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt @@ -33,7 +33,6 @@ private constructor( private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, private val isPtp: JsonField, - private val isRestricted: JsonField, private val isShortProhibited: JsonField, private val isThresholdSecurity: JsonField, private val isTradable: JsonField, @@ -70,9 +69,6 @@ private constructor( @ExcludeMissing isMarginable: JsonField = JsonMissing.of(), @JsonProperty("is_ptp") @ExcludeMissing isPtp: JsonField = JsonMissing.of(), - @JsonProperty("is_restricted") - @ExcludeMissing - isRestricted: JsonField = JsonMissing.of(), @JsonProperty("is_short_prohibited") @ExcludeMissing isShortProhibited: JsonField = JsonMissing.of(), @@ -113,7 +109,6 @@ private constructor( isLiquidationOnly, isMarginable, isPtp, - isRestricted, isShortProhibited, isThresholdSecurity, isTradable, @@ -195,14 +190,6 @@ private constructor( */ fun isPtp(): Boolean = isPtp.getRequired("is_ptp") - /** - * Indicates if the instrument is restricted from trading - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun isRestricted(): Boolean = isRestricted.getRequired("is_restricted") - /** * Indicates if short selling is prohibited for the instrument * @@ -378,15 +365,6 @@ private constructor( */ @JsonProperty("is_ptp") @ExcludeMissing fun _isPtp(): JsonField = isPtp - /** - * Returns the raw JSON value of [isRestricted]. - * - * Unlike [isRestricted], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("is_restricted") - @ExcludeMissing - fun _isRestricted(): JsonField = isRestricted - /** * Returns the raw JSON value of [isShortProhibited]. * @@ -524,7 +502,6 @@ private constructor( * .isLiquidationOnly() * .isMarginable() * .isPtp() - * .isRestricted() * .isShortProhibited() * .isThresholdSecurity() * .isTradable() @@ -546,7 +523,6 @@ private constructor( private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null private var isPtp: JsonField? = null - private var isRestricted: JsonField? = null private var isShortProhibited: JsonField? = null private var isThresholdSecurity: JsonField? = null private var isTradable: JsonField? = null @@ -572,7 +548,6 @@ private constructor( isLiquidationOnly = instrument.isLiquidationOnly isMarginable = instrument.isMarginable isPtp = instrument.isPtp - isRestricted = instrument.isRestricted isShortProhibited = instrument.isShortProhibited isThresholdSecurity = instrument.isThresholdSecurity isTradable = instrument.isTradable @@ -696,20 +671,6 @@ private constructor( */ fun isPtp(isPtp: JsonField) = apply { this.isPtp = isPtp } - /** Indicates if the instrument is restricted from trading */ - fun isRestricted(isRestricted: Boolean) = isRestricted(JsonField.of(isRestricted)) - - /** - * Sets [Builder.isRestricted] to an arbitrary JSON value. - * - * You should usually call [Builder.isRestricted] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun isRestricted(isRestricted: JsonField) = apply { - this.isRestricted = isRestricted - } - /** Indicates if short selling is prohibited for the instrument */ fun isShortProhibited(isShortProhibited: Boolean) = isShortProhibited(JsonField.of(isShortProhibited)) @@ -967,7 +928,6 @@ private constructor( * .isLiquidationOnly() * .isMarginable() * .isPtp() - * .isRestricted() * .isShortProhibited() * .isThresholdSecurity() * .isTradable() @@ -987,7 +947,6 @@ private constructor( checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), checkRequired("isPtp", isPtp), - checkRequired("isRestricted", isRestricted), checkRequired("isShortProhibited", isShortProhibited), checkRequired("isThresholdSecurity", isThresholdSecurity), checkRequired("isTradable", isTradable), @@ -1028,7 +987,6 @@ private constructor( isLiquidationOnly() isMarginable() isPtp() - isRestricted() isShortProhibited() isThresholdSecurity() isTradable() @@ -1068,7 +1026,6 @@ private constructor( (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + (if (isPtp.asKnown().isPresent) 1 else 0) + - (if (isRestricted.asKnown().isPresent) 1 else 0) + (if (isShortProhibited.asKnown().isPresent) 1 else 0) + (if (isThresholdSecurity.asKnown().isPresent) 1 else 0) + (if (isTradable.asKnown().isPresent) 1 else 0) + @@ -1097,7 +1054,6 @@ private constructor( isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isPtp == other.isPtp && - isRestricted == other.isRestricted && isShortProhibited == other.isShortProhibited && isThresholdSecurity == other.isThresholdSecurity && isTradable == other.isTradable && @@ -1124,7 +1080,6 @@ private constructor( isLiquidationOnly, isMarginable, isPtp, - isRestricted, isShortProhibited, isThresholdSecurity, isTradable, @@ -1145,5 +1100,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, additionalProperties=$additionalProperties}" + "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt index fcf84dfc..5ff1ef31 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt @@ -29,7 +29,6 @@ private constructor( private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, private val isPtp: JsonField, - private val isRestricted: JsonField, private val isShortProhibited: JsonField, private val isThresholdSecurity: JsonField, private val isTradable: JsonField, @@ -65,9 +64,6 @@ private constructor( @ExcludeMissing isMarginable: JsonField = JsonMissing.of(), @JsonProperty("is_ptp") @ExcludeMissing isPtp: JsonField = JsonMissing.of(), - @JsonProperty("is_restricted") - @ExcludeMissing - isRestricted: JsonField = JsonMissing.of(), @JsonProperty("is_short_prohibited") @ExcludeMissing isShortProhibited: JsonField = JsonMissing.of(), @@ -105,7 +101,6 @@ private constructor( isLiquidationOnly, isMarginable, isPtp, - isRestricted, isShortProhibited, isThresholdSecurity, isTradable, @@ -186,14 +181,6 @@ private constructor( */ fun isPtp(): Boolean = isPtp.getRequired("is_ptp") - /** - * Indicates if the instrument is restricted from trading - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun isRestricted(): Boolean = isRestricted.getRequired("is_restricted") - /** * Indicates if short selling is prohibited for the instrument * @@ -359,15 +346,6 @@ private constructor( */ @JsonProperty("is_ptp") @ExcludeMissing fun _isPtp(): JsonField = isPtp - /** - * Returns the raw JSON value of [isRestricted]. - * - * Unlike [isRestricted], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("is_restricted") - @ExcludeMissing - fun _isRestricted(): JsonField = isRestricted - /** * Returns the raw JSON value of [isShortProhibited]. * @@ -495,7 +473,6 @@ private constructor( * .isLiquidationOnly() * .isMarginable() * .isPtp() - * .isRestricted() * .isShortProhibited() * .isThresholdSecurity() * .isTradable() @@ -517,7 +494,6 @@ private constructor( private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null private var isPtp: JsonField? = null - private var isRestricted: JsonField? = null private var isShortProhibited: JsonField? = null private var isThresholdSecurity: JsonField? = null private var isTradable: JsonField? = null @@ -542,7 +518,6 @@ private constructor( isLiquidationOnly = instrumentCore.isLiquidationOnly isMarginable = instrumentCore.isMarginable isPtp = instrumentCore.isPtp - isRestricted = instrumentCore.isRestricted isShortProhibited = instrumentCore.isShortProhibited isThresholdSecurity = instrumentCore.isThresholdSecurity isTradable = instrumentCore.isTradable @@ -665,20 +640,6 @@ private constructor( */ fun isPtp(isPtp: JsonField) = apply { this.isPtp = isPtp } - /** Indicates if the instrument is restricted from trading */ - fun isRestricted(isRestricted: Boolean) = isRestricted(JsonField.of(isRestricted)) - - /** - * Sets [Builder.isRestricted] to an arbitrary JSON value. - * - * You should usually call [Builder.isRestricted] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun isRestricted(isRestricted: JsonField) = apply { - this.isRestricted = isRestricted - } - /** Indicates if short selling is prohibited for the instrument */ fun isShortProhibited(isShortProhibited: Boolean) = isShortProhibited(JsonField.of(isShortProhibited)) @@ -900,7 +861,6 @@ private constructor( * .isLiquidationOnly() * .isMarginable() * .isPtp() - * .isRestricted() * .isShortProhibited() * .isThresholdSecurity() * .isTradable() @@ -920,7 +880,6 @@ private constructor( checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), checkRequired("isPtp", isPtp), - checkRequired("isRestricted", isRestricted), checkRequired("isShortProhibited", isShortProhibited), checkRequired("isThresholdSecurity", isThresholdSecurity), checkRequired("isTradable", isTradable), @@ -960,7 +919,6 @@ private constructor( isLiquidationOnly() isMarginable() isPtp() - isRestricted() isShortProhibited() isThresholdSecurity() isTradable() @@ -999,7 +957,6 @@ private constructor( (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + (if (isPtp.asKnown().isPresent) 1 else 0) + - (if (isRestricted.asKnown().isPresent) 1 else 0) + (if (isShortProhibited.asKnown().isPresent) 1 else 0) + (if (isThresholdSecurity.asKnown().isPresent) 1 else 0) + (if (isTradable.asKnown().isPresent) 1 else 0) + @@ -1027,7 +984,6 @@ private constructor( isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isPtp == other.isPtp && - isRestricted == other.isRestricted && isShortProhibited == other.isShortProhibited && isThresholdSecurity == other.isThresholdSecurity && isTradable == other.isTradable && @@ -1053,7 +1009,6 @@ private constructor( isLiquidationOnly, isMarginable, isPtp, - isRestricted, isShortProhibited, isThresholdSecurity, isTradable, @@ -1073,5 +1028,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, additionalProperties=$additionalProperties}" + "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt index 030cd4f3..ec0687ad 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt @@ -18,7 +18,6 @@ private constructor( private val isLiquidationOnly: Boolean?, private val isMarginable: Boolean?, private val isPtp: Boolean?, - private val isRestricted: Boolean?, private val isShortProhibited: Boolean?, private val isThresholdSecurity: Boolean?, private val pageSize: Long?, @@ -42,9 +41,6 @@ private constructor( /** Filter by publicly traded partnership (PTP) status */ fun isPtp(): Optional = Optional.ofNullable(isPtp) - /** Filter by restricted status */ - fun isRestricted(): Optional = Optional.ofNullable(isRestricted) - /** Filter by short prohibited status */ fun isShortProhibited(): Optional = Optional.ofNullable(isShortProhibited) @@ -87,7 +83,6 @@ private constructor( private var isLiquidationOnly: Boolean? = null private var isMarginable: Boolean? = null private var isPtp: Boolean? = null - private var isRestricted: Boolean? = null private var isShortProhibited: Boolean? = null private var isThresholdSecurity: Boolean? = null private var pageSize: Long? = null @@ -102,7 +97,6 @@ private constructor( isLiquidationOnly = instrumentGetInstrumentsParams.isLiquidationOnly isMarginable = instrumentGetInstrumentsParams.isMarginable isPtp = instrumentGetInstrumentsParams.isPtp - isRestricted = instrumentGetInstrumentsParams.isRestricted isShortProhibited = instrumentGetInstrumentsParams.isShortProhibited isThresholdSecurity = instrumentGetInstrumentsParams.isThresholdSecurity pageSize = instrumentGetInstrumentsParams.pageSize @@ -185,19 +179,6 @@ private constructor( /** Alias for calling [Builder.isPtp] with `isPtp.orElse(null)`. */ fun isPtp(isPtp: Optional) = isPtp(isPtp.getOrNull()) - /** Filter by restricted status */ - fun isRestricted(isRestricted: Boolean?) = apply { this.isRestricted = isRestricted } - - /** - * Alias for [Builder.isRestricted]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun isRestricted(isRestricted: Boolean) = isRestricted(isRestricted as Boolean?) - - /** Alias for calling [Builder.isRestricted] with `isRestricted.orElse(null)`. */ - fun isRestricted(isRestricted: Optional) = isRestricted(isRestricted.getOrNull()) - /** Filter by short prohibited status */ fun isShortProhibited(isShortProhibited: Boolean?) = apply { this.isShortProhibited = isShortProhibited @@ -366,7 +347,6 @@ private constructor( isLiquidationOnly, isMarginable, isPtp, - isRestricted, isShortProhibited, isThresholdSecurity, pageSize, @@ -386,7 +366,6 @@ private constructor( isLiquidationOnly?.let { put("is_liquidation_only", it.toString()) } isMarginable?.let { put("is_marginable", it.toString()) } isPtp?.let { put("is_ptp", it.toString()) } - isRestricted?.let { put("is_restricted", it.toString()) } isShortProhibited?.let { put("is_short_prohibited", it.toString()) } isThresholdSecurity?.let { put("is_threshold_security", it.toString()) } pageSize?.let { put("page_size", it.toString()) } @@ -406,7 +385,6 @@ private constructor( isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isPtp == other.isPtp && - isRestricted == other.isRestricted && isShortProhibited == other.isShortProhibited && isThresholdSecurity == other.isThresholdSecurity && pageSize == other.pageSize && @@ -422,7 +400,6 @@ private constructor( isLiquidationOnly, isMarginable, isPtp, - isRestricted, isShortProhibited, isThresholdSecurity, pageSize, @@ -432,5 +409,5 @@ private constructor( ) override fun toString() = - "InstrumentGetInstrumentsParams{easyToBorrow=$easyToBorrow, instrumentIds=$instrumentIds, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isRestricted=$isRestricted, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentGetInstrumentsParams{easyToBorrow=$easyToBorrow, instrumentIds=$instrumentIds, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt index 6cb54caf..c402ef5b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt @@ -29,7 +29,6 @@ private constructor( private val currency: String?, private val includeInactive: Boolean?, private val includePtp: Boolean?, - private val includeRestricted: Boolean?, private val pageSize: Long?, private val pageToken: String?, private val additionalHeaders: Headers, @@ -60,9 +59,6 @@ private constructor( */ fun includePtp(): Optional = Optional.ofNullable(includePtp) - /** Include restricted instruments. Default true (penalized in ranking). */ - fun includeRestricted(): Optional = Optional.ofNullable(includeRestricted) - /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) @@ -103,7 +99,6 @@ private constructor( private var currency: String? = null private var includeInactive: Boolean? = null private var includePtp: Boolean? = null - private var includeRestricted: Boolean? = null private var pageSize: Long? = null private var pageToken: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -118,7 +113,6 @@ private constructor( currency = instrumentSearchInstrumentsParams.currency includeInactive = instrumentSearchInstrumentsParams.includeInactive includePtp = instrumentSearchInstrumentsParams.includePtp - includeRestricted = instrumentSearchInstrumentsParams.includeRestricted pageSize = instrumentSearchInstrumentsParams.pageSize pageToken = instrumentSearchInstrumentsParams.pageToken additionalHeaders = instrumentSearchInstrumentsParams.additionalHeaders.toBuilder() @@ -185,23 +179,6 @@ private constructor( /** Alias for calling [Builder.includePtp] with `includePtp.orElse(null)`. */ fun includePtp(includePtp: Optional) = includePtp(includePtp.getOrNull()) - /** Include restricted instruments. Default true (penalized in ranking). */ - fun includeRestricted(includeRestricted: Boolean?) = apply { - this.includeRestricted = includeRestricted - } - - /** - * Alias for [Builder.includeRestricted]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun includeRestricted(includeRestricted: Boolean) = - includeRestricted(includeRestricted as Boolean?) - - /** Alias for calling [Builder.includeRestricted] with `includeRestricted.orElse(null)`. */ - fun includeRestricted(includeRestricted: Optional) = - includeRestricted(includeRestricted.getOrNull()) - /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } @@ -342,7 +319,6 @@ private constructor( currency, includeInactive, includePtp, - includeRestricted, pageSize, pageToken, additionalHeaders.build(), @@ -361,7 +337,6 @@ private constructor( currency?.let { put("currency", it) } includeInactive?.let { put("include_inactive", it.toString()) } includePtp?.let { put("include_ptp", it.toString()) } - includeRestricted?.let { put("include_restricted", it.toString()) } pageSize?.let { put("page_size", it.toString()) } pageToken?.let { put("page_token", it) } putAll(additionalQueryParams) @@ -380,7 +355,6 @@ private constructor( currency == other.currency && includeInactive == other.includeInactive && includePtp == other.includePtp && - includeRestricted == other.includeRestricted && pageSize == other.pageSize && pageToken == other.pageToken && additionalHeaders == other.additionalHeaders && @@ -395,7 +369,6 @@ private constructor( currency, includeInactive, includePtp, - includeRestricted, pageSize, pageToken, additionalHeaders, @@ -403,5 +376,5 @@ private constructor( ) override fun toString() = - "InstrumentSearchInstrumentsParams{q=$q, assetClass=$assetClass, country=$country, currency=$currency, includeInactive=$includeInactive, includePtp=$includePtp, includeRestricted=$includeRestricted, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentSearchInstrumentsParams{q=$q, assetClass=$assetClass, country=$country, currency=$currency, includeInactive=$includeInactive, includePtp=$includePtp, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/OptionsContract.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/OptionsContract.kt index d7061921..02f73c02 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/OptionsContract.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/OptionsContract.kt @@ -30,7 +30,6 @@ private constructor( private val expiry: JsonField, private val isLiquidationOnly: JsonField, private val isMarginable: JsonField, - private val isRestricted: JsonField, private val listingType: JsonField, private val multiplier: JsonField, private val strikePrice: JsonField, @@ -58,9 +57,6 @@ private constructor( @JsonProperty("is_marginable") @ExcludeMissing isMarginable: JsonField = JsonMissing.of(), - @JsonProperty("is_restricted") - @ExcludeMissing - isRestricted: JsonField = JsonMissing.of(), @JsonProperty("listing_type") @ExcludeMissing listingType: JsonField = JsonMissing.of(), @@ -86,7 +82,6 @@ private constructor( expiry, isLiquidationOnly, isMarginable, - isRestricted, listingType, multiplier, strikePrice, @@ -160,14 +155,6 @@ private constructor( */ fun isMarginable(): Boolean = isMarginable.getRequired("is_marginable") - /** - * Whether the contract is restricted from trading - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun isRestricted(): Boolean = isRestricted.getRequired("is_restricted") - /** * Listing type * @@ -282,15 +269,6 @@ private constructor( @ExcludeMissing fun _isMarginable(): JsonField = isMarginable - /** - * Returns the raw JSON value of [isRestricted]. - * - * Unlike [isRestricted], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("is_restricted") - @ExcludeMissing - fun _isRestricted(): JsonField = isRestricted - /** * Returns the raw JSON value of [listingType]. * @@ -369,7 +347,6 @@ private constructor( * .expiry() * .isLiquidationOnly() * .isMarginable() - * .isRestricted() * .listingType() * .multiplier() * .strikePrice() @@ -390,7 +367,6 @@ private constructor( private var expiry: JsonField? = null private var isLiquidationOnly: JsonField? = null private var isMarginable: JsonField? = null - private var isRestricted: JsonField? = null private var listingType: JsonField? = null private var multiplier: JsonField? = null private var strikePrice: JsonField? = null @@ -409,7 +385,6 @@ private constructor( expiry = optionsContract.expiry isLiquidationOnly = optionsContract.isLiquidationOnly isMarginable = optionsContract.isMarginable - isRestricted = optionsContract.isRestricted listingType = optionsContract.listingType multiplier = optionsContract.multiplier strikePrice = optionsContract.strikePrice @@ -521,20 +496,6 @@ private constructor( this.isMarginable = isMarginable } - /** Whether the contract is restricted from trading */ - fun isRestricted(isRestricted: Boolean) = isRestricted(JsonField.of(isRestricted)) - - /** - * Sets [Builder.isRestricted] to an arbitrary JSON value. - * - * You should usually call [Builder.isRestricted] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun isRestricted(isRestricted: JsonField) = apply { - this.isRestricted = isRestricted - } - /** Listing type */ fun listingType(listingType: ListingType) = listingType(JsonField.of(listingType)) @@ -662,7 +623,6 @@ private constructor( * .expiry() * .isLiquidationOnly() * .isMarginable() - * .isRestricted() * .listingType() * .multiplier() * .strikePrice() @@ -681,7 +641,6 @@ private constructor( checkRequired("expiry", expiry), checkRequired("isLiquidationOnly", isLiquidationOnly), checkRequired("isMarginable", isMarginable), - checkRequired("isRestricted", isRestricted), checkRequired("listingType", listingType), checkRequired("multiplier", multiplier), checkRequired("strikePrice", strikePrice), @@ -715,7 +674,6 @@ private constructor( expiry() isLiquidationOnly() isMarginable() - isRestricted() listingType().validate() multiplier() strikePrice() @@ -748,7 +706,6 @@ private constructor( (if (expiry.asKnown().isPresent) 1 else 0) + (if (isLiquidationOnly.asKnown().isPresent) 1 else 0) + (if (isMarginable.asKnown().isPresent) 1 else 0) + - (if (isRestricted.asKnown().isPresent) 1 else 0) + (listingType.asKnown().getOrNull()?.validity() ?: 0) + (if (multiplier.asKnown().isPresent) 1 else 0) + (if (strikePrice.asKnown().isPresent) 1 else 0) + @@ -770,7 +727,6 @@ private constructor( expiry == other.expiry && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && - isRestricted == other.isRestricted && listingType == other.listingType && multiplier == other.multiplier && strikePrice == other.strikePrice && @@ -790,7 +746,6 @@ private constructor( expiry, isLiquidationOnly, isMarginable, - isRestricted, listingType, multiplier, strikePrice, @@ -804,5 +759,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OptionsContract{id=$id, contractType=$contractType, currency=$currency, exchange=$exchange, exerciseStyle=$exerciseStyle, expiry=$expiry, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isRestricted=$isRestricted, listingType=$listingType, multiplier=$multiplier, strikePrice=$strikePrice, symbol=$symbol, openInterest=$openInterest, underlyingInstrumentId=$underlyingInstrumentId, additionalProperties=$additionalProperties}" + "OptionsContract{id=$id, contractType=$contractType, currency=$currency, exchange=$exchange, exerciseStyle=$exerciseStyle, expiry=$expiry, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, listingType=$listingType, multiplier=$multiplier, strikePrice=$strikePrice, symbol=$symbol, openInterest=$openInterest, underlyingInstrumentId=$underlyingInstrumentId, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt index ca6487d6..5e28f4bd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt @@ -22,7 +22,6 @@ internal class InstrumentCoreTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -45,7 +44,6 @@ internal class InstrumentCoreTest { assertThat(instrumentCore.isLiquidationOnly()).isEqualTo(false) assertThat(instrumentCore.isMarginable()).isEqualTo(true) assertThat(instrumentCore.isPtp()).isEqualTo(false) - assertThat(instrumentCore.isRestricted()).isEqualTo(false) assertThat(instrumentCore.isShortProhibited()).isEqualTo(false) assertThat(instrumentCore.isThresholdSecurity()).isEqualTo(false) assertThat(instrumentCore.isTradable()).isEqualTo(true) @@ -73,7 +71,6 @@ internal class InstrumentCoreTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index f2cb5242..d42a40cd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -49,7 +49,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -101,7 +100,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -155,7 +153,6 @@ internal class InstrumentGetInstrumentByIdResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt index 56c87f51..92053283 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt @@ -16,7 +16,6 @@ internal class InstrumentGetInstrumentsParamsTest { .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) - .isRestricted(true) .isShortProhibited(true) .isThresholdSecurity(true) .pageSize(1L) @@ -33,7 +32,6 @@ internal class InstrumentGetInstrumentsParamsTest { .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) - .isRestricted(true) .isShortProhibited(true) .isThresholdSecurity(true) .pageSize(1L) @@ -50,7 +48,6 @@ internal class InstrumentGetInstrumentsParamsTest { .put("is_liquidation_only", "true") .put("is_marginable", "true") .put("is_ptp", "true") - .put("is_restricted", "true") .put("is_short_prohibited", "true") .put("is_threshold_security", "true") .put("page_size", "1") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index a0687729..a21333a2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -48,7 +48,6 @@ internal class InstrumentGetInstrumentsResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -99,7 +98,6 @@ internal class InstrumentGetInstrumentsResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -152,7 +150,6 @@ internal class InstrumentGetInstrumentsResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt index da0f09c3..65efee68 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt @@ -48,7 +48,6 @@ internal class InstrumentGetOptionContractsResponseTest { .expiry(LocalDate.parse("2026-03-18")) .isLiquidationOnly(true) .isMarginable(true) - .isRestricted(true) .listingType(ListingType.STANDARD) .multiplier("100") .strikePrice("150.00") @@ -93,7 +92,6 @@ internal class InstrumentGetOptionContractsResponseTest { .expiry(LocalDate.parse("2026-03-18")) .isLiquidationOnly(true) .isMarginable(true) - .isRestricted(true) .listingType(ListingType.STANDARD) .multiplier("100") .strikePrice("150.00") @@ -140,7 +138,6 @@ internal class InstrumentGetOptionContractsResponseTest { .expiry(LocalDate.parse("2026-03-18")) .isLiquidationOnly(true) .isMarginable(true) - .isRestricted(true) .listingType(ListingType.STANDARD) .multiplier("100") .strikePrice("150.00") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt index 87e17fe2..8db18994 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt @@ -17,7 +17,6 @@ internal class InstrumentSearchInstrumentsParamsTest { .currency("currency") .includeInactive(true) .includePtp(true) - .includeRestricted(true) .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -33,7 +32,6 @@ internal class InstrumentSearchInstrumentsParamsTest { .currency("currency") .includeInactive(true) .includePtp(true) - .includeRestricted(true) .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -49,7 +47,6 @@ internal class InstrumentSearchInstrumentsParamsTest { .put("currency", "currency") .put("include_inactive", "true") .put("include_ptp", "true") - .put("include_restricted", "true") .put("page_size", "1") .put("page_token", "U3RhaW5sZXNzIHJvY2tz") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index 7a8a3c51..55bb22da 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -48,7 +48,6 @@ internal class InstrumentSearchInstrumentsResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -99,7 +98,6 @@ internal class InstrumentSearchInstrumentsResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -152,7 +150,6 @@ internal class InstrumentSearchInstrumentsResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt index e77272d0..44dfd89a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt @@ -24,7 +24,6 @@ internal class InstrumentTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -48,7 +47,6 @@ internal class InstrumentTest { assertThat(instrument.isLiquidationOnly()).isEqualTo(false) assertThat(instrument.isMarginable()).isEqualTo(true) assertThat(instrument.isPtp()).isEqualTo(false) - assertThat(instrument.isRestricted()).isEqualTo(false) assertThat(instrument.isShortProhibited()).isEqualTo(false) assertThat(instrument.isThresholdSecurity()).isEqualTo(false) assertThat(instrument.isTradable()).isEqualTo(true) @@ -78,7 +76,6 @@ internal class InstrumentTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/OptionsContractTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/OptionsContractTest.kt index 4d87bba4..6e13f9ab 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/OptionsContractTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/OptionsContractTest.kt @@ -22,7 +22,6 @@ internal class OptionsContractTest { .expiry(LocalDate.parse("2026-03-18")) .isLiquidationOnly(true) .isMarginable(true) - .isRestricted(true) .listingType(ListingType.STANDARD) .multiplier("100") .strikePrice("150.00") @@ -39,7 +38,6 @@ internal class OptionsContractTest { assertThat(optionsContract.expiry()).isEqualTo(LocalDate.parse("2026-03-18")) assertThat(optionsContract.isLiquidationOnly()).isEqualTo(true) assertThat(optionsContract.isMarginable()).isEqualTo(true) - assertThat(optionsContract.isRestricted()).isEqualTo(true) assertThat(optionsContract.listingType()).isEqualTo(ListingType.STANDARD) assertThat(optionsContract.multiplier()).isEqualTo("100") assertThat(optionsContract.strikePrice()).isEqualTo("150.00") @@ -62,7 +60,6 @@ internal class OptionsContractTest { .expiry(LocalDate.parse("2026-03-18")) .isLiquidationOnly(true) .isMarginable(true) - .isRestricted(true) .listingType(ListingType.STANDARD) .multiplier("100") .strikePrice("150.00") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt index 542bb8da..09f15039 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -34,7 +34,6 @@ internal class WatchlistDetailTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -74,7 +73,6 @@ internal class WatchlistDetailTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -117,7 +115,6 @@ internal class WatchlistDetailTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index 3ee37e0b..06a2320f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -60,7 +60,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -126,7 +125,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -194,7 +192,6 @@ internal class WatchlistGetWatchlistByIdResponseTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt index d12e3a34..e57bfd75 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -30,7 +30,6 @@ internal class WatchlistItemEntryTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -63,7 +62,6 @@ internal class WatchlistItemEntryTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) @@ -99,7 +97,6 @@ internal class WatchlistItemEntryTest { .isLiquidationOnly(false) .isMarginable(true) .isPtp(false) - .isRestricted(false) .isShortProhibited(false) .isThresholdSecurity(false) .isTradable(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt index ff3c30ec..02213c17 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt @@ -46,7 +46,6 @@ internal class InstrumentServiceAsyncTest { .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) - .isRestricted(true) .isShortProhibited(true) .isThresholdSecurity(true) .pageSize(1L) @@ -95,7 +94,6 @@ internal class InstrumentServiceAsyncTest { .currency("currency") .includeInactive(true) .includePtp(true) - .includeRestricted(true) .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt index 6f7edee6..b820d597 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt @@ -45,7 +45,6 @@ internal class InstrumentServiceTest { .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) - .isRestricted(true) .isShortProhibited(true) .isThresholdSecurity(true) .pageSize(1L) @@ -92,7 +91,6 @@ internal class InstrumentServiceTest { .currency("currency") .includeInactive(true) .includePtp(true) - .includeRestricted(true) .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() From 41e8452dfb42fbb923047fa29d03d01b213adee3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 20:44:53 +0000 Subject: [PATCH 25/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/instruments/Instrument.kt | 88 ++++++++- .../models/v1/instruments/InstrumentCore.kt | 89 ++++++++- .../InstrumentGetInstrumentsParams.kt | 172 +++++++++++++++++- .../v1/instruments/InstrumentCoreTest.kt | 7 + ...InstrumentGetInstrumentByIdResponseTest.kt | 6 + .../InstrumentGetInstrumentsParamsTest.kt | 3 + .../InstrumentGetInstrumentsResponseTest.kt | 7 + ...InstrumentSearchInstrumentsResponseTest.kt | 7 + .../models/v1/instruments/InstrumentTest.kt | 6 + .../v1/watchlist/WatchlistDetailTest.kt | 6 + .../WatchlistGetWatchlistByIdResponseTest.kt | 6 + .../v1/watchlist/WatchlistItemEntryTest.kt | 6 + .../async/v1/InstrumentServiceAsyncTest.kt | 1 + .../blocking/v1/InstrumentServiceTest.kt | 1 + 15 files changed, 402 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 024d95b8..30d83450 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-69dfe6b7ea07485ce7ac2b357d39405ddf11c98e09779527c87afef5f55b4055.yml -openapi_spec_hash: d308c8d8efc3d3d6ef8ecd3168e4505f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-e3ed5b42b9f5d9991da2f3f5cb2fc32e8d68dfd569b52fad0fa559fe0db346ba.yml +openapi_spec_hash: 6c1a04c9357358837d556273a188d012 config_hash: 0fa938c5f41fe056f788e0c05a6ca2f7 diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt index 4727a4f6..d31aac6f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt @@ -39,6 +39,7 @@ private constructor( private val symbol: JsonField, private val venue: JsonField, private val adv: JsonField, + private val expiry: JsonField, private val instrumentType: JsonField, private val longMarginRate: JsonField, private val name: JsonField, @@ -46,6 +47,7 @@ private constructor( private val optionsExpiryDates: JsonField>, private val previousClose: JsonField, private val shortMarginRate: JsonField, + private val strikePrice: JsonField, private val additionalProperties: MutableMap, ) { @@ -81,6 +83,7 @@ private constructor( @JsonProperty("symbol") @ExcludeMissing symbol: JsonField = JsonMissing.of(), @JsonProperty("venue") @ExcludeMissing venue: JsonField = JsonMissing.of(), @JsonProperty("adv") @ExcludeMissing adv: JsonField = JsonMissing.of(), + @JsonProperty("expiry") @ExcludeMissing expiry: JsonField = JsonMissing.of(), @JsonProperty("instrument_type") @ExcludeMissing instrumentType: JsonField = JsonMissing.of(), @@ -100,6 +103,9 @@ private constructor( @JsonProperty("short_margin_rate") @ExcludeMissing shortMarginRate: JsonField = JsonMissing.of(), + @JsonProperty("strike_price") + @ExcludeMissing + strikePrice: JsonField = JsonMissing.of(), ) : this( id, countryOfIssue, @@ -115,6 +121,7 @@ private constructor( symbol, venue, adv, + expiry, instrumentType, longMarginRate, name, @@ -122,6 +129,7 @@ private constructor( optionsExpiryDates, previousClose, shortMarginRate, + strikePrice, mutableMapOf(), ) @@ -238,6 +246,14 @@ private constructor( */ fun adv(): Optional = adv.getOptional("adv") + /** + * The expiration date for options instruments + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun expiry(): Optional = expiry.getOptional("expiry") + /** * The type of security (e.g., Common Stock, ETF) * @@ -298,6 +314,14 @@ private constructor( */ fun shortMarginRate(): Optional = shortMarginRate.getOptional("short_margin_rate") + /** + * The strike price for options instruments + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun strikePrice(): Optional = strikePrice.getOptional("strike_price") + /** * Returns the raw JSON value of [id]. * @@ -413,6 +437,13 @@ private constructor( */ @JsonProperty("adv") @ExcludeMissing fun _adv(): JsonField = adv + /** + * Returns the raw JSON value of [expiry]. + * + * Unlike [expiry], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("expiry") @ExcludeMissing fun _expiry(): JsonField = expiry + /** * Returns the raw JSON value of [instrumentType]. * @@ -475,6 +506,15 @@ private constructor( @ExcludeMissing fun _shortMarginRate(): JsonField = shortMarginRate + /** + * Returns the raw JSON value of [strikePrice]. + * + * Unlike [strikePrice], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("strike_price") + @ExcludeMissing + fun _strikePrice(): JsonField = strikePrice + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -529,6 +569,7 @@ private constructor( private var symbol: JsonField? = null private var venue: JsonField? = null private var adv: JsonField = JsonMissing.of() + private var expiry: JsonField = JsonMissing.of() private var instrumentType: JsonField = JsonMissing.of() private var longMarginRate: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -536,6 +577,7 @@ private constructor( private var optionsExpiryDates: JsonField>? = null private var previousClose: JsonField = JsonMissing.of() private var shortMarginRate: JsonField = JsonMissing.of() + private var strikePrice: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -554,6 +596,7 @@ private constructor( symbol = instrument.symbol venue = instrument.venue adv = instrument.adv + expiry = instrument.expiry instrumentType = instrument.instrumentType longMarginRate = instrument.longMarginRate name = instrument.name @@ -561,6 +604,7 @@ private constructor( optionsExpiryDates = instrument.optionsExpiryDates.map { it.toMutableList() } previousClose = instrument.previousClose shortMarginRate = instrument.shortMarginRate + strikePrice = instrument.strikePrice additionalProperties = instrument.additionalProperties.toMutableMap() } @@ -749,6 +793,21 @@ private constructor( */ fun adv(adv: JsonField) = apply { this.adv = adv } + /** The expiration date for options instruments */ + fun expiry(expiry: LocalDate?) = expiry(JsonField.ofNullable(expiry)) + + /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ + fun expiry(expiry: Optional) = expiry(expiry.getOrNull()) + + /** + * Sets [Builder.expiry] to an arbitrary JSON value. + * + * You should usually call [Builder.expiry] with a well-typed [LocalDate] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun expiry(expiry: JsonField) = apply { this.expiry = expiry } + /** The type of security (e.g., Common Stock, ETF) */ fun instrumentType(instrumentType: SecurityType?) = instrumentType(JsonField.ofNullable(instrumentType)) @@ -894,6 +953,21 @@ private constructor( this.shortMarginRate = shortMarginRate } + /** The strike price for options instruments */ + fun strikePrice(strikePrice: String?) = strikePrice(JsonField.ofNullable(strikePrice)) + + /** Alias for calling [Builder.strikePrice] with `strikePrice.orElse(null)`. */ + fun strikePrice(strikePrice: Optional) = strikePrice(strikePrice.getOrNull()) + + /** + * Sets [Builder.strikePrice] to an arbitrary JSON value. + * + * You should usually call [Builder.strikePrice] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun strikePrice(strikePrice: JsonField) = apply { this.strikePrice = strikePrice } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -953,6 +1027,7 @@ private constructor( checkRequired("symbol", symbol), checkRequired("venue", venue), adv, + expiry, instrumentType, longMarginRate, name, @@ -960,6 +1035,7 @@ private constructor( (optionsExpiryDates ?: JsonMissing.of()).map { it.toImmutable() }, previousClose, shortMarginRate, + strikePrice, additionalProperties.toMutableMap(), ) } @@ -993,6 +1069,7 @@ private constructor( symbol() venue() adv() + expiry() instrumentType().ifPresent { it.validate() } longMarginRate() name() @@ -1000,6 +1077,7 @@ private constructor( optionsExpiryDates() previousClose() shortMarginRate() + strikePrice() validated = true } @@ -1032,13 +1110,15 @@ private constructor( (if (symbol.asKnown().isPresent) 1 else 0) + (if (venue.asKnown().isPresent) 1 else 0) + (if (adv.asKnown().isPresent) 1 else 0) + + (if (expiry.asKnown().isPresent) 1 else 0) + (instrumentType.asKnown().getOrNull()?.validity() ?: 0) + (if (longMarginRate.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (notionalAdv.asKnown().isPresent) 1 else 0) + (optionsExpiryDates.asKnown().getOrNull()?.size ?: 0) + (if (previousClose.asKnown().isPresent) 1 else 0) + - (if (shortMarginRate.asKnown().isPresent) 1 else 0) + (if (shortMarginRate.asKnown().isPresent) 1 else 0) + + (if (strikePrice.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1060,6 +1140,7 @@ private constructor( symbol == other.symbol && venue == other.venue && adv == other.adv && + expiry == other.expiry && instrumentType == other.instrumentType && longMarginRate == other.longMarginRate && name == other.name && @@ -1067,6 +1148,7 @@ private constructor( optionsExpiryDates == other.optionsExpiryDates && previousClose == other.previousClose && shortMarginRate == other.shortMarginRate && + strikePrice == other.strikePrice && additionalProperties == other.additionalProperties } @@ -1086,6 +1168,7 @@ private constructor( symbol, venue, adv, + expiry, instrumentType, longMarginRate, name, @@ -1093,6 +1176,7 @@ private constructor( optionsExpiryDates, previousClose, shortMarginRate, + strikePrice, additionalProperties, ) } @@ -1100,5 +1184,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, additionalProperties=$additionalProperties}" + "Instrument{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, optionsExpiryDates=$optionsExpiryDates, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt index 5ff1ef31..8b89da6c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty +import java.time.LocalDate import java.util.Collections import java.util.Objects import java.util.Optional @@ -35,12 +36,14 @@ private constructor( private val symbol: JsonField, private val venue: JsonField, private val adv: JsonField, + private val expiry: JsonField, private val instrumentType: JsonField, private val longMarginRate: JsonField, private val name: JsonField, private val notionalAdv: JsonField, private val previousClose: JsonField, private val shortMarginRate: JsonField, + private val strikePrice: JsonField, private val additionalProperties: MutableMap, ) { @@ -76,6 +79,7 @@ private constructor( @JsonProperty("symbol") @ExcludeMissing symbol: JsonField = JsonMissing.of(), @JsonProperty("venue") @ExcludeMissing venue: JsonField = JsonMissing.of(), @JsonProperty("adv") @ExcludeMissing adv: JsonField = JsonMissing.of(), + @JsonProperty("expiry") @ExcludeMissing expiry: JsonField = JsonMissing.of(), @JsonProperty("instrument_type") @ExcludeMissing instrumentType: JsonField = JsonMissing.of(), @@ -92,6 +96,9 @@ private constructor( @JsonProperty("short_margin_rate") @ExcludeMissing shortMarginRate: JsonField = JsonMissing.of(), + @JsonProperty("strike_price") + @ExcludeMissing + strikePrice: JsonField = JsonMissing.of(), ) : this( id, countryOfIssue, @@ -107,12 +114,14 @@ private constructor( symbol, venue, adv, + expiry, instrumentType, longMarginRate, name, notionalAdv, previousClose, shortMarginRate, + strikePrice, mutableMapOf(), ) @@ -229,6 +238,14 @@ private constructor( */ fun adv(): Optional = adv.getOptional("adv") + /** + * The expiration date for options instruments + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun expiry(): Optional = expiry.getOptional("expiry") + /** * The type of security (e.g., Common Stock, ETF) * @@ -279,6 +296,14 @@ private constructor( */ fun shortMarginRate(): Optional = shortMarginRate.getOptional("short_margin_rate") + /** + * The strike price for options instruments + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun strikePrice(): Optional = strikePrice.getOptional("strike_price") + /** * Returns the raw JSON value of [id]. * @@ -394,6 +419,13 @@ private constructor( */ @JsonProperty("adv") @ExcludeMissing fun _adv(): JsonField = adv + /** + * Returns the raw JSON value of [expiry]. + * + * Unlike [expiry], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("expiry") @ExcludeMissing fun _expiry(): JsonField = expiry + /** * Returns the raw JSON value of [instrumentType]. * @@ -446,6 +478,15 @@ private constructor( @ExcludeMissing fun _shortMarginRate(): JsonField = shortMarginRate + /** + * Returns the raw JSON value of [strikePrice]. + * + * Unlike [strikePrice], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("strike_price") + @ExcludeMissing + fun _strikePrice(): JsonField = strikePrice + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -500,12 +541,14 @@ private constructor( private var symbol: JsonField? = null private var venue: JsonField? = null private var adv: JsonField = JsonMissing.of() + private var expiry: JsonField = JsonMissing.of() private var instrumentType: JsonField = JsonMissing.of() private var longMarginRate: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var notionalAdv: JsonField = JsonMissing.of() private var previousClose: JsonField = JsonMissing.of() private var shortMarginRate: JsonField = JsonMissing.of() + private var strikePrice: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -524,12 +567,14 @@ private constructor( symbol = instrumentCore.symbol venue = instrumentCore.venue adv = instrumentCore.adv + expiry = instrumentCore.expiry instrumentType = instrumentCore.instrumentType longMarginRate = instrumentCore.longMarginRate name = instrumentCore.name notionalAdv = instrumentCore.notionalAdv previousClose = instrumentCore.previousClose shortMarginRate = instrumentCore.shortMarginRate + strikePrice = instrumentCore.strikePrice additionalProperties = instrumentCore.additionalProperties.toMutableMap() } @@ -718,6 +763,21 @@ private constructor( */ fun adv(adv: JsonField) = apply { this.adv = adv } + /** The expiration date for options instruments */ + fun expiry(expiry: LocalDate?) = expiry(JsonField.ofNullable(expiry)) + + /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ + fun expiry(expiry: Optional) = expiry(expiry.getOrNull()) + + /** + * Sets [Builder.expiry] to an arbitrary JSON value. + * + * You should usually call [Builder.expiry] with a well-typed [LocalDate] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun expiry(expiry: JsonField) = apply { this.expiry = expiry } + /** The type of security (e.g., Common Stock, ETF) */ fun instrumentType(instrumentType: SecurityType?) = instrumentType(JsonField.ofNullable(instrumentType)) @@ -827,6 +887,21 @@ private constructor( this.shortMarginRate = shortMarginRate } + /** The strike price for options instruments */ + fun strikePrice(strikePrice: String?) = strikePrice(JsonField.ofNullable(strikePrice)) + + /** Alias for calling [Builder.strikePrice] with `strikePrice.orElse(null)`. */ + fun strikePrice(strikePrice: Optional) = strikePrice(strikePrice.getOrNull()) + + /** + * Sets [Builder.strikePrice] to an arbitrary JSON value. + * + * You should usually call [Builder.strikePrice] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun strikePrice(strikePrice: JsonField) = apply { this.strikePrice = strikePrice } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -886,12 +961,14 @@ private constructor( checkRequired("symbol", symbol), checkRequired("venue", venue), adv, + expiry, instrumentType, longMarginRate, name, notionalAdv, previousClose, shortMarginRate, + strikePrice, additionalProperties.toMutableMap(), ) } @@ -925,12 +1002,14 @@ private constructor( symbol() venue() adv() + expiry() instrumentType().ifPresent { it.validate() } longMarginRate() name() notionalAdv() previousClose() shortMarginRate() + strikePrice() validated = true } @@ -963,12 +1042,14 @@ private constructor( (if (symbol.asKnown().isPresent) 1 else 0) + (if (venue.asKnown().isPresent) 1 else 0) + (if (adv.asKnown().isPresent) 1 else 0) + + (if (expiry.asKnown().isPresent) 1 else 0) + (instrumentType.asKnown().getOrNull()?.validity() ?: 0) + (if (longMarginRate.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (notionalAdv.asKnown().isPresent) 1 else 0) + (if (previousClose.asKnown().isPresent) 1 else 0) + - (if (shortMarginRate.asKnown().isPresent) 1 else 0) + (if (shortMarginRate.asKnown().isPresent) 1 else 0) + + (if (strikePrice.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -990,12 +1071,14 @@ private constructor( symbol == other.symbol && venue == other.venue && adv == other.adv && + expiry == other.expiry && instrumentType == other.instrumentType && longMarginRate == other.longMarginRate && name == other.name && notionalAdv == other.notionalAdv && previousClose == other.previousClose && shortMarginRate == other.shortMarginRate && + strikePrice == other.strikePrice && additionalProperties == other.additionalProperties } @@ -1015,12 +1098,14 @@ private constructor( symbol, venue, adv, + expiry, instrumentType, longMarginRate, name, notionalAdv, previousClose, shortMarginRate, + strikePrice, additionalProperties, ) } @@ -1028,5 +1113,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, additionalProperties=$additionalProperties}" + "InstrumentCore{id=$id, countryOfIssue=$countryOfIssue, currency=$currency, easyToBorrow=$easyToBorrow, isFractionable=$isFractionable, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, isTradable=$isTradable, symbol=$symbol, venue=$venue, adv=$adv, expiry=$expiry, instrumentType=$instrumentType, longMarginRate=$longMarginRate, name=$name, notionalAdv=$notionalAdv, previousClose=$previousClose, shortMarginRate=$shortMarginRate, strikePrice=$strikePrice, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt index ec0687ad..753d873e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt @@ -2,10 +2,14 @@ package com.clear_street.api.models.v1.instruments +import com.clear_street.api.core.Enum +import com.clear_street.api.core.JsonField import com.clear_street.api.core.Params import com.clear_street.api.core.http.Headers import com.clear_street.api.core.http.QueryParams import com.clear_street.api.core.toImmutable +import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonCreator import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -15,6 +19,7 @@ class InstrumentGetInstrumentsParams private constructor( private val easyToBorrow: Boolean?, private val instrumentIds: List?, + private val instrumentType: InstrumentType?, private val isLiquidationOnly: Boolean?, private val isMarginable: Boolean?, private val isPtp: Boolean?, @@ -32,6 +37,9 @@ private constructor( /** Comma-separated OEMS instrument UUIDs */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) + /** Filter by instrument type (e.g. COMMON_STOCK, OPTION) */ + fun instrumentType(): Optional = Optional.ofNullable(instrumentType) + /** Filter by liquidation only status */ fun isLiquidationOnly(): Optional = Optional.ofNullable(isLiquidationOnly) @@ -80,6 +88,7 @@ private constructor( private var easyToBorrow: Boolean? = null private var instrumentIds: MutableList? = null + private var instrumentType: InstrumentType? = null private var isLiquidationOnly: Boolean? = null private var isMarginable: Boolean? = null private var isPtp: Boolean? = null @@ -94,6 +103,7 @@ private constructor( internal fun from(instrumentGetInstrumentsParams: InstrumentGetInstrumentsParams) = apply { easyToBorrow = instrumentGetInstrumentsParams.easyToBorrow instrumentIds = instrumentGetInstrumentsParams.instrumentIds?.toMutableList() + instrumentType = instrumentGetInstrumentsParams.instrumentType isLiquidationOnly = instrumentGetInstrumentsParams.isLiquidationOnly isMarginable = instrumentGetInstrumentsParams.isMarginable isPtp = instrumentGetInstrumentsParams.isPtp @@ -136,6 +146,15 @@ private constructor( instrumentIds = (instrumentIds ?: mutableListOf()).apply { add(instrumentId) } } + /** Filter by instrument type (e.g. COMMON_STOCK, OPTION) */ + fun instrumentType(instrumentType: InstrumentType?) = apply { + this.instrumentType = instrumentType + } + + /** Alias for calling [Builder.instrumentType] with `instrumentType.orElse(null)`. */ + fun instrumentType(instrumentType: Optional) = + instrumentType(instrumentType.getOrNull()) + /** Filter by liquidation only status */ fun isLiquidationOnly(isLiquidationOnly: Boolean?) = apply { this.isLiquidationOnly = isLiquidationOnly @@ -344,6 +363,7 @@ private constructor( InstrumentGetInstrumentsParams( easyToBorrow, instrumentIds?.toImmutable(), + instrumentType, isLiquidationOnly, isMarginable, isPtp, @@ -363,6 +383,7 @@ private constructor( .apply { easyToBorrow?.let { put("easy_to_borrow", it.toString()) } instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } + instrumentType?.let { put("instrument_type", it.toString()) } isLiquidationOnly?.let { put("is_liquidation_only", it.toString()) } isMarginable?.let { put("is_marginable", it.toString()) } isPtp?.let { put("is_ptp", it.toString()) } @@ -374,6 +395,153 @@ private constructor( } .build() + /** Filter by instrument type (e.g. COMMON_STOCK, OPTION) */ + class InstrumentType @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val COMMON_STOCK = of("COMMON_STOCK") + + @JvmField val OPTION = of("OPTION") + + @JvmField val CASH = of("CASH") + + @JvmStatic fun of(value: String) = InstrumentType(JsonField.of(value)) + } + + /** An enum containing [InstrumentType]'s known values. */ + enum class Known { + COMMON_STOCK, + OPTION, + CASH, + } + + /** + * An enum containing [InstrumentType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [InstrumentType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + COMMON_STOCK, + OPTION, + CASH, + /** + * An enum member indicating that [InstrumentType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + COMMON_STOCK -> Value.COMMON_STOCK + OPTION -> Value.OPTION + CASH -> Value.CASH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ClearStreetInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + COMMON_STOCK -> Known.COMMON_STOCK + OPTION -> Known.OPTION + CASH -> Known.CASH + else -> throw ClearStreetInvalidDataException("Unknown InstrumentType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ClearStreetInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ClearStreetInvalidDataException("Value is not a String") + } + + 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(): InstrumentType = apply { + if (validated) { + return@apply + } + + known() + 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 = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InstrumentType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -382,6 +550,7 @@ private constructor( return other is InstrumentGetInstrumentsParams && easyToBorrow == other.easyToBorrow && instrumentIds == other.instrumentIds && + instrumentType == other.instrumentType && isLiquidationOnly == other.isLiquidationOnly && isMarginable == other.isMarginable && isPtp == other.isPtp && @@ -397,6 +566,7 @@ private constructor( Objects.hash( easyToBorrow, instrumentIds, + instrumentType, isLiquidationOnly, isMarginable, isPtp, @@ -409,5 +579,5 @@ private constructor( ) override fun toString() = - "InstrumentGetInstrumentsParams{easyToBorrow=$easyToBorrow, instrumentIds=$instrumentIds, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "InstrumentGetInstrumentsParams{easyToBorrow=$easyToBorrow, instrumentIds=$instrumentIds, instrumentType=$instrumentType, isLiquidationOnly=$isLiquidationOnly, isMarginable=$isMarginable, isPtp=$isPtp, isShortProhibited=$isShortProhibited, isThresholdSecurity=$isThresholdSecurity, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt index 5e28f4bd..3e787ddd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt @@ -5,6 +5,7 @@ package com.clear_street.api.models.v1.instruments import com.clear_street.api.core.jsonMapper import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -28,12 +29,14 @@ internal class InstrumentCoreTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() assertThat(instrumentCore.id()).isEqualTo("0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b") @@ -50,12 +53,14 @@ internal class InstrumentCoreTest { assertThat(instrumentCore.symbol()).isEqualTo("AAPL") assertThat(instrumentCore.venue()).isEqualTo("XNMS") assertThat(instrumentCore.adv()).contains("75000000") + assertThat(instrumentCore.expiry()).contains(LocalDate.parse("2024-12-20")) assertThat(instrumentCore.instrumentType()).contains(SecurityType.COMMON_STOCK) assertThat(instrumentCore.longMarginRate()).contains("0.25") assertThat(instrumentCore.name()).contains("Apple Inc.") assertThat(instrumentCore.notionalAdv()).contains("15815250000") assertThat(instrumentCore.previousClose()).contains("210.87") assertThat(instrumentCore.shortMarginRate()).contains("0.25") + assertThat(instrumentCore.strikePrice()).contains("150.00") } @Test @@ -77,12 +82,14 @@ internal class InstrumentCoreTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() val roundtrippedInstrumentCore = diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index d42a40cd..4e8d4281 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -55,6 +55,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -62,6 +63,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() @@ -106,6 +108,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -113,6 +116,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) } @@ -159,6 +163,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -166,6 +171,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt index 92053283..faab7846 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt @@ -13,6 +13,7 @@ internal class InstrumentGetInstrumentsParamsTest { InstrumentGetInstrumentsParams.builder() .easyToBorrow(true) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) @@ -29,6 +30,7 @@ internal class InstrumentGetInstrumentsParamsTest { InstrumentGetInstrumentsParams.builder() .easyToBorrow(true) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) @@ -45,6 +47,7 @@ internal class InstrumentGetInstrumentsParamsTest { QueryParams.builder() .put("easy_to_borrow", "true") .put("instrument_ids[0]", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put("instrument_type", "COMMON_STOCK") .put("is_liquidation_only", "true") .put("is_marginable", "true") .put("is_ptp", "true") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index a21333a2..33b6675d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -8,6 +8,7 @@ import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -54,12 +55,14 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() @@ -104,12 +107,14 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) } @@ -156,12 +161,14 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index 55bb22da..adc95e47 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -8,6 +8,7 @@ import com.clear_street.api.models.ApiError import com.clear_street.api.models.ResponseMetadata import com.clear_street.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -54,12 +55,14 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() @@ -104,12 +107,14 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) } @@ -156,12 +161,14 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt index 44dfd89a..aca4b0ab 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt @@ -30,6 +30,7 @@ internal class InstrumentTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -37,6 +38,7 @@ internal class InstrumentTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() assertThat(instrument.id()).isEqualTo("0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b") @@ -53,6 +55,7 @@ internal class InstrumentTest { assertThat(instrument.symbol()).isEqualTo("AAPL") assertThat(instrument.venue()).isEqualTo("XNMS") assertThat(instrument.adv()).contains("75000000") + assertThat(instrument.expiry()).contains(LocalDate.parse("2024-12-20")) assertThat(instrument.instrumentType()).contains(SecurityType.COMMON_STOCK) assertThat(instrument.longMarginRate()).contains("0.25") assertThat(instrument.name()).contains("Apple Inc.") @@ -61,6 +64,7 @@ internal class InstrumentTest { .containsExactly(LocalDate.parse("2019-12-27")) assertThat(instrument.previousClose()).contains("210.87") assertThat(instrument.shortMarginRate()).contains("0.25") + assertThat(instrument.strikePrice()).contains("150.00") } @Test @@ -82,6 +86,7 @@ internal class InstrumentTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -89,6 +94,7 @@ internal class InstrumentTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() val roundtrippedInstrument = diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt index 09f15039..b06ffc65 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -40,6 +40,7 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -47,6 +48,7 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() @@ -79,6 +81,7 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -86,6 +89,7 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() @@ -121,6 +125,7 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -128,6 +133,7 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index 06a2320f..d6bff2a4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -66,6 +66,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -73,6 +74,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() @@ -131,6 +133,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -138,6 +141,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() @@ -198,6 +202,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -205,6 +210,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt index e57bfd75..366b354f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -36,6 +36,7 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -43,6 +44,7 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() @@ -68,6 +70,7 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -75,6 +78,7 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) } @@ -103,6 +107,7 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") + .expiry(LocalDate.parse("2024-12-20")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -110,6 +115,7 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") + .strikePrice("150.00") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt index 02213c17..ebf34322 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt @@ -43,6 +43,7 @@ internal class InstrumentServiceAsyncTest { InstrumentGetInstrumentsParams.builder() .easyToBorrow(true) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt index b820d597..ad774a05 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt @@ -42,6 +42,7 @@ internal class InstrumentServiceTest { InstrumentGetInstrumentsParams.builder() .easyToBorrow(true) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .instrumentType(InstrumentGetInstrumentsParams.InstrumentType.COMMON_STOCK) .isLiquidationOnly(true) .isMarginable(true) .isPtp(true) From b27be7ed6619ad6758374049c03689f92cd304d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:13:59 +0000 Subject: [PATCH 26/51] feat(api): api update --- .github/workflows/publish-sonatype.yml | 2 +- .stats.yml | 6 +- README.md | 180 +++---- build.gradle.kts | 15 +- buildSrc/build.gradle.kts | 3 + .../main/kotlin/clear-street.java.gradle.kts | 9 - .../kotlin/clear-street.publish.gradle.kts | 107 +++-- .../client/okhttp/ClearStreetOkHttpClient.kt | 28 +- .../okhttp/ClearStreetOkHttpClientAsync.kt | 28 +- .../api/client/okhttp/OkHttpClient.kt | 24 +- .../api/client/okhttp/OkHttpClientTest.kt | 6 +- .../WatchlistDeleteWatchlistItemResponse.kt | 130 ----- .../WatchlistDeleteWatchlistResponse.kt | 129 ----- .../api/client/ClearStreetClient.kt | 6 +- .../api/client/ClearStreetClientAsync.kt | 6 +- .../api/client/ClearStreetClientAsyncImpl.kt | 10 +- .../api/client/ClearStreetClientImpl.kt | 10 +- .../api/core/BaseDeserializer.kt | 2 +- .../api/core/BaseSerializer.kt | 2 +- .../api/core/Check.kt | 2 +- .../api/core/ClientOptions.kt | 20 +- .../api/core/DefaultSleeper.kt | 2 +- .../api/core/LogLevel.kt | 2 +- .../api/core/ObjectMappers.kt | 2 +- .../api/core/Params.kt | 6 +- .../api/core/PhantomReachable.kt | 4 +- .../core/PhantomReachableExecutorService.kt | 2 +- .../api/core/PhantomReachableSleeper.kt | 2 +- .../api/core/PrepareRequest.kt | 4 +- .../api/core/Properties.kt | 4 +- .../api/core/RequestOptions.kt | 2 +- .../api/core/Sleeper.kt | 2 +- .../api/core/Timeout.kt | 2 +- .../api/core/Utils.kt | 4 +- .../api/core/Values.kt | 4 +- .../api/core/handlers/EmptyHandler.kt | 6 +- .../api/core/handlers/ErrorHandler.kt | 26 +- .../api/core/handlers/JsonHandler.kt | 8 +- .../api/core/handlers/StringHandler.kt | 6 +- .../api/core/http/AsyncStreamResponse.kt | 4 +- .../api/core/http/Headers.kt | 22 +- .../api/core/http/HttpClient.kt | 4 +- .../api/core/http/HttpMethod.kt | 2 +- .../api/core/http/HttpRequest.kt | 6 +- .../api/core/http/HttpRequestBodies.kt | 36 +- .../api/core/http/HttpRequestBody.kt | 2 +- .../api/core/http/HttpResponse.kt | 2 +- .../api/core/http/HttpResponseFor.kt | 2 +- .../api/core/http/LoggingHttpClient.kt | 10 +- ...ntomReachableClosingAsyncStreamResponse.kt | 6 +- .../http/PhantomReachableClosingHttpClient.kt | 6 +- .../PhantomReachableClosingStreamResponse.kt | 4 +- .../api/core/http/ProxyAuthenticator.kt | 2 +- .../api/core/http/QueryParams.kt | 43 +- .../api/core/http/RetryingHttpClient.kt | 16 +- .../api/core/http/StreamResponse.kt | 2 +- .../api/errors/BadRequestException.kt | 10 +- .../api/errors/ClearStreetException.kt | 2 +- .../errors/ClearStreetInvalidDataException.kt | 2 +- .../api/errors/ClearStreetIoException.kt | 2 +- .../errors/ClearStreetRetryableException.kt | 2 +- .../api/errors/ClearStreetServiceException.kt | 6 +- .../api/errors/InternalServerException.kt | 10 +- .../api/errors/NotFoundException.kt | 10 +- .../api/errors/PermissionDeniedException.kt | 10 +- .../api/errors/RateLimitException.kt | 10 +- .../api/errors/UnauthorizedException.kt | 10 +- .../errors/UnexpectedStatusCodeException.kt | 10 +- .../errors/UnprocessableEntityException.kt | 10 +- .../api/models/ApiError.kt | 20 +- .../api/models/BaseResponse.kt | 16 +- .../api/models/ResponseMetadata.kt | 16 +- .../api/models/v1/SecurityType.kt | 8 +- .../api/models/v1/accounts/Account.kt | 16 +- .../api/models/v1/accounts/AccountBalances.kt | 16 +- .../models/v1/accounts/AccountBalancesSod.kt | 16 +- .../AccountGetAccountBalancesParams.kt | 8 +- .../AccountGetAccountBalancesResponse.kt | 22 +- .../accounts/AccountGetAccountByIdParams.kt | 8 +- .../accounts/AccountGetAccountByIdResponse.kt | 22 +- .../v1/accounts/AccountGetAccountsParams.kt | 8 +- .../v1/accounts/AccountGetAccountsResponse.kt | 26 +- .../AccountGetPortfolioHistoryParams.kt | 10 +- .../AccountGetPortfolioHistoryResponse.kt | 22 +- .../accounts/AccountPatchAccountByIdParams.kt | 20 +- .../AccountPatchAccountByIdResponse.kt | 22 +- .../api/models/v1/accounts/AccountSettings.kt | 12 +- .../api/models/v1/accounts/AccountStatus.kt | 8 +- .../api/models/v1/accounts/AccountSubtype.kt | 8 +- .../api/models/v1/accounts/AccountType.kt | 8 +- .../api/models/v1/accounts/MarginDetails.kt | 20 +- .../models/v1/accounts/MarginDetailsUsage.kt | 16 +- .../v1/accounts/MarginTopContributor.kt | 16 +- .../api/models/v1/accounts/MarginType.kt | 8 +- .../v1/accounts/PortfolioHistoryResponse.kt | 20 +- .../v1/accounts/PortfolioHistorySegment.kt | 16 +- .../api/models/v1/accounts/RiskSettings.kt | 12 +- .../apiversion/ApiVersionGetVersionParams.kt | 8 +- .../ApiVersionGetVersionResponse.kt | 22 +- .../api/models/v1/apiversion/Version.kt | 16 +- .../v1/calendar/CalendarGetClockParams.kt | 8 +- .../v1/calendar/CalendarGetClockResponse.kt | 22 +- .../CalendarGetMarketHoursCalendarParams.kt | 10 +- .../CalendarGetMarketHoursCalendarResponse.kt | 26 +- .../api/models/v1/calendar/ClockDetail.kt | 16 +- .../api/models/v1/calendar/DayType.kt | 8 +- .../models/v1/calendar/MarketHoursDetail.kt | 16 +- .../models/v1/calendar/MarketSessionType.kt | 8 +- .../api/models/v1/calendar/MarketStatus.kt | 16 +- .../api/models/v1/calendar/MarketType.kt | 8 +- .../api/models/v1/calendar/SessionSchedule.kt | 16 +- .../api/models/v1/calendar/TradingSessions.kt | 12 +- .../v1/instrumentdata/AllEventsEventType.kt | 8 +- .../v1/instrumentdata/AnalystDistribution.kt | 16 +- .../models/v1/instrumentdata/AnalystRating.kt | 8 +- .../v1/instrumentdata/FiscalPeriodType.kt | 8 +- .../instrumentdata/InstrumentAllEventsData.kt | 20 +- .../InstrumentAnalystConsensus.kt | 16 +- .../InstrumentBalanceSheetStatement.kt | 16 +- .../InstrumentCashFlowStatement.kt | 16 +- ...trumentDataGetAllInstrumentEventsParams.kt | 16 +- ...umentDataGetAllInstrumentEventsResponse.kt | 22 +- ...DataGetInstrumentAnalystConsensusParams.kt | 8 +- ...taGetInstrumentAnalystConsensusResponse.kt | 22 +- ...tInstrumentBalanceSheetStatementsParams.kt | 8 +- ...nstrumentBalanceSheetStatementsResponse.kt | 26 +- ...taGetInstrumentCashFlowStatementsParams.kt | 8 +- ...GetInstrumentCashFlowStatementsResponse.kt | 26 +- ...InstrumentDataGetInstrumentEventsParams.kt | 8 +- ...strumentDataGetInstrumentEventsResponse.kt | 22 +- ...mentDataGetInstrumentFundamentalsParams.kt | 8 +- ...ntDataGetInstrumentFundamentalsResponse.kt | 22 +- ...DataGetInstrumentIncomeStatementsParams.kt | 8 +- ...taGetInstrumentIncomeStatementsResponse.kt | 26 +- .../instrumentdata/InstrumentDividendEvent.kt | 16 +- .../v1/instrumentdata/InstrumentEarnings.kt | 16 +- .../instrumentdata/InstrumentEventEnvelope.kt | 16 +- .../instrumentdata/InstrumentEventIpoItem.kt | 12 +- .../instrumentdata/InstrumentEventsByDate.kt | 20 +- .../v1/instrumentdata/InstrumentEventsData.kt | 20 +- .../instrumentdata/InstrumentFundamentals.kt | 12 +- .../InstrumentIncomeStatement.kt | 16 +- .../v1/instrumentdata/InstrumentSplitEvent.kt | 16 +- .../models/v1/instrumentdata/PriceTarget.kt | 16 +- .../instrumentdata/marketdata/DailySummary.kt | 16 +- .../MarketDataGetDailySummariesParams.kt | 10 +- .../MarketDataGetDailySummariesResponse.kt | 26 +- .../MarketDataGetSnapshotsParams.kt | 12 +- .../MarketDataGetSnapshotsResponse.kt | 26 +- .../marketdata/MarketDataSnapshot.kt | 16 +- .../marketdata/SnapshotGreeks.kt | 16 +- .../marketdata/SnapshotLastTrade.kt | 16 +- .../marketdata/SnapshotQuote.kt | 16 +- .../marketdata/SnapshotSession.kt | 16 +- .../instrumentdata/news/NewsGetNewsParams.kt | 22 +- .../news/NewsGetNewsResponse.kt | 26 +- .../v1/instrumentdata/news/NewsInstrument.kt | 16 +- .../models/v1/instrumentdata/news/NewsItem.kt | 20 +- .../models/v1/instrumentdata/news/NewsType.kt | 8 +- .../api/models/v1/instruments/ContractType.kt | 8 +- .../models/v1/instruments/ExerciseStyle.kt | 8 +- .../api/models/v1/instruments/Instrument.kt | 22 +- .../models/v1/instruments/InstrumentCore.kt | 18 +- .../InstrumentGetInstrumentByIdParams.kt | 8 +- .../InstrumentGetInstrumentByIdResponse.kt | 22 +- .../InstrumentGetInstrumentsParams.kt | 20 +- .../InstrumentGetInstrumentsResponse.kt | 26 +- .../InstrumentGetOptionContractsParams.kt | 8 +- .../InstrumentGetOptionContractsResponse.kt | 26 +- .../InstrumentSearchInstrumentsParams.kt | 10 +- .../InstrumentSearchInstrumentsResponse.kt | 26 +- .../api/models/v1/instruments/ListingType.kt | 8 +- .../models/v1/instruments/OptionsContract.kt | 16 +- .../api/models/v1/omniai/ActionButton.kt | 16 +- .../api/models/v1/omniai/ChartPayload.kt | 20 +- .../api/models/v1/omniai/ChartPoint.kt | 16 +- .../api/models/v1/omniai/ChartSeries.kt | 20 +- .../v1/omniai/ContentPartChartPayload.kt | 16 +- .../v1/omniai/ContentPartCustomPayload.kt | 12 +- .../ContentPartStructuredActionPayload.kt | 16 +- .../ContentPartSuggestedActionsPayload.kt | 16 +- .../v1/omniai/ContentPartTextPayload.kt | 16 +- .../v1/omniai/ContentPartThinkingPayload.kt | 20 +- .../api/models/v1/omniai/DataChart.kt | 18 +- .../v1/omniai}/EntitlementAgreementKey.kt | 8 +- .../api/models/v1/omniai}/EntitlementCode.kt | 8 +- .../api/models/v1/omniai/OpenChartAction.kt | 16 +- .../v1/omniai/OpenEntitlementConsentAction.kt | 22 +- .../models/v1/omniai/OpenScreenerAction.kt | 20 +- .../v1/omniai/PrefillCancelOrderAction.kt | 22 +- .../models/v1/omniai/PrefillNewOrderAction.kt | 22 +- .../models/v1/omniai/PrefillOrderAction.kt | 36 +- .../models/v1/omniai/PromptButtonAction.kt | 16 +- .../api/models/v1/omniai/ScreenerFilter.kt | 16 +- .../api/models/v1/omniai/StructuredAction.kt | 26 +- .../v1/omniai/StructuredActionButtonAction.kt | 12 +- .../v1/omniai/SuggestedActionsPayload.kt | 18 +- .../entitlements/DeleteEntitlementResponse.kt | 16 +- .../EntitlementAgreementResource.kt | 22 +- .../EntitlementCreateEntitlementsParams.kt | 27 +- .../EntitlementCreateEntitlementsResponse.kt | 26 +- .../EntitlementDeleteEntitlementParams.kt | 12 +- .../EntitlementDeleteEntitlementResponse.kt | 22 +- ...titlementGetEntitlementAgreementsParams.kt | 8 +- ...tlementGetEntitlementAgreementsResponse.kt | 26 +- .../EntitlementGetEntitlementsParams.kt | 8 +- .../EntitlementGetEntitlementsResponse.kt | 26 +- .../entitlements/EntitlementResource.kt | 17 +- .../omniai/messages/CreateFeedbackResponse.kt | 16 +- .../messages/MessageGetMessageByIdParams.kt | 10 +- .../messages/MessageGetMessageByIdResponse.kt | 24 +- .../messages/MessageSubmitFeedbackParams.kt | 22 +- .../messages/MessageSubmitFeedbackResponse.kt | 22 +- .../omniai/responses/CancelResponsePayload.kt | 16 +- .../models/v1/omniai/responses/ErrorStatus.kt | 16 +- .../models/v1/omniai/responses/Response.kt | 16 +- .../responses/ResponseCancelResponseParams.kt | 16 +- .../ResponseCancelResponseResponse.kt | 22 +- .../v1/omniai/responses/ResponseContent.kt | 74 +-- .../omniai/responses/ResponseContentPart.kt | 454 ++++++++++-------- .../ResponseGetResponseByIdParams.kt | 10 +- .../ResponseGetResponseByIdResponse.kt | 22 +- .../v1/omniai/responses/ResponseStatus.kt | 8 +- .../omniai/threads/CreateMessageResponse.kt | 16 +- .../v1/omniai/threads/CreateThreadResponse.kt | 16 +- .../api/models/v1/omniai/threads/Message.kt | 18 +- .../v1/omniai/threads/MessageContent.kt | 64 ++- .../v1/omniai/threads/MessageContentPart.kt | 381 ++++++++------- .../v1/omniai/threads/MessageOutcome.kt | 8 +- .../models/v1/omniai/threads/MessageRole.kt | 8 +- .../api/models/v1/omniai/threads/Thread.kt | 16 +- .../threads/ThreadCreateMessageParams.kt | 28 +- .../threads/ThreadCreateMessageResponse.kt | 22 +- .../threads/ThreadCreateThreadParams.kt | 28 +- .../threads/ThreadCreateThreadResponse.kt | 22 +- .../omniai/threads/ThreadGetMessagesParams.kt | 10 +- .../threads/ThreadGetMessagesResponse.kt | 26 +- .../threads/ThreadGetThreadByIdParams.kt | 10 +- .../threads/ThreadGetThreadByIdResponse.kt | 22 +- .../threads/ThreadGetThreadResponseParams.kt | 10 +- .../ThreadGetThreadResponseResponse.kt | 24 +- .../omniai/threads/ThreadGetThreadsParams.kt | 10 +- .../threads/ThreadGetThreadsResponse.kt | 26 +- .../models/v1/orders/CancelOrderRequest.kt | 16 +- .../api/models/v1/orders/Execution.kt | 16 +- .../api/models/v1/orders/NewOrderRequest.kt | 16 +- .../api/models/v1/orders/Order.kt | 22 +- .../orders/OrderCancelAllOpenOrdersParams.kt | 22 +- .../OrderCancelAllOpenOrdersResponse.kt | 26 +- .../v1/orders/OrderCancelOpenOrderParams.kt | 16 +- .../v1/orders/OrderCancelOpenOrderResponse.kt | 22 +- .../v1/orders/OrderGetExecutionsParams.kt | 8 +- .../v1/orders/OrderGetExecutionsResponse.kt | 26 +- .../v1/orders/OrderGetOrderByIdParams.kt | 10 +- .../v1/orders/OrderGetOrderByIdResponse.kt | 22 +- .../models/v1/orders/OrderGetOrdersParams.kt | 53 +- .../v1/orders/OrderGetOrdersResponse.kt | 26 +- .../v1/orders/OrderReplaceOrderParams.kt | 22 +- .../v1/orders/OrderReplaceOrderResponse.kt | 22 +- .../api/models/v1/orders/OrderStatus.kt | 8 +- .../v1/orders/OrderSubmitOrdersParams.kt | 36 +- .../v1/orders/OrderSubmitOrdersResponse.kt | 26 +- .../api/models/v1/orders/OrderType.kt | 8 +- .../api/models/v1/orders/PositionEffect.kt | 8 +- .../api/models/v1/orders/QueueState.kt | 8 +- .../api/models/v1/orders/RequestOrderType.kt | 8 +- .../models/v1/orders/RequestTimeInForce.kt | 8 +- .../api/models/v1/orders/Side.kt | 8 +- .../api/models/v1/orders/TimeInForce.kt | 8 +- .../models/v1/orders/TrailingOffsetType.kt | 8 +- .../api/models/v1/positions/Position.kt | 18 +- ...PositionCancelPositionInstructionParams.kt | 16 +- ...sitionCancelPositionInstructionResponse.kt | 22 +- .../positions/PositionClosePositionParams.kt | 22 +- .../PositionClosePositionResponse.kt | 28 +- .../positions/PositionClosePositionsParams.kt | 20 +- .../PositionClosePositionsResponse.kt | 28 +- .../PositionGetPositionInstructionsParams.kt | 8 +- ...PositionGetPositionInstructionsResponse.kt | 26 +- .../positions/PositionGetPositionsParams.kt | 20 +- .../positions/PositionGetPositionsResponse.kt | 26 +- .../v1/positions/PositionInstruction.kt | 16 +- .../v1/positions/PositionInstructionStatus.kt | 8 +- .../v1/positions/PositionInstructionType.kt | 8 +- ...ositionSubmitPositionInstructionsParams.kt | 24 +- ...itionSubmitPositionInstructionsResponse.kt | 26 +- .../api/models/v1/positions/PositionType.kt | 8 +- .../v1/watchlist/AddWatchlistItemData.kt | 16 +- .../WatchlistAddWatchlistItemParams.kt | 22 +- .../WatchlistAddWatchlistItemResponse.kt | 22 +- .../WatchlistCreateWatchlistParams.kt | 22 +- .../WatchlistCreateWatchlistResponse.kt | 22 +- .../WatchlistDeleteWatchlistItemParams.kt | 16 +- .../WatchlistDeleteWatchlistItemResponse.kt | 274 +++++++++++ .../WatchlistDeleteWatchlistParams.kt | 12 +- .../WatchlistDeleteWatchlistResponse.kt | 273 +++++++++++ .../models/v1/watchlist/WatchlistDetail.kt | 20 +- .../api/models/v1/watchlist/WatchlistEntry.kt | 16 +- .../WatchlistGetWatchlistByIdParams.kt | 8 +- .../WatchlistGetWatchlistByIdResponse.kt | 22 +- .../watchlist/WatchlistGetWatchlistsParams.kt | 8 +- .../WatchlistGetWatchlistsResponse.kt | 26 +- .../models/v1/watchlist/WatchlistItemEntry.kt | 18 +- .../WebsocketWebsocketHandlerParams.kt | 8 +- .../api/services/async/V1ServiceAsync.kt | 26 +- .../api/services/async/V1ServiceAsyncImpl.kt | 46 +- .../services/async/v1/AccountServiceAsync.kt | 30 +- .../async/v1/AccountServiceAsyncImpl.kt | 50 +- .../async/v1/ApiVersionServiceAsync.kt | 12 +- .../async/v1/ApiVersionServiceAsyncImpl.kt | 30 +- .../services/async/v1/CalendarServiceAsync.kt | 18 +- .../async/v1/CalendarServiceAsyncImpl.kt | 34 +- .../async/v1/InstrumentDataServiceAsync.kt | 42 +- .../v1/InstrumentDataServiceAsyncImpl.kt | 66 +-- .../async/v1/InstrumentServiceAsync.kt | 26 +- .../async/v1/InstrumentServiceAsyncImpl.kt | 46 +- .../services/async/v1/OmniAiServiceAsync.kt | 12 +- .../async/v1/OmniAiServiceAsyncImpl.kt | 22 +- .../services/async/v1/OrderServiceAsync.kt | 38 +- .../async/v1/OrderServiceAsyncImpl.kt | 58 +-- .../services/async/v1/PositionServiceAsync.kt | 34 +- .../async/v1/PositionServiceAsyncImpl.kt | 54 +-- .../async/v1/WatchlistServiceAsync.kt | 34 +- .../async/v1/WatchlistServiceAsyncImpl.kt | 54 +-- .../async/v1/WebsocketServiceAsync.kt | 10 +- .../async/v1/WebsocketServiceAsyncImpl.kt | 26 +- .../instrumentdata/MarketDataServiceAsync.kt | 18 +- .../MarketDataServiceAsyncImpl.kt | 34 +- .../v1/instrumentdata/NewsServiceAsync.kt | 12 +- .../v1/instrumentdata/NewsServiceAsyncImpl.kt | 30 +- .../v1/omniai/EntitlementServiceAsync.kt | 26 +- .../v1/omniai/EntitlementServiceAsyncImpl.kt | 48 +- .../async/v1/omniai/MessageServiceAsync.kt | 18 +- .../v1/omniai/MessageServiceAsyncImpl.kt | 38 +- .../async/v1/omniai/ResponseServiceAsync.kt | 18 +- .../v1/omniai/ResponseServiceAsyncImpl.kt | 38 +- .../async/v1/omniai/ThreadServiceAsync.kt | 34 +- .../async/v1/omniai/ThreadServiceAsyncImpl.kt | 54 +-- .../api/services/blocking/V1Service.kt | 26 +- .../api/services/blocking/V1ServiceImpl.kt | 46 +- .../services/blocking/v1/AccountService.kt | 30 +- .../blocking/v1/AccountServiceImpl.kt | 52 +- .../services/blocking/v1/ApiVersionService.kt | 12 +- .../blocking/v1/ApiVersionServiceImpl.kt | 30 +- .../services/blocking/v1/CalendarService.kt | 18 +- .../blocking/v1/CalendarServiceImpl.kt | 34 +- .../blocking/v1/InstrumentDataService.kt | 42 +- .../blocking/v1/InstrumentDataServiceImpl.kt | 66 +-- .../services/blocking/v1/InstrumentService.kt | 26 +- .../blocking/v1/InstrumentServiceImpl.kt | 46 +- .../api/services/blocking/v1/OmniAiService.kt | 12 +- .../services/blocking/v1/OmniAiServiceImpl.kt | 22 +- .../api/services/blocking/v1/OrderService.kt | 38 +- .../services/blocking/v1/OrderServiceImpl.kt | 58 +-- .../services/blocking/v1/PositionService.kt | 34 +- .../blocking/v1/PositionServiceImpl.kt | 54 +-- .../services/blocking/v1/WatchlistService.kt | 34 +- .../blocking/v1/WatchlistServiceImpl.kt | 54 +-- .../services/blocking/v1/WebsocketService.kt | 10 +- .../blocking/v1/WebsocketServiceImpl.kt | 26 +- .../v1/instrumentdata/MarketDataService.kt | 18 +- .../instrumentdata/MarketDataServiceImpl.kt | 34 +- .../blocking/v1/instrumentdata/NewsService.kt | 12 +- .../v1/instrumentdata/NewsServiceImpl.kt | 30 +- .../blocking/v1/omniai/EntitlementService.kt | 26 +- .../v1/omniai/EntitlementServiceImpl.kt | 48 +- .../blocking/v1/omniai/MessageService.kt | 18 +- .../blocking/v1/omniai/MessageServiceImpl.kt | 38 +- .../blocking/v1/omniai/ResponseService.kt | 18 +- .../blocking/v1/omniai/ResponseServiceImpl.kt | 38 +- .../blocking/v1/omniai/ThreadService.kt | 34 +- .../blocking/v1/omniai/ThreadServiceImpl.kt | 54 +-- .../proguard/clear-street-java-core.pro | 6 +- ...atchlistDeleteWatchlistItemResponseTest.kt | 33 -- .../WatchlistDeleteWatchlistResponseTest.kt | 31 -- .../api/core/ClientOptionsTest.kt | 4 +- .../api/core/ObjectMappersTest.kt | 2 +- .../api/core/PhantomReachableTest.kt | 2 +- .../api/core/UtilsTest.kt | 2 +- .../api/core/ValuesTest.kt | 2 +- .../api/core/http/AsyncStreamResponseTest.kt | 2 +- .../api/core/http/HeadersTest.kt | 2 +- .../api/core/http/HttpRequestBodiesTest.kt | 34 +- .../api/core/http/HttpRequestTest.kt | 2 +- .../api/core/http/LoggingHttpClientTest.kt | 6 +- .../api/core/http/QueryParamsTest.kt | 2 +- .../api/core/http/RetryingHttpClientTest.kt | 10 +- .../api/models/ApiErrorTest.kt | 6 +- .../api/models/BaseResponseTest.kt | 6 +- .../api/models/ResponseMetadataTest.kt | 4 +- .../v1/accounts/AccountBalancesSodTest.kt | 4 +- .../models/v1/accounts/AccountBalancesTest.kt | 4 +- .../AccountGetAccountBalancesParamsTest.kt | 4 +- .../AccountGetAccountBalancesResponseTest.kt | 10 +- .../AccountGetAccountByIdParamsTest.kt | 2 +- .../AccountGetAccountByIdResponseTest.kt | 10 +- .../accounts/AccountGetAccountsParamsTest.kt | 4 +- .../AccountGetAccountsResponseTest.kt | 10 +- .../AccountGetPortfolioHistoryParamsTest.kt | 4 +- .../AccountGetPortfolioHistoryResponseTest.kt | 10 +- .../AccountPatchAccountByIdParamsTest.kt | 2 +- .../AccountPatchAccountByIdResponseTest.kt | 10 +- .../models/v1/accounts/AccountSettingsTest.kt | 4 +- .../api/models/v1/accounts/AccountTest.kt | 4 +- .../models/v1/accounts/MarginDetailsTest.kt | 4 +- .../v1/accounts/MarginDetailsUsageTest.kt | 4 +- .../v1/accounts/MarginTopContributorTest.kt | 4 +- .../accounts/PortfolioHistoryResponseTest.kt | 4 +- .../accounts/PortfolioHistorySegmentTest.kt | 4 +- .../models/v1/accounts/RiskSettingsTest.kt | 4 +- .../ApiVersionGetVersionParamsTest.kt | 2 +- .../ApiVersionGetVersionResponseTest.kt | 10 +- .../api/models/v1/apiversion/VersionTest.kt | 4 +- .../v1/calendar/CalendarGetClockParamsTest.kt | 2 +- .../calendar/CalendarGetClockResponseTest.kt | 10 +- ...alendarGetMarketHoursCalendarParamsTest.kt | 4 +- ...endarGetMarketHoursCalendarResponseTest.kt | 10 +- .../api/models/v1/calendar/ClockDetailTest.kt | 4 +- .../v1/calendar/MarketHoursDetailTest.kt | 4 +- .../models/v1/calendar/MarketStatusTest.kt | 4 +- .../models/v1/calendar/SessionScheduleTest.kt | 4 +- .../models/v1/calendar/TradingSessionsTest.kt | 4 +- .../instrumentdata/AnalystDistributionTest.kt | 4 +- .../InstrumentAllEventsDataTest.kt | 4 +- .../InstrumentAnalystConsensusTest.kt | 4 +- .../InstrumentBalanceSheetStatementTest.kt | 4 +- .../InstrumentCashFlowStatementTest.kt | 4 +- ...entDataGetAllInstrumentEventsParamsTest.kt | 11 +- ...tDataGetAllInstrumentEventsResponseTest.kt | 10 +- ...GetInstrumentAnalystConsensusParamsTest.kt | 4 +- ...tInstrumentAnalystConsensusResponseTest.kt | 10 +- ...trumentBalanceSheetStatementsParamsTest.kt | 4 +- ...umentBalanceSheetStatementsResponseTest.kt | 10 +- ...tInstrumentCashFlowStatementsParamsTest.kt | 4 +- ...nstrumentCashFlowStatementsResponseTest.kt | 10 +- ...rumentDataGetInstrumentEventsParamsTest.kt | 4 +- ...mentDataGetInstrumentEventsResponseTest.kt | 10 +- ...DataGetInstrumentFundamentalsParamsTest.kt | 2 +- ...taGetInstrumentFundamentalsResponseTest.kt | 10 +- ...GetInstrumentIncomeStatementsParamsTest.kt | 4 +- ...tInstrumentIncomeStatementsResponseTest.kt | 10 +- .../InstrumentDividendEventTest.kt | 4 +- .../instrumentdata/InstrumentEarningsTest.kt | 4 +- .../InstrumentEventEnvelopeTest.kt | 4 +- .../InstrumentEventIpoItemTest.kt | 4 +- .../InstrumentEventsByDateTest.kt | 4 +- .../InstrumentEventsDataTest.kt | 4 +- .../InstrumentFundamentalsTest.kt | 4 +- .../InstrumentIncomeStatementTest.kt | 4 +- .../InstrumentSplitEventTest.kt | 4 +- .../v1/instrumentdata/PriceTargetTest.kt | 4 +- .../marketdata/DailySummaryTest.kt | 4 +- .../MarketDataGetDailySummariesParamsTest.kt | 4 +- ...MarketDataGetDailySummariesResponseTest.kt | 10 +- .../MarketDataGetSnapshotsParamsTest.kt | 9 +- .../MarketDataGetSnapshotsResponseTest.kt | 10 +- .../marketdata/MarketDataSnapshotTest.kt | 4 +- .../marketdata/SnapshotGreeksTest.kt | 4 +- .../marketdata/SnapshotLastTradeTest.kt | 4 +- .../marketdata/SnapshotQuoteTest.kt | 4 +- .../marketdata/SnapshotSessionTest.kt | 4 +- .../news/NewsGetNewsParamsTest.kt | 8 +- .../news/NewsGetNewsResponseTest.kt | 10 +- .../instrumentdata/news/NewsInstrumentTest.kt | 4 +- .../v1/instrumentdata/news/NewsItemTest.kt | 4 +- .../v1/instruments/InstrumentCoreTest.kt | 6 +- .../InstrumentGetInstrumentByIdParamsTest.kt | 4 +- ...InstrumentGetInstrumentByIdResponseTest.kt | 12 +- .../InstrumentGetInstrumentsParamsTest.kt | 9 +- .../InstrumentGetInstrumentsResponseTest.kt | 12 +- .../InstrumentGetOptionContractsParamsTest.kt | 4 +- ...nstrumentGetOptionContractsResponseTest.kt | 10 +- .../InstrumentSearchInstrumentsParamsTest.kt | 4 +- ...InstrumentSearchInstrumentsResponseTest.kt | 12 +- .../models/v1/instruments/InstrumentTest.kt | 6 +- .../v1/instruments/OptionsContractTest.kt | 4 +- .../api/models/v1/omniai/ActionButtonTest.kt | 4 +- .../api/models/v1/omniai/ChartPayloadTest.kt | 4 +- .../api/models/v1/omniai/ChartPointTest.kt | 4 +- .../api/models/v1/omniai/ChartSeriesTest.kt | 4 +- .../v1/omniai/ContentPartChartPayloadTest.kt | 4 +- .../v1/omniai/ContentPartCustomPayloadTest.kt | 6 +- .../ContentPartStructuredActionPayloadTest.kt | 16 +- .../ContentPartSuggestedActionsPayloadTest.kt | 4 +- .../v1/omniai/ContentPartTextPayloadTest.kt | 4 +- .../omniai/ContentPartThinkingPayloadTest.kt | 4 +- .../api/models/v1/omniai/DataChartTest.kt | 4 +- .../models/v1/omniai/OpenChartActionTest.kt | 6 +- .../OpenEntitlementConsentActionTest.kt | 6 +- .../v1/omniai/OpenScreenerActionTest.kt | 6 +- .../v1/omniai/PrefillCancelOrderActionTest.kt | 6 +- .../v1/omniai/PrefillNewOrderActionTest.kt | 16 +- .../v1/omniai/PrefillOrderActionTest.kt | 24 +- .../v1/omniai/PromptButtonActionTest.kt | 4 +- .../models/v1/omniai/ScreenerFilterTest.kt | 6 +- .../StructuredActionButtonActionTest.kt | 4 +- .../models/v1/omniai/StructuredActionTest.kt | 22 +- .../v1/omniai/SuggestedActionsPayloadTest.kt | 4 +- .../DeleteEntitlementResponseTest.kt | 4 +- .../EntitlementAgreementResourceTest.kt | 6 +- ...EntitlementCreateEntitlementsParamsTest.kt | 3 +- ...titlementCreateEntitlementsResponseTest.kt | 11 +- .../EntitlementDeleteEntitlementParamsTest.kt | 2 +- ...ntitlementDeleteEntitlementResponseTest.kt | 10 +- ...ementGetEntitlementAgreementsParamsTest.kt | 2 +- ...entGetEntitlementAgreementsResponseTest.kt | 12 +- .../EntitlementGetEntitlementsParamsTest.kt | 4 +- .../EntitlementGetEntitlementsResponseTest.kt | 11 +- .../entitlements/EntitlementResourceTest.kt | 5 +- .../messages/CreateFeedbackResponseTest.kt | 4 +- .../MessageGetMessageByIdParamsTest.kt | 4 +- .../MessageGetMessageByIdResponseTest.kt | 34 +- .../MessageSubmitFeedbackParamsTest.kt | 4 +- .../MessageSubmitFeedbackResponseTest.kt | 10 +- .../responses/CancelResponsePayloadTest.kt | 4 +- .../v1/omniai/responses/ErrorStatusTest.kt | 6 +- .../ResponseCancelResponseParamsTest.kt | 4 +- .../ResponseCancelResponseResponseTest.kt | 10 +- .../responses/ResponseContentPartTest.kt | 230 ++++----- .../omniai/responses/ResponseContentTest.kt | 18 +- .../ResponseGetResponseByIdParamsTest.kt | 4 +- .../ResponseGetResponseByIdResponseTest.kt | 22 +- .../v1/omniai/responses/ResponseTest.kt | 18 +- .../threads/CreateMessageResponseTest.kt | 4 +- .../threads/CreateThreadResponseTest.kt | 4 +- .../omniai/threads/MessageContentPartTest.kt | 190 ++++---- .../v1/omniai/threads/MessageContentTest.kt | 18 +- .../models/v1/omniai/threads/MessageTest.kt | 20 +- .../threads/ThreadCreateMessageParamsTest.kt | 2 +- .../ThreadCreateMessageResponseTest.kt | 10 +- .../threads/ThreadCreateThreadParamsTest.kt | 2 +- .../threads/ThreadCreateThreadResponseTest.kt | 10 +- .../threads/ThreadGetMessagesParamsTest.kt | 4 +- .../threads/ThreadGetMessagesResponseTest.kt | 24 +- .../threads/ThreadGetThreadByIdParamsTest.kt | 4 +- .../ThreadGetThreadByIdResponseTest.kt | 10 +- .../ThreadGetThreadResponseParamsTest.kt | 4 +- .../ThreadGetThreadResponseResponseTest.kt | 32 +- .../threads/ThreadGetThreadsParamsTest.kt | 4 +- .../threads/ThreadGetThreadsResponseTest.kt | 10 +- .../models/v1/omniai/threads/ThreadTest.kt | 4 +- .../v1/orders/CancelOrderRequestTest.kt | 4 +- .../api/models/v1/orders/ExecutionTest.kt | 4 +- .../models/v1/orders/NewOrderRequestTest.kt | 4 +- .../OrderCancelAllOpenOrdersParamsTest.kt | 9 +- .../OrderCancelAllOpenOrdersResponseTest.kt | 12 +- .../orders/OrderCancelOpenOrderParamsTest.kt | 2 +- .../OrderCancelOpenOrderResponseTest.kt | 12 +- .../v1/orders/OrderGetExecutionsParamsTest.kt | 4 +- .../orders/OrderGetExecutionsResponseTest.kt | 10 +- .../v1/orders/OrderGetOrderByIdParamsTest.kt | 2 +- .../orders/OrderGetOrderByIdResponseTest.kt | 12 +- .../v1/orders/OrderGetOrdersParamsTest.kt | 20 +- .../v1/orders/OrderGetOrdersResponseTest.kt | 12 +- .../v1/orders/OrderReplaceOrderParamsTest.kt | 2 +- .../orders/OrderReplaceOrderResponseTest.kt | 12 +- .../v1/orders/OrderSubmitOrdersParamsTest.kt | 2 +- .../orders/OrderSubmitOrdersResponseTest.kt | 12 +- .../api/models/v1/orders/OrderTest.kt | 6 +- ...tionCancelPositionInstructionParamsTest.kt | 2 +- ...onCancelPositionInstructionResponseTest.kt | 10 +- .../PositionClosePositionParamsTest.kt | 2 +- .../PositionClosePositionResponseTest.kt | 26 +- .../PositionClosePositionsParamsTest.kt | 2 +- .../PositionClosePositionsResponseTest.kt | 26 +- ...sitionGetPositionInstructionsParamsTest.kt | 4 +- ...tionGetPositionInstructionsResponseTest.kt | 10 +- .../PositionGetPositionsParamsTest.kt | 9 +- .../PositionGetPositionsResponseTest.kt | 12 +- .../v1/positions/PositionInstructionTest.kt | 4 +- ...ionSubmitPositionInstructionsParamsTest.kt | 2 +- ...nSubmitPositionInstructionsResponseTest.kt | 10 +- .../api/models/v1/positions/PositionTest.kt | 6 +- .../v1/watchlist/AddWatchlistItemDataTest.kt | 4 +- .../WatchlistAddWatchlistItemParamsTest.kt | 2 +- .../WatchlistAddWatchlistItemResponseTest.kt | 10 +- .../WatchlistCreateWatchlistParamsTest.kt | 2 +- .../WatchlistCreateWatchlistResponseTest.kt | 10 +- .../WatchlistDeleteWatchlistItemParamsTest.kt | 2 +- ...atchlistDeleteWatchlistItemResponseTest.kt | 104 ++++ .../WatchlistDeleteWatchlistParamsTest.kt | 2 +- .../WatchlistDeleteWatchlistResponseTest.kt | 104 ++++ .../v1/watchlist/WatchlistDetailTest.kt | 8 +- .../models/v1/watchlist/WatchlistEntryTest.kt | 4 +- .../WatchlistGetWatchlistByIdParamsTest.kt | 2 +- .../WatchlistGetWatchlistByIdResponseTest.kt | 14 +- .../WatchlistGetWatchlistsParamsTest.kt | 4 +- .../WatchlistGetWatchlistsResponseTest.kt | 10 +- .../v1/watchlist/WatchlistItemEntryTest.kt | 8 +- .../WebsocketWebsocketHandlerParamsTest.kt | 2 +- .../api/services/ErrorHandlingTest.kt | 34 +- .../api/services/ServiceParamsTest.kt | 8 +- .../async/v1/AccountServiceAsyncTest.kt | 16 +- .../async/v1/ApiVersionServiceAsyncTest.kt | 4 +- .../async/v1/CalendarServiceAsyncTest.kt | 8 +- .../v1/InstrumentDataServiceAsyncTest.kt | 20 +- .../async/v1/InstrumentServiceAsyncTest.kt | 14 +- .../async/v1/OrderServiceAsyncTest.kt | 30 +- .../async/v1/PositionServiceAsyncTest.kt | 20 +- .../async/v1/WatchlistServiceAsyncTest.kt | 12 +- .../async/v1/WebsocketServiceAsyncTest.kt | 4 +- .../MarketDataServiceAsyncTest.kt | 8 +- .../v1/instrumentdata/NewsServiceAsyncTest.kt | 6 +- .../v1/omniai/EntitlementServiceAsyncTest.kt | 10 +- .../v1/omniai/MessageServiceAsyncTest.kt | 10 +- .../v1/omniai/ResponseServiceAsyncTest.kt | 8 +- .../async/v1/omniai/ThreadServiceAsyncTest.kt | 18 +- .../blocking/v1/AccountServiceTest.kt | 16 +- .../blocking/v1/ApiVersionServiceTest.kt | 4 +- .../blocking/v1/CalendarServiceTest.kt | 8 +- .../blocking/v1/InstrumentDataServiceTest.kt | 20 +- .../blocking/v1/InstrumentServiceTest.kt | 14 +- .../services/blocking/v1/OrderServiceTest.kt | 30 +- .../blocking/v1/PositionServiceTest.kt | 20 +- .../blocking/v1/WatchlistServiceTest.kt | 12 +- .../blocking/v1/WebsocketServiceTest.kt | 4 +- .../instrumentdata/MarketDataServiceTest.kt | 8 +- .../v1/instrumentdata/NewsServiceTest.kt | 6 +- .../v1/omniai/EntitlementServiceTest.kt | 10 +- .../blocking/v1/omniai/MessageServiceTest.kt | 10 +- .../blocking/v1/omniai/ResponseServiceTest.kt | 8 +- .../blocking/v1/omniai/ThreadServiceTest.kt | 18 +- .../build.gradle.kts | 4 +- .../api/proguard/ProGuardCompatibilityTest.kt | 30 +- clear-street-java-proguard-test/test.pro | 2 +- 625 files changed, 5975 insertions(+), 5377 deletions(-) rename clear-street-java-client-okhttp/src/main/kotlin/com/{clear_street => clearstreet}/api/client/okhttp/ClearStreetOkHttpClient.kt (95%) rename clear-street-java-client-okhttp/src/main/kotlin/com/{clear_street => clearstreet}/api/client/okhttp/ClearStreetOkHttpClientAsync.kt (95%) rename clear-street-java-client-okhttp/src/main/kotlin/com/{clear_street => clearstreet}/api/client/okhttp/OkHttpClient.kt (95%) rename clear-street-java-client-okhttp/src/test/kotlin/com/{clear_street => clearstreet}/api/client/okhttp/OkHttpClientTest.kt (90%) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponse.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponse.kt rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/client/ClearStreetClient.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/client/ClearStreetClientAsync.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/client/ClearStreetClientAsyncImpl.kt (88%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/client/ClearStreetClientImpl.kt (88%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/BaseDeserializer.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/BaseSerializer.kt (83%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/Check.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/ClientOptions.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/DefaultSleeper.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/LogLevel.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/ObjectMappers.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/Params.kt (74%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/PhantomReachable.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/PhantomReachableExecutorService.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/PhantomReachableSleeper.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/PrepareRequest.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/Properties.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/RequestOptions.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/Sleeper.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/Timeout.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/Utils.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/Values.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/handlers/EmptyHandler.kt (60%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/handlers/ErrorHandler.kt (80%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/handlers/JsonHandler.kt (71%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/handlers/StringHandler.kt (66%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/AsyncStreamResponse.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/Headers.kt (87%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpClient.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpMethod.kt (76%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpRequest.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpRequestBodies.kt (85%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpRequestBody.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpResponse.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpResponseFor.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/LoggingHttpClient.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/PhantomReachableClosingHttpClient.kt (84%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/PhantomReachableClosingStreamResponse.kt (84%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/ProxyAuthenticator.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/QueryParams.kt (67%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/RetryingHttpClient.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/core/http/StreamResponse.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/BadRequestException.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/ClearStreetException.kt (80%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/ClearStreetInvalidDataException.kt (81%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/ClearStreetIoException.kt (80%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/ClearStreetRetryableException.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/ClearStreetServiceException.kt (71%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/InternalServerException.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/NotFoundException.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/PermissionDeniedException.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/RateLimitException.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/UnauthorizedException.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/UnexpectedStatusCodeException.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/errors/UnprocessableEntityException.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/ApiError.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/BaseResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/ResponseMetadata.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/SecurityType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/Account.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountBalances.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountBalancesSod.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountBalancesParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountByIdParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountByIdResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountPatchAccountByIdParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountPatchAccountByIdResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountSettings.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountStatus.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountSubtype.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountType.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/MarginDetails.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/MarginDetailsUsage.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/MarginTopContributor.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/MarginType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/PortfolioHistoryResponse.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/PortfolioHistorySegment.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/RiskSettings.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/apiversion/ApiVersionGetVersionParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/apiversion/Version.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/CalendarGetClockParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/CalendarGetClockResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/ClockDetail.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/DayType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/MarketHoursDetail.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/MarketSessionType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/MarketStatus.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/MarketType.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/SessionSchedule.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/TradingSessions.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/AllEventsEventType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/AnalystDistribution.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/AnalystRating.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/FiscalPeriodType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentAllEventsData.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDividendEvent.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEarnings.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEventsByDate.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEventsData.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentFundamentals.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentSplitEvent.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/PriceTarget.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/DailySummary.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsInstrument.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsItem.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsType.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/ContractType.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/ExerciseStyle.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/Instrument.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentCore.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetInstrumentByIdResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetInstrumentsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentSearchInstrumentsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/ListingType.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/OptionsContract.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ActionButton.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ChartPayload.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ChartPoint.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ChartSeries.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartChartPayload.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartCustomPayload.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartStructuredActionPayload.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartSuggestedActionsPayload.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartTextPayload.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartThinkingPayload.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/DataChart.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street/api/models/v1/omniai/entitlements => clearstreet/api/models/v1/omniai}/EntitlementAgreementKey.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street/api/models/v1/omniai/entitlements => clearstreet/api/models/v1/omniai}/EntitlementCode.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/OpenChartAction.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/OpenEntitlementConsentAction.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/OpenScreenerAction.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/PrefillCancelOrderAction.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/PrefillNewOrderAction.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/PrefillOrderAction.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/PromptButtonAction.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ScreenerFilter.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/StructuredAction.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/StructuredActionButtonAction.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/SuggestedActionsPayload.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/DeleteEntitlementResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParams.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementResource.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/CreateFeedbackResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/MessageGetMessageByIdParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/MessageSubmitFeedbackParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/CancelResponsePayload.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ErrorStatus.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/Response.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseCancelResponseParams.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseContent.kt (73%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseContentPart.kt (84%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseGetResponseByIdParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseStatus.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/CreateMessageResponse.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/CreateThreadResponse.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/Message.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/MessageContent.kt (76%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/MessageContentPart.kt (84%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/MessageOutcome.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/MessageRole.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/Thread.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadCreateThreadParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadByIdParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadResponseParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/CancelOrderRequest.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/Execution.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/NewOrderRequest.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/Order.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderCancelOpenOrderParams.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderCancelOpenOrderResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetExecutionsParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetExecutionsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetOrderByIdParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetOrderByIdResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetOrdersParams.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetOrdersResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderReplaceOrderParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderReplaceOrderResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderStatus.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderSubmitOrdersParams.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderSubmitOrdersResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/PositionEffect.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/QueueState.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/RequestOrderType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/RequestTimeInForce.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/Side.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/TimeInForce.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/TrailingOffsetType.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/Position.kt (99%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionCancelPositionInstructionParams.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionClosePositionParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionClosePositionResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionClosePositionsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionClosePositionsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionGetPositionInstructionsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionGetPositionsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionGetPositionsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionInstruction.kt (98%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionInstructionStatus.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionInstructionType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionType.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/AddWatchlistItemData.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt (96%) create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponse.kt rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistDeleteWatchlistParams.kt (97%) create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistResponse.kt rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistDetail.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistEntry.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistGetWatchlistByIdParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponse.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistGetWatchlistsResponse.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistItemEntry.kt (96%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt (97%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/V1ServiceAsync.kt (80%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/V1ServiceAsyncImpl.kt (81%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/AccountServiceAsync.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/AccountServiceAsyncImpl.kt (87%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/ApiVersionServiceAsync.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/ApiVersionServiceAsyncImpl.kt (78%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/CalendarServiceAsync.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/CalendarServiceAsyncImpl.kt (82%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/InstrumentDataServiceAsync.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt (87%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/InstrumentServiceAsync.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/InstrumentServiceAsyncImpl.kt (86%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/OmniAiServiceAsync.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/OmniAiServiceAsyncImpl.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/OrderServiceAsync.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/OrderServiceAsyncImpl.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/PositionServiceAsync.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/PositionServiceAsyncImpl.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/WatchlistServiceAsync.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/WatchlistServiceAsyncImpl.kt (88%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/WebsocketServiceAsync.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/WebsocketServiceAsyncImpl.kt (78%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt (81%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/instrumentdata/NewsServiceAsync.kt (88%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt (77%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/EntitlementServiceAsync.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt (85%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/MessageServiceAsync.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt (83%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/ResponseServiceAsync.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt (83%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/ThreadServiceAsync.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt (88%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/V1Service.kt (80%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/V1ServiceImpl.kt (80%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/AccountService.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/AccountServiceImpl.kt (86%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/ApiVersionService.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/ApiVersionServiceImpl.kt (76%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/CalendarService.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/CalendarServiceImpl.kt (81%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/InstrumentDataService.kt (95%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/InstrumentDataServiceImpl.kt (86%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/InstrumentService.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/InstrumentServiceImpl.kt (84%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/OmniAiService.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/OmniAiServiceImpl.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/OrderService.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/OrderServiceImpl.kt (88%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/PositionService.kt (94%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/PositionServiceImpl.kt (88%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/WatchlistService.kt (93%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/WatchlistServiceImpl.kt (87%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/WebsocketService.kt (91%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/WebsocketServiceImpl.kt (76%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/instrumentdata/MarketDataService.kt (89%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt (80%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/instrumentdata/NewsService.kt (88%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt (75%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/EntitlementService.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt (84%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/MessageService.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/MessageServiceImpl.kt (82%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/ResponseService.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/ResponseServiceImpl.kt (82%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/ThreadService.kt (92%) rename clear-street-java-core/src/main/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/ThreadServiceImpl.kt (86%) delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/ClientOptionsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/ObjectMappersTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/PhantomReachableTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/UtilsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/ValuesTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/http/AsyncStreamResponseTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/http/HeadersTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpRequestBodiesTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/http/HttpRequestTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/http/LoggingHttpClientTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/http/QueryParamsTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/core/http/RetryingHttpClientTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/ApiErrorTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/BaseResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/ResponseMetadataTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountBalancesSodTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountBalancesTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountByIdParamsTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountByIdResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountsParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetAccountsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountPatchAccountByIdParamsTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountPatchAccountByIdResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountSettingsTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/AccountTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/MarginDetailsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/MarginDetailsUsageTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/MarginTopContributorTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/PortfolioHistoryResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/PortfolioHistorySegmentTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/accounts/RiskSettingsTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt (82%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/apiversion/VersionTest.kt (88%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/CalendarGetClockParamsTest.kt (82%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/CalendarGetClockResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/ClockDetailTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/MarketHoursDetailTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/MarketStatusTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/SessionScheduleTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/calendar/TradingSessionsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/AnalystDistributionTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt (79%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEarningsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/PriceTargetTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt (85%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt (77%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt (89%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt (88%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instrumentdata/news/NewsItemTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentCoreTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetInstrumentByIdParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt (89%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/InstrumentTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/instruments/OptionsContractTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ActionButtonTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ChartPayloadTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ChartPointTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ChartSeriesTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartChartPayloadTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartCustomPayloadTest.kt (89%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartSuggestedActionsPayloadTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartTextPayloadTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ContentPartThinkingPayloadTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/DataChartTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/OpenChartActionTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt (89%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/OpenScreenerActionTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/PrefillCancelOrderActionTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/PrefillNewOrderActionTest.kt (89%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/PrefillOrderActionTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/PromptButtonActionTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/ScreenerFilterTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/StructuredActionButtonActionTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/StructuredActionTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/SuggestedActionsPayloadTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/DeleteEntitlementResponseTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt (81%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParamsTest.kt (88%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/MessageGetMessageByIdParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt (87%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/MessageSubmitFeedbackParamsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt (90%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ErrorStatusTest.kt (89%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseCancelResponseParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseContentPartTest.kt (67%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseContentTest.kt (67%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseGetResponseByIdParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/responses/ResponseTest.kt (85%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/CreateMessageResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/CreateThreadResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/MessageContentPartTest.kt (71%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/MessageContentTest.kt (67%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/MessageTest.kt (83%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadCreateThreadParamsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadByIdParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadResponseParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt (88%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadsParamsTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/omniai/threads/ThreadTest.kt (92%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/CancelOrderRequestTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/ExecutionTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/NewOrderRequestTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt (87%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetExecutionsParamsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetExecutionsResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetOrdersParamsTest.kt (77%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderGetOrdersResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderReplaceOrderParamsTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderReplaceOrderResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt (99%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/orders/OrderTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionClosePositionParamsTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionClosePositionResponseTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionClosePositionsParamsTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionClosePositionsResponseTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionGetPositionsParamsTest.kt (87%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionGetPositionsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionInstructionTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt (98%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/positions/PositionTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/AddWatchlistItemDataTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt (95%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt (93%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistDetailTest.kt (97%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistEntryTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt (93%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt (91%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt (95%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/watchlist/WatchlistItemEntryTest.kt (96%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt (83%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/ErrorHandlingTest.kt (94%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/ServiceParamsTest.kt (89%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/AccountServiceAsyncTest.kt (86%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/ApiVersionServiceAsyncTest.kt (82%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/CalendarServiceAsyncTest.kt (81%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/InstrumentDataServiceAsyncTest.kt (86%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/InstrumentServiceAsyncTest.kt (87%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/OrderServiceAsyncTest.kt (88%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/PositionServiceAsyncTest.kt (86%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/WatchlistServiceAsyncTest.kt (88%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/WebsocketServiceAsyncTest.kt (81%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt (79%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt (84%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt (85%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/MessageServiceAsyncTest.kt (81%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt (82%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt (88%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/AccountServiceTest.kt (84%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/ApiVersionServiceTest.kt (80%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/CalendarServiceTest.kt (79%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/InstrumentDataServiceTest.kt (85%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/InstrumentServiceTest.kt (86%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/OrderServiceTest.kt (88%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/PositionServiceTest.kt (85%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/WatchlistServiceTest.kt (87%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/WebsocketServiceTest.kt (79%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt (78%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt (83%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/EntitlementServiceTest.kt (84%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/MessageServiceTest.kt (80%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/ResponseServiceTest.kt (81%) rename clear-street-java-core/src/test/kotlin/com/{clear_street => clearstreet}/api/services/blocking/v1/omniai/ThreadServiceTest.kt (87%) rename clear-street-java-proguard-test/src/test/kotlin/com/{clear_street => clearstreet}/api/proguard/ProGuardCompatibilityTest.kt (84%) diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml index d79ba1a6..97a31bec 100644 --- a/.github/workflows/publish-sonatype.yml +++ b/.github/workflows/publish-sonatype.yml @@ -33,7 +33,7 @@ jobs: 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/.stats.yml b/.stats.yml index 30d83450..d0226fff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-e3ed5b42b9f5d9991da2f3f5cb2fc32e8d68dfd569b52fad0fa559fe0db346ba.yml -openapi_spec_hash: 6c1a04c9357358837d556273a188d012 -config_hash: 0fa938c5f41fe056f788e0c05a6ca2f7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-4194f89657dd373f09e3b4ba795740950f2ddc4e0b35f90c22e4155ad6010c52.yml +openapi_spec_hash: 3477d6986fdb7b3c9d638b3557fc1ed7 +config_hash: 60b384cdbd19cc2eeda21394d4a18195 diff --git a/README.md b/README.md index 4fe2bae5..bb0f30ef 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.clear_street.api/clear-street-java)](https://central.sonatype.com/artifact/com.clear_street.api/clear-street-java/0.2.0) -[![javadoc](https://javadoc.io/badge2/com.clear_street.api/clear-street-java/0.2.0/javadoc.svg)](https://javadoc.io/doc/com.clear_street.api/clear-street-java/0.2.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.clearstreet.api/clear-street-java)](https://central.sonatype.com/artifact/com.clearstreet.api/clear-street-java/0.2.0) +[![javadoc](https://javadoc.io/badge2/com.clearstreet.api/clear-street-java/0.2.0/javadoc.svg)](https://javadoc.io/doc/com.clearstreet.api/clear-street-java/0.2.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.2.0). @@ -24,14 +24,14 @@ 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.2.0") ``` ### Maven ```xml - com.clear_street.api + com.clearstreet.api clear-street-java 0.2.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,8 +422,8 @@ 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() @@ -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,12 +554,12 @@ 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.AccountGetAccountBalancesParams; -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 = AccountGetAccountBalancesParams.builder() .accountId(JsonMissing.of()) @@ -571,7 +571,7 @@ AccountGetAccountsParams params = AccountGetAccountBalancesParams.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..e1fd0363 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,7 +7,7 @@ repositories { } allprojects { - group = "com.clear_street.api" + group = "com.clearstreet.api" version = "0.2.0" // x-release-please-version } @@ -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..64200c48 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, 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") - 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 95% 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 9ccb92b3..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) } 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 95% 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 bbbfbb19..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) } 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/watchlist/WatchlistDeleteWatchlistItemResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponse.kt deleted file mode 100644 index 2f8cd093..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponse.kt +++ /dev/null @@ -1,130 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.watchlist - -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 WatchlistDeleteWatchlistItemResponse -@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 - * [WatchlistDeleteWatchlistItemResponse]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [WatchlistDeleteWatchlistItemResponse]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from( - watchlistDeleteWatchlistItemResponse: WatchlistDeleteWatchlistItemResponse - ) = apply { - additionalProperties = - watchlistDeleteWatchlistItemResponse.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 [WatchlistDeleteWatchlistItemResponse]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): WatchlistDeleteWatchlistItemResponse = - WatchlistDeleteWatchlistItemResponse(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(): WatchlistDeleteWatchlistItemResponse = 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 WatchlistDeleteWatchlistItemResponse && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "WatchlistDeleteWatchlistItemResponse{additionalProperties=$additionalProperties}" -} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponse.kt deleted file mode 100644 index 23181121..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponse.kt +++ /dev/null @@ -1,129 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.watchlist - -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/client/ClearStreetClient.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClient.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClient.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClient.kt index 2aaac9e1..183726f0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClient.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClient.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.client +package com.clearstreet.api.client -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.V1Service +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.blocking.V1Service import java.util.function.Consumer /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsync.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsync.kt index c79b37bf..25c1cc87 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsync.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.client +package com.clearstreet.api.client -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.async.V1ServiceAsync +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.async.V1ServiceAsync import java.util.function.Consumer /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsyncImpl.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsyncImpl.kt index 2681c9ba..fdc5d52c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsyncImpl.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.client +package com.clearstreet.api.client -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.core.getPackageVersion -import com.clear_street.api.services.async.V1ServiceAsync -import com.clear_street.api.services.async.V1ServiceAsyncImpl +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.getPackageVersion +import com.clearstreet.api.services.async.V1ServiceAsync +import com.clearstreet.api.services.async.V1ServiceAsyncImpl import java.util.function.Consumer class ClearStreetClientAsyncImpl(private val clientOptions: ClientOptions) : diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientImpl.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientImpl.kt index 87df0a40..f2f48159 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientImpl.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.client +package com.clearstreet.api.client -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.core.getPackageVersion -import com.clear_street.api.services.blocking.V1Service -import com.clear_street.api.services.blocking.V1ServiceImpl +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.getPackageVersion +import com.clearstreet.api.services.blocking.V1Service +import com.clearstreet.api.services.blocking.V1ServiceImpl import java.util.function.Consumer class ClearStreetClientImpl(private val clientOptions: ClientOptions) : ClearStreetClient { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/BaseDeserializer.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/BaseDeserializer.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/BaseDeserializer.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/BaseDeserializer.kt index 4b05f523..20f4e618 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/BaseDeserializer.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/BaseDeserializer.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.core.ObjectCodec diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/BaseSerializer.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/BaseSerializer.kt similarity index 83% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/BaseSerializer.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/BaseSerializer.kt index 96892ec0..9109b281 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/BaseSerializer.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/BaseSerializer.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import com.fasterxml.jackson.databind.ser.std.StdSerializer import kotlin.reflect.KClass diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Check.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Check.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Check.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Check.kt index b3e20a5e..ad996c19 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Check.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Check.kt @@ -1,6 +1,6 @@ @file:JvmName("Check") -package com.clear_street.api.core +package com.clearstreet.api.core import com.fasterxml.jackson.core.Version import com.fasterxml.jackson.core.util.VersionUtil diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ClientOptions.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/ClientOptions.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ClientOptions.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/ClientOptions.kt index e481c94c..c31580e9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ClientOptions.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/ClientOptions.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core - -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.HttpClient -import com.clear_street.api.core.http.LoggingHttpClient -import com.clear_street.api.core.http.PhantomReachableClosingHttpClient -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.http.RetryingHttpClient +package com.clearstreet.api.core + +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.HttpClient +import com.clearstreet.api.core.http.LoggingHttpClient +import com.clearstreet.api.core.http.PhantomReachableClosingHttpClient +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.http.RetryingHttpClient import com.fasterxml.jackson.databind.json.JsonMapper import java.time.Clock import java.time.Duration @@ -37,7 +37,7 @@ 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. */ @get:JvmName("jsonMapper") val jsonMapper: JsonMapper, @@ -212,7 +212,7 @@ 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 { this.jsonMapper = jsonMapper } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/DefaultSleeper.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/DefaultSleeper.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/DefaultSleeper.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/DefaultSleeper.kt index 756ff49c..cabecf38 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/DefaultSleeper.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/DefaultSleeper.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import java.time.Duration import java.util.Timer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/LogLevel.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/LogLevel.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/LogLevel.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/LogLevel.kt index fac6c157..73210cf5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/LogLevel.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/LogLevel.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core +package com.clearstreet.api.core /** The level at which to log request and response information. */ enum class LogLevel { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ObjectMappers.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/ObjectMappers.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ObjectMappers.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/ObjectMappers.kt index d90d1c08..d8f50904 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/ObjectMappers.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/ObjectMappers.kt @@ -1,6 +1,6 @@ @file:JvmName("ObjectMappers") -package com.clear_street.api.core +package com.clearstreet.api.core import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.core.JsonGenerator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Params.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Params.kt similarity index 74% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Params.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Params.kt index 6efa105e..792dbd17 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Params.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Params.kt @@ -1,7 +1,7 @@ -package com.clear_street.api.core +package com.clearstreet.api.core -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams /** An interface representing parameters passed to a service method. */ interface Params { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachable.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachable.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachable.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachable.kt index c43cd769..1252f902 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachable.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachable.kt @@ -1,8 +1,8 @@ @file:JvmName("PhantomReachable") -package com.clear_street.api.core +package com.clearstreet.api.core -import com.clear_street.api.errors.ClearStreetException +import com.clearstreet.api.errors.ClearStreetException import java.lang.reflect.InvocationTargetException /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachableExecutorService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachableExecutorService.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachableExecutorService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachableExecutorService.kt index 44d850c2..9a3f4087 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachableExecutorService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachableExecutorService.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import java.util.concurrent.Callable import java.util.concurrent.ExecutorService diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachableSleeper.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachableSleeper.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachableSleeper.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachableSleeper.kt index f9057b83..554dbe8f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PhantomReachableSleeper.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PhantomReachableSleeper.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import java.time.Duration import java.util.concurrent.CompletableFuture diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PrepareRequest.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PrepareRequest.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PrepareRequest.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PrepareRequest.kt index 9ff97911..59a26d2d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/PrepareRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/PrepareRequest.kt @@ -1,8 +1,8 @@ @file:JvmName("PrepareRequest") -package com.clear_street.api.core +package com.clearstreet.api.core -import com.clear_street.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpRequest import java.util.concurrent.CompletableFuture @JvmSynthetic diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Properties.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Properties.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Properties.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Properties.kt index 487a844f..7cd4728a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Properties.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Properties.kt @@ -1,8 +1,8 @@ @file:JvmName("Properties") -package com.clear_street.api.core +package com.clearstreet.api.core -import com.clear_street.api.client.ClearStreetClient +import com.clearstreet.api.client.ClearStreetClient fun getOsArch(): String { val osArch = System.getProperty("os.arch") diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/RequestOptions.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/RequestOptions.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/RequestOptions.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/RequestOptions.kt index 8b775e09..2657588b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/RequestOptions.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/RequestOptions.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import java.time.Duration diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Sleeper.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Sleeper.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Sleeper.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Sleeper.kt index 912b558a..4e4f807f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Sleeper.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Sleeper.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import java.time.Duration import java.util.concurrent.CompletableFuture diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Timeout.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Timeout.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Timeout.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Timeout.kt index 7c826036..2be8ac61 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Timeout.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Timeout.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core +package com.clearstreet.api.core import java.time.Duration import java.util.Objects diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Utils.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Utils.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Utils.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Utils.kt index 81aaf8af..7acc19e9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Utils.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Utils.kt @@ -1,8 +1,8 @@ @file:JvmName("Utils") -package com.clear_street.api.core +package com.clearstreet.api.core -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.errors.ClearStreetInvalidDataException import java.util.Collections import java.util.SortedMap import java.util.SortedSet diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Values.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Values.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Values.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Values.kt index fbe07d5d..5b8c74d1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Values.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Values.kt @@ -1,6 +1,6 @@ -package com.clear_street.api.core +package com.clearstreet.api.core -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JacksonAnnotationsInside import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonInclude diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/EmptyHandler.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt similarity index 60% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/EmptyHandler.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt index a9c9fbd8..d989fd70 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/EmptyHandler.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt @@ -1,9 +1,9 @@ @file:JvmName("EmptyHandler") -package com.clear_street.api.core.handlers +package com.clearstreet.api.core.handlers -import com.clear_street.api.core.http.HttpResponse -import com.clear_street.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler @JvmSynthetic internal fun emptyHandler(): Handler = EmptyHandlerInternal diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/ErrorHandler.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/ErrorHandler.kt similarity index 80% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/ErrorHandler.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/ErrorHandler.kt index aa6bd1c9..252eb946 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/ErrorHandler.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/ErrorHandler.kt @@ -2,20 +2,20 @@ @file:JvmName("ErrorHandler") -package com.clear_street.api.core.handlers +package com.clearstreet.api.core.handlers -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.http.HttpResponse -import com.clear_street.api.core.http.HttpResponse.Handler -import com.clear_street.api.errors.BadRequestException -import com.clear_street.api.errors.InternalServerException -import com.clear_street.api.errors.NotFoundException -import com.clear_street.api.errors.PermissionDeniedException -import com.clear_street.api.errors.RateLimitException -import com.clear_street.api.errors.UnauthorizedException -import com.clear_street.api.errors.UnexpectedStatusCodeException -import com.clear_street.api.errors.UnprocessableEntityException +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.errors.BadRequestException +import com.clearstreet.api.errors.InternalServerException +import com.clearstreet.api.errors.NotFoundException +import com.clearstreet.api.errors.PermissionDeniedException +import com.clearstreet.api.errors.RateLimitException +import com.clearstreet.api.errors.UnauthorizedException +import com.clearstreet.api.errors.UnexpectedStatusCodeException +import com.clearstreet.api.errors.UnprocessableEntityException import com.fasterxml.jackson.databind.json.JsonMapper @JvmSynthetic diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/JsonHandler.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/JsonHandler.kt similarity index 71% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/JsonHandler.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/JsonHandler.kt index 9970c901..8e30dfec 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/JsonHandler.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/JsonHandler.kt @@ -1,10 +1,10 @@ @file:JvmName("JsonHandler") -package com.clear_street.api.core.handlers +package com.clearstreet.api.core.handlers -import com.clear_street.api.core.http.HttpResponse -import com.clear_street.api.core.http.HttpResponse.Handler -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/StringHandler.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/StringHandler.kt similarity index 66% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/StringHandler.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/StringHandler.kt index 84e96d3f..60edfd89 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/handlers/StringHandler.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/StringHandler.kt @@ -1,9 +1,9 @@ @file:JvmName("StringHandler") -package com.clear_street.api.core.handlers +package com.clearstreet.api.core.handlers -import com.clear_street.api.core.http.HttpResponse -import com.clear_street.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler @JvmSynthetic internal fun stringHandler(): Handler = StringHandlerInternal diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/AsyncStreamResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/AsyncStreamResponse.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/AsyncStreamResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/AsyncStreamResponse.kt index 03aef16a..0bce39b6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/AsyncStreamResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/AsyncStreamResponse.kt @@ -1,6 +1,6 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.http.AsyncStreamResponse.Handler +import com.clearstreet.api.core.http.AsyncStreamResponse.Handler import java.util.Optional import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/Headers.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/Headers.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/Headers.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/Headers.kt index 21b0f52a..71dd88ea 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/Headers.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/Headers.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core.http - -import com.clear_street.api.core.JsonArray -import com.clear_street.api.core.JsonBoolean -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonNull -import com.clear_street.api.core.JsonNumber -import com.clear_street.api.core.JsonObject -import com.clear_street.api.core.JsonString -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.toImmutable +package com.clearstreet.api.core.http + +import com.clearstreet.api.core.JsonArray +import com.clearstreet.api.core.JsonBoolean +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonNull +import com.clearstreet.api.core.JsonNumber +import com.clearstreet.api.core.JsonObject +import com.clearstreet.api.core.JsonString +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.toImmutable import java.util.TreeMap class Headers diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpClient.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpClient.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpClient.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpClient.kt index e29cf960..d4e6afeb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpClient.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpClient.kt @@ -1,6 +1,6 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.RequestOptions +import com.clearstreet.api.core.RequestOptions import java.lang.AutoCloseable import java.util.concurrent.CompletableFuture diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpMethod.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpMethod.kt similarity index 76% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpMethod.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpMethod.kt index c35f2eb9..13dddef1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpMethod.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpMethod.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http enum class HttpMethod { GET, diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequest.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequest.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequest.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequest.kt index b2bf64f3..fce32eb2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequest.kt @@ -1,7 +1,7 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable import java.net.URLEncoder class HttpRequest diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequestBodies.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequestBodies.kt similarity index 85% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequestBodies.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequestBodies.kt index 67d8625b..f0042034 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequestBodies.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequestBodies.kt @@ -2,11 +2,11 @@ @file:JvmName("HttpRequestBodies") -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.MultipartField -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.MultipartField +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.databind.node.JsonNodeType @@ -109,9 +109,31 @@ private fun serializePart(name: String, node: JsonNode): Sequence sequenceOf(name to node.booleanValue().toString().byteInputStream()) JsonNodeType.NUMBER -> sequenceOf(name to node.numberValue().toString().byteInputStream()) JsonNodeType.ARRAY -> - node.elements().asSequence().flatMapIndexed { index, element -> - serializePart("$name[$index]", element) - } + sequenceOf( + name to + node + .elements() + .asSequence() + .mapNotNull { element -> + when (element.nodeType) { + JsonNodeType.MISSING, + JsonNodeType.NULL -> null + JsonNodeType.STRING -> element.textValue() + JsonNodeType.BOOLEAN -> element.booleanValue().toString() + JsonNodeType.NUMBER -> element.numberValue().toString() + null, + JsonNodeType.BINARY, + JsonNodeType.ARRAY, + JsonNodeType.OBJECT, + JsonNodeType.POJO -> + throw ClearStreetInvalidDataException( + "Unexpected JsonNode type in array: ${element.nodeType}" + ) + } + } + .joinToString(",") + .byteInputStream() + ) JsonNodeType.OBJECT -> node.fields().asSequence().flatMap { (key, value) -> serializePart("$name[$key]", value) diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequestBody.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequestBody.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequestBody.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequestBody.kt index bf47f10e..35269c81 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpRequestBody.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpRequestBody.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import java.io.OutputStream import java.lang.AutoCloseable diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpResponse.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpResponse.kt index 922724e9..22834691 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import java.io.InputStream diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpResponseFor.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpResponseFor.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpResponseFor.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpResponseFor.kt index 1da7f591..15df51fc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpResponseFor.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpResponseFor.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import java.io.InputStream diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/LoggingHttpClient.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/LoggingHttpClient.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/LoggingHttpClient.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/LoggingHttpClient.kt index 17ad6ca3..e3bc557b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/LoggingHttpClient.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/LoggingHttpClient.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.LogLevel -import com.clear_street.api.core.RequestOptions -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable +import com.clearstreet.api.core.LogLevel +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable import java.io.ByteArrayOutputStream import java.io.InputStream import java.io.OutputStream diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt index e445f835..8bd43517 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt @@ -1,7 +1,7 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.closeWhenPhantomReachable -import com.clear_street.api.core.http.AsyncStreamResponse.Handler +import com.clearstreet.api.core.closeWhenPhantomReachable +import com.clearstreet.api.core.http.AsyncStreamResponse.Handler import java.util.Optional import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingHttpClient.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingHttpClient.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingHttpClient.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingHttpClient.kt index d85d6bcf..76e3ce1c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingHttpClient.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingHttpClient.kt @@ -1,7 +1,7 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.RequestOptions -import com.clear_street.api.core.closeWhenPhantomReachable +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.closeWhenPhantomReachable import java.util.concurrent.CompletableFuture /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingStreamResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingStreamResponse.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingStreamResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingStreamResponse.kt index be2b56cf..2cba7b59 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/PhantomReachableClosingStreamResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/PhantomReachableClosingStreamResponse.kt @@ -1,6 +1,6 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.closeWhenPhantomReachable +import com.clearstreet.api.core.closeWhenPhantomReachable import java.util.stream.Stream /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/ProxyAuthenticator.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/ProxyAuthenticator.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/ProxyAuthenticator.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/ProxyAuthenticator.kt index c6aa7203..8d40725b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/ProxyAuthenticator.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/ProxyAuthenticator.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import java.net.Proxy import java.nio.charset.Charset diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/QueryParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/QueryParams.kt similarity index 67% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/QueryParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/QueryParams.kt index 08995e1c..5804960b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/QueryParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/QueryParams.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core.http - -import com.clear_street.api.core.JsonArray -import com.clear_street.api.core.JsonBoolean -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonNull -import com.clear_street.api.core.JsonNumber -import com.clear_street.api.core.JsonObject -import com.clear_street.api.core.JsonString -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.toImmutable +package com.clearstreet.api.core.http + +import com.clearstreet.api.core.JsonArray +import com.clearstreet.api.core.JsonBoolean +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonNull +import com.clearstreet.api.core.JsonNumber +import com.clearstreet.api.core.JsonObject +import com.clearstreet.api.core.JsonString +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.toImmutable class QueryParams private constructor( @@ -44,7 +44,26 @@ private constructor( is JsonNumber -> put(key, value.value.toString()) is JsonString -> put(key, value.value) is JsonArray -> - value.values.forEachIndexed { index, value -> put("$key[$index]", value) } + put( + key, + value.values + .asSequence() + .mapNotNull { + when (it) { + is JsonMissing, + is JsonNull -> null + is JsonBoolean -> it.value.toString() + is JsonNumber -> it.value.toString() + is JsonString -> it.value + is JsonArray, + is JsonObject -> + throw IllegalArgumentException( + "Cannot comma separate non-primitives in query params" + ) + } + } + .joinToString(","), + ) is JsonObject -> value.values.forEach { (nestedKey, value) -> put("$key[$nestedKey]", value) } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/RetryingHttpClient.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/RetryingHttpClient.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/RetryingHttpClient.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/RetryingHttpClient.kt index e5e80573..43730dd6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/RetryingHttpClient.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/RetryingHttpClient.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core.http - -import com.clear_street.api.core.DefaultSleeper -import com.clear_street.api.core.RequestOptions -import com.clear_street.api.core.Sleeper -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetIoException -import com.clear_street.api.errors.ClearStreetRetryableException +package com.clearstreet.api.core.http + +import com.clearstreet.api.core.DefaultSleeper +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.Sleeper +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetIoException +import com.clearstreet.api.errors.ClearStreetRetryableException import java.io.IOException import java.time.Clock import java.time.Duration diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/StreamResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/StreamResponse.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/StreamResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/StreamResponse.kt index c40b3b89..a6b7d266 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/StreamResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/StreamResponse.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import java.util.stream.Stream diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/BadRequestException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/BadRequestException.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/BadRequestException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/BadRequestException.kt index b5115be1..1ae4a7e0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/BadRequestException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/BadRequestException.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetException.kt similarity index 80% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetException.kt index 6b8d45a0..84e1fd17 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetException.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.errors +package com.clearstreet.api.errors open class ClearStreetException @JvmOverloads diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetInvalidDataException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetInvalidDataException.kt similarity index 81% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetInvalidDataException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetInvalidDataException.kt index 6658e82b..bf54b47e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetInvalidDataException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetInvalidDataException.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.errors +package com.clearstreet.api.errors class ClearStreetInvalidDataException @JvmOverloads diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetIoException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetIoException.kt similarity index 80% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetIoException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetIoException.kt index dc0f7139..63404319 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetIoException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetIoException.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.errors +package com.clearstreet.api.errors class ClearStreetIoException @JvmOverloads diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetRetryableException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetRetryableException.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetRetryableException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetRetryableException.kt index 2d1dfe28..58fb7156 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetRetryableException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetRetryableException.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.errors +package com.clearstreet.api.errors /** * Exception that indicates a transient error that can be retried. diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetServiceException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetServiceException.kt similarity index 71% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetServiceException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetServiceException.kt index 31726bf0..c1e471a9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetServiceException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetServiceException.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.http.Headers +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.http.Headers abstract class ClearStreetServiceException protected constructor(message: String, cause: Throwable? = null) : diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/InternalServerException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/InternalServerException.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/InternalServerException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/InternalServerException.kt index 05222aff..1841748a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/InternalServerException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/InternalServerException.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/NotFoundException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/NotFoundException.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/NotFoundException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/NotFoundException.kt index 7482faa6..8761d61a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/NotFoundException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/NotFoundException.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/PermissionDeniedException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/PermissionDeniedException.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/PermissionDeniedException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/PermissionDeniedException.kt index 67e3a9c6..6709b733 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/PermissionDeniedException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/PermissionDeniedException.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/RateLimitException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/RateLimitException.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/RateLimitException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/RateLimitException.kt index 6b889dc5..afddb835 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/RateLimitException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/RateLimitException.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnauthorizedException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnauthorizedException.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnauthorizedException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnauthorizedException.kt index 2c0fd45f..1b1f1dec 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnauthorizedException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnauthorizedException.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnexpectedStatusCodeException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnexpectedStatusCodeException.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnexpectedStatusCodeException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnexpectedStatusCodeException.kt index 6d44744e..fad92f1d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnexpectedStatusCodeException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnexpectedStatusCodeException.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnprocessableEntityException.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnprocessableEntityException.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnprocessableEntityException.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnprocessableEntityException.kt index a7afcd1d..536945b0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnprocessableEntityException.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnprocessableEntityException.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.errors +package com.clearstreet.api.errors -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ApiError.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/ApiError.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ApiError.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/ApiError.kt index fc3868ad..da35eb2d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ApiError.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/ApiError.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/BaseResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/BaseResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/BaseResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/BaseResponse.kt index a065bcda..b5a0cf4d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/BaseResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/BaseResponse.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ResponseMetadata.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/ResponseMetadata.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ResponseMetadata.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/ResponseMetadata.kt index 42b47cfe..64af9f74 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/ResponseMetadata.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/ResponseMetadata.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/SecurityType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/SecurityType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/SecurityType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/SecurityType.kt index 76ccb7c0..b0d0e9e5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/SecurityType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/SecurityType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1 +package com.clearstreet.api.models.v1 -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Security type */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/Account.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/Account.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/Account.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/Account.kt index 9854d42b..db7170c4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/Account.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/Account.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalances.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalances.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt index d695c002..ed671d63 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalances.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSod.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSod.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt index 67b6fc47..354c7de5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSod.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParams.kt index 7dfe28fb..b051fa7d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt index 937adce8..0a8c09f1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdParams.kt index 823d0b00..a8b45b8b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdResponse.kt index 45b9c609..7c2feb15 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParams.kt index efd7a8f7..9eab27ea 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsResponse.kt index 509ad268..421879b7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt index b8f1f6f8..1ee3594c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.time.LocalDate import java.util.Objects import java.util.Optional diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt index 6ee944b1..f64752b6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdParams.kt index bc6fe471..e452c46b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdParams.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdResponse.kt index 68c7a08f..a49d7b4e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountSettings.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettings.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountSettings.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettings.kt index 912c2e54..2fddaf4d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountSettings.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettings.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountStatus.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountStatus.kt index 19a9dd54..00488818 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountStatus.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Account status */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountSubtype.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSubtype.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountSubtype.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSubtype.kt index a1cfa4d1..ea958cd9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountSubtype.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSubtype.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Account subtype classification providing more granular categorization */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountType.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountType.kt index 933f5ab7..3562f572 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/AccountType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Account type classification */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetails.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetails.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt index 85adf2ff..63e45538 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetails.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsage.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsUsage.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsage.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsUsage.kt index fef441de..5768e2d9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsage.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsUsage.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributor.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributor.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributor.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributor.kt index d7db8e75..bb9e0823 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributor.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributor.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginType.kt index d72443d1..e2817193 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/MarginType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** An account's margin type */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistoryResponse.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistoryResponse.kt index ccce778f..80207540 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistoryResponse.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegment.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistorySegment.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegment.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistorySegment.kt index 486f5700..43ef5c6a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegment.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistorySegment.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/RiskSettings.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettings.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/RiskSettings.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettings.kt index e92f58a9..f420b555 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/accounts/RiskSettings.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettings.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionParams.kt index e972a4a4..e6e36f32 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.apiversion +package com.clearstreet.api.models.v1.apiversion -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects /** Returns the current version string for this API endpoint. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt index 04efe109..49b6530c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.apiversion - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.apiversion + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/Version.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/Version.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/Version.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/Version.kt index 2a3a24bb..a595755a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/apiversion/Version.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/apiversion/Version.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.apiversion - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.apiversion + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockParams.kt index 62fadd0e..e50f4301 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects /** Returns the current server time in UTC. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockResponse.kt index 04b2c98e..166794c0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.calendar + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt index b554f71d..08794016 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt index 4879fd1d..d403249f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.calendar + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/ClockDetail.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/ClockDetail.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/ClockDetail.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/ClockDetail.kt index 2639f882..de9781cb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/ClockDetail.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/ClockDetail.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.calendar + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/DayType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/DayType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/DayType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/DayType.kt index 6dac109e..e43e5bbc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/DayType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/DayType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Day type for market hours - indicates the type of trading day */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetail.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketHoursDetail.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetail.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketHoursDetail.kt index 79fa7db5..00206d41 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetail.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketHoursDetail.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.calendar + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketSessionType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketSessionType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketSessionType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketSessionType.kt index 77d7d176..fd325e28 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketSessionType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketSessionType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Session type for market hours */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatus.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatus.kt index 74c9cf79..425092fe 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatus.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.calendar + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketType.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketType.kt index acc004b2..63a52e37 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/MarketType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Market type for market hours calendar endpoint */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/SessionSchedule.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/SessionSchedule.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/SessionSchedule.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/SessionSchedule.kt index 662cb4b3..238d5d96 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/SessionSchedule.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/SessionSchedule.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.calendar + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/TradingSessions.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessions.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/TradingSessions.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessions.kt index b39a9660..ed02b532 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/calendar/TradingSessions.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessions.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AllEventsEventType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AllEventsEventType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AllEventsEventType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AllEventsEventType.kt index a7047de2..8eba8dd4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AllEventsEventType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AllEventsEventType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Event types supported by the all-events endpoint. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistribution.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystDistribution.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistribution.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystDistribution.kt index 4a5f0fcc..bddd9fc5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistribution.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystDistribution.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystRating.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystRating.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystRating.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystRating.kt index 1200211c..8fd268d6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystRating.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystRating.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Analyst rating category */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/FiscalPeriodType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/FiscalPeriodType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/FiscalPeriodType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/FiscalPeriodType.kt index da8610c9..878f3dd4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/FiscalPeriodType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/FiscalPeriodType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Fiscal period type for earnings reports */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsData.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAllEventsData.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsData.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAllEventsData.kt index c2728b7e..7f44c7c9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAllEventsData.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt index 45ab0727..3d553fdc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt index 622e8236..f867e2a2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentBalanceSheetStatement.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt index ed7f72d7..ecf2d63f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentCashFlowStatement.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt index abe5d50e..9cc0e715 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -254,11 +254,9 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { - eventTypes?.forEachIndexed { index, it -> - put("event_types[$index]", it.toString()) - } + eventTypes?.let { put("event_types", it.joinToString(",") { it.toString() }) } fromDate?.let { put("from_date", it) } - instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } + instrumentIds?.let { put("instrument_ids", it.joinToString(",")) } toDate?.let { put("to_date", it) } putAll(additionalQueryParams) } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt index 761732aa..420c9250 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt index 28eb4abf..478ff044 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.time.LocalDate import java.util.Objects import java.util.Optional diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt index e6eac2d3..39965be5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt index bf3c7af9..3271f66a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt index c83f3cae..ce97d6e3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt index 3cb11cd2..24e4b9fc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt index 0821ddcd..623be6d0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt index 178711e6..b6840f16 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt index da057348..c972f122 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt index fd93ed4e..0c574a8c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt index 3e657017..fad9bb3c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt index 0e428046..2f110ee8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt index a5af88fb..d6bf9460 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEvent.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEvent.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEvent.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEvent.kt index ae378aae..bed81b24 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEvent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEvent.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarnings.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarnings.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarnings.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarnings.kt index 0022d6cf..c15d7f5b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarnings.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarnings.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt index 5146c47d..3f86f871 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt index df412883..f33aeb6b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDate.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsByDate.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDate.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsByDate.kt index f7f4f2e2..5dcf36a2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDate.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsByDate.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt index 03afd190..9e62ef9a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentals.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentals.kt index 6f4454d9..98253ddc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentals.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentals.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt index 703aada6..03dbf4b7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentIncomeStatement.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEvent.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentSplitEvent.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEvent.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentSplitEvent.kt index 83549525..35be0344 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEvent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentSplitEvent.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTarget.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/PriceTarget.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTarget.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/PriceTarget.kt index 25fceaa6..58a7081c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTarget.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/PriceTarget.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummary.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummary.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt index 9b46fd34..b7742054 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummary.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.marketdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt index d8e72c21..e092a1f0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt index 7f9be278..77a03fa2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata.marketdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt index 99a41ccf..940b3f2f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -187,7 +187,7 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { - instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } + instrumentIds?.let { put("instrument_ids", it.joinToString(",")) } putAll(additionalQueryParams) } .build() diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt index 22f8897d..6566a8ab 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata.marketdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt index f0cb4cfd..7e3ce1dd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.marketdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt index d9c6ba10..978e1de8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.marketdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt index e1f309a4..f120184c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotLastTrade.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.marketdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt index a8a04de4..9a9e660f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.marketdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt index 8cd8dff4..4c209d6c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotSession.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.marketdata + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt index b00df7f2..884cff06 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news - -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.news + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator import java.util.Objects import java.util.Optional @@ -350,12 +350,12 @@ private constructor( excludePublishers?.let { put("exclude_publishers", it) } from?.let { put("from", it) } includePublishers?.let { put("include_publishers", it) } - instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } + instrumentIds?.let { put("instrument_ids", it.joinToString(",")) } newsType?.let { put("news_type", it.toString()) } pageSize?.let { put("page_size", it.toString()) } pageToken?.let { put("page_token", it) } searchQuery?.let { put("search_query", it) } - sectors?.forEachIndexed { index, it -> put("sectors[$index]", it.toString()) } + sectors?.let { put("sectors", it.joinToString(",") { it.toString() }) } to?.let { put("to", it) } putAll(additionalQueryParams) } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt index 7df5c4ab..f5aadb88 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instrumentdata.news + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrument.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrument.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt index 0fb210b1..806b63d6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.news + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItem.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItem.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItem.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItem.kt index bb68ad11..61fde33e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItem.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItem.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instrumentdata.news + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsType.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsType.kt index e9025b9b..c642fee1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news +package com.clearstreet.api.models.v1.instrumentdata.news -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** News item classification. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ContractType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ContractType.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ContractType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ContractType.kt index 20b45f38..1c8d681a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ContractType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ContractType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** The type of options contract */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ExerciseStyle.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ExerciseStyle.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ExerciseStyle.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ExerciseStyle.kt index 6e834f38..3c4758ef 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ExerciseStyle.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ExerciseStyle.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** The exercise style of an options contract */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt index d31aac6f..9cf568e7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType +package com.clearstreet.api.models.v1.instruments + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt index 8b89da6c..eaaaa840 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType +package com.clearstreet.api.models.v1.instruments + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt index fa02ac86..62ccf994 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponse.kt index f1b4920a..2eb138d9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instruments + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt index 753d873e..3b2cb9d9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments - -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instruments + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator import java.util.Objects import java.util.Optional @@ -382,7 +382,7 @@ private constructor( QueryParams.builder() .apply { easyToBorrow?.let { put("easy_to_borrow", it.toString()) } - instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } + instrumentIds?.let { put("instrument_ids", it.joinToString(",")) } instrumentType?.let { put("instrument_type", it.toString()) } isLiquidationOnly?.let { put("is_liquidation_only", it.toString()) } isMarginable?.let { put("is_marginable", it.toString()) } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponse.kt index bbc8dd3f..7e1eeda4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instruments + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt index 90d0f4f9..58dfc272 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.time.LocalDate import java.util.Objects import java.util.Optional diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt index eea782cf..98d163b7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instruments + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt index c402ef5b..71e8cbea 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponse.kt index aae6db98..f1b43dd1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.instruments + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ListingType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ListingType.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ListingType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ListingType.kt index e6ad1a0b..bee4816d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/ListingType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/ListingType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** The listing type of an options contract */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/OptionsContract.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/OptionsContract.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt index 02f73c02..057a467a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/instruments/OptionsContract.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.instruments + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ActionButton.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ActionButton.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ActionButton.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ActionButton.kt index 4abfa07f..5ca61917 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ActionButton.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ActionButton.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayload.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayload.kt index 508b1e58..0802aba0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayload.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPoint.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPoint.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPoint.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPoint.kt index 42d4b02c..d975c3db 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartPoint.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPoint.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartSeries.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartSeries.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartSeries.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartSeries.kt index 1ae0b1b1..d4593fdd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ChartSeries.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartSeries.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartChartPayload.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartChartPayload.kt index 0de50342..d06e3052 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartChartPayload.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartCustomPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartCustomPayload.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartCustomPayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartCustomPayload.kt index 99a2ab72..27162db5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartCustomPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartCustomPayload.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayload.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayload.kt index e7702d67..fa56398a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayload.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartSuggestedActionsPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartSuggestedActionsPayload.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartSuggestedActionsPayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartSuggestedActionsPayload.kt index d51a4c80..65b10acc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartSuggestedActionsPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartSuggestedActionsPayload.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartTextPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartTextPayload.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartTextPayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartTextPayload.kt index 50365098..55b76a30 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartTextPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartTextPayload.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartThinkingPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartThinkingPayload.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartThinkingPayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartThinkingPayload.kt index 02f10318..23c6122a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ContentPartThinkingPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartThinkingPayload.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/DataChart.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/DataChart.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/DataChart.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/DataChart.kt index 82a885e9..a84b2844 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/DataChart.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/DataChart.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementKey.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/EntitlementAgreementKey.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementKey.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/EntitlementAgreementKey.kt index df556dcc..51e2b1c0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementKey.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/EntitlementAgreementKey.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Stable entitlement agreement family key. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCode.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/EntitlementCode.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCode.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/EntitlementCode.kt index 2f1a0487..2beaa184 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCode.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/EntitlementCode.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Stable entitlement code granted by an agreement. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenChartAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartAction.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenChartAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartAction.kt index 06d06465..8c677fee 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenChartAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartAction.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenEntitlementConsentAction.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenEntitlementConsentAction.kt index 9d80553e..e1733a88 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenEntitlementConsentAction.kt @@ -1,17 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementAgreementKey -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenScreenerAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenScreenerAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt index 05c58e77..009c8e68 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/OpenScreenerAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillCancelOrderAction.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillCancelOrderAction.kt index 95c596aa..e54c6c7b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillCancelOrderAction.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.orders.CancelOrderRequest +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.orders.CancelOrderRequest import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderAction.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderAction.kt index 2187f0b8..419c27b6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderAction.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.orders.NewOrderRequest +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.orders.NewOrderRequest import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderAction.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderAction.kt index bed26012..4d06a4d4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderAction.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.BaseDeserializer -import com.clear_street.api.core.BaseSerializer -import com.clear_street.api.core.Enum -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.allMaxBy -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.getOrThrow -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.orders.CancelOrderRequest -import com.clear_street.api.models.v1.orders.NewOrderRequest +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.BaseDeserializer +import com.clearstreet.api.core.BaseSerializer +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.allMaxBy +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.getOrThrow +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.orders.CancelOrderRequest +import com.clearstreet.api.models.v1.orders.NewOrderRequest import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -76,7 +76,7 @@ private constructor( * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the * SDK gracefully, consider overriding [Visitor.unknown]: * ```java - * import com.clear_street.api.core.JsonValue; + * import com.clearstreet.api.core.JsonValue; * import java.util.Optional; * * Optional result = prefillOrderAction.accept(new PrefillOrderAction.Visitor>() { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PromptButtonAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PromptButtonAction.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PromptButtonAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PromptButtonAction.kt index 160eae6a..70f82beb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/PromptButtonAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/PromptButtonAction.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ScreenerFilter.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilter.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ScreenerFilter.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilter.kt index 7de6b706..91b5a071 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/ScreenerFilter.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilter.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/StructuredAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredAction.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/StructuredAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredAction.kt index f1e82eea..40a3e55e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/StructuredAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredAction.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.BaseDeserializer -import com.clear_street.api.core.BaseSerializer -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.allMaxBy -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.getOrThrow -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.BaseDeserializer +import com.clearstreet.api.core.BaseSerializer +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.allMaxBy +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.getOrThrow +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -88,7 +88,7 @@ private constructor( * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the * SDK gracefully, consider overriding [Visitor.unknown]: * ```java - * import com.clear_street.api.core.JsonValue; + * import com.clearstreet.api.core.JsonValue; * import java.util.Optional; * * Optional result = structuredAction.accept(new StructuredAction.Visitor>() { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionButtonAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonAction.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionButtonAction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonAction.kt index 9a04b603..bd464048 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionButtonAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonAction.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/SuggestedActionsPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/SuggestedActionsPayload.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/SuggestedActionsPayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/SuggestedActionsPayload.kt index 87309a7f..368de0f4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/SuggestedActionsPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/SuggestedActionsPayload.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/DeleteEntitlementResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/DeleteEntitlementResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/DeleteEntitlementResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/DeleteEntitlementResponse.kt index 19cfd2cc..06bddfc9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/DeleteEntitlementResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/DeleteEntitlementResponse.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.entitlements + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt index 342a3e1f..07234312 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementAgreementResource.kt @@ -1,15 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.entitlements + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.omniai.EntitlementAgreementKey +import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt index d3a89ab1..ddf407e3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParams.kt @@ -1,18 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.entitlements + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponse.kt index 433515ff..3849716a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.entitlements + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParams.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParams.kt index b1ea5b36..eb741e95 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParams.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponse.kt index c7512cef..e876c77c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.entitlements + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt index b8fb4d1f..1828ffe9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects /** List current signable entitlement agreements for consent UX. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt index f72644ab..b3cfde17 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.entitlements + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParams.kt index 564e4ee7..50943f86 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponse.kt index cb8e5071..dbd575d4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.entitlements + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResource.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementResource.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResource.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementResource.kt index 8d33ea16..0cb61361 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResource.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementResource.kt @@ -1,13 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.entitlements + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponse.kt index 58e08bdc..99902280 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponse.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.messages + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdParams.kt index 7c893e1f..22c13803 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages +package com.clearstreet.api.models.v1.omniai.messages -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt index caa0bb6b..53507265 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdResponse.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.threads.Message +package com.clearstreet.api.models.v1.omniai.messages + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.omniai.threads.Message import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackParams.kt index 6f1ee9a1..4015afc7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackParams.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.messages + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt index 8f9dc49f..86643aec 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.messages + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/CancelResponsePayload.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayload.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/CancelResponsePayload.kt index 6b707d91..5d2ee157 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/CancelResponsePayload.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatus.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatus.kt index 873656e8..26a8c58e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatus.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/Response.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/Response.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/Response.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/Response.kt index 48f3e34e..6e14bf47 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/Response.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/Response.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseParams.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseParams.kt index 5027c046..1b5bb660 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseParams.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt index 747076b4..0808125e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContent.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContent.kt similarity index 73% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContent.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContent.kt index 4e4918fa..6d05a42e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContent.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -108,29 +108,47 @@ private constructor( (parts ?: JsonField.of(mutableListOf())).also { checkKnown("parts", it).add(part) } } - /** Alias for calling [addPart] with `ResponseContentPart.ofUnionMember0(unionMember0)`. */ - fun addPart(unionMember0: ResponseContentPart.UnionMember0) = - addPart(ResponseContentPart.ofUnionMember0(unionMember0)) + /** + * Alias for calling [addPart] with + * `ResponseContentPart.ofContentPartText(contentPartText)`. + */ + fun addPart(contentPartText: ResponseContentPart.ContentPartText) = + addPart(ResponseContentPart.ofContentPartText(contentPartText)) - /** Alias for calling [addPart] with `ResponseContentPart.ofUnionMember1(unionMember1)`. */ - fun addPart(unionMember1: ResponseContentPart.UnionMember1) = - addPart(ResponseContentPart.ofUnionMember1(unionMember1)) + /** + * Alias for calling [addPart] with + * `ResponseContentPart.ofContentPartThinking(contentPartThinking)`. + */ + fun addPart(contentPartThinking: ResponseContentPart.ContentPartThinking) = + addPart(ResponseContentPart.ofContentPartThinking(contentPartThinking)) - /** Alias for calling [addPart] with `ResponseContentPart.ofUnionMember2(unionMember2)`. */ - fun addPart(unionMember2: ResponseContentPart.UnionMember2) = - addPart(ResponseContentPart.ofUnionMember2(unionMember2)) + /** + * Alias for calling [addPart] with + * `ResponseContentPart.ofContentPartStructuredAction(contentPartStructuredAction)`. + */ + fun addPart(contentPartStructuredAction: ResponseContentPart.ContentPartStructuredAction) = + addPart(ResponseContentPart.ofContentPartStructuredAction(contentPartStructuredAction)) - /** Alias for calling [addPart] with `ResponseContentPart.ofUnionMember3(unionMember3)`. */ - fun addPart(unionMember3: ResponseContentPart.UnionMember3) = - addPart(ResponseContentPart.ofUnionMember3(unionMember3)) + /** + * Alias for calling [addPart] with + * `ResponseContentPart.ofContentPartChart(contentPartChart)`. + */ + fun addPart(contentPartChart: ResponseContentPart.ContentPartChart) = + addPart(ResponseContentPart.ofContentPartChart(contentPartChart)) - /** Alias for calling [addPart] with `ResponseContentPart.ofUnionMember4(unionMember4)`. */ - fun addPart(unionMember4: ResponseContentPart.UnionMember4) = - addPart(ResponseContentPart.ofUnionMember4(unionMember4)) + /** + * Alias for calling [addPart] with + * `ResponseContentPart.ofContentPartSuggestedActions(contentPartSuggestedActions)`. + */ + fun addPart(contentPartSuggestedActions: ResponseContentPart.ContentPartSuggestedActions) = + addPart(ResponseContentPart.ofContentPartSuggestedActions(contentPartSuggestedActions)) - /** Alias for calling [addPart] with `ResponseContentPart.ofUnionMember5(unionMember5)`. */ - fun addPart(unionMember5: ResponseContentPart.UnionMember5) = - addPart(ResponseContentPart.ofUnionMember5(unionMember5)) + /** + * Alias for calling [addPart] with + * `ResponseContentPart.ofContentPartCustom(contentPartCustom)`. + */ + fun addPart(contentPartCustom: ResponseContentPart.ContentPartCustom) = + addPart(ResponseContentPart.ofContentPartCustom(contentPartCustom)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPart.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPart.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPart.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPart.kt index 9f3bc882..ebcb68a5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPart.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPart.kt @@ -1,29 +1,29 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.BaseDeserializer -import com.clear_street.api.core.BaseSerializer -import com.clear_street.api.core.Enum -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.allMaxBy -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.getOrThrow -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.ChartPayload -import com.clear_street.api.models.v1.omniai.ContentPartChartPayload -import com.clear_street.api.models.v1.omniai.ContentPartCustomPayload -import com.clear_street.api.models.v1.omniai.ContentPartStructuredActionPayload -import com.clear_street.api.models.v1.omniai.ContentPartSuggestedActionsPayload -import com.clear_street.api.models.v1.omniai.ContentPartTextPayload -import com.clear_street.api.models.v1.omniai.ContentPartThinkingPayload -import com.clear_street.api.models.v1.omniai.StructuredAction -import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.BaseDeserializer +import com.clearstreet.api.core.BaseSerializer +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.allMaxBy +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.getOrThrow +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.omniai.ChartPayload +import com.clearstreet.api.models.v1.omniai.ContentPartChartPayload +import com.clearstreet.api.models.v1.omniai.ContentPartCustomPayload +import com.clearstreet.api.models.v1.omniai.ContentPartStructuredActionPayload +import com.clearstreet.api.models.v1.omniai.ContentPartSuggestedActionsPayload +import com.clearstreet.api.models.v1.omniai.ContentPartTextPayload +import com.clearstreet.api.models.v1.omniai.ContentPartThinkingPayload +import com.clearstreet.api.models.v1.omniai.StructuredAction +import com.clearstreet.api.models.v1.omniai.SuggestedActionsPayload import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -45,62 +45,68 @@ import kotlin.jvm.optionals.getOrNull @JsonSerialize(using = ResponseContentPart.Serializer::class) class ResponseContentPart private constructor( - private val unionMember0: UnionMember0? = null, - private val unionMember1: UnionMember1? = null, - private val unionMember2: UnionMember2? = null, - private val unionMember3: UnionMember3? = null, - private val unionMember4: UnionMember4? = null, - private val unionMember5: UnionMember5? = null, + private val contentPartText: ContentPartText? = null, + private val contentPartThinking: ContentPartThinking? = null, + private val contentPartStructuredAction: ContentPartStructuredAction? = null, + private val contentPartChart: ContentPartChart? = null, + private val contentPartSuggestedActions: ContentPartSuggestedActions? = null, + private val contentPartCustom: ContentPartCustom? = null, private val _json: JsonValue? = null, ) { /** Text content part. */ - fun unionMember0(): Optional = Optional.ofNullable(unionMember0) + fun contentPartText(): Optional = Optional.ofNullable(contentPartText) /** Thinking content part shown on dynamic response polling. */ - fun unionMember1(): Optional = Optional.ofNullable(unionMember1) + fun contentPartThinking(): Optional = + Optional.ofNullable(contentPartThinking) /** Structured action content part. */ - fun unionMember2(): Optional = Optional.ofNullable(unionMember2) + fun contentPartStructuredAction(): Optional = + Optional.ofNullable(contentPartStructuredAction) /** Chart payload content part. */ - fun unionMember3(): Optional = Optional.ofNullable(unionMember3) + fun contentPartChart(): Optional = Optional.ofNullable(contentPartChart) /** Suggested actions payload content part. */ - fun unionMember4(): Optional = Optional.ofNullable(unionMember4) + fun contentPartSuggestedActions(): Optional = + Optional.ofNullable(contentPartSuggestedActions) /** Escape-hatch custom payload content part. */ - fun unionMember5(): Optional = Optional.ofNullable(unionMember5) + fun contentPartCustom(): Optional = Optional.ofNullable(contentPartCustom) - fun isUnionMember0(): Boolean = unionMember0 != null + fun isContentPartText(): Boolean = contentPartText != null - fun isUnionMember1(): Boolean = unionMember1 != null + fun isContentPartThinking(): Boolean = contentPartThinking != null - fun isUnionMember2(): Boolean = unionMember2 != null + fun isContentPartStructuredAction(): Boolean = contentPartStructuredAction != null - fun isUnionMember3(): Boolean = unionMember3 != null + fun isContentPartChart(): Boolean = contentPartChart != null - fun isUnionMember4(): Boolean = unionMember4 != null + fun isContentPartSuggestedActions(): Boolean = contentPartSuggestedActions != null - fun isUnionMember5(): Boolean = unionMember5 != null + fun isContentPartCustom(): Boolean = contentPartCustom != null /** Text content part. */ - fun asUnionMember0(): UnionMember0 = unionMember0.getOrThrow("unionMember0") + fun asContentPartText(): ContentPartText = contentPartText.getOrThrow("contentPartText") /** Thinking content part shown on dynamic response polling. */ - fun asUnionMember1(): UnionMember1 = unionMember1.getOrThrow("unionMember1") + fun asContentPartThinking(): ContentPartThinking = + contentPartThinking.getOrThrow("contentPartThinking") /** Structured action content part. */ - fun asUnionMember2(): UnionMember2 = unionMember2.getOrThrow("unionMember2") + fun asContentPartStructuredAction(): ContentPartStructuredAction = + contentPartStructuredAction.getOrThrow("contentPartStructuredAction") /** Chart payload content part. */ - fun asUnionMember3(): UnionMember3 = unionMember3.getOrThrow("unionMember3") + fun asContentPartChart(): ContentPartChart = contentPartChart.getOrThrow("contentPartChart") /** Suggested actions payload content part. */ - fun asUnionMember4(): UnionMember4 = unionMember4.getOrThrow("unionMember4") + fun asContentPartSuggestedActions(): ContentPartSuggestedActions = + contentPartSuggestedActions.getOrThrow("contentPartSuggestedActions") /** Escape-hatch custom payload content part. */ - fun asUnionMember5(): UnionMember5 = unionMember5.getOrThrow("unionMember5") + fun asContentPartCustom(): ContentPartCustom = contentPartCustom.getOrThrow("contentPartCustom") fun _json(): Optional = Optional.ofNullable(_json) @@ -111,13 +117,13 @@ private constructor( * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the * SDK gracefully, consider overriding [Visitor.unknown]: * ```java - * import com.clear_street.api.core.JsonValue; + * import com.clearstreet.api.core.JsonValue; * import java.util.Optional; * * Optional result = responseContentPart.accept(new ResponseContentPart.Visitor>() { * @Override - * public Optional visitUnionMember0(UnionMember0 unionMember0) { - * return Optional.of(unionMember0.toString()); + * public Optional visitContentPartText(ContentPartText contentPartText) { + * return Optional.of(contentPartText.toString()); * } * * // ... @@ -135,12 +141,14 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - unionMember0 != null -> visitor.visitUnionMember0(unionMember0) - unionMember1 != null -> visitor.visitUnionMember1(unionMember1) - unionMember2 != null -> visitor.visitUnionMember2(unionMember2) - unionMember3 != null -> visitor.visitUnionMember3(unionMember3) - unionMember4 != null -> visitor.visitUnionMember4(unionMember4) - unionMember5 != null -> visitor.visitUnionMember5(unionMember5) + contentPartText != null -> visitor.visitContentPartText(contentPartText) + contentPartThinking != null -> visitor.visitContentPartThinking(contentPartThinking) + contentPartStructuredAction != null -> + visitor.visitContentPartStructuredAction(contentPartStructuredAction) + contentPartChart != null -> visitor.visitContentPartChart(contentPartChart) + contentPartSuggestedActions != null -> + visitor.visitContentPartSuggestedActions(contentPartSuggestedActions) + contentPartCustom != null -> visitor.visitContentPartCustom(contentPartCustom) else -> visitor.unknown(_json) } @@ -161,28 +169,32 @@ private constructor( accept( object : Visitor { - override fun visitUnionMember0(unionMember0: UnionMember0) { - unionMember0.validate() + override fun visitContentPartText(contentPartText: ContentPartText) { + contentPartText.validate() } - override fun visitUnionMember1(unionMember1: UnionMember1) { - unionMember1.validate() + override fun visitContentPartThinking(contentPartThinking: ContentPartThinking) { + contentPartThinking.validate() } - override fun visitUnionMember2(unionMember2: UnionMember2) { - unionMember2.validate() + override fun visitContentPartStructuredAction( + contentPartStructuredAction: ContentPartStructuredAction + ) { + contentPartStructuredAction.validate() } - override fun visitUnionMember3(unionMember3: UnionMember3) { - unionMember3.validate() + override fun visitContentPartChart(contentPartChart: ContentPartChart) { + contentPartChart.validate() } - override fun visitUnionMember4(unionMember4: UnionMember4) { - unionMember4.validate() + override fun visitContentPartSuggestedActions( + contentPartSuggestedActions: ContentPartSuggestedActions + ) { + contentPartSuggestedActions.validate() } - override fun visitUnionMember5(unionMember5: UnionMember5) { - unionMember5.validate() + override fun visitContentPartCustom(contentPartCustom: ContentPartCustom) { + contentPartCustom.validate() } } ) @@ -206,17 +218,25 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitUnionMember0(unionMember0: UnionMember0) = unionMember0.validity() + override fun visitContentPartText(contentPartText: ContentPartText) = + contentPartText.validity() - override fun visitUnionMember1(unionMember1: UnionMember1) = unionMember1.validity() + override fun visitContentPartThinking(contentPartThinking: ContentPartThinking) = + contentPartThinking.validity() - override fun visitUnionMember2(unionMember2: UnionMember2) = unionMember2.validity() + override fun visitContentPartStructuredAction( + contentPartStructuredAction: ContentPartStructuredAction + ) = contentPartStructuredAction.validity() - override fun visitUnionMember3(unionMember3: UnionMember3) = unionMember3.validity() + override fun visitContentPartChart(contentPartChart: ContentPartChart) = + contentPartChart.validity() - override fun visitUnionMember4(unionMember4: UnionMember4) = unionMember4.validity() + override fun visitContentPartSuggestedActions( + contentPartSuggestedActions: ContentPartSuggestedActions + ) = contentPartSuggestedActions.validity() - override fun visitUnionMember5(unionMember5: UnionMember5) = unionMember5.validity() + override fun visitContentPartCustom(contentPartCustom: ContentPartCustom) = + contentPartCustom.validity() override fun unknown(json: JsonValue?) = 0 } @@ -228,32 +248,35 @@ private constructor( } return other is ResponseContentPart && - unionMember0 == other.unionMember0 && - unionMember1 == other.unionMember1 && - unionMember2 == other.unionMember2 && - unionMember3 == other.unionMember3 && - unionMember4 == other.unionMember4 && - unionMember5 == other.unionMember5 + contentPartText == other.contentPartText && + contentPartThinking == other.contentPartThinking && + contentPartStructuredAction == other.contentPartStructuredAction && + contentPartChart == other.contentPartChart && + contentPartSuggestedActions == other.contentPartSuggestedActions && + contentPartCustom == other.contentPartCustom } override fun hashCode(): Int = Objects.hash( - unionMember0, - unionMember1, - unionMember2, - unionMember3, - unionMember4, - unionMember5, + contentPartText, + contentPartThinking, + contentPartStructuredAction, + contentPartChart, + contentPartSuggestedActions, + contentPartCustom, ) override fun toString(): String = when { - unionMember0 != null -> "ResponseContentPart{unionMember0=$unionMember0}" - unionMember1 != null -> "ResponseContentPart{unionMember1=$unionMember1}" - unionMember2 != null -> "ResponseContentPart{unionMember2=$unionMember2}" - unionMember3 != null -> "ResponseContentPart{unionMember3=$unionMember3}" - unionMember4 != null -> "ResponseContentPart{unionMember4=$unionMember4}" - unionMember5 != null -> "ResponseContentPart{unionMember5=$unionMember5}" + contentPartText != null -> "ResponseContentPart{contentPartText=$contentPartText}" + contentPartThinking != null -> + "ResponseContentPart{contentPartThinking=$contentPartThinking}" + contentPartStructuredAction != null -> + "ResponseContentPart{contentPartStructuredAction=$contentPartStructuredAction}" + contentPartChart != null -> "ResponseContentPart{contentPartChart=$contentPartChart}" + contentPartSuggestedActions != null -> + "ResponseContentPart{contentPartSuggestedActions=$contentPartSuggestedActions}" + contentPartCustom != null -> "ResponseContentPart{contentPartCustom=$contentPartCustom}" _json != null -> "ResponseContentPart{_unknown=$_json}" else -> throw IllegalStateException("Invalid ResponseContentPart") } @@ -262,33 +285,35 @@ private constructor( /** Text content part. */ @JvmStatic - fun ofUnionMember0(unionMember0: UnionMember0) = - ResponseContentPart(unionMember0 = unionMember0) + fun ofContentPartText(contentPartText: ContentPartText) = + ResponseContentPart(contentPartText = contentPartText) /** Thinking content part shown on dynamic response polling. */ @JvmStatic - fun ofUnionMember1(unionMember1: UnionMember1) = - ResponseContentPart(unionMember1 = unionMember1) + fun ofContentPartThinking(contentPartThinking: ContentPartThinking) = + ResponseContentPart(contentPartThinking = contentPartThinking) /** Structured action content part. */ @JvmStatic - fun ofUnionMember2(unionMember2: UnionMember2) = - ResponseContentPart(unionMember2 = unionMember2) + fun ofContentPartStructuredAction( + contentPartStructuredAction: ContentPartStructuredAction + ) = ResponseContentPart(contentPartStructuredAction = contentPartStructuredAction) /** Chart payload content part. */ @JvmStatic - fun ofUnionMember3(unionMember3: UnionMember3) = - ResponseContentPart(unionMember3 = unionMember3) + fun ofContentPartChart(contentPartChart: ContentPartChart) = + ResponseContentPart(contentPartChart = contentPartChart) /** Suggested actions payload content part. */ @JvmStatic - fun ofUnionMember4(unionMember4: UnionMember4) = - ResponseContentPart(unionMember4 = unionMember4) + fun ofContentPartSuggestedActions( + contentPartSuggestedActions: ContentPartSuggestedActions + ) = ResponseContentPart(contentPartSuggestedActions = contentPartSuggestedActions) /** Escape-hatch custom payload content part. */ @JvmStatic - fun ofUnionMember5(unionMember5: UnionMember5) = - ResponseContentPart(unionMember5 = unionMember5) + fun ofContentPartCustom(contentPartCustom: ContentPartCustom) = + ResponseContentPart(contentPartCustom = contentPartCustom) } /** @@ -298,22 +323,26 @@ private constructor( interface Visitor { /** Text content part. */ - fun visitUnionMember0(unionMember0: UnionMember0): T + fun visitContentPartText(contentPartText: ContentPartText): T /** Thinking content part shown on dynamic response polling. */ - fun visitUnionMember1(unionMember1: UnionMember1): T + fun visitContentPartThinking(contentPartThinking: ContentPartThinking): T /** Structured action content part. */ - fun visitUnionMember2(unionMember2: UnionMember2): T + fun visitContentPartStructuredAction( + contentPartStructuredAction: ContentPartStructuredAction + ): T /** Chart payload content part. */ - fun visitUnionMember3(unionMember3: UnionMember3): T + fun visitContentPartChart(contentPartChart: ContentPartChart): T /** Suggested actions payload content part. */ - fun visitUnionMember4(unionMember4: UnionMember4): T + fun visitContentPartSuggestedActions( + contentPartSuggestedActions: ContentPartSuggestedActions + ): T /** Escape-hatch custom payload content part. */ - fun visitUnionMember5(unionMember5: UnionMember5): T + fun visitContentPartCustom(contentPartCustom: ContentPartCustom): T /** * Maps an unknown variant of [ResponseContentPart] to a value of type [T]. @@ -338,23 +367,23 @@ private constructor( val bestMatches = sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - ResponseContentPart(unionMember0 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + ResponseContentPart(contentPartText = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - ResponseContentPart(unionMember1 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + ResponseContentPart(contentPartThinking = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - ResponseContentPart(unionMember2 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + ResponseContentPart(contentPartStructuredAction = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - ResponseContentPart(unionMember3 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + ResponseContentPart(contentPartChart = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - ResponseContentPart(unionMember4 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + ResponseContentPart(contentPartSuggestedActions = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - ResponseContentPart(unionMember5 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + ResponseContentPart(contentPartCustom = it, _json = json) }, ) .filterNotNull() @@ -380,12 +409,15 @@ private constructor( provider: SerializerProvider, ) { when { - value.unionMember0 != null -> generator.writeObject(value.unionMember0) - value.unionMember1 != null -> generator.writeObject(value.unionMember1) - value.unionMember2 != null -> generator.writeObject(value.unionMember2) - value.unionMember3 != null -> generator.writeObject(value.unionMember3) - value.unionMember4 != null -> generator.writeObject(value.unionMember4) - value.unionMember5 != null -> generator.writeObject(value.unionMember5) + value.contentPartText != null -> generator.writeObject(value.contentPartText) + value.contentPartThinking != null -> + generator.writeObject(value.contentPartThinking) + value.contentPartStructuredAction != null -> + generator.writeObject(value.contentPartStructuredAction) + value.contentPartChart != null -> generator.writeObject(value.contentPartChart) + value.contentPartSuggestedActions != null -> + generator.writeObject(value.contentPartSuggestedActions) + value.contentPartCustom != null -> generator.writeObject(value.contentPartCustom) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid ResponseContentPart") } @@ -393,7 +425,7 @@ private constructor( } /** Text content part. */ - class UnionMember0 + class ContentPartText @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val text: JsonField, @@ -451,7 +483,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember0]. + * Returns a mutable builder for constructing an instance of [ContentPartText]. * * The following fields are required: * ```java @@ -462,7 +494,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember0]. */ + /** A builder for [ContentPartText]. */ class Builder internal constructor() { private var text: JsonField? = null @@ -470,10 +502,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember0: UnionMember0) = apply { - text = unionMember0.text - type = unionMember0.type - additionalProperties = unionMember0.additionalProperties.toMutableMap() + internal fun from(contentPartText: ContentPartText) = apply { + text = contentPartText.text + type = contentPartText.type + additionalProperties = contentPartText.additionalProperties.toMutableMap() } fun text(text: String) = text(JsonField.of(text)) @@ -518,7 +550,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember0]. + * Returns an immutable instance of [ContentPartText]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -530,8 +562,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember0 = - UnionMember0( + fun build(): ContentPartText = + ContentPartText( checkRequired("text", text), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -549,7 +581,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember0 = apply { + fun validate(): ContentPartText = apply { if (validated) { return@apply } @@ -713,7 +745,7 @@ private constructor( return true } - return other is UnionMember0 && + return other is ContentPartText && text == other.text && type == other.type && additionalProperties == other.additionalProperties @@ -724,11 +756,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember0{text=$text, type=$type, additionalProperties=$additionalProperties}" + "ContentPartText{text=$text, type=$type, additionalProperties=$additionalProperties}" } /** Thinking content part shown on dynamic response polling. */ - class UnionMember1 + class ContentPartThinking @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val thoughts: JsonField>, @@ -790,7 +822,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember1]. + * Returns a mutable builder for constructing an instance of [ContentPartThinking]. * * The following fields are required: * ```java @@ -801,7 +833,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember1]. */ + /** A builder for [ContentPartThinking]. */ class Builder internal constructor() { private var thoughts: JsonField>? = null @@ -809,10 +841,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember1: UnionMember1) = apply { - thoughts = unionMember1.thoughts.map { it.toMutableList() } - type = unionMember1.type - additionalProperties = unionMember1.additionalProperties.toMutableMap() + internal fun from(contentPartThinking: ContentPartThinking) = apply { + thoughts = contentPartThinking.thoughts.map { it.toMutableList() } + type = contentPartThinking.type + additionalProperties = contentPartThinking.additionalProperties.toMutableMap() } fun thoughts(thoughts: List) = thoughts(JsonField.of(thoughts)) @@ -871,7 +903,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember1]. + * Returns an immutable instance of [ContentPartThinking]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -883,8 +915,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember1 = - UnionMember1( + fun build(): ContentPartThinking = + ContentPartThinking( checkRequired("thoughts", thoughts).map { it.toImmutable() }, checkRequired("type", type), additionalProperties.toMutableMap(), @@ -902,7 +934,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember1 = apply { + fun validate(): ContentPartThinking = apply { if (validated) { return@apply } @@ -1067,7 +1099,7 @@ private constructor( return true } - return other is UnionMember1 && + return other is ContentPartThinking && thoughts == other.thoughts && type == other.type && additionalProperties == other.additionalProperties @@ -1078,11 +1110,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember1{thoughts=$thoughts, type=$type, additionalProperties=$additionalProperties}" + "ContentPartThinking{thoughts=$thoughts, type=$type, additionalProperties=$additionalProperties}" } /** Structured action content part. */ - class UnionMember2 + class ContentPartStructuredAction @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val action: JsonField, @@ -1164,7 +1196,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember2]. + * Returns a mutable builder for constructing an instance of + * [ContentPartStructuredAction]. * * The following fields are required: * ```java @@ -1176,7 +1209,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember2]. */ + /** A builder for [ContentPartStructuredAction]. */ class Builder internal constructor() { private var action: JsonField? = null @@ -1185,11 +1218,12 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember2: UnionMember2) = apply { - action = unionMember2.action - actionId = unionMember2.actionId - type = unionMember2.type - additionalProperties = unionMember2.additionalProperties.toMutableMap() + internal fun from(contentPartStructuredAction: ContentPartStructuredAction) = apply { + action = contentPartStructuredAction.action + actionId = contentPartStructuredAction.actionId + type = contentPartStructuredAction.type + additionalProperties = + contentPartStructuredAction.additionalProperties.toMutableMap() } /** @@ -1270,7 +1304,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember2]. + * Returns an immutable instance of [ContentPartStructuredAction]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -1283,8 +1317,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember2 = - UnionMember2( + fun build(): ContentPartStructuredAction = + ContentPartStructuredAction( checkRequired("action", action), checkRequired("actionId", actionId), checkRequired("type", type), @@ -1303,7 +1337,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember2 = apply { + fun validate(): ContentPartStructuredAction = apply { if (validated) { return@apply } @@ -1470,7 +1504,7 @@ private constructor( return true } - return other is UnionMember2 && + return other is ContentPartStructuredAction && action == other.action && actionId == other.actionId && type == other.type && @@ -1484,11 +1518,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember2{action=$action, actionId=$actionId, type=$type, additionalProperties=$additionalProperties}" + "ContentPartStructuredAction{action=$action, actionId=$actionId, type=$type, additionalProperties=$additionalProperties}" } /** Chart payload content part. */ - class UnionMember3 + class ContentPartChart @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val payload: JsonField, @@ -1550,7 +1584,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember3]. + * Returns a mutable builder for constructing an instance of [ContentPartChart]. * * The following fields are required: * ```java @@ -1561,7 +1595,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember3]. */ + /** A builder for [ContentPartChart]. */ class Builder internal constructor() { private var payload: JsonField? = null @@ -1569,10 +1603,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember3: UnionMember3) = apply { - payload = unionMember3.payload - type = unionMember3.type - additionalProperties = unionMember3.additionalProperties.toMutableMap() + internal fun from(contentPartChart: ContentPartChart) = apply { + payload = contentPartChart.payload + type = contentPartChart.type + additionalProperties = contentPartChart.additionalProperties.toMutableMap() } /** Typed chart payload rendered inline in assistant content. */ @@ -1618,7 +1652,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember3]. + * Returns an immutable instance of [ContentPartChart]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -1630,8 +1664,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember3 = - UnionMember3( + fun build(): ContentPartChart = + ContentPartChart( checkRequired("payload", payload), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -1649,7 +1683,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember3 = apply { + fun validate(): ContentPartChart = apply { if (validated) { return@apply } @@ -1814,7 +1848,7 @@ private constructor( return true } - return other is UnionMember3 && + return other is ContentPartChart && payload == other.payload && type == other.type && additionalProperties == other.additionalProperties @@ -1825,11 +1859,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember3{payload=$payload, type=$type, additionalProperties=$additionalProperties}" + "ContentPartChart{payload=$payload, type=$type, additionalProperties=$additionalProperties}" } /** Suggested actions payload content part. */ - class UnionMember4 + class ContentPartSuggestedActions @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val payload: JsonField, @@ -1893,7 +1927,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember4]. + * Returns a mutable builder for constructing an instance of + * [ContentPartSuggestedActions]. * * The following fields are required: * ```java @@ -1904,7 +1939,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember4]. */ + /** A builder for [ContentPartSuggestedActions]. */ class Builder internal constructor() { private var payload: JsonField? = null @@ -1912,10 +1947,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember4: UnionMember4) = apply { - payload = unionMember4.payload - type = unionMember4.type - additionalProperties = unionMember4.additionalProperties.toMutableMap() + internal fun from(contentPartSuggestedActions: ContentPartSuggestedActions) = apply { + payload = contentPartSuggestedActions.payload + type = contentPartSuggestedActions.type + additionalProperties = + contentPartSuggestedActions.additionalProperties.toMutableMap() } /** Suggested follow-up buttons rendered at the end of an assistant message. */ @@ -1963,7 +1999,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember4]. + * Returns an immutable instance of [ContentPartSuggestedActions]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -1975,8 +2011,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember4 = - UnionMember4( + fun build(): ContentPartSuggestedActions = + ContentPartSuggestedActions( checkRequired("payload", payload), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -1994,7 +2030,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember4 = apply { + fun validate(): ContentPartSuggestedActions = apply { if (validated) { return@apply } @@ -2159,7 +2195,7 @@ private constructor( return true } - return other is UnionMember4 && + return other is ContentPartSuggestedActions && payload == other.payload && type == other.type && additionalProperties == other.additionalProperties @@ -2170,11 +2206,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember4{payload=$payload, type=$type, additionalProperties=$additionalProperties}" + "ContentPartSuggestedActions{payload=$payload, type=$type, additionalProperties=$additionalProperties}" } /** Escape-hatch custom payload content part. */ - class UnionMember5 + class ContentPartCustom @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val payload: JsonValue, @@ -2194,7 +2230,7 @@ private constructor( /** * This arbitrary value can be deserialized into a custom type using the `convert` method: * ```java - * MyClass myObject = unionMember5.payload().convert(MyClass.class); + * MyClass myObject = contentPartCustom.payload().convert(MyClass.class); * ``` */ @JsonProperty("payload") @ExcludeMissing fun _payload(): JsonValue = payload @@ -2227,7 +2263,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember5]. + * Returns a mutable builder for constructing an instance of [ContentPartCustom]. * * The following fields are required: * ```java @@ -2238,7 +2274,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember5]. */ + /** A builder for [ContentPartCustom]. */ class Builder internal constructor() { private var payload: JsonValue? = null @@ -2246,10 +2282,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember5: UnionMember5) = apply { - payload = unionMember5.payload - type = unionMember5.type - additionalProperties = unionMember5.additionalProperties.toMutableMap() + internal fun from(contentPartCustom: ContentPartCustom) = apply { + payload = contentPartCustom.payload + type = contentPartCustom.type + additionalProperties = contentPartCustom.additionalProperties.toMutableMap() } fun payload(payload: JsonValue) = apply { this.payload = payload } @@ -2285,7 +2321,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember5]. + * Returns an immutable instance of [ContentPartCustom]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -2297,8 +2333,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember5 = - UnionMember5( + fun build(): ContentPartCustom = + ContentPartCustom( checkRequired("payload", payload), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -2316,7 +2352,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember5 = apply { + fun validate(): ContentPartCustom = apply { if (validated) { return@apply } @@ -2477,7 +2513,7 @@ private constructor( return true } - return other is UnionMember5 && + return other is ContentPartCustom && payload == other.payload && type == other.type && additionalProperties == other.additionalProperties @@ -2488,6 +2524,6 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember5{payload=$payload, type=$type, additionalProperties=$additionalProperties}" + "ContentPartCustom{payload=$payload, type=$type, additionalProperties=$additionalProperties}" } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdParams.kt index 181bc7bd..bb0205e6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt index 3c88153f..1f8cf6dc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseStatus.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseStatus.kt index d3b4b3f8..aca74633 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseStatus.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Dynamic lifecycle status for a pollable response. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateMessageResponse.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateMessageResponse.kt index 2ec129e5..04c52489 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateMessageResponse.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateThreadResponse.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateThreadResponse.kt index 24bd2cbb..e6f21aad 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateThreadResponse.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Message.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Message.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Message.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Message.kt index 6dd1decc..ced4a9fa 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Message.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Message.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.responses.ErrorStatus +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.omniai.responses.ErrorStatus import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContent.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContent.kt similarity index 76% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContent.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContent.kt index b6960d48..beb5ab5d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContent.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -106,25 +106,39 @@ private constructor( (parts ?: JsonField.of(mutableListOf())).also { checkKnown("parts", it).add(part) } } - /** Alias for calling [addPart] with `MessageContentPart.ofUnionMember0(unionMember0)`. */ - fun addPart(unionMember0: MessageContentPart.UnionMember0) = - addPart(MessageContentPart.ofUnionMember0(unionMember0)) + /** + * Alias for calling [addPart] with `MessageContentPart.ofContentPartText(contentPartText)`. + */ + fun addPart(contentPartText: MessageContentPart.ContentPartText) = + addPart(MessageContentPart.ofContentPartText(contentPartText)) - /** Alias for calling [addPart] with `MessageContentPart.ofUnionMember1(unionMember1)`. */ - fun addPart(unionMember1: MessageContentPart.UnionMember1) = - addPart(MessageContentPart.ofUnionMember1(unionMember1)) + /** + * Alias for calling [addPart] with + * `MessageContentPart.ofContentPartStructuredAction(contentPartStructuredAction)`. + */ + fun addPart(contentPartStructuredAction: MessageContentPart.ContentPartStructuredAction) = + addPart(MessageContentPart.ofContentPartStructuredAction(contentPartStructuredAction)) - /** Alias for calling [addPart] with `MessageContentPart.ofUnionMember2(unionMember2)`. */ - fun addPart(unionMember2: MessageContentPart.UnionMember2) = - addPart(MessageContentPart.ofUnionMember2(unionMember2)) + /** + * Alias for calling [addPart] with + * `MessageContentPart.ofContentPartChart(contentPartChart)`. + */ + fun addPart(contentPartChart: MessageContentPart.ContentPartChart) = + addPart(MessageContentPart.ofContentPartChart(contentPartChart)) - /** Alias for calling [addPart] with `MessageContentPart.ofUnionMember3(unionMember3)`. */ - fun addPart(unionMember3: MessageContentPart.UnionMember3) = - addPart(MessageContentPart.ofUnionMember3(unionMember3)) + /** + * Alias for calling [addPart] with + * `MessageContentPart.ofContentPartSuggestedActions(contentPartSuggestedActions)`. + */ + fun addPart(contentPartSuggestedActions: MessageContentPart.ContentPartSuggestedActions) = + addPart(MessageContentPart.ofContentPartSuggestedActions(contentPartSuggestedActions)) - /** Alias for calling [addPart] with `MessageContentPart.ofUnionMember4(unionMember4)`. */ - fun addPart(unionMember4: MessageContentPart.UnionMember4) = - addPart(MessageContentPart.ofUnionMember4(unionMember4)) + /** + * Alias for calling [addPart] with + * `MessageContentPart.ofContentPartCustom(contentPartCustom)`. + */ + fun addPart(contentPartCustom: MessageContentPart.ContentPartCustom) = + addPart(MessageContentPart.ofContentPartCustom(contentPartCustom)) fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPart.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPart.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPart.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPart.kt index d45afc13..aace54c7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPart.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPart.kt @@ -1,26 +1,26 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.BaseDeserializer -import com.clear_street.api.core.BaseSerializer -import com.clear_street.api.core.Enum -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.allMaxBy -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.getOrThrow -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.ChartPayload -import com.clear_street.api.models.v1.omniai.ContentPartChartPayload -import com.clear_street.api.models.v1.omniai.ContentPartCustomPayload -import com.clear_street.api.models.v1.omniai.ContentPartStructuredActionPayload -import com.clear_street.api.models.v1.omniai.ContentPartSuggestedActionsPayload -import com.clear_street.api.models.v1.omniai.ContentPartTextPayload -import com.clear_street.api.models.v1.omniai.StructuredAction -import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.BaseDeserializer +import com.clearstreet.api.core.BaseSerializer +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.allMaxBy +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.getOrThrow +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.omniai.ChartPayload +import com.clearstreet.api.models.v1.omniai.ContentPartChartPayload +import com.clearstreet.api.models.v1.omniai.ContentPartCustomPayload +import com.clearstreet.api.models.v1.omniai.ContentPartStructuredActionPayload +import com.clearstreet.api.models.v1.omniai.ContentPartSuggestedActionsPayload +import com.clearstreet.api.models.v1.omniai.ContentPartTextPayload +import com.clearstreet.api.models.v1.omniai.StructuredAction +import com.clearstreet.api.models.v1.omniai.SuggestedActionsPayload import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -42,53 +42,57 @@ import kotlin.jvm.optionals.getOrNull @JsonSerialize(using = MessageContentPart.Serializer::class) class MessageContentPart private constructor( - private val unionMember0: UnionMember0? = null, - private val unionMember1: UnionMember1? = null, - private val unionMember2: UnionMember2? = null, - private val unionMember3: UnionMember3? = null, - private val unionMember4: UnionMember4? = null, + private val contentPartText: ContentPartText? = null, + private val contentPartStructuredAction: ContentPartStructuredAction? = null, + private val contentPartChart: ContentPartChart? = null, + private val contentPartSuggestedActions: ContentPartSuggestedActions? = null, + private val contentPartCustom: ContentPartCustom? = null, private val _json: JsonValue? = null, ) { /** Text content part. */ - fun unionMember0(): Optional = Optional.ofNullable(unionMember0) + fun contentPartText(): Optional = Optional.ofNullable(contentPartText) /** Structured action content part. */ - fun unionMember1(): Optional = Optional.ofNullable(unionMember1) + fun contentPartStructuredAction(): Optional = + Optional.ofNullable(contentPartStructuredAction) /** Chart payload content part. */ - fun unionMember2(): Optional = Optional.ofNullable(unionMember2) + fun contentPartChart(): Optional = Optional.ofNullable(contentPartChart) /** Suggested actions payload content part. */ - fun unionMember3(): Optional = Optional.ofNullable(unionMember3) + fun contentPartSuggestedActions(): Optional = + Optional.ofNullable(contentPartSuggestedActions) /** Escape-hatch custom payload content part. */ - fun unionMember4(): Optional = Optional.ofNullable(unionMember4) + fun contentPartCustom(): Optional = Optional.ofNullable(contentPartCustom) - fun isUnionMember0(): Boolean = unionMember0 != null + fun isContentPartText(): Boolean = contentPartText != null - fun isUnionMember1(): Boolean = unionMember1 != null + fun isContentPartStructuredAction(): Boolean = contentPartStructuredAction != null - fun isUnionMember2(): Boolean = unionMember2 != null + fun isContentPartChart(): Boolean = contentPartChart != null - fun isUnionMember3(): Boolean = unionMember3 != null + fun isContentPartSuggestedActions(): Boolean = contentPartSuggestedActions != null - fun isUnionMember4(): Boolean = unionMember4 != null + fun isContentPartCustom(): Boolean = contentPartCustom != null /** Text content part. */ - fun asUnionMember0(): UnionMember0 = unionMember0.getOrThrow("unionMember0") + fun asContentPartText(): ContentPartText = contentPartText.getOrThrow("contentPartText") /** Structured action content part. */ - fun asUnionMember1(): UnionMember1 = unionMember1.getOrThrow("unionMember1") + fun asContentPartStructuredAction(): ContentPartStructuredAction = + contentPartStructuredAction.getOrThrow("contentPartStructuredAction") /** Chart payload content part. */ - fun asUnionMember2(): UnionMember2 = unionMember2.getOrThrow("unionMember2") + fun asContentPartChart(): ContentPartChart = contentPartChart.getOrThrow("contentPartChart") /** Suggested actions payload content part. */ - fun asUnionMember3(): UnionMember3 = unionMember3.getOrThrow("unionMember3") + fun asContentPartSuggestedActions(): ContentPartSuggestedActions = + contentPartSuggestedActions.getOrThrow("contentPartSuggestedActions") /** Escape-hatch custom payload content part. */ - fun asUnionMember4(): UnionMember4 = unionMember4.getOrThrow("unionMember4") + fun asContentPartCustom(): ContentPartCustom = contentPartCustom.getOrThrow("contentPartCustom") fun _json(): Optional = Optional.ofNullable(_json) @@ -99,13 +103,13 @@ private constructor( * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the * SDK gracefully, consider overriding [Visitor.unknown]: * ```java - * import com.clear_street.api.core.JsonValue; + * import com.clearstreet.api.core.JsonValue; * import java.util.Optional; * * Optional result = messageContentPart.accept(new MessageContentPart.Visitor>() { * @Override - * public Optional visitUnionMember0(UnionMember0 unionMember0) { - * return Optional.of(unionMember0.toString()); + * public Optional visitContentPartText(ContentPartText contentPartText) { + * return Optional.of(contentPartText.toString()); * } * * // ... @@ -123,11 +127,13 @@ private constructor( */ fun accept(visitor: Visitor): T = when { - unionMember0 != null -> visitor.visitUnionMember0(unionMember0) - unionMember1 != null -> visitor.visitUnionMember1(unionMember1) - unionMember2 != null -> visitor.visitUnionMember2(unionMember2) - unionMember3 != null -> visitor.visitUnionMember3(unionMember3) - unionMember4 != null -> visitor.visitUnionMember4(unionMember4) + contentPartText != null -> visitor.visitContentPartText(contentPartText) + contentPartStructuredAction != null -> + visitor.visitContentPartStructuredAction(contentPartStructuredAction) + contentPartChart != null -> visitor.visitContentPartChart(contentPartChart) + contentPartSuggestedActions != null -> + visitor.visitContentPartSuggestedActions(contentPartSuggestedActions) + contentPartCustom != null -> visitor.visitContentPartCustom(contentPartCustom) else -> visitor.unknown(_json) } @@ -148,24 +154,28 @@ private constructor( accept( object : Visitor { - override fun visitUnionMember0(unionMember0: UnionMember0) { - unionMember0.validate() + override fun visitContentPartText(contentPartText: ContentPartText) { + contentPartText.validate() } - override fun visitUnionMember1(unionMember1: UnionMember1) { - unionMember1.validate() + override fun visitContentPartStructuredAction( + contentPartStructuredAction: ContentPartStructuredAction + ) { + contentPartStructuredAction.validate() } - override fun visitUnionMember2(unionMember2: UnionMember2) { - unionMember2.validate() + override fun visitContentPartChart(contentPartChart: ContentPartChart) { + contentPartChart.validate() } - override fun visitUnionMember3(unionMember3: UnionMember3) { - unionMember3.validate() + override fun visitContentPartSuggestedActions( + contentPartSuggestedActions: ContentPartSuggestedActions + ) { + contentPartSuggestedActions.validate() } - override fun visitUnionMember4(unionMember4: UnionMember4) { - unionMember4.validate() + override fun visitContentPartCustom(contentPartCustom: ContentPartCustom) { + contentPartCustom.validate() } } ) @@ -189,15 +199,22 @@ private constructor( internal fun validity(): Int = accept( object : Visitor { - override fun visitUnionMember0(unionMember0: UnionMember0) = unionMember0.validity() + override fun visitContentPartText(contentPartText: ContentPartText) = + contentPartText.validity() - override fun visitUnionMember1(unionMember1: UnionMember1) = unionMember1.validity() + override fun visitContentPartStructuredAction( + contentPartStructuredAction: ContentPartStructuredAction + ) = contentPartStructuredAction.validity() - override fun visitUnionMember2(unionMember2: UnionMember2) = unionMember2.validity() + override fun visitContentPartChart(contentPartChart: ContentPartChart) = + contentPartChart.validity() - override fun visitUnionMember3(unionMember3: UnionMember3) = unionMember3.validity() + override fun visitContentPartSuggestedActions( + contentPartSuggestedActions: ContentPartSuggestedActions + ) = contentPartSuggestedActions.validity() - override fun visitUnionMember4(unionMember4: UnionMember4) = unionMember4.validity() + override fun visitContentPartCustom(contentPartCustom: ContentPartCustom) = + contentPartCustom.validity() override fun unknown(json: JsonValue?) = 0 } @@ -209,23 +226,31 @@ private constructor( } return other is MessageContentPart && - unionMember0 == other.unionMember0 && - unionMember1 == other.unionMember1 && - unionMember2 == other.unionMember2 && - unionMember3 == other.unionMember3 && - unionMember4 == other.unionMember4 + contentPartText == other.contentPartText && + contentPartStructuredAction == other.contentPartStructuredAction && + contentPartChart == other.contentPartChart && + contentPartSuggestedActions == other.contentPartSuggestedActions && + contentPartCustom == other.contentPartCustom } override fun hashCode(): Int = - Objects.hash(unionMember0, unionMember1, unionMember2, unionMember3, unionMember4) + Objects.hash( + contentPartText, + contentPartStructuredAction, + contentPartChart, + contentPartSuggestedActions, + contentPartCustom, + ) override fun toString(): String = when { - unionMember0 != null -> "MessageContentPart{unionMember0=$unionMember0}" - unionMember1 != null -> "MessageContentPart{unionMember1=$unionMember1}" - unionMember2 != null -> "MessageContentPart{unionMember2=$unionMember2}" - unionMember3 != null -> "MessageContentPart{unionMember3=$unionMember3}" - unionMember4 != null -> "MessageContentPart{unionMember4=$unionMember4}" + contentPartText != null -> "MessageContentPart{contentPartText=$contentPartText}" + contentPartStructuredAction != null -> + "MessageContentPart{contentPartStructuredAction=$contentPartStructuredAction}" + contentPartChart != null -> "MessageContentPart{contentPartChart=$contentPartChart}" + contentPartSuggestedActions != null -> + "MessageContentPart{contentPartSuggestedActions=$contentPartSuggestedActions}" + contentPartCustom != null -> "MessageContentPart{contentPartCustom=$contentPartCustom}" _json != null -> "MessageContentPart{_unknown=$_json}" else -> throw IllegalStateException("Invalid MessageContentPart") } @@ -234,28 +259,30 @@ private constructor( /** Text content part. */ @JvmStatic - fun ofUnionMember0(unionMember0: UnionMember0) = - MessageContentPart(unionMember0 = unionMember0) + fun ofContentPartText(contentPartText: ContentPartText) = + MessageContentPart(contentPartText = contentPartText) /** Structured action content part. */ @JvmStatic - fun ofUnionMember1(unionMember1: UnionMember1) = - MessageContentPart(unionMember1 = unionMember1) + fun ofContentPartStructuredAction( + contentPartStructuredAction: ContentPartStructuredAction + ) = MessageContentPart(contentPartStructuredAction = contentPartStructuredAction) /** Chart payload content part. */ @JvmStatic - fun ofUnionMember2(unionMember2: UnionMember2) = - MessageContentPart(unionMember2 = unionMember2) + fun ofContentPartChart(contentPartChart: ContentPartChart) = + MessageContentPart(contentPartChart = contentPartChart) /** Suggested actions payload content part. */ @JvmStatic - fun ofUnionMember3(unionMember3: UnionMember3) = - MessageContentPart(unionMember3 = unionMember3) + fun ofContentPartSuggestedActions( + contentPartSuggestedActions: ContentPartSuggestedActions + ) = MessageContentPart(contentPartSuggestedActions = contentPartSuggestedActions) /** Escape-hatch custom payload content part. */ @JvmStatic - fun ofUnionMember4(unionMember4: UnionMember4) = - MessageContentPart(unionMember4 = unionMember4) + fun ofContentPartCustom(contentPartCustom: ContentPartCustom) = + MessageContentPart(contentPartCustom = contentPartCustom) } /** @@ -265,19 +292,23 @@ private constructor( interface Visitor { /** Text content part. */ - fun visitUnionMember0(unionMember0: UnionMember0): T + fun visitContentPartText(contentPartText: ContentPartText): T /** Structured action content part. */ - fun visitUnionMember1(unionMember1: UnionMember1): T + fun visitContentPartStructuredAction( + contentPartStructuredAction: ContentPartStructuredAction + ): T /** Chart payload content part. */ - fun visitUnionMember2(unionMember2: UnionMember2): T + fun visitContentPartChart(contentPartChart: ContentPartChart): T /** Suggested actions payload content part. */ - fun visitUnionMember3(unionMember3: UnionMember3): T + fun visitContentPartSuggestedActions( + contentPartSuggestedActions: ContentPartSuggestedActions + ): T /** Escape-hatch custom payload content part. */ - fun visitUnionMember4(unionMember4: UnionMember4): T + fun visitContentPartCustom(contentPartCustom: ContentPartCustom): T /** * Maps an unknown variant of [MessageContentPart] to a value of type [T]. @@ -301,20 +332,20 @@ private constructor( val bestMatches = sequenceOf( - tryDeserialize(node, jacksonTypeRef())?.let { - MessageContentPart(unionMember0 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + MessageContentPart(contentPartText = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - MessageContentPart(unionMember1 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + MessageContentPart(contentPartStructuredAction = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - MessageContentPart(unionMember2 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + MessageContentPart(contentPartChart = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - MessageContentPart(unionMember3 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + MessageContentPart(contentPartSuggestedActions = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - MessageContentPart(unionMember4 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + MessageContentPart(contentPartCustom = it, _json = json) }, ) .filterNotNull() @@ -340,11 +371,13 @@ private constructor( provider: SerializerProvider, ) { when { - value.unionMember0 != null -> generator.writeObject(value.unionMember0) - value.unionMember1 != null -> generator.writeObject(value.unionMember1) - value.unionMember2 != null -> generator.writeObject(value.unionMember2) - value.unionMember3 != null -> generator.writeObject(value.unionMember3) - value.unionMember4 != null -> generator.writeObject(value.unionMember4) + value.contentPartText != null -> generator.writeObject(value.contentPartText) + value.contentPartStructuredAction != null -> + generator.writeObject(value.contentPartStructuredAction) + value.contentPartChart != null -> generator.writeObject(value.contentPartChart) + value.contentPartSuggestedActions != null -> + generator.writeObject(value.contentPartSuggestedActions) + value.contentPartCustom != null -> generator.writeObject(value.contentPartCustom) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid MessageContentPart") } @@ -352,7 +385,7 @@ private constructor( } /** Text content part. */ - class UnionMember0 + class ContentPartText @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val text: JsonField, @@ -410,7 +443,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember0]. + * Returns a mutable builder for constructing an instance of [ContentPartText]. * * The following fields are required: * ```java @@ -421,7 +454,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember0]. */ + /** A builder for [ContentPartText]. */ class Builder internal constructor() { private var text: JsonField? = null @@ -429,10 +462,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember0: UnionMember0) = apply { - text = unionMember0.text - type = unionMember0.type - additionalProperties = unionMember0.additionalProperties.toMutableMap() + internal fun from(contentPartText: ContentPartText) = apply { + text = contentPartText.text + type = contentPartText.type + additionalProperties = contentPartText.additionalProperties.toMutableMap() } fun text(text: String) = text(JsonField.of(text)) @@ -477,7 +510,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember0]. + * Returns an immutable instance of [ContentPartText]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -489,8 +522,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember0 = - UnionMember0( + fun build(): ContentPartText = + ContentPartText( checkRequired("text", text), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -508,7 +541,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember0 = apply { + fun validate(): ContentPartText = apply { if (validated) { return@apply } @@ -672,7 +705,7 @@ private constructor( return true } - return other is UnionMember0 && + return other is ContentPartText && text == other.text && type == other.type && additionalProperties == other.additionalProperties @@ -683,11 +716,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember0{text=$text, type=$type, additionalProperties=$additionalProperties}" + "ContentPartText{text=$text, type=$type, additionalProperties=$additionalProperties}" } /** Structured action content part. */ - class UnionMember1 + class ContentPartStructuredAction @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val action: JsonField, @@ -769,7 +802,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember1]. + * Returns a mutable builder for constructing an instance of + * [ContentPartStructuredAction]. * * The following fields are required: * ```java @@ -781,7 +815,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember1]. */ + /** A builder for [ContentPartStructuredAction]. */ class Builder internal constructor() { private var action: JsonField? = null @@ -790,11 +824,12 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember1: UnionMember1) = apply { - action = unionMember1.action - actionId = unionMember1.actionId - type = unionMember1.type - additionalProperties = unionMember1.additionalProperties.toMutableMap() + internal fun from(contentPartStructuredAction: ContentPartStructuredAction) = apply { + action = contentPartStructuredAction.action + actionId = contentPartStructuredAction.actionId + type = contentPartStructuredAction.type + additionalProperties = + contentPartStructuredAction.additionalProperties.toMutableMap() } /** @@ -875,7 +910,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember1]. + * Returns an immutable instance of [ContentPartStructuredAction]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -888,8 +923,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember1 = - UnionMember1( + fun build(): ContentPartStructuredAction = + ContentPartStructuredAction( checkRequired("action", action), checkRequired("actionId", actionId), checkRequired("type", type), @@ -908,7 +943,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember1 = apply { + fun validate(): ContentPartStructuredAction = apply { if (validated) { return@apply } @@ -1075,7 +1110,7 @@ private constructor( return true } - return other is UnionMember1 && + return other is ContentPartStructuredAction && action == other.action && actionId == other.actionId && type == other.type && @@ -1089,11 +1124,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember1{action=$action, actionId=$actionId, type=$type, additionalProperties=$additionalProperties}" + "ContentPartStructuredAction{action=$action, actionId=$actionId, type=$type, additionalProperties=$additionalProperties}" } /** Chart payload content part. */ - class UnionMember2 + class ContentPartChart @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val payload: JsonField, @@ -1155,7 +1190,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember2]. + * Returns a mutable builder for constructing an instance of [ContentPartChart]. * * The following fields are required: * ```java @@ -1166,7 +1201,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember2]. */ + /** A builder for [ContentPartChart]. */ class Builder internal constructor() { private var payload: JsonField? = null @@ -1174,10 +1209,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember2: UnionMember2) = apply { - payload = unionMember2.payload - type = unionMember2.type - additionalProperties = unionMember2.additionalProperties.toMutableMap() + internal fun from(contentPartChart: ContentPartChart) = apply { + payload = contentPartChart.payload + type = contentPartChart.type + additionalProperties = contentPartChart.additionalProperties.toMutableMap() } /** Typed chart payload rendered inline in assistant content. */ @@ -1223,7 +1258,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember2]. + * Returns an immutable instance of [ContentPartChart]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -1235,8 +1270,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember2 = - UnionMember2( + fun build(): ContentPartChart = + ContentPartChart( checkRequired("payload", payload), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -1254,7 +1289,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember2 = apply { + fun validate(): ContentPartChart = apply { if (validated) { return@apply } @@ -1419,7 +1454,7 @@ private constructor( return true } - return other is UnionMember2 && + return other is ContentPartChart && payload == other.payload && type == other.type && additionalProperties == other.additionalProperties @@ -1430,11 +1465,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember2{payload=$payload, type=$type, additionalProperties=$additionalProperties}" + "ContentPartChart{payload=$payload, type=$type, additionalProperties=$additionalProperties}" } /** Suggested actions payload content part. */ - class UnionMember3 + class ContentPartSuggestedActions @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val payload: JsonField, @@ -1498,7 +1533,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember3]. + * Returns a mutable builder for constructing an instance of + * [ContentPartSuggestedActions]. * * The following fields are required: * ```java @@ -1509,7 +1545,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember3]. */ + /** A builder for [ContentPartSuggestedActions]. */ class Builder internal constructor() { private var payload: JsonField? = null @@ -1517,10 +1553,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember3: UnionMember3) = apply { - payload = unionMember3.payload - type = unionMember3.type - additionalProperties = unionMember3.additionalProperties.toMutableMap() + internal fun from(contentPartSuggestedActions: ContentPartSuggestedActions) = apply { + payload = contentPartSuggestedActions.payload + type = contentPartSuggestedActions.type + additionalProperties = + contentPartSuggestedActions.additionalProperties.toMutableMap() } /** Suggested follow-up buttons rendered at the end of an assistant message. */ @@ -1568,7 +1605,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember3]. + * Returns an immutable instance of [ContentPartSuggestedActions]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -1580,8 +1617,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember3 = - UnionMember3( + fun build(): ContentPartSuggestedActions = + ContentPartSuggestedActions( checkRequired("payload", payload), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -1599,7 +1636,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember3 = apply { + fun validate(): ContentPartSuggestedActions = apply { if (validated) { return@apply } @@ -1764,7 +1801,7 @@ private constructor( return true } - return other is UnionMember3 && + return other is ContentPartSuggestedActions && payload == other.payload && type == other.type && additionalProperties == other.additionalProperties @@ -1775,11 +1812,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember3{payload=$payload, type=$type, additionalProperties=$additionalProperties}" + "ContentPartSuggestedActions{payload=$payload, type=$type, additionalProperties=$additionalProperties}" } /** Escape-hatch custom payload content part. */ - class UnionMember4 + class ContentPartCustom @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val payload: JsonValue, @@ -1799,7 +1836,7 @@ private constructor( /** * This arbitrary value can be deserialized into a custom type using the `convert` method: * ```java - * MyClass myObject = unionMember4.payload().convert(MyClass.class); + * MyClass myObject = contentPartCustom.payload().convert(MyClass.class); * ``` */ @JsonProperty("payload") @ExcludeMissing fun _payload(): JsonValue = payload @@ -1832,7 +1869,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [UnionMember4]. + * Returns a mutable builder for constructing an instance of [ContentPartCustom]. * * The following fields are required: * ```java @@ -1843,7 +1880,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember4]. */ + /** A builder for [ContentPartCustom]. */ class Builder internal constructor() { private var payload: JsonValue? = null @@ -1851,10 +1888,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember4: UnionMember4) = apply { - payload = unionMember4.payload - type = unionMember4.type - additionalProperties = unionMember4.additionalProperties.toMutableMap() + internal fun from(contentPartCustom: ContentPartCustom) = apply { + payload = contentPartCustom.payload + type = contentPartCustom.type + additionalProperties = contentPartCustom.additionalProperties.toMutableMap() } fun payload(payload: JsonValue) = apply { this.payload = payload } @@ -1890,7 +1927,7 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember4]. + * Returns an immutable instance of [ContentPartCustom]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -1902,8 +1939,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): UnionMember4 = - UnionMember4( + fun build(): ContentPartCustom = + ContentPartCustom( checkRequired("payload", payload), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -1921,7 +1958,7 @@ private constructor( * @throws ClearStreetInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnionMember4 = apply { + fun validate(): ContentPartCustom = apply { if (validated) { return@apply } @@ -2082,7 +2119,7 @@ private constructor( return true } - return other is UnionMember4 && + return other is ContentPartCustom && payload == other.payload && type == other.type && additionalProperties == other.additionalProperties @@ -2093,6 +2130,6 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnionMember4{payload=$payload, type=$type, additionalProperties=$additionalProperties}" + "ContentPartCustom{payload=$payload, type=$type, additionalProperties=$additionalProperties}" } } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageOutcome.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageOutcome.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageOutcome.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageOutcome.kt index 0615e6c1..72a5f6dc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageOutcome.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageOutcome.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Immutable terminal outcome for a finalized assistant message. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageRole.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageRole.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageRole.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageRole.kt index 5ad7c24e..63aaaf4f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageRole.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageRole.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Finalized message role in the public contract. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Thread.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Thread.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Thread.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Thread.kt index c561ce33..fad030e5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/Thread.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Thread.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt index f40ec4d5..c1fb3ad6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageParams.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.Enum -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt index 243ea483..ac683f14 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadParams.kt index 9a535254..b76bd1d6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadParams.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.Enum -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt index 77e17305..8e9bdf99 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt index 967e47bb..8540fcef 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt index cee53fdf..f05952f0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdParams.kt index 39d3153a..4faf2272 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt index 7bcbbe30..779c49ff 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseParams.kt index 2a8b4b96..f4ec3612 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt index 668cc3bd..1bb861f4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.responses.Response +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.omniai.responses.Response import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt index 6e5f58fe..452df2b2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt index a7794606..0060f208 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequest.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/CancelOrderRequest.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequest.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/CancelOrderRequest.kt index 77999cbc..3688d2ac 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/CancelOrderRequest.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Execution.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Execution.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Execution.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Execution.kt index 5d8904c7..6d146fc1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Execution.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Execution.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt index c33590f1..0f1f90df 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Order.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Order.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt index 3cf389c9..60823ace 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Order.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt index 2c6379b0..55d85145 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator import java.util.Objects import java.util.Optional @@ -292,7 +292,7 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { - instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } + instrumentIds?.let { put("instrument_ids", it.joinToString(",")) } instrumentType?.let { put("instrument_type", it.toString()) } side?.let { put("side", it.toString()) } type?.let { put("type", it.toString()) } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt index 7a19c60a..bf8034a2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderParams.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderParams.kt index 872f139b..a2ebd0d8 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderParams.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponse.kt index b8c5dbd6..4dbdfd35 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParams.kt index 9dac9ce0..6502779f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsResponse.kt index c1ad4014..2c1af7f6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdParams.kt index 42406397..b72357ab 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdParams.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponse.kt index d708f791..cb4d6d7b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt index c8f08006..f64a6fa3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator import java.time.OffsetDateTime import java.time.format.DateTimeFormatter @@ -28,7 +28,7 @@ private constructor( private val status: List?, private val symbol: String?, private val to: OffsetDateTime?, - private val underlyingInstrumentIds: String?, + private val underlyingInstrumentIds: List?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -66,7 +66,8 @@ private constructor( * Comma-separated OEMS instrument UUIDs. Matches options orders whose resolved underlier is any * of the given IDs. */ - fun underlyingInstrumentIds(): Optional = Optional.ofNullable(underlyingInstrumentIds) + fun underlyingInstrumentIds(): Optional> = + Optional.ofNullable(underlyingInstrumentIds) /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -96,7 +97,7 @@ private constructor( private var status: MutableList? = null private var symbol: String? = null private var to: OffsetDateTime? = null - private var underlyingInstrumentIds: String? = null + private var underlyingInstrumentIds: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -111,7 +112,7 @@ private constructor( status = orderGetOrdersParams.status?.toMutableList() symbol = orderGetOrdersParams.symbol to = orderGetOrdersParams.to - underlyingInstrumentIds = orderGetOrdersParams.underlyingInstrumentIds + underlyingInstrumentIds = orderGetOrdersParams.underlyingInstrumentIds?.toMutableList() additionalHeaders = orderGetOrdersParams.additionalHeaders.toBuilder() additionalQueryParams = orderGetOrdersParams.additionalQueryParams.toBuilder() } @@ -214,17 +215,27 @@ private constructor( * Comma-separated OEMS instrument UUIDs. Matches options orders whose resolved underlier is * any of the given IDs. */ - fun underlyingInstrumentIds(underlyingInstrumentIds: String?) = apply { - this.underlyingInstrumentIds = underlyingInstrumentIds + fun underlyingInstrumentIds(underlyingInstrumentIds: List?) = apply { + this.underlyingInstrumentIds = underlyingInstrumentIds?.toMutableList() } /** * Alias for calling [Builder.underlyingInstrumentIds] with * `underlyingInstrumentIds.orElse(null)`. */ - fun underlyingInstrumentIds(underlyingInstrumentIds: Optional) = + fun underlyingInstrumentIds(underlyingInstrumentIds: Optional>) = underlyingInstrumentIds(underlyingInstrumentIds.getOrNull()) + /** + * Adds a single [String] to [underlyingInstrumentIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addUnderlyingInstrumentId(underlyingInstrumentId: String) = apply { + underlyingInstrumentIds = + (underlyingInstrumentIds ?: mutableListOf()).apply { add(underlyingInstrumentId) } + } + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -339,7 +350,7 @@ private constructor( status?.toImmutable(), symbol, to, - underlyingInstrumentIds, + underlyingInstrumentIds?.toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), ) @@ -357,14 +368,16 @@ private constructor( QueryParams.builder() .apply { from?.let { put("from", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) } - instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } + instrumentIds?.let { put("instrument_ids", it.joinToString(",")) } instrumentType?.let { put("instrument_type", it.toString()) } pageSize?.let { put("page_size", it.toString()) } pageToken?.let { put("page_token", it) } - status?.forEachIndexed { index, it -> put("status[$index]", it.toString()) } + status?.let { put("status", it.joinToString(",") { it.toString() }) } symbol?.let { put("symbol", it) } to?.let { put("to", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) } - underlyingInstrumentIds?.let { put("underlying_instrument_ids", it) } + underlyingInstrumentIds?.let { + put("underlying_instrument_ids", it.joinToString(",")) + } putAll(additionalQueryParams) } .build() diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponse.kt index 05fd8cf2..88b38d8c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParams.kt index 596aefd4..4f923135 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParams.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponse.kt index df9be228..ae79eba4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderStatus.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderStatus.kt index beac5b15..64ebd9b7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderStatus.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Order status */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParams.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParams.kt index db031181..4921bc81 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParams.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.BaseDeserializer -import com.clear_street.api.core.BaseSerializer -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.allMaxBy -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.getOrThrow -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.BaseDeserializer +import com.clearstreet.api.core.BaseSerializer +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.allMaxBy +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.getOrThrow +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -290,7 +290,7 @@ private constructor( * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of * the SDK gracefully, consider overriding [Visitor.unknown]: * ```java - * import com.clear_street.api.core.JsonValue; + * import com.clearstreet.api.core.JsonValue; * import java.util.Optional; * * Optional result = order.accept(new Order.Visitor>() { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponse.kt index 9d93c7e4..6080b3d3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.orders + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderType.kt index e7859633..9d6dbda9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/OrderType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Order type */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/PositionEffect.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/PositionEffect.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/PositionEffect.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/PositionEffect.kt index 2616ca08..f4583c96 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/PositionEffect.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/PositionEffect.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Position effect for options orders */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/QueueState.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/QueueState.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/QueueState.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/QueueState.kt index 5da5c0e7..536dc666 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/QueueState.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/QueueState.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Parent order queue or hold state. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestOrderType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/RequestOrderType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestOrderType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/RequestOrderType.kt index 8758a18d..c26b0056 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestOrderType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/RequestOrderType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Strict order-type enum for order submission/replacement requests. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestTimeInForce.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/RequestTimeInForce.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestTimeInForce.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/RequestTimeInForce.kt index fc535613..bb5820e6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/RequestTimeInForce.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/RequestTimeInForce.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Strict time-in-force enum for order submission/replacement requests. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Side.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Side.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Side.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Side.kt index af012a63..3d30f818 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/Side.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Side.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Side of an order */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TimeInForce.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/TimeInForce.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TimeInForce.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/TimeInForce.kt index c364d2e2..f4495807 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TimeInForce.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/TimeInForce.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Time in force */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TrailingOffsetType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/TrailingOffsetType.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TrailingOffsetType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/TrailingOffsetType.kt index 9ea4f5b6..2ce22deb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/orders/TrailingOffsetType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/TrailingOffsetType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Trailing offset type for trailing stop orders. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/Position.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/Position.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt index 970c54c9..640c8d0f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/Position.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.SecurityType +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionParams.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionParams.kt index 106e2e26..58390784 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionParams.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt index 7283209d..f8f85ee3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParams.kt index d4617627..61491c87 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParams.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponse.kt index a092391d..867fa693 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponse.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.orders.Order +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.orders.Order import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsParams.kt index ea82bde0..161e874d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsParams.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponse.kt index 66191b0d..faf4f735 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponse.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.orders.Order +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.orders.Order import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt index e4297b8e..4e254c18 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt index 760f8444..61b41789 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt index d0c96890..0e699bd6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator import java.util.Objects import java.util.Optional @@ -283,7 +283,7 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { - instrumentIds?.forEachIndexed { index, it -> put("instrument_ids[$index]", it) } + instrumentIds?.let { put("instrument_ids", it.joinToString(",")) } pageSize?.let { put("page_size", it.toString()) } pageToken?.let { put("page_token", it) } sortBy?.let { put("sort_by", it.toString()) } diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponse.kt index e38ff36c..81e6be8d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt similarity index 98% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt index d4388edb..aaf9c46d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstruction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt index 2a29821a..78724957 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionType.kt index 35cdc46c..f6d5ebcc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** The action to take against an options position. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt index d9e470fc..f0c5047f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt index 22cf7739..0c230ad5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.positions + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionType.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionType.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionType.kt index 9e5cd140..55f76ced 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/positions/PositionType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionType.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.Enum -import com.clear_street.api.core.JsonField -import com.clear_street.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonCreator /** Position type classification */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemData.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/AddWatchlistItemData.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemData.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/AddWatchlistItemData.kt index d4c54aec..ba162d1e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/AddWatchlistItemData.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt index cf38d8bc..f3d4abb9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt index eff4c662..c5a10d83 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt index 9a12e64e..9d66981b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistParams.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt index 9978d418..5d659c0e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt index d6fd7ec8..ce7d12e5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParams.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponse.kt new file mode 100644 index 00000000..604196d3 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponse.kt @@ -0,0 +1,274 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class WatchlistDeleteWatchlistItemResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val metadata: JsonField, + private val error: JsonField, + private val data: JsonValue, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing data: JsonValue = JsonMissing.of(), + ) : this(metadata, error, data, mutableMapOf()) + + fun toBaseResponse(): BaseResponse = + BaseResponse.builder().metadata(metadata).error(error).build() + + /** + * Response metadata, including the request ID and optional pagination info. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): ResponseMetadata = metadata.getRequired("metadata") + + /** + * Structured error details when the request is unsuccessful. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun error(): Optional = error.getOptional("error") + + /** + * Expected to always return the following: + * ```java + * JsonValue.from(null) + * ``` + * + * However, this method can be useful for debugging and logging (e.g. if the server responded + * with an unexpected value). + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonValue = data + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [error]. + * + * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error + + @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 + * [WatchlistDeleteWatchlistItemResponse]. + * + * The following fields are required: + * ```java + * .metadata() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [WatchlistDeleteWatchlistItemResponse]. */ + class Builder internal constructor() { + + private var metadata: JsonField? = null + private var error: JsonField = JsonMissing.of() + private var data: JsonValue = JsonValue.from(null) + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + watchlistDeleteWatchlistItemResponse: WatchlistDeleteWatchlistItemResponse + ) = apply { + metadata = watchlistDeleteWatchlistItemResponse.metadata + error = watchlistDeleteWatchlistItemResponse.error + data = watchlistDeleteWatchlistItemResponse.data + additionalProperties = + watchlistDeleteWatchlistItemResponse.additionalProperties.toMutableMap() + } + + /** Response metadata, including the request ID and optional pagination info. */ + fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [ResponseMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** Structured error details when the request is unsuccessful. */ + fun error(error: ApiError?) = error(JsonField.ofNullable(error)) + + /** Alias for calling [Builder.error] with `error.orElse(null)`. */ + fun error(error: Optional) = error(error.getOrNull()) + + /** + * Sets [Builder.error] to an arbitrary JSON value. + * + * You should usually call [Builder.error] with a well-typed [ApiError] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun error(error: JsonField) = apply { this.error = error } + + /** + * Sets the field to an arbitrary JSON value. + * + * It is usually unnecessary to call this method because the field defaults to the + * following: + * ```java + * JsonValue.from(null) + * ``` + * + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun data(data: JsonValue) = apply { this.data = data } + + 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 [WatchlistDeleteWatchlistItemResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .metadata() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): WatchlistDeleteWatchlistItemResponse = + WatchlistDeleteWatchlistItemResponse( + checkRequired("metadata", metadata), + error, + data, + 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(): WatchlistDeleteWatchlistItemResponse = apply { + if (validated) { + return@apply + } + + metadata().validate() + error().ifPresent { it.validate() } + _data().let { + if (it != JsonValue.from(null)) { + throw ClearStreetInvalidDataException("'data' is invalid, received $it") + } + } + 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 = + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (error.asKnown().getOrNull()?.validity() ?: 0) + + data.let { if (it == JsonValue.from(null)) 1 else 0 } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is WatchlistDeleteWatchlistItemResponse && + metadata == other.metadata && + error == other.error && + data == other.data && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(metadata, error, data, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "WatchlistDeleteWatchlistItemResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistParams.kt index 8c732152..5039f5b7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistParams.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams -import com.clear_street.api.core.toImmutable +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistResponse.kt new file mode 100644 index 00000000..0c513fe0 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistResponse.kt @@ -0,0 +1,273 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class WatchlistDeleteWatchlistResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val metadata: JsonField, + private val error: JsonField, + private val data: JsonValue, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing data: JsonValue = JsonMissing.of(), + ) : this(metadata, error, data, mutableMapOf()) + + fun toBaseResponse(): BaseResponse = + BaseResponse.builder().metadata(metadata).error(error).build() + + /** + * Response metadata, including the request ID and optional pagination info. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): ResponseMetadata = metadata.getRequired("metadata") + + /** + * Structured error details when the request is unsuccessful. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun error(): Optional = error.getOptional("error") + + /** + * Expected to always return the following: + * ```java + * JsonValue.from(null) + * ``` + * + * However, this method can be useful for debugging and logging (e.g. if the server responded + * with an unexpected value). + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonValue = data + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [error]. + * + * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error + + @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]. + * + * The following fields are required: + * ```java + * .metadata() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [WatchlistDeleteWatchlistResponse]. */ + class Builder internal constructor() { + + private var metadata: JsonField? = null + private var error: JsonField = JsonMissing.of() + private var data: JsonValue = JsonValue.from(null) + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(watchlistDeleteWatchlistResponse: WatchlistDeleteWatchlistResponse) = + apply { + metadata = watchlistDeleteWatchlistResponse.metadata + error = watchlistDeleteWatchlistResponse.error + data = watchlistDeleteWatchlistResponse.data + additionalProperties = + watchlistDeleteWatchlistResponse.additionalProperties.toMutableMap() + } + + /** Response metadata, including the request ID and optional pagination info. */ + fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [ResponseMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** Structured error details when the request is unsuccessful. */ + fun error(error: ApiError?) = error(JsonField.ofNullable(error)) + + /** Alias for calling [Builder.error] with `error.orElse(null)`. */ + fun error(error: Optional) = error(error.getOrNull()) + + /** + * Sets [Builder.error] to an arbitrary JSON value. + * + * You should usually call [Builder.error] with a well-typed [ApiError] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun error(error: JsonField) = apply { this.error = error } + + /** + * Sets the field to an arbitrary JSON value. + * + * It is usually unnecessary to call this method because the field defaults to the + * following: + * ```java + * JsonValue.from(null) + * ``` + * + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun data(data: JsonValue) = apply { this.data = data } + + 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. + * + * The following fields are required: + * ```java + * .metadata() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): WatchlistDeleteWatchlistResponse = + WatchlistDeleteWatchlistResponse( + checkRequired("metadata", metadata), + error, + data, + 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 + } + + metadata().validate() + error().ifPresent { it.validate() } + _data().let { + if (it != JsonValue.from(null)) { + throw ClearStreetInvalidDataException("'data' is invalid, received $it") + } + } + 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 = + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (error.asKnown().getOrNull()?.validity() ?: 0) + + data.let { if (it == JsonValue.from(null)) 1 else 0 } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is WatchlistDeleteWatchlistResponse && + metadata == other.metadata && + error == other.error && + data == other.data && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(metadata, error, data, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "WatchlistDeleteWatchlistResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetail.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetail.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetail.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetail.kt index 35be428b..25fa2c9b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetail.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetail.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntry.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistEntry.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntry.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistEntry.kt index 07f06cb0..a6de7ad6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntry.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistEntry.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdParams.kt index 28500a07..4d461cad 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponse.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponse.kt index a7bd0c2e..a2d1ae81 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt index d43147bc..dc67d4bc 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsResponse.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponse.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsResponse.kt index 1d34cc46..7e4590c2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkKnown -import com.clear_street.api.core.checkRequired -import com.clear_street.api.core.toImmutable -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.BaseResponse -import com.clear_street.api.models.ResponseMetadata +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntry.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntry.kt similarity index 96% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntry.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntry.kt index 7454be9b..a6838e9e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntry.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntry.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.ExcludeMissing -import com.clear_street.api.core.JsonField -import com.clear_street.api.core.JsonMissing -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.checkRequired -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.instruments.Instrument +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.instruments.Instrument import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt similarity index 97% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt index 2ef4dd92..53b597a0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.websocket +package com.clearstreet.api.models.v1.websocket -import com.clear_street.api.core.Params -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams import java.util.Objects /** Upgrade the HTTP connection to a WebSocket and echo incoming messages. */ 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/clearstreet/api/services/async/V1ServiceAsync.kt similarity index 80% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/V1ServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt index 49d97fe6..c66d61df 100644 --- 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/clearstreet/api/services/async/V1ServiceAsync.kt @@ -1,18 +1,18 @@ // 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.services.async.v1.AccountServiceAsync -import com.clear_street.api.services.async.v1.ApiVersionServiceAsync -import com.clear_street.api.services.async.v1.CalendarServiceAsync -import com.clear_street.api.services.async.v1.InstrumentDataServiceAsync -import com.clear_street.api.services.async.v1.InstrumentServiceAsync -import com.clear_street.api.services.async.v1.OmniAiServiceAsync -import com.clear_street.api.services.async.v1.OrderServiceAsync -import com.clear_street.api.services.async.v1.PositionServiceAsync -import com.clear_street.api.services.async.v1.WatchlistServiceAsync -import com.clear_street.api.services.async.v1.WebsocketServiceAsync +package com.clearstreet.api.services.async + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.async.v1.AccountServiceAsync +import com.clearstreet.api.services.async.v1.ApiVersionServiceAsync +import com.clearstreet.api.services.async.v1.CalendarServiceAsync +import com.clearstreet.api.services.async.v1.InstrumentDataServiceAsync +import com.clearstreet.api.services.async.v1.InstrumentServiceAsync +import com.clearstreet.api.services.async.v1.OmniAiServiceAsync +import com.clearstreet.api.services.async.v1.OrderServiceAsync +import com.clearstreet.api.services.async.v1.PositionServiceAsync +import com.clearstreet.api.services.async.v1.WatchlistServiceAsync +import com.clearstreet.api.services.async.v1.WebsocketServiceAsync import java.util.function.Consumer interface V1ServiceAsync { 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/clearstreet/api/services/async/V1ServiceAsyncImpl.kt similarity index 81% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/V1ServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt index c6b8265c..77fae320 100644 --- 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/clearstreet/api/services/async/V1ServiceAsyncImpl.kt @@ -1,28 +1,28 @@ // 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.services.async.v1.AccountServiceAsync -import com.clear_street.api.services.async.v1.AccountServiceAsyncImpl -import com.clear_street.api.services.async.v1.ApiVersionServiceAsync -import com.clear_street.api.services.async.v1.ApiVersionServiceAsyncImpl -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.InstrumentDataServiceAsync -import com.clear_street.api.services.async.v1.InstrumentDataServiceAsyncImpl -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.OmniAiServiceAsync -import com.clear_street.api.services.async.v1.OmniAiServiceAsyncImpl -import com.clear_street.api.services.async.v1.OrderServiceAsync -import com.clear_street.api.services.async.v1.OrderServiceAsyncImpl -import com.clear_street.api.services.async.v1.PositionServiceAsync -import com.clear_street.api.services.async.v1.PositionServiceAsyncImpl -import com.clear_street.api.services.async.v1.WatchlistServiceAsync -import com.clear_street.api.services.async.v1.WatchlistServiceAsyncImpl -import com.clear_street.api.services.async.v1.WebsocketServiceAsync -import com.clear_street.api.services.async.v1.WebsocketServiceAsyncImpl +package com.clearstreet.api.services.async + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.async.v1.AccountServiceAsync +import com.clearstreet.api.services.async.v1.AccountServiceAsyncImpl +import com.clearstreet.api.services.async.v1.ApiVersionServiceAsync +import com.clearstreet.api.services.async.v1.ApiVersionServiceAsyncImpl +import com.clearstreet.api.services.async.v1.CalendarServiceAsync +import com.clearstreet.api.services.async.v1.CalendarServiceAsyncImpl +import com.clearstreet.api.services.async.v1.InstrumentDataServiceAsync +import com.clearstreet.api.services.async.v1.InstrumentDataServiceAsyncImpl +import com.clearstreet.api.services.async.v1.InstrumentServiceAsync +import com.clearstreet.api.services.async.v1.InstrumentServiceAsyncImpl +import com.clearstreet.api.services.async.v1.OmniAiServiceAsync +import com.clearstreet.api.services.async.v1.OmniAiServiceAsyncImpl +import com.clearstreet.api.services.async.v1.OrderServiceAsync +import com.clearstreet.api.services.async.v1.OrderServiceAsyncImpl +import com.clearstreet.api.services.async.v1.PositionServiceAsync +import com.clearstreet.api.services.async.v1.PositionServiceAsyncImpl +import com.clearstreet.api.services.async.v1.WatchlistServiceAsync +import com.clearstreet.api.services.async.v1.WatchlistServiceAsyncImpl +import com.clearstreet.api.services.async.v1.WebsocketServiceAsync +import com.clearstreet.api.services.async.v1.WebsocketServiceAsyncImpl import java.util.function.Consumer class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsync.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsync.kt index dff348a8..0eef04a6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsync.kt @@ -1,20 +1,20 @@ // 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.accounts.AccountGetAccountBalancesParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse -import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdResponse -import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesResponse +import com.clearstreet.api.models.v1.accounts.AccountGetAccountByIdParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountByIdResponse +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryResponse +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncImpl.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncImpl.kt index 25100ce5..e2302a63 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncImpl.kt @@ -1,31 +1,31 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -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.AccountGetAccountBalancesParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse -import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdResponse -import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesResponse +import com.clearstreet.api.models.v1.accounts.AccountGetAccountByIdParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountByIdResponse +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryResponse +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsync.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsync.kt index 48602f6b..524ccc62 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsync.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.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.apiversion.ApiVersionGetVersionParams -import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.apiversion.ApiVersionGetVersionParams +import com.clearstreet.api.models.v1.apiversion.ApiVersionGetVersionResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncImpl.kt similarity index 78% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncImpl.kt index 456ab6d9..249cadbe 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncImpl.kt @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.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.apiversion.ApiVersionGetVersionParams -import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.apiversion.ApiVersionGetVersionParams +import com.clearstreet.api.models.v1.apiversion.ApiVersionGetVersionResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer 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/clearstreet/api/services/async/v1/CalendarServiceAsync.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsync.kt index 15d9dc82..e364c4c9 100644 --- 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/clearstreet/api/services/async/v1/CalendarServiceAsync.kt @@ -1,14 +1,14 @@ // 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.calendar.CalendarGetClockParams -import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.calendar.CalendarGetClockParams +import com.clearstreet.api.models.v1.calendar.CalendarGetClockResponse +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer 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/clearstreet/api/services/async/v1/CalendarServiceAsyncImpl.kt similarity index 82% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsyncImpl.kt index acf0c3aa..993f02e4 100644 --- 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/clearstreet/api/services/async/v1/CalendarServiceAsyncImpl.kt @@ -1,23 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.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.calendar.CalendarGetClockParams -import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.calendar.CalendarGetClockParams +import com.clearstreet.api.models.v1.calendar.CalendarGetClockResponse +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsync.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsync.kt index 35ce0c5f..5b33b82c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsync.kt @@ -1,26 +1,26 @@ // 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.instrumentdata.InstrumentDataGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse -import com.clear_street.api.services.async.v1.instrumentdata.MarketDataServiceAsync -import com.clear_street.api.services.async.v1.instrumentdata.NewsServiceAsync +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse +import com.clearstreet.api.services.async.v1.instrumentdata.MarketDataServiceAsync +import com.clearstreet.api.services.async.v1.instrumentdata.NewsServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt index 74ba42e7..82e19c80 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncImpl.kt @@ -1,38 +1,38 @@ // 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.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.instrumentdata.InstrumentDataGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse -import com.clear_street.api.services.async.v1.instrumentdata.MarketDataServiceAsync -import com.clear_street.api.services.async.v1.instrumentdata.MarketDataServiceAsyncImpl -import com.clear_street.api.services.async.v1.instrumentdata.NewsServiceAsync -import com.clear_street.api.services.async.v1.instrumentdata.NewsServiceAsyncImpl +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse +import com.clearstreet.api.services.async.v1.instrumentdata.MarketDataServiceAsync +import com.clearstreet.api.services.async.v1.instrumentdata.MarketDataServiceAsyncImpl +import com.clearstreet.api.services.async.v1.instrumentdata.NewsServiceAsync +import com.clearstreet.api.services.async.v1.instrumentdata.NewsServiceAsyncImpl import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt index a0be4ae2..a6d81303 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt @@ -1,18 +1,18 @@ // 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.instruments.InstrumentGetInstrumentByIdParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsResponse -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsResponse -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsResponse +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsResponse +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsResponse +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncImpl.kt similarity index 86% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncImpl.kt index 0b5b6f0a..8374d641 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncImpl.kt @@ -1,28 +1,28 @@ // 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.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.InstrumentGetInstrumentByIdParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsResponse -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsResponse -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsResponse +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsResponse +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsResponse +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OmniAiServiceAsync.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OmniAiServiceAsync.kt index 4f0e9a27..9a1469e0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OmniAiServiceAsync.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.async.v1.omniai.EntitlementServiceAsync -import com.clear_street.api.services.async.v1.omniai.MessageServiceAsync -import com.clear_street.api.services.async.v1.omniai.ResponseServiceAsync -import com.clear_street.api.services.async.v1.omniai.ThreadServiceAsync +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.async.v1.omniai.EntitlementServiceAsync +import com.clearstreet.api.services.async.v1.omniai.MessageServiceAsync +import com.clearstreet.api.services.async.v1.omniai.ResponseServiceAsync +import com.clearstreet.api.services.async.v1.omniai.ThreadServiceAsync import java.util.function.Consumer interface OmniAiServiceAsync { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OmniAiServiceAsyncImpl.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OmniAiServiceAsyncImpl.kt index 1fc155cf..6414cf8f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OmniAiServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OmniAiServiceAsyncImpl.kt @@ -1,16 +1,16 @@ // 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.omniai.EntitlementServiceAsync -import com.clear_street.api.services.async.v1.omniai.EntitlementServiceAsyncImpl -import com.clear_street.api.services.async.v1.omniai.MessageServiceAsync -import com.clear_street.api.services.async.v1.omniai.MessageServiceAsyncImpl -import com.clear_street.api.services.async.v1.omniai.ResponseServiceAsync -import com.clear_street.api.services.async.v1.omniai.ResponseServiceAsyncImpl -import com.clear_street.api.services.async.v1.omniai.ThreadServiceAsync -import com.clear_street.api.services.async.v1.omniai.ThreadServiceAsyncImpl +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.async.v1.omniai.EntitlementServiceAsync +import com.clearstreet.api.services.async.v1.omniai.EntitlementServiceAsyncImpl +import com.clearstreet.api.services.async.v1.omniai.MessageServiceAsync +import com.clearstreet.api.services.async.v1.omniai.MessageServiceAsyncImpl +import com.clearstreet.api.services.async.v1.omniai.ResponseServiceAsync +import com.clearstreet.api.services.async.v1.omniai.ResponseServiceAsyncImpl +import com.clearstreet.api.services.async.v1.omniai.ThreadServiceAsync +import com.clearstreet.api.services.async.v1.omniai.ThreadServiceAsyncImpl import java.util.function.Consumer class OmniAiServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsync.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsync.kt index 1642420b..92edcc7c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsync.kt @@ -1,24 +1,24 @@ // 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.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse -import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams -import com.clear_street.api.models.v1.orders.OrderGetExecutionsResponse -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse -import com.clear_street.api.models.v1.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.orders.OrderGetOrdersResponse -import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.orders.OrderReplaceOrderResponse -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersResponse +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersResponse +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsParams +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsResponse +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdParams +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdResponse +import com.clearstreet.api.models.v1.orders.OrderGetOrdersParams +import com.clearstreet.api.models.v1.orders.OrderGetOrdersResponse +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderParams +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderResponse +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersParams +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncImpl.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncImpl.kt index a08890cb..dbaf2a1c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncImpl.kt @@ -1,35 +1,35 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -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.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse -import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams -import com.clear_street.api.models.v1.orders.OrderGetExecutionsResponse -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse -import com.clear_street.api.models.v1.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.orders.OrderGetOrdersResponse -import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.orders.OrderReplaceOrderResponse -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersResponse +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsParams +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsResponse +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdParams +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdResponse +import com.clearstreet.api.models.v1.orders.OrderGetOrdersParams +import com.clearstreet.api.models.v1.orders.OrderGetOrdersResponse +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderParams +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderResponse +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersParams +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt index f0f6b9cd..8071925c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt @@ -1,22 +1,22 @@ // 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.positions.PositionCancelPositionInstructionParams -import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse -import com.clear_street.api.models.v1.positions.PositionClosePositionParams -import com.clear_street.api.models.v1.positions.PositionClosePositionResponse -import com.clear_street.api.models.v1.positions.PositionClosePositionsParams -import com.clear_street.api.models.v1.positions.PositionClosePositionsResponse -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsResponse -import com.clear_street.api.models.v1.positions.PositionGetPositionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionResponse +import com.clearstreet.api.models.v1.positions.PositionClosePositionParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionResponse +import com.clearstreet.api.models.v1.positions.PositionClosePositionsParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionsResponse +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsResponse +import com.clearstreet.api.models.v1.positions.PositionGetPositionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionsResponse +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncImpl.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncImpl.kt index cc26aa02..116c2e80 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncImpl.kt @@ -1,33 +1,33 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -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.positions.PositionCancelPositionInstructionParams -import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse -import com.clear_street.api.models.v1.positions.PositionClosePositionParams -import com.clear_street.api.models.v1.positions.PositionClosePositionResponse -import com.clear_street.api.models.v1.positions.PositionClosePositionsParams -import com.clear_street.api.models.v1.positions.PositionClosePositionsResponse -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsResponse -import com.clear_street.api.models.v1.positions.PositionGetPositionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionResponse +import com.clearstreet.api.models.v1.positions.PositionClosePositionParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionResponse +import com.clearstreet.api.models.v1.positions.PositionClosePositionsParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionsResponse +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsResponse +import com.clearstreet.api.models.v1.positions.PositionGetPositionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionsResponse +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsync.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsync.kt index 7085949e..3ebfdb28 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsync.kt @@ -1,22 +1,22 @@ // 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.watchlist.WatchlistAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistResponse -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsResponse +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncImpl.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncImpl.kt index b4802aac..44bb11a7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncImpl.kt @@ -1,33 +1,33 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -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.watchlist.WatchlistAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistResponse -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsync.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsync.kt index 02bb1324..b99f3a34 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsync.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.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.HttpResponse -import com.clear_street.api.models.v1.websocket.WebsocketWebsocketHandlerParams +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.models.v1.websocket.WebsocketWebsocketHandlerParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncImpl.kt similarity index 78% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncImpl.kt index f671c08f..120f918f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncImpl.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.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.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.websocket.WebsocketWebsocketHandlerParams +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.emptyHandler +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.websocket.WebsocketWebsocketHandlerParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt index ed8a72b6..37e2775e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.instrumentdata - -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.instrumentdata.marketdata.MarketDataGetDailySummariesParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse +package com.clearstreet.api.services.async.v1.instrumentdata + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt similarity index 81% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt index dc6c8cfd..ebcce750 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncImpl.kt @@ -1,23 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.instrumentdata +package com.clearstreet.api.services.async.v1.instrumentdata -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.instrumentdata.marketdata.MarketDataGetDailySummariesParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsync.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsync.kt index b88e17dc..3440e700 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsync.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.instrumentdata +package com.clearstreet.api.services.async.v1.instrumentdata -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.instrumentdata.news.NewsGetNewsParams -import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt similarity index 77% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt index 98cd3ee0..e048d74e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncImpl.kt @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.instrumentdata +package com.clearstreet.api.services.async.v1.instrumentdata -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.instrumentdata.news.NewsGetNewsParams -import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsync.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsync.kt index b08ade71..68a4b857 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsync.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai - -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.omniai.entitlements.EntitlementCreateEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse +package com.clearstreet.api.services.async.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt similarity index 85% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt index b275dee1..aa8399fb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncImpl.kt @@ -1,29 +1,29 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai - -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.omniai.entitlements.EntitlementCreateEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse +package com.clearstreet.api.services.async.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsync.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsync.kt index 46b08f9b..faa28bbd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsync.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai - -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.omniai.messages.MessageGetMessageByIdParams -import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdResponse -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackParams -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse +package com.clearstreet.api.services.async.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdParams +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdResponse +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackParams +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt similarity index 83% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt index ee5bb505..d458f7f9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncImpl.kt @@ -1,25 +1,25 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai +package com.clearstreet.api.services.async.v1.omniai -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.omniai.messages.MessageGetMessageByIdParams -import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdResponse -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackParams -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdParams +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdResponse +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackParams +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsync.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsync.kt index 9ca8a67c..eacd84a0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsync.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai - -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.omniai.responses.ResponseCancelResponseParams -import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseResponse -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdParams -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse +package com.clearstreet.api.services.async.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseResponse +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt similarity index 83% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt index 18e5ab5d..0940b0f2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncImpl.kt @@ -1,25 +1,25 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai +package com.clearstreet.api.services.async.v1.omniai -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.omniai.responses.ResponseCancelResponseParams -import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseResponse -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdParams -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseResponse +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsync.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsync.kt index a104eba4..0e105415 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsync.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai - -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.omniai.threads.ThreadCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse +package com.clearstreet.api.services.async.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt index 511e0d09..d5dea521 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncImpl.kt @@ -1,33 +1,33 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai +package com.clearstreet.api.services.async.v1.omniai -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.omniai.threads.ThreadCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt similarity index 80% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt index 978a88f8..00e8fa92 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1Service.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking - -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.AccountService -import com.clear_street.api.services.blocking.v1.ApiVersionService -import com.clear_street.api.services.blocking.v1.CalendarService -import com.clear_street.api.services.blocking.v1.InstrumentDataService -import com.clear_street.api.services.blocking.v1.InstrumentService -import com.clear_street.api.services.blocking.v1.OmniAiService -import com.clear_street.api.services.blocking.v1.OrderService -import com.clear_street.api.services.blocking.v1.PositionService -import com.clear_street.api.services.blocking.v1.WatchlistService -import com.clear_street.api.services.blocking.v1.WebsocketService +package com.clearstreet.api.services.blocking + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.blocking.v1.AccountService +import com.clearstreet.api.services.blocking.v1.ApiVersionService +import com.clearstreet.api.services.blocking.v1.CalendarService +import com.clearstreet.api.services.blocking.v1.InstrumentDataService +import com.clearstreet.api.services.blocking.v1.InstrumentService +import com.clearstreet.api.services.blocking.v1.OmniAiService +import com.clearstreet.api.services.blocking.v1.OrderService +import com.clearstreet.api.services.blocking.v1.PositionService +import com.clearstreet.api.services.blocking.v1.WatchlistService +import com.clearstreet.api.services.blocking.v1.WebsocketService import java.util.function.Consumer interface V1Service { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt similarity index 80% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt index c27db079..bd244a6b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/V1ServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt @@ -1,28 +1,28 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking - -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.AccountService -import com.clear_street.api.services.blocking.v1.AccountServiceImpl -import com.clear_street.api.services.blocking.v1.ApiVersionService -import com.clear_street.api.services.blocking.v1.ApiVersionServiceImpl -import com.clear_street.api.services.blocking.v1.CalendarService -import com.clear_street.api.services.blocking.v1.CalendarServiceImpl -import com.clear_street.api.services.blocking.v1.InstrumentDataService -import com.clear_street.api.services.blocking.v1.InstrumentDataServiceImpl -import com.clear_street.api.services.blocking.v1.InstrumentService -import com.clear_street.api.services.blocking.v1.InstrumentServiceImpl -import com.clear_street.api.services.blocking.v1.OmniAiService -import com.clear_street.api.services.blocking.v1.OmniAiServiceImpl -import com.clear_street.api.services.blocking.v1.OrderService -import com.clear_street.api.services.blocking.v1.OrderServiceImpl -import com.clear_street.api.services.blocking.v1.PositionService -import com.clear_street.api.services.blocking.v1.PositionServiceImpl -import com.clear_street.api.services.blocking.v1.WatchlistService -import com.clear_street.api.services.blocking.v1.WatchlistServiceImpl -import com.clear_street.api.services.blocking.v1.WebsocketService -import com.clear_street.api.services.blocking.v1.WebsocketServiceImpl +package com.clearstreet.api.services.blocking + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.blocking.v1.AccountService +import com.clearstreet.api.services.blocking.v1.AccountServiceImpl +import com.clearstreet.api.services.blocking.v1.ApiVersionService +import com.clearstreet.api.services.blocking.v1.ApiVersionServiceImpl +import com.clearstreet.api.services.blocking.v1.CalendarService +import com.clearstreet.api.services.blocking.v1.CalendarServiceImpl +import com.clearstreet.api.services.blocking.v1.InstrumentDataService +import com.clearstreet.api.services.blocking.v1.InstrumentDataServiceImpl +import com.clearstreet.api.services.blocking.v1.InstrumentService +import com.clearstreet.api.services.blocking.v1.InstrumentServiceImpl +import com.clearstreet.api.services.blocking.v1.OmniAiService +import com.clearstreet.api.services.blocking.v1.OmniAiServiceImpl +import com.clearstreet.api.services.blocking.v1.OrderService +import com.clearstreet.api.services.blocking.v1.OrderServiceImpl +import com.clearstreet.api.services.blocking.v1.PositionService +import com.clearstreet.api.services.blocking.v1.PositionServiceImpl +import com.clearstreet.api.services.blocking.v1.WatchlistService +import com.clearstreet.api.services.blocking.v1.WatchlistServiceImpl +import com.clearstreet.api.services.blocking.v1.WebsocketService +import com.clearstreet.api.services.blocking.v1.WebsocketServiceImpl import java.util.function.Consumer class V1ServiceImpl internal constructor(private val clientOptions: ClientOptions) : V1Service { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountService.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountService.kt index 404242d6..d9f5d52b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountService.kt @@ -1,20 +1,20 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.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.accounts.AccountGetAccountBalancesParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse -import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdResponse -import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesResponse +import com.clearstreet.api.models.v1.accounts.AccountGetAccountByIdParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountByIdResponse +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryResponse +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceImpl.kt similarity index 86% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceImpl.kt index 4dce82cc..de5cd84f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceImpl.kt @@ -1,31 +1,31 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 - -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.prepare -import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse -import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdResponse -import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryResponse -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesResponse +import com.clearstreet.api.models.v1.accounts.AccountGetAccountByIdParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountByIdResponse +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryResponse +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionService.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionService.kt index 7a4b0bdb..9171a5a4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionService.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.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.apiversion.ApiVersionGetVersionParams -import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.apiversion.ApiVersionGetVersionParams +import com.clearstreet.api.models.v1.apiversion.ApiVersionGetVersionResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceImpl.kt similarity index 76% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceImpl.kt index 7d150ce2..c95f90f5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceImpl.kt @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionParams -import com.clear_street.api.models.v1.apiversion.ApiVersionGetVersionResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.apiversion.ApiVersionGetVersionParams +import com.clearstreet.api.models.v1.apiversion.ApiVersionGetVersionResponse import java.util.function.Consumer /** Endpoints for API service metadata. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/CalendarService.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/CalendarService.kt index 90a6f2c8..0e8932d0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/CalendarService.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.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.calendar.CalendarGetClockParams -import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.calendar.CalendarGetClockParams +import com.clearstreet.api.models.v1.calendar.CalendarGetClockResponse +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceImpl.kt similarity index 81% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceImpl.kt index c004bae0..8ed947ef 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceImpl.kt @@ -1,23 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.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.prepare -import com.clear_street.api.models.v1.calendar.CalendarGetClockParams -import com.clear_street.api.models.v1.calendar.CalendarGetClockResponse -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.calendar.CalendarGetClockParams +import com.clearstreet.api.models.v1.calendar.CalendarGetClockResponse +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarResponse import java.util.function.Consumer /** Access clocks and financial calendars for market sessions and events. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataService.kt similarity index 95% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataService.kt index 6151949e..4f125124 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataService.kt @@ -1,26 +1,26 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.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.instrumentdata.InstrumentDataGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse -import com.clear_street.api.services.blocking.v1.instrumentdata.MarketDataService -import com.clear_street.api.services.blocking.v1.instrumentdata.NewsService +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse +import com.clearstreet.api.services.blocking.v1.instrumentdata.MarketDataService +import com.clearstreet.api.services.blocking.v1.instrumentdata.NewsService import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceImpl.kt similarity index 86% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceImpl.kt index b6b0089b..117131d1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceImpl.kt @@ -1,38 +1,38 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 - -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.prepare -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse -import com.clear_street.api.services.blocking.v1.instrumentdata.MarketDataService -import com.clear_street.api.services.blocking.v1.instrumentdata.MarketDataServiceImpl -import com.clear_street.api.services.blocking.v1.instrumentdata.NewsService -import com.clear_street.api.services.blocking.v1.instrumentdata.NewsServiceImpl +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentFundamentalsResponse +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsResponse +import com.clearstreet.api.services.blocking.v1.instrumentdata.MarketDataService +import com.clearstreet.api.services.blocking.v1.instrumentdata.MarketDataServiceImpl +import com.clearstreet.api.services.blocking.v1.instrumentdata.NewsService +import com.clearstreet.api.services.blocking.v1.instrumentdata.NewsServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt index bab2aa7d..7e16d09f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.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.instruments.InstrumentGetInstrumentByIdParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsResponse -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsResponse -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsResponse +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsResponse +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsResponse +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceImpl.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceImpl.kt index f3c2cab0..7e071950 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceImpl.kt @@ -1,28 +1,28 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 - -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.prepare -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsResponse -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsResponse -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsResponse +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdResponse +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsResponse +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsResponse +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OmniAiService.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OmniAiService.kt index 01a1f254..a4a6a903 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OmniAiService.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.omniai.EntitlementService -import com.clear_street.api.services.blocking.v1.omniai.MessageService -import com.clear_street.api.services.blocking.v1.omniai.ResponseService -import com.clear_street.api.services.blocking.v1.omniai.ThreadService +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.blocking.v1.omniai.EntitlementService +import com.clearstreet.api.services.blocking.v1.omniai.MessageService +import com.clearstreet.api.services.blocking.v1.omniai.ResponseService +import com.clearstreet.api.services.blocking.v1.omniai.ThreadService import java.util.function.Consumer interface OmniAiService { diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OmniAiServiceImpl.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OmniAiServiceImpl.kt index c9951220..fa1cf47b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OmniAiServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OmniAiServiceImpl.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.core.ClientOptions -import com.clear_street.api.services.blocking.v1.omniai.EntitlementService -import com.clear_street.api.services.blocking.v1.omniai.EntitlementServiceImpl -import com.clear_street.api.services.blocking.v1.omniai.MessageService -import com.clear_street.api.services.blocking.v1.omniai.MessageServiceImpl -import com.clear_street.api.services.blocking.v1.omniai.ResponseService -import com.clear_street.api.services.blocking.v1.omniai.ResponseServiceImpl -import com.clear_street.api.services.blocking.v1.omniai.ThreadService -import com.clear_street.api.services.blocking.v1.omniai.ThreadServiceImpl +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.services.blocking.v1.omniai.EntitlementService +import com.clearstreet.api.services.blocking.v1.omniai.EntitlementServiceImpl +import com.clearstreet.api.services.blocking.v1.omniai.MessageService +import com.clearstreet.api.services.blocking.v1.omniai.MessageServiceImpl +import com.clearstreet.api.services.blocking.v1.omniai.ResponseService +import com.clearstreet.api.services.blocking.v1.omniai.ResponseServiceImpl +import com.clearstreet.api.services.blocking.v1.omniai.ThreadService +import com.clearstreet.api.services.blocking.v1.omniai.ThreadServiceImpl import java.util.function.Consumer class OmniAiServiceImpl internal constructor(private val clientOptions: ClientOptions) : diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OrderService.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OrderService.kt index b047bea2..3ac6fa77 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OrderService.kt @@ -1,24 +1,24 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.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.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse -import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams -import com.clear_street.api.models.v1.orders.OrderGetExecutionsResponse -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse -import com.clear_street.api.models.v1.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.orders.OrderGetOrdersResponse -import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.orders.OrderReplaceOrderResponse -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersResponse +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersResponse +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsParams +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsResponse +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdParams +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdResponse +import com.clearstreet.api.models.v1.orders.OrderGetOrdersParams +import com.clearstreet.api.models.v1.orders.OrderGetOrdersResponse +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderParams +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderResponse +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersParams +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceImpl.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceImpl.kt index c6fe8f0f..0aecf04b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceImpl.kt @@ -1,35 +1,35 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -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.prepare -import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersResponse -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderResponse -import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams -import com.clear_street.api.models.v1.orders.OrderGetExecutionsResponse -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdResponse -import com.clear_street.api.models.v1.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.orders.OrderGetOrdersResponse -import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.orders.OrderReplaceOrderResponse -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersResponse +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderResponse +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsParams +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsResponse +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdParams +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdResponse +import com.clearstreet.api.models.v1.orders.OrderGetOrdersParams +import com.clearstreet.api.models.v1.orders.OrderGetOrdersResponse +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderParams +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderResponse +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersParams +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt similarity index 94% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt index b7a40bce..64679e9f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.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.positions.PositionCancelPositionInstructionParams -import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse -import com.clear_street.api.models.v1.positions.PositionClosePositionParams -import com.clear_street.api.models.v1.positions.PositionClosePositionResponse -import com.clear_street.api.models.v1.positions.PositionClosePositionsParams -import com.clear_street.api.models.v1.positions.PositionClosePositionsResponse -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsResponse -import com.clear_street.api.models.v1.positions.PositionGetPositionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionResponse +import com.clearstreet.api.models.v1.positions.PositionClosePositionParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionResponse +import com.clearstreet.api.models.v1.positions.PositionClosePositionsParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionsResponse +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsResponse +import com.clearstreet.api.models.v1.positions.PositionGetPositionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionsResponse +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceImpl.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceImpl.kt index 370bc414..6839af94 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceImpl.kt @@ -1,33 +1,33 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -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.prepare -import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionParams -import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse -import com.clear_street.api.models.v1.positions.PositionClosePositionParams -import com.clear_street.api.models.v1.positions.PositionClosePositionResponse -import com.clear_street.api.models.v1.positions.PositionClosePositionsParams -import com.clear_street.api.models.v1.positions.PositionClosePositionsResponse -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsResponse -import com.clear_street.api.models.v1.positions.PositionGetPositionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionsResponse -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionResponse +import com.clearstreet.api.models.v1.positions.PositionClosePositionParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionResponse +import com.clearstreet.api.models.v1.positions.PositionClosePositionsParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionsResponse +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsResponse +import com.clearstreet.api.models.v1.positions.PositionGetPositionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionsResponse +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistService.kt similarity index 93% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistService.kt index 44cb5c27..9dbf0963 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistService.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.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.watchlist.WatchlistAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistResponse -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsResponse +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceImpl.kt similarity index 87% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceImpl.kt index 0211f844..ed8a3b4a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceImpl.kt @@ -1,33 +1,33 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -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.prepare -import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistResponse -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistByIdParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistByIdResponse +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketService.kt similarity index 91% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketService.kt index d6e47bb6..f7225703 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketService.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -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.websocket.WebsocketWebsocketHandlerParams +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.models.v1.websocket.WebsocketWebsocketHandlerParams import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceImpl.kt similarity index 76% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceImpl.kt index 3a2f6752..85074f51 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceImpl.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -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.prepare -import com.clear_street.api.models.v1.websocket.WebsocketWebsocketHandlerParams +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.emptyHandler +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.websocket.WebsocketWebsocketHandlerParams import java.util.function.Consumer /** Active Websocket. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataService.kt similarity index 89% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataService.kt index b476b8bc..513f9c14 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataService.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.instrumentdata - -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.instrumentdata.marketdata.MarketDataGetDailySummariesParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse +package com.clearstreet.api.services.blocking.v1.instrumentdata + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt similarity index 80% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt index 47374608..a5843e9f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceImpl.kt @@ -1,23 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.instrumentdata +package com.clearstreet.api.services.blocking.v1.instrumentdata -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.prepare -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesResponse +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse import java.util.function.Consumer /** Retrieve instrument analytics, market data, news, and related reference data. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsService.kt similarity index 88% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsService.kt index b27a9831..d7c7ab25 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsService.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.instrumentdata +package com.clearstreet.api.services.blocking.v1.instrumentdata -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.instrumentdata.news.NewsGetNewsParams -import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt similarity index 75% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt index 7c1aecf7..d5bed563 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceImpl.kt @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.instrumentdata +package com.clearstreet.api.services.blocking.v1.instrumentdata -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.prepare -import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams -import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsResponse import java.util.function.Consumer /** Retrieve instrument analytics, market data, news, and related reference data. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementService.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementService.kt index 74d8e4ac..742db1f7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementService.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai - -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.omniai.entitlements.EntitlementCreateEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse +package com.clearstreet.api.services.blocking.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt similarity index 84% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt index 414432eb..dfedd66a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceImpl.kt @@ -1,29 +1,29 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai - -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.prepare -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse +package com.clearstreet.api.services.blocking.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementDeleteEntitlementResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementAgreementsResponse +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageService.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageService.kt index 1c5d4612..49dfd199 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageService.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai - -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.omniai.messages.MessageGetMessageByIdParams -import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdResponse -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackParams -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse +package com.clearstreet.api.services.blocking.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdParams +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdResponse +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackParams +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceImpl.kt similarity index 82% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceImpl.kt index c9a24e62..d3ff7115 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceImpl.kt @@ -1,25 +1,25 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai +package com.clearstreet.api.services.blocking.v1.omniai -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.prepare -import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdParams -import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdResponse -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackParams -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdParams +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdResponse +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackParams +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseService.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseService.kt index 7f2abb24..4beb35d4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseService.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai - -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.omniai.responses.ResponseCancelResponseParams -import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseResponse -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdParams -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse +package com.clearstreet.api.services.blocking.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseResponse +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceImpl.kt similarity index 82% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceImpl.kt index ec221e24..47f5b386 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceImpl.kt @@ -1,25 +1,25 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai +package com.clearstreet.api.services.blocking.v1.omniai -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.prepare -import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseParams -import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseResponse -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdParams -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseResponse +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadService.kt similarity index 92% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadService.kt index 83daceeb..1a5d0276 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadService.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai - -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.omniai.threads.ThreadCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse +package com.clearstreet.api.services.blocking.v1.omniai + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsResponse import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceImpl.kt similarity index 86% rename from clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceImpl.kt index 22ed3150..b3116844 100644 --- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceImpl.kt @@ -1,33 +1,33 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai +package com.clearstreet.api.services.blocking.v1.omniai -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.prepare -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsResponse +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseResponse +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/main/resources/META-INF/proguard/clear-street-java-core.pro b/clear-street-java-core/src/main/resources/META-INF/proguard/clear-street-java-core.pro index 5e5ec2e6..eea093e1 100644 --- a/clear-street-java-core/src/main/resources/META-INF/proguard/clear-street-java-core.pro +++ b/clear-street-java-core/src/main/resources/META-INF/proguard/clear-street-java-core.pro @@ -22,11 +22,11 @@ -keep class * extends com.fasterxml.jackson.core.type.TypeReference { *; } # Jackson uses reflection to access our class serializers and deserializers. --keep @com.fasterxml.jackson.databind.annotation.JsonSerialize class com.clear_street.api.** { *; } --keep @com.fasterxml.jackson.databind.annotation.JsonDeserialize class com.clear_street.api.** { *; } +-keep @com.fasterxml.jackson.databind.annotation.JsonSerialize class com.clearstreet.api.** { *; } +-keep @com.fasterxml.jackson.databind.annotation.JsonDeserialize class com.clearstreet.api.** { *; } # Jackson uses reflection to serialize and deserialize our classes based on their constructors and annotated members. --keepclassmembers class com.clear_street.api.** { +-keepclassmembers class com.clearstreet.api.** { (...); @com.fasterxml.jackson.annotation.* *; } \ No newline at end of file diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt deleted file mode 100644 index 21f01dbb..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt +++ /dev/null @@ -1,33 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class WatchlistDeleteWatchlistItemResponseTest { - - @Test - fun create() { - val watchlistDeleteWatchlistItemResponse = - WatchlistDeleteWatchlistItemResponse.builder().build() - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val watchlistDeleteWatchlistItemResponse = - WatchlistDeleteWatchlistItemResponse.builder().build() - - val roundtrippedWatchlistDeleteWatchlistItemResponse = - jsonMapper.readValue( - jsonMapper.writeValueAsString(watchlistDeleteWatchlistItemResponse), - jacksonTypeRef(), - ) - - assertThat(roundtrippedWatchlistDeleteWatchlistItemResponse) - .isEqualTo(watchlistDeleteWatchlistItemResponse) - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt deleted file mode 100644 index bff1b8eb..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clear_street.api.models.v1.watchlist - -import com.clear_street.api.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class WatchlistDeleteWatchlistResponseTest { - - @Test - fun create() { - val watchlistDeleteWatchlistResponse = WatchlistDeleteWatchlistResponse.builder().build() - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val watchlistDeleteWatchlistResponse = WatchlistDeleteWatchlistResponse.builder().build() - - val roundtrippedWatchlistDeleteWatchlistResponse = - jsonMapper.readValue( - jsonMapper.writeValueAsString(watchlistDeleteWatchlistResponse), - jacksonTypeRef(), - ) - - assertThat(roundtrippedWatchlistDeleteWatchlistResponse) - .isEqualTo(watchlistDeleteWatchlistResponse) - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ClientOptionsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ClientOptionsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ClientOptionsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ClientOptionsTest.kt index b46ad135..a740e6c4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ClientOptionsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ClientOptionsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core +package com.clearstreet.api.core -import com.clear_street.api.core.http.HttpClient +import com.clearstreet.api.core.http.HttpClient import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ObjectMappersTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ObjectMappersTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ObjectMappersTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ObjectMappersTest.kt index c0e5624b..5f638be4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ObjectMappersTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ObjectMappersTest.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.exc.MismatchedInputException diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/PhantomReachableTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/PhantomReachableTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/PhantomReachableTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/PhantomReachableTest.kt index 20c6a476..8fd7b47f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/PhantomReachableTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/PhantomReachableTest.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/UtilsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/UtilsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/UtilsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/UtilsTest.kt index fdf94c57..b326ee6b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/UtilsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/UtilsTest.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ValuesTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ValuesTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ValuesTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ValuesTest.kt index fc52ffdb..63cc065c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/ValuesTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/ValuesTest.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core +package com.clearstreet.api.core import java.util.Optional import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/AsyncStreamResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/AsyncStreamResponseTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/AsyncStreamResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/AsyncStreamResponseTest.kt index d91ff599..d16bfb71 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/AsyncStreamResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/AsyncStreamResponseTest.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import java.util.* import java.util.concurrent.CompletableFuture diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HeadersTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HeadersTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HeadersTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HeadersTest.kt index 90a703fc..fb60afbf 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HeadersTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HeadersTest.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.params.ParameterizedTest diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HttpRequestBodiesTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HttpRequestBodiesTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HttpRequestBodiesTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HttpRequestBodiesTest.kt index 799fbbf3..da0de5e7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HttpRequestBodiesTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HttpRequestBodiesTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.MultipartField -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.MultipartField +import com.clearstreet.api.core.jsonMapper import java.io.ByteArrayOutputStream import java.io.InputStream import org.assertj.core.api.Assertions.assertThat @@ -293,20 +293,10 @@ internal class HttpRequestBodiesTest { .isEqualTo( """ |--$boundary - |Content-Disposition: form-data; name="items[0]" + |Content-Disposition: form-data; name="items" |Content-Type: text/plain | - |alpha - |--$boundary - |Content-Disposition: form-data; name="items[1]" - |Content-Type: text/plain - | - |beta - |--$boundary - |Content-Disposition: form-data; name="items[2]" - |Content-Type: text/plain - | - |gamma + |alpha,beta,gamma |--$boundary-- | """ @@ -587,15 +577,10 @@ internal class HttpRequestBodiesTest { .isEqualTo( """ |--$boundary - |Content-Disposition: form-data; name="data[tags][0]" + |Content-Disposition: form-data; name="data[tags]" |Content-Type: text/plain | - |a - |--$boundary - |Content-Disposition: form-data; name="data[tags][1]" - |Content-Type: text/plain - | - |b + |a,b |--$boundary-- | """ @@ -685,6 +670,11 @@ internal class HttpRequestBodiesTest { |Content-Type: text/plain | |present + |--$boundary + |Content-Disposition: form-data; name="items" + |Content-Type: text/plain + | + | |--$boundary-- | """ diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HttpRequestTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HttpRequestTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HttpRequestTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HttpRequestTest.kt index 3872fe75..252f0e57 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/HttpRequestTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/HttpRequestTest.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.params.ParameterizedTest diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/LoggingHttpClientTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/LoggingHttpClientTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/LoggingHttpClientTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/LoggingHttpClientTest.kt index 16f6dbb9..399d804d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/LoggingHttpClientTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/LoggingHttpClientTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.core.LogLevel -import com.clear_street.api.core.RequestOptions +import com.clearstreet.api.core.LogLevel +import com.clearstreet.api.core.RequestOptions import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream import java.io.IOException diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/QueryParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/QueryParamsTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/QueryParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/QueryParamsTest.kt index 8cc74ba9..3b860fb2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/QueryParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/QueryParamsTest.kt @@ -1,4 +1,4 @@ -package com.clear_street.api.core.http +package com.clearstreet.api.core.http import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.params.ParameterizedTest diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/RetryingHttpClientTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/RetryingHttpClientTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/RetryingHttpClientTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/RetryingHttpClientTest.kt index b896d224..f8c9c332 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/core/http/RetryingHttpClientTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/core/http/RetryingHttpClientTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.core.http +package com.clearstreet.api.core.http -import com.clear_street.api.client.okhttp.OkHttpClient -import com.clear_street.api.core.RequestOptions -import com.clear_street.api.core.Sleeper -import com.clear_street.api.errors.ClearStreetRetryableException +import com.clearstreet.api.client.okhttp.OkHttpClient +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.Sleeper +import com.clearstreet.api.errors.ClearStreetRetryableException import com.github.tomakehurst.wiremock.client.WireMock.equalTo import com.github.tomakehurst.wiremock.client.WireMock.matching import com.github.tomakehurst.wiremock.client.WireMock.ok diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/ApiErrorTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/ApiErrorTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/ApiErrorTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/ApiErrorTest.kt index b93e2026..6959a1bd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/ApiErrorTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/ApiErrorTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models +package com.clearstreet.api.models -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/BaseResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/BaseResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/BaseResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/BaseResponseTest.kt index 5deaa830..872f7857 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/BaseResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/BaseResponseTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models +package com.clearstreet.api.models -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/ResponseMetadataTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/ResponseMetadataTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/ResponseMetadataTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/ResponseMetadataTest.kt index 96f45c0d..15df47e4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/ResponseMetadataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/ResponseMetadataTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models +package com.clearstreet.api.models -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSodTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSodTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSodTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSodTest.kt index 38f59854..b6bd4072 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesSodTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSodTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt index bda0f16d..d13c45bc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountBalancesTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt index 44126153..ce5ba7bf 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt index 78949cd8..4d765f59 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdParamsTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdParamsTest.kt index 80267ea8..38535930 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdResponseTest.kt index 65fb0d33..0f13ce8c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountByIdResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParamsTest.kt index d5a22c7c..cebf3a9f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsResponseTest.kt index 44dae72b..485b17c2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetAccountsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt index b8b66eab..42e2bcfd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt index ab9fc4b3..4bb2cedd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetPortfolioHistoryResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdParamsTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdParamsTest.kt index 131cac31..bd3c4af3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdResponseTest.kt index c70a9b31..290d0556 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountPatchAccountByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountPatchAccountByIdResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountSettingsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettingsTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountSettingsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettingsTest.kt index fa27c251..fc966705 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountSettingsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettingsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountTest.kt index 7d6a765e..0847d561 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/AccountTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsTest.kt index fa066b88..81f59e8c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsageTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsUsageTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsageTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsUsageTest.kt index 34486168..e0cbb3df 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginDetailsUsageTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsUsageTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributorTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributorTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributorTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributorTest.kt index 658d59eb..6f722aa5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/MarginTopContributorTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributorTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistoryResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistoryResponseTest.kt index c78e3ef6..81fb8b75 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistoryResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistoryResponseTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegmentTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistorySegmentTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegmentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistorySegmentTest.kt index ca7236ea..2099946e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/PortfolioHistorySegmentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/PortfolioHistorySegmentTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/RiskSettingsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettingsTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/RiskSettingsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettingsTest.kt index 3a203d4b..253232e8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/accounts/RiskSettingsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettingsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.accounts +package com.clearstreet.api.models.v1.accounts -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt similarity index 82% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt index 44709a8a..b51a6237 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.apiversion +package com.clearstreet.api.models.v1.apiversion import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt index d98c5a5f..98de9b63 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/ApiVersionGetVersionResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.apiversion +package com.clearstreet.api.models.v1.apiversion -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/VersionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/VersionTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/VersionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/VersionTest.kt index 7311269f..cd6d6a20 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/apiversion/VersionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/apiversion/VersionTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.apiversion +package com.clearstreet.api.models.v1.apiversion -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockParamsTest.kt similarity index 82% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockParamsTest.kt index a5e25b08..a06c6aeb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockResponseTest.kt index cfd24ac4..e56cb473 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetClockResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetClockResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt index 0e57ac7d..ddca226a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt index 895f0bc5..8966e47c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/CalendarGetMarketHoursCalendarResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/ClockDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/ClockDetailTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/ClockDetailTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/ClockDetailTest.kt index 3c640b27..d2ecef08 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/ClockDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/ClockDetailTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/MarketHoursDetailTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetailTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/MarketHoursDetailTest.kt index 94d75d05..0097bbe1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketHoursDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/MarketHoursDetailTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketStatusTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatusTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketStatusTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatusTest.kt index ff07934c..e48c225a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/MarketStatusTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatusTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/SessionScheduleTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/SessionScheduleTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/SessionScheduleTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/SessionScheduleTest.kt index 8fea9741..b2ce4bb8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/SessionScheduleTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/SessionScheduleTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/TradingSessionsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessionsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/TradingSessionsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessionsTest.kt index b156a37e..c875391b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/calendar/TradingSessionsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessionsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.calendar +package com.clearstreet.api.models.v1.calendar -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistributionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystDistributionTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistributionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystDistributionTest.kt index fe7e11cd..aae99bec 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/AnalystDistributionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/AnalystDistributionTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt index b84781c1..50efffba 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAllEventsDataTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt index 8270919c..72c0a378 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensusTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt index 98a98cfd..25659f8c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentBalanceSheetStatementTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt index f081e6bd..7b2c0160 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentCashFlowStatementTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt similarity index 79% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt index 23b5fb77..08b9988b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -33,9 +33,12 @@ internal class InstrumentDataGetAllInstrumentEventsParamsTest { assertThat(queryParams) .isEqualTo( QueryParams.builder() - .put("event_types[0]", "EARNINGS") + .put("event_types", listOf("EARNINGS").joinToString(",")) .put("from_date", "from_date") - .put("instrument_ids[0]", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put( + "instrument_ids", + listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").joinToString(","), + ) .put("to_date", "to_date") .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt index 79913474..dcde2a59 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt index 93682ff2..1a5e4f28 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt index ca3487f9..a6519209 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt index ef017c2d..cbe346aa 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt index 4bfcdcab..0337f11a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt index 5b658464..15418efe 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt index 70306741..d9ec86b4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt index bd6a487c..e5be2ba5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt index 53624b06..b25bddb9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt index 165ffb7c..e24e125f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt index 5ce62c0e..86c0d8e9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt index c72d9748..547ddd1e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt index 54c9aa91..fe194907 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt index 1a590f4f..653f58ea 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEventTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarningsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarningsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarningsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarningsTest.kt index 42fe6bad..c6aac007 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEarningsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarningsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt index 608d9c1a..4d91e937 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelopeTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt index c207afd6..bffb4302 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItemTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt index 03b9a015..06a5db75 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsByDateTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt index ae1d01ff..43b61807 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsDataTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt index def56adb..c910de63 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentalsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt index 6f757ef6..4bae3d3f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentIncomeStatementTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt index f9788215..580f982a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentSplitEventTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTargetTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/PriceTargetTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTargetTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/PriceTargetTest.kt index f1c79694..a43a048f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/PriceTargetTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/PriceTargetTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata +package com.clearstreet.api.models.v1.instrumentdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt index f7a01a7b..81f8ef0f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummaryTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt index 94f882be..06700624 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt index 5bfca5d0..065f79d6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt similarity index 77% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt index d7a3953b..31b747ad 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -27,7 +27,10 @@ internal class MarketDataGetSnapshotsParamsTest { assertThat(queryParams) .isEqualTo( QueryParams.builder() - .put("instrument_ids[0]", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put( + "instrument_ids", + listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").joinToString(","), + ) .build() ) } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt index 27166463..0555c4a2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt index 6640b1c1..8e1e04c9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt index f0ede8f2..2abcc6a8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeksTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt similarity index 89% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt index c1c63ece..e53389c4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotLastTradeTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt index 82e7c64c..0ed4ae7e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt index b3d53e56..ad774148 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotSessionTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.marketdata +package com.clearstreet.api.models.v1.instrumentdata.marketdata -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt index 5b2b628e..7ab8515b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news +package com.clearstreet.api.models.v1.instrumentdata.news -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -48,12 +48,12 @@ internal class NewsGetNewsParamsTest { .put("exclude_publishers", "exclude_publishers") .put("from", "from") .put("include_publishers", "include_publishers") - .put("instrument_ids[0]", "string") + .put("instrument_ids", listOf("string").joinToString(",")) .put("news_type", "NEWS") .put("page_size", "1") .put("page_token", "U3RhaW5sZXNzIHJvY2tz") .put("search_query", "search_query") - .put("sectors[0]", "BASIC_MATERIALS") + .put("sectors", listOf("BASIC_MATERIALS").joinToString(",")) .put("to", "to") .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt index 0df1f74f..a0c90f9b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news +package com.clearstreet.api.models.v1.instrumentdata.news -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt index 274b629c..88e06f79 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrumentTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news +package com.clearstreet.api.models.v1.instrumentdata.news -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItemTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItemTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItemTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItemTest.kt index a1c6521b..83b86de0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instrumentdata/news/NewsItemTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItemTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instrumentdata.news +package com.clearstreet.api.models.v1.instrumentdata.news -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCoreTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCoreTest.kt index 3e787ddd..0769cb05 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCoreTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParamsTest.kt index 475978cb..c0cb6da0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index 4e8d4281..23b2eeaa 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt similarity index 89% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt index faab7846..5645477f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -46,7 +46,10 @@ internal class InstrumentGetInstrumentsParamsTest { .isEqualTo( QueryParams.builder() .put("easy_to_borrow", "true") - .put("instrument_ids[0]", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put( + "instrument_ids", + listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").joinToString(","), + ) .put("instrument_type", "COMMON_STOCK") .put("is_liquidation_only", "true") .put("is_marginable", "true") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index 33b6675d..c7a4f7e1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt index c8c83e40..b7b050cf 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt index 65efee68..666df71a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt index 8db18994..52204307 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index adc95e47..7261e5ae 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentTest.kt index aca4b0ab..e36a40fd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/OptionsContractTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContractTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/OptionsContractTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContractTest.kt index 6e13f9ab..8946b061 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/instruments/OptionsContractTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContractTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.instruments +package com.clearstreet.api.models.v1.instruments -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ActionButtonTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ActionButtonTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ActionButtonTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ActionButtonTest.kt index c7c99bd7..4f2f1e59 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ActionButtonTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ActionButtonTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayloadTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayloadTest.kt index f2954f6f..5655afe7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayloadTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPointTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartPointTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPointTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartPointTest.kt index 7ec8b314..ec83b01f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartPointTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartPointTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartSeriesTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartSeriesTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartSeriesTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartSeriesTest.kt index c3ba1271..00974ea0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ChartSeriesTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ChartSeriesTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartChartPayloadTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartChartPayloadTest.kt index 38142e87..93c1a609 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartChartPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartChartPayloadTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartCustomPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartCustomPayloadTest.kt similarity index 89% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartCustomPayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartCustomPayloadTest.kt index b3cb5531..af4769e6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartCustomPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartCustomPayloadTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt index 0f691ab9..c75d43bb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.orders.NewOrderRequest -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TrailingOffsetType +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.orders.NewOrderRequest +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartSuggestedActionsPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartSuggestedActionsPayloadTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartSuggestedActionsPayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartSuggestedActionsPayloadTest.kt index 470161b0..6a4e48ca 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartSuggestedActionsPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartSuggestedActionsPayloadTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartTextPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartTextPayloadTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartTextPayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartTextPayloadTest.kt index 6da48d81..5bc2b0d9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartTextPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartTextPayloadTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartThinkingPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartThinkingPayloadTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartThinkingPayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartThinkingPayloadTest.kt index fc1d7af3..801cfb42 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ContentPartThinkingPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartThinkingPayloadTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/DataChartTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/DataChartTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/DataChartTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/DataChartTest.kt index 17fdec03..d7daebde 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/DataChartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/DataChartTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenChartActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartActionTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenChartActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartActionTest.kt index 7dcec58b..6fb09cfc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenChartActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartActionTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt similarity index 89% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt index 97d3c23f..fa6673a9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenEntitlementConsentActionTest.kt @@ -1,10 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementAgreementKey -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenScreenerActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenScreenerActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt index b8457687..32fc986a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/OpenScreenerActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillCancelOrderActionTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillCancelOrderActionTest.kt index f61c3b84..dd2da0ac 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillCancelOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillCancelOrderActionTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.orders.CancelOrderRequest +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.orders.CancelOrderRequest import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderActionTest.kt similarity index 89% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderActionTest.kt index 33c08208..ea2db95c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillNewOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderActionTest.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.orders.NewOrderRequest -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TrailingOffsetType +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.orders.NewOrderRequest +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderActionTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderActionTest.kt index 448b3379..d2dd45a0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PrefillOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderActionTest.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai - -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.orders.CancelOrderRequest -import com.clear_street.api.models.v1.orders.NewOrderRequest -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TrailingOffsetType +package com.clearstreet.api.models.v1.omniai + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.orders.CancelOrderRequest +import com.clearstreet.api.models.v1.orders.NewOrderRequest +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PromptButtonActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PromptButtonActionTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PromptButtonActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PromptButtonActionTest.kt index c0d0fc22..d1c72e0b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/PromptButtonActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PromptButtonActionTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ScreenerFilterTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilterTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ScreenerFilterTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilterTest.kt index 0422ce11..e555a7dc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/ScreenerFilterTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilterTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionButtonActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonActionTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionButtonActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonActionTest.kt index db797148..36501097 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionButtonActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonActionTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt index 748ed702..0ae2d9be 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/StructuredActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt @@ -1,18 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementAgreementKey -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode -import com.clear_street.api.models.v1.orders.NewOrderRequest -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TrailingOffsetType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.orders.NewOrderRequest +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/SuggestedActionsPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/SuggestedActionsPayloadTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/SuggestedActionsPayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/SuggestedActionsPayloadTest.kt index 4f382908..0d15b390 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/SuggestedActionsPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/SuggestedActionsPayloadTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai +package com.clearstreet.api.models.v1.omniai -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/DeleteEntitlementResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/DeleteEntitlementResponseTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/DeleteEntitlementResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/DeleteEntitlementResponseTest.kt index f8ec56fc..ffcc6549 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/DeleteEntitlementResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/DeleteEntitlementResponseTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt index e60698ef..dbacbfec 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementAgreementResourceTest.kt @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.omniai.EntitlementAgreementKey +import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt index 2e8a796e..03a41916 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsParamsTest.kt @@ -1,7 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements +import com.clearstreet.api.models.v1.omniai.EntitlementCode import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt index 524e7783..e65f0470 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementCreateEntitlementsResponseTest.kt @@ -1,11 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParamsTest.kt index efc20083..08d87a8b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponseTest.kt index 7c1be446..06d56e1a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementDeleteEntitlementResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt index 85516ef4..01ad75a2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt index 9533e8df..3ddea5b4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementAgreementsResponseTest.kt @@ -1,11 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.omniai.EntitlementAgreementKey +import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParamsTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParamsTest.kt index f35cb6f8..f62e7841 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt index da6fd30c..657da3f0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementGetEntitlementsResponseTest.kt @@ -1,11 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt index 4c7c2cfb..550d7e07 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/entitlements/EntitlementResourceTest.kt @@ -1,8 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.entitlements +package com.clearstreet.api.models.v1.omniai.entitlements -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt index d96ab9c3..342e52d5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponseTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages +package com.clearstreet.api.models.v1.omniai.messages -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdParamsTest.kt index d879a37c..61da226f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages +package com.clearstreet.api.models.v1.omniai.messages -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt similarity index 87% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt index 8ebd2b33..d28f9682 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageGetMessageByIdResponseTest.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages +package com.clearstreet.api.models.v1.omniai.messages -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.responses.ErrorStatus -import com.clear_street.api.models.v1.omniai.threads.Message -import com.clear_street.api.models.v1.omniai.threads.MessageContent -import com.clear_street.api.models.v1.omniai.threads.MessageContentPart -import com.clear_street.api.models.v1.omniai.threads.MessageOutcome -import com.clear_street.api.models.v1.omniai.threads.MessageRole +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.omniai.responses.ErrorStatus +import com.clearstreet.api.models.v1.omniai.threads.Message +import com.clearstreet.api.models.v1.omniai.threads.MessageContent +import com.clearstreet.api.models.v1.omniai.threads.MessageContentPart +import com.clearstreet.api.models.v1.omniai.threads.MessageOutcome +import com.clearstreet.api.models.v1.omniai.threads.MessageRole import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -49,9 +49,9 @@ internal class MessageGetMessageByIdResponseTest { .content( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -102,9 +102,9 @@ internal class MessageGetMessageByIdResponseTest { .content( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -157,9 +157,9 @@ internal class MessageGetMessageByIdResponseTest { .content( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackParamsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackParamsTest.kt index 89743e6b..6bbbbe62 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages +package com.clearstreet.api.models.v1.omniai.messages -import com.clear_street.api.core.JsonValue +import com.clearstreet.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt index 9f396733..71104689 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/messages/MessageSubmitFeedbackResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.messages +package com.clearstreet.api.models.v1.omniai.messages -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt similarity index 90% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt index b1ac18c8..136252dd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/CancelResponsePayloadTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatusTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatusTest.kt similarity index 89% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatusTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatusTest.kt index 23fefc68..70208d62 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ErrorStatusTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatusTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseParamsTest.kt index a2bc85b2..f34bc774 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt index 4815a785..b2cbcd82 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseCancelResponseResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPartTest.kt similarity index 67% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPartTest.kt index b17931fb..35971c45 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPartTest.kt @@ -1,26 +1,26 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses - -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.ActionButton -import com.clear_street.api.models.v1.omniai.ChartPayload -import com.clear_street.api.models.v1.omniai.ChartPoint -import com.clear_street.api.models.v1.omniai.ChartSeries -import com.clear_street.api.models.v1.omniai.DataChart -import com.clear_street.api.models.v1.omniai.PrefillOrderAction -import com.clear_street.api.models.v1.omniai.PromptButtonAction -import com.clear_street.api.models.v1.omniai.StructuredAction -import com.clear_street.api.models.v1.omniai.StructuredActionButtonAction -import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload -import com.clear_street.api.models.v1.orders.NewOrderRequest -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TrailingOffsetType +package com.clearstreet.api.models.v1.omniai.responses + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.omniai.ActionButton +import com.clearstreet.api.models.v1.omniai.ChartPayload +import com.clearstreet.api.models.v1.omniai.ChartPoint +import com.clearstreet.api.models.v1.omniai.ChartSeries +import com.clearstreet.api.models.v1.omniai.DataChart +import com.clearstreet.api.models.v1.omniai.PrefillOrderAction +import com.clearstreet.api.models.v1.omniai.PromptButtonAction +import com.clearstreet.api.models.v1.omniai.StructuredAction +import com.clearstreet.api.models.v1.omniai.StructuredActionButtonAction +import com.clearstreet.api.models.v1.omniai.SuggestedActionsPayload +import com.clearstreet.api.models.v1.orders.NewOrderRequest +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -32,31 +32,31 @@ import org.junit.jupiter.params.provider.EnumSource internal class ResponseContentPartTest { @Test - fun ofUnionMember0() { - val unionMember0 = - ResponseContentPart.UnionMember0.builder() + fun ofContentPartText() { + val contentPartText = + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() - val responseContentPart = ResponseContentPart.ofUnionMember0(unionMember0) + val responseContentPart = ResponseContentPart.ofContentPartText(contentPartText) - assertThat(responseContentPart.unionMember0()).contains(unionMember0) - assertThat(responseContentPart.unionMember1()).isEmpty - assertThat(responseContentPart.unionMember2()).isEmpty - assertThat(responseContentPart.unionMember3()).isEmpty - assertThat(responseContentPart.unionMember4()).isEmpty - assertThat(responseContentPart.unionMember5()).isEmpty + assertThat(responseContentPart.contentPartText()).contains(contentPartText) + assertThat(responseContentPart.contentPartThinking()).isEmpty + assertThat(responseContentPart.contentPartStructuredAction()).isEmpty + assertThat(responseContentPart.contentPartChart()).isEmpty + assertThat(responseContentPart.contentPartSuggestedActions()).isEmpty + assertThat(responseContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember0Roundtrip() { + fun ofContentPartTextRoundtrip() { val jsonMapper = jsonMapper() val responseContentPart = - ResponseContentPart.ofUnionMember0( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ofContentPartText( + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) @@ -70,31 +70,31 @@ internal class ResponseContentPartTest { } @Test - fun ofUnionMember1() { - val unionMember1 = - ResponseContentPart.UnionMember1.builder() + fun ofContentPartThinking() { + val contentPartThinking = + ResponseContentPart.ContentPartThinking.builder() .addThought("string") - .type(ResponseContentPart.UnionMember1.Type.THINKING) + .type(ResponseContentPart.ContentPartThinking.Type.THINKING) .build() - val responseContentPart = ResponseContentPart.ofUnionMember1(unionMember1) + val responseContentPart = ResponseContentPart.ofContentPartThinking(contentPartThinking) - assertThat(responseContentPart.unionMember0()).isEmpty - assertThat(responseContentPart.unionMember1()).contains(unionMember1) - assertThat(responseContentPart.unionMember2()).isEmpty - assertThat(responseContentPart.unionMember3()).isEmpty - assertThat(responseContentPart.unionMember4()).isEmpty - assertThat(responseContentPart.unionMember5()).isEmpty + assertThat(responseContentPart.contentPartText()).isEmpty + assertThat(responseContentPart.contentPartThinking()).contains(contentPartThinking) + assertThat(responseContentPart.contentPartStructuredAction()).isEmpty + assertThat(responseContentPart.contentPartChart()).isEmpty + assertThat(responseContentPart.contentPartSuggestedActions()).isEmpty + assertThat(responseContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember1Roundtrip() { + fun ofContentPartThinkingRoundtrip() { val jsonMapper = jsonMapper() val responseContentPart = - ResponseContentPart.ofUnionMember1( - ResponseContentPart.UnionMember1.builder() + ResponseContentPart.ofContentPartThinking( + ResponseContentPart.ContentPartThinking.builder() .addThought("string") - .type(ResponseContentPart.UnionMember1.Type.THINKING) + .type(ResponseContentPart.ContentPartThinking.Type.THINKING) .build() ) @@ -108,9 +108,9 @@ internal class ResponseContentPartTest { } @Test - fun ofUnionMember2() { - val unionMember2 = - ResponseContentPart.UnionMember2.builder() + fun ofContentPartStructuredAction() { + val contentPartStructuredAction = + ResponseContentPart.ContentPartStructuredAction.builder() .action( StructuredAction.PrefillOrder.builder() .prefillOrder( @@ -142,25 +142,27 @@ internal class ResponseContentPartTest { .build() ) .actionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .type(ResponseContentPart.UnionMember2.Type.STRUCTURED_ACTION) + .type(ResponseContentPart.ContentPartStructuredAction.Type.STRUCTURED_ACTION) .build() - val responseContentPart = ResponseContentPart.ofUnionMember2(unionMember2) - - assertThat(responseContentPart.unionMember0()).isEmpty - assertThat(responseContentPart.unionMember1()).isEmpty - assertThat(responseContentPart.unionMember2()).contains(unionMember2) - assertThat(responseContentPart.unionMember3()).isEmpty - assertThat(responseContentPart.unionMember4()).isEmpty - assertThat(responseContentPart.unionMember5()).isEmpty + val responseContentPart = + ResponseContentPart.ofContentPartStructuredAction(contentPartStructuredAction) + + assertThat(responseContentPart.contentPartText()).isEmpty + assertThat(responseContentPart.contentPartThinking()).isEmpty + assertThat(responseContentPart.contentPartStructuredAction()) + .contains(contentPartStructuredAction) + assertThat(responseContentPart.contentPartChart()).isEmpty + assertThat(responseContentPart.contentPartSuggestedActions()).isEmpty + assertThat(responseContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember2Roundtrip() { + fun ofContentPartStructuredActionRoundtrip() { val jsonMapper = jsonMapper() val responseContentPart = - ResponseContentPart.ofUnionMember2( - ResponseContentPart.UnionMember2.builder() + ResponseContentPart.ofContentPartStructuredAction( + ResponseContentPart.ContentPartStructuredAction.builder() .action( StructuredAction.PrefillOrder.builder() .prefillOrder( @@ -196,7 +198,7 @@ internal class ResponseContentPartTest { .build() ) .actionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .type(ResponseContentPart.UnionMember2.Type.STRUCTURED_ACTION) + .type(ResponseContentPart.ContentPartStructuredAction.Type.STRUCTURED_ACTION) .build() ) @@ -210,9 +212,9 @@ internal class ResponseContentPartTest { } @Test - fun ofUnionMember3() { - val unionMember3 = - ResponseContentPart.UnionMember3.builder() + fun ofContentPartChart() { + val contentPartChart = + ResponseContentPart.ContentPartChart.builder() .payload( ChartPayload.builder() .chartId("chart_revenue_growth") @@ -245,25 +247,25 @@ internal class ResponseContentPartTest { ) .build() ) - .type(ResponseContentPart.UnionMember3.Type.CHART) + .type(ResponseContentPart.ContentPartChart.Type.CHART) .build() - val responseContentPart = ResponseContentPart.ofUnionMember3(unionMember3) + val responseContentPart = ResponseContentPart.ofContentPartChart(contentPartChart) - assertThat(responseContentPart.unionMember0()).isEmpty - assertThat(responseContentPart.unionMember1()).isEmpty - assertThat(responseContentPart.unionMember2()).isEmpty - assertThat(responseContentPart.unionMember3()).contains(unionMember3) - assertThat(responseContentPart.unionMember4()).isEmpty - assertThat(responseContentPart.unionMember5()).isEmpty + assertThat(responseContentPart.contentPartText()).isEmpty + assertThat(responseContentPart.contentPartThinking()).isEmpty + assertThat(responseContentPart.contentPartStructuredAction()).isEmpty + assertThat(responseContentPart.contentPartChart()).contains(contentPartChart) + assertThat(responseContentPart.contentPartSuggestedActions()).isEmpty + assertThat(responseContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember3Roundtrip() { + fun ofContentPartChartRoundtrip() { val jsonMapper = jsonMapper() val responseContentPart = - ResponseContentPart.ofUnionMember3( - ResponseContentPart.UnionMember3.builder() + ResponseContentPart.ofContentPartChart( + ResponseContentPart.ContentPartChart.builder() .payload( ChartPayload.builder() .chartId("chart_revenue_growth") @@ -296,7 +298,7 @@ internal class ResponseContentPartTest { ) .build() ) - .type(ResponseContentPart.UnionMember3.Type.CHART) + .type(ResponseContentPart.ContentPartChart.Type.CHART) .build() ) @@ -310,9 +312,9 @@ internal class ResponseContentPartTest { } @Test - fun ofUnionMember4() { - val unionMember4 = - ResponseContentPart.UnionMember4.builder() + fun ofContentPartSuggestedActions() { + val contentPartSuggestedActions = + ResponseContentPart.ContentPartSuggestedActions.builder() .payload( SuggestedActionsPayload.builder() .addActionButton( @@ -349,25 +351,27 @@ internal class ResponseContentPartTest { ) .build() ) - .type(ResponseContentPart.UnionMember4.Type.SUGGESTED_ACTIONS) + .type(ResponseContentPart.ContentPartSuggestedActions.Type.SUGGESTED_ACTIONS) .build() - val responseContentPart = ResponseContentPart.ofUnionMember4(unionMember4) - - assertThat(responseContentPart.unionMember0()).isEmpty - assertThat(responseContentPart.unionMember1()).isEmpty - assertThat(responseContentPart.unionMember2()).isEmpty - assertThat(responseContentPart.unionMember3()).isEmpty - assertThat(responseContentPart.unionMember4()).contains(unionMember4) - assertThat(responseContentPart.unionMember5()).isEmpty + val responseContentPart = + ResponseContentPart.ofContentPartSuggestedActions(contentPartSuggestedActions) + + assertThat(responseContentPart.contentPartText()).isEmpty + assertThat(responseContentPart.contentPartThinking()).isEmpty + assertThat(responseContentPart.contentPartStructuredAction()).isEmpty + assertThat(responseContentPart.contentPartChart()).isEmpty + assertThat(responseContentPart.contentPartSuggestedActions()) + .contains(contentPartSuggestedActions) + assertThat(responseContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember4Roundtrip() { + fun ofContentPartSuggestedActionsRoundtrip() { val jsonMapper = jsonMapper() val responseContentPart = - ResponseContentPart.ofUnionMember4( - ResponseContentPart.UnionMember4.builder() + ResponseContentPart.ofContentPartSuggestedActions( + ResponseContentPart.ContentPartSuggestedActions.builder() .payload( SuggestedActionsPayload.builder() .addActionButton( @@ -404,7 +408,7 @@ internal class ResponseContentPartTest { ) .build() ) - .type(ResponseContentPart.UnionMember4.Type.SUGGESTED_ACTIONS) + .type(ResponseContentPart.ContentPartSuggestedActions.Type.SUGGESTED_ACTIONS) .build() ) @@ -418,31 +422,31 @@ internal class ResponseContentPartTest { } @Test - fun ofUnionMember5() { - val unionMember5 = - ResponseContentPart.UnionMember5.builder() + fun ofContentPartCustom() { + val contentPartCustom = + ResponseContentPart.ContentPartCustom.builder() .payload(JsonValue.from(mapOf())) - .type(ResponseContentPart.UnionMember5.Type.CUSTOM) + .type(ResponseContentPart.ContentPartCustom.Type.CUSTOM) .build() - val responseContentPart = ResponseContentPart.ofUnionMember5(unionMember5) + val responseContentPart = ResponseContentPart.ofContentPartCustom(contentPartCustom) - assertThat(responseContentPart.unionMember0()).isEmpty - assertThat(responseContentPart.unionMember1()).isEmpty - assertThat(responseContentPart.unionMember2()).isEmpty - assertThat(responseContentPart.unionMember3()).isEmpty - assertThat(responseContentPart.unionMember4()).isEmpty - assertThat(responseContentPart.unionMember5()).contains(unionMember5) + assertThat(responseContentPart.contentPartText()).isEmpty + assertThat(responseContentPart.contentPartThinking()).isEmpty + assertThat(responseContentPart.contentPartStructuredAction()).isEmpty + assertThat(responseContentPart.contentPartChart()).isEmpty + assertThat(responseContentPart.contentPartSuggestedActions()).isEmpty + assertThat(responseContentPart.contentPartCustom()).contains(contentPartCustom) } @Test - fun ofUnionMember5Roundtrip() { + fun ofContentPartCustomRoundtrip() { val jsonMapper = jsonMapper() val responseContentPart = - ResponseContentPart.ofUnionMember5( - ResponseContentPart.UnionMember5.builder() + ResponseContentPart.ofContentPartCustom( + ResponseContentPart.ContentPartCustom.builder() .payload(JsonValue.from(mapOf())) - .type(ResponseContentPart.UnionMember5.Type.CUSTOM) + .type(ResponseContentPart.ContentPartCustom.Type.CUSTOM) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentTest.kt similarity index 67% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentTest.kt index 8f2ba194..e2fe0877 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseContentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -14,19 +14,19 @@ internal class ResponseContentTest { val responseContent = ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() assertThat(responseContent.parts()) .containsExactly( - ResponseContentPart.ofUnionMember0( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ofContentPartText( + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) ) @@ -38,9 +38,9 @@ internal class ResponseContentTest { val responseContent = ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdParamsTest.kt index 6acce31e..8c41d175 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt index e2a747c8..1e1b24c8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseGetResponseByIdResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -46,9 +46,9 @@ internal class ResponseGetResponseByIdResponseTest { .content( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -98,9 +98,9 @@ internal class ResponseGetResponseByIdResponseTest { .content( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -152,9 +152,9 @@ internal class ResponseGetResponseByIdResponseTest { .content( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseTest.kt index 8010504d..52454883 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/responses/ResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.responses +package com.clearstreet.api.models.v1.omniai.responses -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -21,9 +21,9 @@ internal class ResponseTest { .content( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -46,9 +46,9 @@ internal class ResponseTest { .contains( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -76,9 +76,9 @@ internal class ResponseTest { .content( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateMessageResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateMessageResponseTest.kt index 6e388eb2..45799c04 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateMessageResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateMessageResponseTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateThreadResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateThreadResponseTest.kt index b9d34749..be29d01a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/CreateThreadResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/CreateThreadResponseTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPartTest.kt similarity index 71% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPartTest.kt index a7d8c5e7..2ab61e57 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPartTest.kt @@ -1,26 +1,26 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads - -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.errors.ClearStreetInvalidDataException -import com.clear_street.api.models.v1.omniai.ActionButton -import com.clear_street.api.models.v1.omniai.ChartPayload -import com.clear_street.api.models.v1.omniai.ChartPoint -import com.clear_street.api.models.v1.omniai.ChartSeries -import com.clear_street.api.models.v1.omniai.DataChart -import com.clear_street.api.models.v1.omniai.PrefillOrderAction -import com.clear_street.api.models.v1.omniai.PromptButtonAction -import com.clear_street.api.models.v1.omniai.StructuredAction -import com.clear_street.api.models.v1.omniai.StructuredActionButtonAction -import com.clear_street.api.models.v1.omniai.SuggestedActionsPayload -import com.clear_street.api.models.v1.orders.NewOrderRequest -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TrailingOffsetType +package com.clearstreet.api.models.v1.omniai.threads + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.omniai.ActionButton +import com.clearstreet.api.models.v1.omniai.ChartPayload +import com.clearstreet.api.models.v1.omniai.ChartPoint +import com.clearstreet.api.models.v1.omniai.ChartSeries +import com.clearstreet.api.models.v1.omniai.DataChart +import com.clearstreet.api.models.v1.omniai.PrefillOrderAction +import com.clearstreet.api.models.v1.omniai.PromptButtonAction +import com.clearstreet.api.models.v1.omniai.StructuredAction +import com.clearstreet.api.models.v1.omniai.StructuredActionButtonAction +import com.clearstreet.api.models.v1.omniai.SuggestedActionsPayload +import com.clearstreet.api.models.v1.orders.NewOrderRequest +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -32,30 +32,30 @@ import org.junit.jupiter.params.provider.EnumSource internal class MessageContentPartTest { @Test - fun ofUnionMember0() { - val unionMember0 = - MessageContentPart.UnionMember0.builder() + fun ofContentPartText() { + val contentPartText = + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() - val messageContentPart = MessageContentPart.ofUnionMember0(unionMember0) + val messageContentPart = MessageContentPart.ofContentPartText(contentPartText) - assertThat(messageContentPart.unionMember0()).contains(unionMember0) - assertThat(messageContentPart.unionMember1()).isEmpty - assertThat(messageContentPart.unionMember2()).isEmpty - assertThat(messageContentPart.unionMember3()).isEmpty - assertThat(messageContentPart.unionMember4()).isEmpty + assertThat(messageContentPart.contentPartText()).contains(contentPartText) + assertThat(messageContentPart.contentPartStructuredAction()).isEmpty + assertThat(messageContentPart.contentPartChart()).isEmpty + assertThat(messageContentPart.contentPartSuggestedActions()).isEmpty + assertThat(messageContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember0Roundtrip() { + fun ofContentPartTextRoundtrip() { val jsonMapper = jsonMapper() val messageContentPart = - MessageContentPart.ofUnionMember0( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ofContentPartText( + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) @@ -69,9 +69,9 @@ internal class MessageContentPartTest { } @Test - fun ofUnionMember1() { - val unionMember1 = - MessageContentPart.UnionMember1.builder() + fun ofContentPartStructuredAction() { + val contentPartStructuredAction = + MessageContentPart.ContentPartStructuredAction.builder() .action( StructuredAction.PrefillOrder.builder() .prefillOrder( @@ -103,24 +103,26 @@ internal class MessageContentPartTest { .build() ) .actionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .type(MessageContentPart.UnionMember1.Type.STRUCTURED_ACTION) + .type(MessageContentPart.ContentPartStructuredAction.Type.STRUCTURED_ACTION) .build() - val messageContentPart = MessageContentPart.ofUnionMember1(unionMember1) - - assertThat(messageContentPart.unionMember0()).isEmpty - assertThat(messageContentPart.unionMember1()).contains(unionMember1) - assertThat(messageContentPart.unionMember2()).isEmpty - assertThat(messageContentPart.unionMember3()).isEmpty - assertThat(messageContentPart.unionMember4()).isEmpty + val messageContentPart = + MessageContentPart.ofContentPartStructuredAction(contentPartStructuredAction) + + assertThat(messageContentPart.contentPartText()).isEmpty + assertThat(messageContentPart.contentPartStructuredAction()) + .contains(contentPartStructuredAction) + assertThat(messageContentPart.contentPartChart()).isEmpty + assertThat(messageContentPart.contentPartSuggestedActions()).isEmpty + assertThat(messageContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember1Roundtrip() { + fun ofContentPartStructuredActionRoundtrip() { val jsonMapper = jsonMapper() val messageContentPart = - MessageContentPart.ofUnionMember1( - MessageContentPart.UnionMember1.builder() + MessageContentPart.ofContentPartStructuredAction( + MessageContentPart.ContentPartStructuredAction.builder() .action( StructuredAction.PrefillOrder.builder() .prefillOrder( @@ -156,7 +158,7 @@ internal class MessageContentPartTest { .build() ) .actionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .type(MessageContentPart.UnionMember1.Type.STRUCTURED_ACTION) + .type(MessageContentPart.ContentPartStructuredAction.Type.STRUCTURED_ACTION) .build() ) @@ -170,9 +172,9 @@ internal class MessageContentPartTest { } @Test - fun ofUnionMember2() { - val unionMember2 = - MessageContentPart.UnionMember2.builder() + fun ofContentPartChart() { + val contentPartChart = + MessageContentPart.ContentPartChart.builder() .payload( ChartPayload.builder() .chartId("chart_revenue_growth") @@ -205,24 +207,24 @@ internal class MessageContentPartTest { ) .build() ) - .type(MessageContentPart.UnionMember2.Type.CHART) + .type(MessageContentPart.ContentPartChart.Type.CHART) .build() - val messageContentPart = MessageContentPart.ofUnionMember2(unionMember2) + val messageContentPart = MessageContentPart.ofContentPartChart(contentPartChart) - assertThat(messageContentPart.unionMember0()).isEmpty - assertThat(messageContentPart.unionMember1()).isEmpty - assertThat(messageContentPart.unionMember2()).contains(unionMember2) - assertThat(messageContentPart.unionMember3()).isEmpty - assertThat(messageContentPart.unionMember4()).isEmpty + assertThat(messageContentPart.contentPartText()).isEmpty + assertThat(messageContentPart.contentPartStructuredAction()).isEmpty + assertThat(messageContentPart.contentPartChart()).contains(contentPartChart) + assertThat(messageContentPart.contentPartSuggestedActions()).isEmpty + assertThat(messageContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember2Roundtrip() { + fun ofContentPartChartRoundtrip() { val jsonMapper = jsonMapper() val messageContentPart = - MessageContentPart.ofUnionMember2( - MessageContentPart.UnionMember2.builder() + MessageContentPart.ofContentPartChart( + MessageContentPart.ContentPartChart.builder() .payload( ChartPayload.builder() .chartId("chart_revenue_growth") @@ -255,7 +257,7 @@ internal class MessageContentPartTest { ) .build() ) - .type(MessageContentPart.UnionMember2.Type.CHART) + .type(MessageContentPart.ContentPartChart.Type.CHART) .build() ) @@ -269,9 +271,9 @@ internal class MessageContentPartTest { } @Test - fun ofUnionMember3() { - val unionMember3 = - MessageContentPart.UnionMember3.builder() + fun ofContentPartSuggestedActions() { + val contentPartSuggestedActions = + MessageContentPart.ContentPartSuggestedActions.builder() .payload( SuggestedActionsPayload.builder() .addActionButton( @@ -308,24 +310,26 @@ internal class MessageContentPartTest { ) .build() ) - .type(MessageContentPart.UnionMember3.Type.SUGGESTED_ACTIONS) + .type(MessageContentPart.ContentPartSuggestedActions.Type.SUGGESTED_ACTIONS) .build() - val messageContentPart = MessageContentPart.ofUnionMember3(unionMember3) - - assertThat(messageContentPart.unionMember0()).isEmpty - assertThat(messageContentPart.unionMember1()).isEmpty - assertThat(messageContentPart.unionMember2()).isEmpty - assertThat(messageContentPart.unionMember3()).contains(unionMember3) - assertThat(messageContentPart.unionMember4()).isEmpty + val messageContentPart = + MessageContentPart.ofContentPartSuggestedActions(contentPartSuggestedActions) + + assertThat(messageContentPart.contentPartText()).isEmpty + assertThat(messageContentPart.contentPartStructuredAction()).isEmpty + assertThat(messageContentPart.contentPartChart()).isEmpty + assertThat(messageContentPart.contentPartSuggestedActions()) + .contains(contentPartSuggestedActions) + assertThat(messageContentPart.contentPartCustom()).isEmpty } @Test - fun ofUnionMember3Roundtrip() { + fun ofContentPartSuggestedActionsRoundtrip() { val jsonMapper = jsonMapper() val messageContentPart = - MessageContentPart.ofUnionMember3( - MessageContentPart.UnionMember3.builder() + MessageContentPart.ofContentPartSuggestedActions( + MessageContentPart.ContentPartSuggestedActions.builder() .payload( SuggestedActionsPayload.builder() .addActionButton( @@ -362,7 +366,7 @@ internal class MessageContentPartTest { ) .build() ) - .type(MessageContentPart.UnionMember3.Type.SUGGESTED_ACTIONS) + .type(MessageContentPart.ContentPartSuggestedActions.Type.SUGGESTED_ACTIONS) .build() ) @@ -376,30 +380,30 @@ internal class MessageContentPartTest { } @Test - fun ofUnionMember4() { - val unionMember4 = - MessageContentPart.UnionMember4.builder() + fun ofContentPartCustom() { + val contentPartCustom = + MessageContentPart.ContentPartCustom.builder() .payload(JsonValue.from(mapOf())) - .type(MessageContentPart.UnionMember4.Type.CUSTOM) + .type(MessageContentPart.ContentPartCustom.Type.CUSTOM) .build() - val messageContentPart = MessageContentPart.ofUnionMember4(unionMember4) + val messageContentPart = MessageContentPart.ofContentPartCustom(contentPartCustom) - assertThat(messageContentPart.unionMember0()).isEmpty - assertThat(messageContentPart.unionMember1()).isEmpty - assertThat(messageContentPart.unionMember2()).isEmpty - assertThat(messageContentPart.unionMember3()).isEmpty - assertThat(messageContentPart.unionMember4()).contains(unionMember4) + assertThat(messageContentPart.contentPartText()).isEmpty + assertThat(messageContentPart.contentPartStructuredAction()).isEmpty + assertThat(messageContentPart.contentPartChart()).isEmpty + assertThat(messageContentPart.contentPartSuggestedActions()).isEmpty + assertThat(messageContentPart.contentPartCustom()).contains(contentPartCustom) } @Test - fun ofUnionMember4Roundtrip() { + fun ofContentPartCustomRoundtrip() { val jsonMapper = jsonMapper() val messageContentPart = - MessageContentPart.ofUnionMember4( - MessageContentPart.UnionMember4.builder() + MessageContentPart.ofContentPartCustom( + MessageContentPart.ContentPartCustom.builder() .payload(JsonValue.from(mapOf())) - .type(MessageContentPart.UnionMember4.Type.CUSTOM) + .type(MessageContentPart.ContentPartCustom.Type.CUSTOM) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentTest.kt similarity index 67% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentTest.kt index 76450642..9e06d3b8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageContentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -14,19 +14,19 @@ internal class MessageContentTest { val messageContent = MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() assertThat(messageContent.parts()) .containsExactly( - MessageContentPart.ofUnionMember0( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ofContentPartText( + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) ) @@ -38,9 +38,9 @@ internal class MessageContentTest { val messageContent = MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageTest.kt similarity index 83% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageTest.kt index 32e84cf1..75b910f7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/MessageTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.omniai.responses.ErrorStatus +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.omniai.responses.ErrorStatus import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -19,9 +19,9 @@ internal class MessageTest { .content( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -45,9 +45,9 @@ internal class MessageTest { .isEqualTo( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -76,9 +76,9 @@ internal class MessageTest { .content( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt index 7dfdf172..14a0d666 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt index 3386b33c..265b51f8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateMessageResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadParamsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadParamsTest.kt index 6be47305..1505b2a5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt index 9d28b6aa..ef14b402 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadCreateThreadResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt index 1495cee2..59e5f8c2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt index b2aff257..68052725 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetMessagesResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.responses.ErrorStatus +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.omniai.responses.ErrorStatus import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -44,9 +44,9 @@ internal class ThreadGetMessagesResponseTest { .content( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -97,9 +97,9 @@ internal class ThreadGetMessagesResponseTest { .content( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -152,9 +152,9 @@ internal class ThreadGetMessagesResponseTest { .content( MessageContent.builder() .addPart( - MessageContentPart.UnionMember0.builder() + MessageContentPart.ContentPartText.builder() .text("text") - .type(MessageContentPart.UnionMember0.Type.TEXT) + .type(MessageContentPart.ContentPartText.Type.TEXT) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdParamsTest.kt index 61a4e054..961b02d9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt index e28d1abd..4ff314e9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadByIdResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseParamsTest.kt index bb0eb114..2b7a1063 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt index 0f7c1058..d55e6064 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.omniai.responses.ErrorStatus -import com.clear_street.api.models.v1.omniai.responses.Response -import com.clear_street.api.models.v1.omniai.responses.ResponseContent -import com.clear_street.api.models.v1.omniai.responses.ResponseContentPart -import com.clear_street.api.models.v1.omniai.responses.ResponseStatus +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.omniai.responses.ErrorStatus +import com.clearstreet.api.models.v1.omniai.responses.Response +import com.clearstreet.api.models.v1.omniai.responses.ResponseContent +import com.clearstreet.api.models.v1.omniai.responses.ResponseContentPart +import com.clearstreet.api.models.v1.omniai.responses.ResponseStatus import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -51,9 +51,9 @@ internal class ThreadGetThreadResponseResponseTest { .content( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -103,9 +103,9 @@ internal class ThreadGetThreadResponseResponseTest { .content( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() @@ -157,9 +157,9 @@ internal class ThreadGetThreadResponseResponseTest { .content( ResponseContent.builder() .addPart( - ResponseContentPart.UnionMember0.builder() + ResponseContentPart.ContentPartText.builder() .text("text") - .type(ResponseContentPart.UnionMember0.Type.TEXT) + .type(ResponseContentPart.ContentPartText.Type.TEXT) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsParamsTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsParamsTest.kt index 407cf67e..27bb7f63 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt index d785db27..87a90fd2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadTest.kt similarity index 92% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadTest.kt index d17f34ec..1bcdd29e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/omniai/threads/ThreadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.omniai.threads +package com.clearstreet.api.models.v1.omniai.threads -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequestTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/CancelOrderRequestTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequestTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/CancelOrderRequestTest.kt index bd9eb1de..4660b68e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/CancelOrderRequestTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/CancelOrderRequestTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/ExecutionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/ExecutionTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/ExecutionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/ExecutionTest.kt index 2df0cce6..7dbe9c30 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/ExecutionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/ExecutionTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequestTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequestTest.kt index 4e98f28c..1bcc6e1f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/NewOrderRequestTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequestTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt similarity index 87% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt index 9ea9e9c5..04d0a552 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -44,7 +44,10 @@ internal class OrderCancelAllOpenOrdersParamsTest { assertThat(queryParams) .isEqualTo( QueryParams.builder() - .put("instrument_ids[0]", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put( + "instrument_ids", + listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").joinToString(","), + ) .put("instrument_type", "COMMON_STOCK") .put("side", "BUY") .put("type", "MARKET") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt index a0f9d904..9ce4a577 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt index 0900ee59..b86dfe17 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt index 86758cbc..e76baff7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParamsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParamsTest.kt index fdbb15d2..7588dd61 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsResponseTest.kt index 2b9fa412..24e6ee13 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetExecutionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt index f674ac2a..69f23b3c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt index 0b86ff00..5cf43b6a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParamsTest.kt similarity index 77% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParamsTest.kt index 2307279d..dc269f3f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -21,7 +21,7 @@ internal class OrderGetOrdersParamsTest { .addStatus(OrderGetOrdersParams.Status.PENDING_NEW) .symbol("symbol") .to(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .underlyingInstrumentIds("underlying_instrument_ids") + .addUnderlyingInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -47,7 +47,7 @@ internal class OrderGetOrdersParamsTest { .addStatus(OrderGetOrdersParams.Status.PENDING_NEW) .symbol("symbol") .to(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .underlyingInstrumentIds("underlying_instrument_ids") + .addUnderlyingInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val queryParams = params._queryParams() @@ -56,14 +56,20 @@ internal class OrderGetOrdersParamsTest { .isEqualTo( QueryParams.builder() .put("from", "2019-12-27T18:11:19.117Z") - .put("instrument_ids[0]", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put( + "instrument_ids", + listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").joinToString(","), + ) .put("instrument_type", "COMMON_STOCK") .put("page_size", "1") .put("page_token", "U3RhaW5sZXNzIHJvY2tz") - .put("status[0]", "PENDING_NEW") + .put("status", listOf("PENDING_NEW").joinToString(",")) .put("symbol", "symbol") .put("to", "2019-12-27T18:11:19.117Z") - .put("underlying_instrument_ids", "underlying_instrument_ids") + .put( + "underlying_instrument_ids", + listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").joinToString(","), + ) .build() ) } diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponseTest.kt index d43a10bf..c651a89f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderGetOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParamsTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParamsTest.kt index 89ed29f7..5df33c3d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponseTest.kt index e0b410de..87fcc7ca 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderReplaceOrderResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt similarity index 99% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt index 972268e4..7c64b87a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt index 78a315ac..70d6dd1f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderTest.kt index 1bd4cbb5..5e53327d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/orders/OrderTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.orders +package com.clearstreet.api.models.v1.orders -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import kotlin.jvm.optionals.getOrNull diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt index 7fcfe222..dfddaf53 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt index 16e823bc..c3001f14 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionCancelPositionInstructionResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParamsTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParamsTest.kt index d0a63be1..1a257657 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponseTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponseTest.kt index 6a98a4f3..5a05d6b7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponseTest.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.orders.Order -import com.clear_street.api.models.v1.orders.OrderStatus -import com.clear_street.api.models.v1.orders.OrderType -import com.clear_street.api.models.v1.orders.QueueState -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TimeInForce -import com.clear_street.api.models.v1.orders.TrailingOffsetType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType +import com.clearstreet.api.models.v1.orders.Order +import com.clearstreet.api.models.v1.orders.OrderStatus +import com.clearstreet.api.models.v1.orders.OrderType +import com.clearstreet.api.models.v1.orders.QueueState +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TimeInForce +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsParamsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsParamsTest.kt index f00129ae..bf86cfd5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponseTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponseTest.kt index 5c3b59d2..ac4a2706 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionClosePositionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponseTest.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.orders.Order -import com.clear_street.api.models.v1.orders.OrderStatus -import com.clear_street.api.models.v1.orders.OrderType -import com.clear_street.api.models.v1.orders.QueueState -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TimeInForce -import com.clear_street.api.models.v1.orders.TrailingOffsetType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType +import com.clearstreet.api.models.v1.orders.Order +import com.clearstreet.api.models.v1.orders.OrderStatus +import com.clearstreet.api.models.v1.orders.OrderType +import com.clearstreet.api.models.v1.orders.QueueState +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TimeInForce +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt index a5208304..f4844ef4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt index 1bfc832a..6ad6951f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParamsTest.kt similarity index 87% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParamsTest.kt index 8c398824..d1850b64 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -46,7 +46,10 @@ internal class PositionGetPositionsParamsTest { assertThat(queryParams) .isEqualTo( QueryParams.builder() - .put("instrument_ids[0]", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put( + "instrument_ids", + listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").joinToString(","), + ) .put("page_size", "1") .put("page_token", "U3RhaW5sZXNzIHJvY2tz") .put("sort_by", "SYMBOL") diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponseTest.kt index c0000d83..127ae7ba 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionGetPositionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponseTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionTest.kt index ead7e172..e5a9b76d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionInstructionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt similarity index 98% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt index 69410b41..010e4599 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt index cf94d912..14c56767 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionTest.kt index 347b2353..7a32aa05 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/positions/PositionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.positions +package com.clearstreet.api.models.v1.positions -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.SecurityType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemDataTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/AddWatchlistItemDataTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemDataTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/AddWatchlistItemDataTest.kt index 448267a1..1ce4b64b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/AddWatchlistItemDataTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/AddWatchlistItemDataTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt index 6466d1cd..38b41519 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt index 0d9e7ac0..ec191b08 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt index bbc8b6a9..afb82027 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt index cdd42792..61eff794 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistCreateWatchlistResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt index a033264e..faef20a0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt new file mode 100644 index 00000000..2dfab752 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistItemResponseTest.kt @@ -0,0 +1,104 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class WatchlistDeleteWatchlistItemResponseTest { + + @Test + fun create() { + val watchlistDeleteWatchlistItemResponse = + WatchlistDeleteWatchlistItemResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .build() + + assertThat(watchlistDeleteWatchlistItemResponse.metadata()) + .isEqualTo( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + assertThat(watchlistDeleteWatchlistItemResponse.error()) + .contains( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val watchlistDeleteWatchlistItemResponse = + WatchlistDeleteWatchlistItemResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .build() + + val roundtrippedWatchlistDeleteWatchlistItemResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(watchlistDeleteWatchlistItemResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedWatchlistDeleteWatchlistItemResponse) + .isEqualTo(watchlistDeleteWatchlistItemResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt index 1443629e..c11a847c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt new file mode 100644 index 00000000..358facdd --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDeleteWatchlistResponseTest.kt @@ -0,0 +1,104 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.watchlist + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class WatchlistDeleteWatchlistResponseTest { + + @Test + fun create() { + val watchlistDeleteWatchlistResponse = + WatchlistDeleteWatchlistResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .build() + + assertThat(watchlistDeleteWatchlistResponse.metadata()) + .isEqualTo( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + assertThat(watchlistDeleteWatchlistResponse.error()) + .contains( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val watchlistDeleteWatchlistResponse = + WatchlistDeleteWatchlistResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .build() + + val roundtrippedWatchlistDeleteWatchlistResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(watchlistDeleteWatchlistResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedWatchlistDeleteWatchlistResponse) + .isEqualTo(watchlistDeleteWatchlistResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetailTest.kt similarity index 97% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetailTest.kt index b06ffc65..57f77dfa 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.instruments.Instrument +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.SecurityType +import com.clearstreet.api.models.v1.instruments.Instrument import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistEntryTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntryTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistEntryTest.kt index c8851685..3c88dd99 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistEntryTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.jsonMapper +import com.clearstreet.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt similarity index 93% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt index 8412fc6b..dcb095e9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index d6bff2a4..4e9c9dc4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata -import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.instruments.Instrument +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SecurityType +import com.clearstreet.api.models.v1.instruments.Instrument import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt similarity index 91% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt index 74b4a276..03cf95e4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.http.QueryParams +import com.clearstreet.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt similarity index 95% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt index 3541d5b1..880377c9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistsResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.ApiError -import com.clear_street.api.models.ResponseMetadata +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntryTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntryTest.kt index 366b354f..8741bcdc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.watchlist +package com.clearstreet.api.models.v1.watchlist -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.SecurityType -import com.clear_street.api.models.v1.instruments.Instrument +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.SecurityType +import com.clearstreet.api.models.v1.instruments.Instrument import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt similarity index 83% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt index c0842912..3c6d5089 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.models.v1.websocket +package com.clearstreet.api.models.v1.websocket import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/ErrorHandlingTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ErrorHandlingTest.kt similarity index 94% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/ErrorHandlingTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ErrorHandlingTest.kt index efd8070a..7c31c0bd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/ErrorHandlingTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ErrorHandlingTest.kt @@ -1,22 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services - -import com.clear_street.api.client.ClearStreetClient -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.core.JsonValue -import com.clear_street.api.core.http.Headers -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.errors.BadRequestException -import com.clear_street.api.errors.ClearStreetException -import com.clear_street.api.errors.InternalServerException -import com.clear_street.api.errors.NotFoundException -import com.clear_street.api.errors.PermissionDeniedException -import com.clear_street.api.errors.RateLimitException -import com.clear_street.api.errors.UnauthorizedException -import com.clear_street.api.errors.UnexpectedStatusCodeException -import com.clear_street.api.errors.UnprocessableEntityException -import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams +package com.clearstreet.api.services + +import com.clearstreet.api.client.ClearStreetClient +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.errors.BadRequestException +import com.clearstreet.api.errors.ClearStreetException +import com.clearstreet.api.errors.InternalServerException +import com.clearstreet.api.errors.NotFoundException +import com.clearstreet.api.errors.PermissionDeniedException +import com.clearstreet.api.errors.RateLimitException +import com.clearstreet.api.errors.UnauthorizedException +import com.clearstreet.api.errors.UnexpectedStatusCodeException +import com.clearstreet.api.errors.UnprocessableEntityException +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams import com.github.tomakehurst.wiremock.client.WireMock.anyUrl import com.github.tomakehurst.wiremock.client.WireMock.get import com.github.tomakehurst.wiremock.client.WireMock.status diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/ServiceParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt similarity index 89% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/ServiceParamsTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt index e4efa442..aa126f1f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/ServiceParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services +package com.clearstreet.api.services -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.clearstreet.api.client.ClearStreetClient +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams import com.github.tomakehurst.wiremock.client.WireMock.anyUrl import com.github.tomakehurst.wiremock.client.WireMock.equalTo import com.github.tomakehurst.wiremock.client.WireMock.get diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt similarity index 86% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt index ced98004..87471ceb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/AccountServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams -import com.clear_street.api.models.v1.accounts.RiskSettings +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams +import com.clearstreet.api.models.v1.accounts.RiskSettings import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncTest.kt similarity index 82% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncTest.kt index 9bcb894c..a7aff11c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/ApiVersionServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsyncTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsyncTest.kt index 13848a37..871cc855 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsyncTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendar.MarketType +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clearstreet.api.models.v1.calendar.MarketType import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncTest.kt similarity index 86% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncTest.kt index 30c23a4c..8a6a8851 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentDataServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncTest.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instrumentdata.AllEventsEventType -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.instrumentdata.AllEventsEventType +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncTest.kt similarity index 87% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncTest.kt index ebf34322..9ec3a7c5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/InstrumentServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncTest.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instruments.ContractType -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.instruments.ContractType +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsParams import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt index 570bcd4e..f9107db4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/OrderServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsParams +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdParams +import com.clearstreet.api.models.v1.orders.OrderGetOrdersParams +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderParams +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersParams +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side import java.time.OffsetDateTime import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -111,7 +111,7 @@ internal class OrderServiceAsyncTest { .addStatus(OrderGetOrdersParams.Status.PENDING_NEW) .symbol("symbol") .to(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .underlyingInstrumentIds("underlying_instrument_ids") + .addUnderlyingInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncTest.kt similarity index 86% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncTest.kt index 68464bdf..8b7df1d6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/PositionServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncTest.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionParams -import com.clear_street.api.models.v1.positions.PositionClosePositionParams -import com.clear_street.api.models.v1.positions.PositionClosePositionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionsParams -import com.clear_street.api.models.v1.positions.PositionInstructionType -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionsParams +import com.clearstreet.api.models.v1.positions.PositionInstructionType +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncTest.kt index 6e94f28d..fe8e1b93 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WatchlistServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt index 9b3199ff..8c1a09b3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/WebsocketServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1 +package com.clearstreet.api.services.async.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt similarity index 79% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt index afceaa34..8a8cb95b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.instrumentdata +package com.clearstreet.api.services.async.v1.instrumentdata -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt similarity index 84% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt index 4fee1f0d..cb68f760 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.instrumentdata +package com.clearstreet.api.services.async.v1.instrumentdata -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt index b2e0c692..4f49dad8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai +package com.clearstreet.api.services.async.v1.omniai -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.omniai.EntitlementCode +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncTest.kt index b4ce3e62..7e3620bb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/MessageServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai +package com.clearstreet.api.services.async.v1.omniai -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.core.JsonValue -import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdParams -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdParams +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt similarity index 82% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt index 3373e0a5..c70397a1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai +package com.clearstreet.api.services.async.v1.omniai -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseParams -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt index b6ca96b3..62b7e470 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.async.v1.omniai - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams +package com.clearstreet.api.services.async.v1.omniai + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt similarity index 84% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt index 8029a512..3ef13b67 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/AccountServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesParams -import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams -import com.clear_street.api.models.v1.accounts.AccountGetPortfolioHistoryParams -import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams -import com.clear_street.api.models.v1.accounts.RiskSettings +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams +import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams +import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryParams +import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams +import com.clearstreet.api.models.v1.accounts.RiskSettings import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceTest.kt similarity index 80% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceTest.kt index f1179b50..8e5a4350 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/ApiVersionServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceTest.kt similarity index 79% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceTest.kt index 2c6c4468..d062a347 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/CalendarServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams -import com.clear_street.api.models.v1.calendar.MarketType +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams +import com.clearstreet.api.models.v1.calendar.MarketType import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceTest.kt index f631c275..2d10aa2a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentDataServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceTest.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instrumentdata.AllEventsEventType -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams -import com.clear_street.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.instrumentdata.AllEventsEventType +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentAnalystConsensusParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentBalanceSheetStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentCashFlowStatementsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams +import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceTest.kt similarity index 86% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceTest.kt index ad774a05..f6923e9a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/InstrumentServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceTest.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instruments.ContractType -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentByIdParams -import com.clear_street.api.models.v1.instruments.InstrumentGetInstrumentsParams -import com.clear_street.api.models.v1.instruments.InstrumentGetOptionContractsParams -import com.clear_street.api.models.v1.instruments.InstrumentSearchInstrumentsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.instruments.ContractType +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsParams +import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsParams +import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsParams import java.time.LocalDate import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt similarity index 88% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt index fab2ceb6..2252a370 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/OrderServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.orders.OrderCancelAllOpenOrdersParams -import com.clear_street.api.models.v1.orders.OrderCancelOpenOrderParams -import com.clear_street.api.models.v1.orders.OrderGetExecutionsParams -import com.clear_street.api.models.v1.orders.OrderGetOrderByIdParams -import com.clear_street.api.models.v1.orders.OrderGetOrdersParams -import com.clear_street.api.models.v1.orders.OrderReplaceOrderParams -import com.clear_street.api.models.v1.orders.OrderSubmitOrdersParams -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams +import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams +import com.clearstreet.api.models.v1.orders.OrderGetExecutionsParams +import com.clearstreet.api.models.v1.orders.OrderGetOrderByIdParams +import com.clearstreet.api.models.v1.orders.OrderGetOrdersParams +import com.clearstreet.api.models.v1.orders.OrderReplaceOrderParams +import com.clearstreet.api.models.v1.orders.OrderSubmitOrdersParams +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side import java.time.OffsetDateTime import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -107,7 +107,7 @@ internal class OrderServiceTest { .addStatus(OrderGetOrdersParams.Status.PENDING_NEW) .symbol("symbol") .to(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .underlyingInstrumentIds("underlying_instrument_ids") + .addUnderlyingInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceTest.kt similarity index 85% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceTest.kt index bd56576f..250ddac6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/PositionServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceTest.kt @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionParams -import com.clear_street.api.models.v1.positions.PositionClosePositionParams -import com.clear_street.api.models.v1.positions.PositionClosePositionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionInstructionsParams -import com.clear_street.api.models.v1.positions.PositionGetPositionsParams -import com.clear_street.api.models.v1.positions.PositionInstructionType -import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionParams +import com.clearstreet.api.models.v1.positions.PositionClosePositionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsParams +import com.clearstreet.api.models.v1.positions.PositionGetPositionsParams +import com.clearstreet.api.models.v1.positions.PositionInstructionType +import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceTest.kt similarity index 87% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceTest.kt index 2d393748..cf53593d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WatchlistServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.watchlist.WatchlistAddWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistCreateWatchlistParams -import com.clear_street.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams -import com.clear_street.api.models.v1.watchlist.WatchlistGetWatchlistsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistParams +import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams +import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt similarity index 79% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt index 444f9510..a3a34297 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/WebsocketServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1 +package com.clearstreet.api.services.blocking.v1 -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt similarity index 78% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt index 1a37fd1f..069fa7c4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.instrumentdata +package com.clearstreet.api.services.blocking.v1.instrumentdata -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams -import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams +import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt similarity index 83% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt index ebd122e6..a3aab3d9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.instrumentdata +package com.clearstreet.api.services.blocking.v1.instrumentdata -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.instrumentdata.news.NewsGetNewsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceTest.kt similarity index 84% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceTest.kt index eb262579..f338bd35 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/EntitlementServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai +package com.clearstreet.api.services.blocking.v1.omniai -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCode -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams -import com.clear_street.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.omniai.EntitlementCode +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams +import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceTest.kt similarity index 80% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceTest.kt index 7f77ece0..e01d82ab 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/MessageServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai +package com.clearstreet.api.services.blocking.v1.omniai -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.core.JsonValue -import com.clear_street.api.models.v1.omniai.messages.MessageGetMessageByIdParams -import com.clear_street.api.models.v1.omniai.messages.MessageSubmitFeedbackParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdParams +import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceTest.kt similarity index 81% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceTest.kt index 7b1ec1b9..083773fa 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ResponseServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai +package com.clearstreet.api.services.blocking.v1.omniai -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.omniai.responses.ResponseCancelResponseParams -import com.clear_street.api.models.v1.omniai.responses.ResponseGetResponseByIdParams +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseParams +import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceTest.kt similarity index 87% rename from clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceTest.kt index 35102114..618d64b0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clear_street/api/services/blocking/v1/omniai/ThreadServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceTest.kt @@ -1,14 +1,14 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.services.blocking.v1.omniai - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateMessageParams -import com.clear_street.api.models.v1.omniai.threads.ThreadCreateThreadParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetMessagesParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadByIdParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadResponseParams -import com.clear_street.api.models.v1.omniai.threads.ThreadGetThreadsParams +package com.clearstreet.api.services.blocking.v1.omniai + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseParams +import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/clear-street-java-proguard-test/build.gradle.kts b/clear-street-java-proguard-test/build.gradle.kts index 3e076a0a..f8abd8db 100644 --- a/clear-street-java-proguard-test/build.gradle.kts +++ b/clear-street-java-proguard-test/build.gradle.kts @@ -59,7 +59,7 @@ val testProGuard by tasks.registering(JavaExec::class) { dependsOn(proguardJar) notCompatibleWithConfigurationCache("ProGuard") - mainClass.set("com.clear_street.api.proguard.ProGuardCompatibilityTest") + mainClass.set("com.clearstreet.api.proguard.ProGuardCompatibilityTest") classpath = files(proguardJarPath) } @@ -89,7 +89,7 @@ val testR8 by tasks.registering(JavaExec::class) { dependsOn(r8Jar) notCompatibleWithConfigurationCache("R8") - mainClass.set("com.clear_street.api.proguard.ProGuardCompatibilityTest") + mainClass.set("com.clearstreet.api.proguard.ProGuardCompatibilityTest") classpath = files(r8JarPath) } diff --git a/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt b/clear-street-java-proguard-test/src/test/kotlin/com/clearstreet/api/proguard/ProGuardCompatibilityTest.kt similarity index 84% rename from clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt rename to clear-street-java-proguard-test/src/test/kotlin/com/clearstreet/api/proguard/ProGuardCompatibilityTest.kt index 617ae1d6..41e425d2 100644 --- a/clear-street-java-proguard-test/src/test/kotlin/com/clear_street/api/proguard/ProGuardCompatibilityTest.kt +++ b/clear-street-java-proguard-test/src/test/kotlin/com/clearstreet/api/proguard/ProGuardCompatibilityTest.kt @@ -1,20 +1,20 @@ // File generated from our OpenAPI spec by Stainless. -package com.clear_street.api.proguard - -import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient -import com.clear_street.api.core.jsonMapper -import com.clear_street.api.models.v1.accounts.Account -import com.clear_street.api.models.v1.accounts.AccountStatus -import com.clear_street.api.models.v1.accounts.AccountSubtype -import com.clear_street.api.models.v1.accounts.AccountType -import com.clear_street.api.models.v1.omniai.PrefillOrderAction -import com.clear_street.api.models.v1.orders.NewOrderRequest -import com.clear_street.api.models.v1.orders.PositionEffect -import com.clear_street.api.models.v1.orders.RequestOrderType -import com.clear_street.api.models.v1.orders.RequestTimeInForce -import com.clear_street.api.models.v1.orders.Side -import com.clear_street.api.models.v1.orders.TrailingOffsetType +package com.clearstreet.api.proguard + +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.accounts.Account +import com.clearstreet.api.models.v1.accounts.AccountStatus +import com.clearstreet.api.models.v1.accounts.AccountSubtype +import com.clearstreet.api.models.v1.accounts.AccountType +import com.clearstreet.api.models.v1.omniai.PrefillOrderAction +import com.clearstreet.api.models.v1.orders.NewOrderRequest +import com.clearstreet.api.models.v1.orders.PositionEffect +import com.clearstreet.api.models.v1.orders.RequestOrderType +import com.clearstreet.api.models.v1.orders.RequestTimeInForce +import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.LocalDate import java.time.OffsetDateTime diff --git a/clear-street-java-proguard-test/test.pro b/clear-street-java-proguard-test/test.pro index 30c39d7f..9fbc9692 100644 --- a/clear-street-java-proguard-test/test.pro +++ b/clear-street-java-proguard-test/test.pro @@ -1,5 +1,5 @@ # Specify the entrypoint where ProGuard starts to determine what's reachable. --keep class com.clear_street.api.proguard.** { *; } +-keep class com.clearstreet.api.proguard.** { *; } # For the testing framework. -keep class org.junit.** { *; } From ac78491bf8e59b74eb89fb36e633c7fb5f371160 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:43:06 +0000 Subject: [PATCH 27/51] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d0226fff..8c1ce73b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-4194f89657dd373f09e3b4ba795740950f2ddc4e0b35f90c22e4155ad6010c52.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-34c7e461556ec9324dd20c95ce4fea1fbfcc4de83b3d15365c51fdb9d8e56073.yml openapi_spec_hash: 3477d6986fdb7b3c9d638b3557fc1ed7 -config_hash: 60b384cdbd19cc2eeda21394d4a18195 +config_hash: 66e3fd0a8171a922070c46769ac48c06 From 9bc4c8b546a3589526541f25f8e987ed83aa35b0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:47:35 +0000 Subject: [PATCH 28/51] feat(api): api update --- .stats.yml | 4 ++-- .../positions/PositionSubmitPositionInstructionsParams.kt | 8 +++++--- .../api/services/async/v1/PositionServiceAsync.kt | 8 +++++--- .../api/services/blocking/v1/PositionService.kt | 8 +++++--- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8c1ce73b..77cf4ceb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-34c7e461556ec9324dd20c95ce4fea1fbfcc4de83b3d15365c51fdb9d8e56073.yml -openapi_spec_hash: 3477d6986fdb7b3c9d638b3557fc1ed7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-694b951024e473f931ddc34fbb03eaf84d12ff16a5f240cc0f788a3492c6034c.yml +openapi_spec_hash: ddee21c9720ff566514acf1989ac4dc5 config_hash: 66e3fd0a8171a922070c46769ac48c06 diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt index f0c5047f..aeebb52c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt @@ -30,9 +30,11 @@ import kotlin.jvm.optionals.getOrNull * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` * summarizes the batch failure. - * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying - * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA on a - * non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. + * - **All rows rejected** → `4xx`/`5xx`. The HTTP status reflects the aggregate cause: `409` when + * every row was a duplicate, `400` for validation failures like DNE/CEA on a non-expiry day, + * `503` if the clearing service is unavailable. `data` still contains every row carrying `status + * = ENGINE_REJECTED` and `rejection_reason` so callers can attribute failures by + * `instruction_id`; the top-level `error` summarizes the batch. */ class PositionSubmitPositionInstructionsParams private constructor( diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt index 8071925c..d7bd9e16 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt @@ -236,9 +236,11 @@ interface PositionServiceAsync { * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` * summarizes the batch failure. - * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying - * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA - * on a non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. + * - **All rows rejected** → `4xx`/`5xx`. The HTTP status reflects the aggregate cause: `409` + * when every row was a duplicate, `400` for validation failures like DNE/CEA on a non-expiry + * day, `503` if the clearing service is unavailable. `data` still contains every row carrying + * `status = ENGINE_REJECTED` and `rejection_reason` so callers can attribute failures by + * `instruction_id`; the top-level `error` summarizes the batch. */ fun submitPositionInstructions( accountId: Long, diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt index 64679e9f..31cc0076 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt @@ -226,9 +226,11 @@ interface PositionService { * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` * summarizes the batch failure. - * - **All rows rejected** → `4xx`/`5xx` error response. The HTTP status reflects the underlying - * cause: `409` for duplicate `instruction_id`, `400` for validation failures such as DNE/CEA - * on a non-expiry day, `503` if the clearing service is unavailable. No `data` is returned. + * - **All rows rejected** → `4xx`/`5xx`. The HTTP status reflects the aggregate cause: `409` + * when every row was a duplicate, `400` for validation failures like DNE/CEA on a non-expiry + * day, `503` if the clearing service is unavailable. `data` still contains every row carrying + * `status = ENGINE_REJECTED` and `rejection_reason` so callers can attribute failures by + * `instruction_id`; the top-level `error` summarizes the batch. */ fun submitPositionInstructions( accountId: Long, From 3b99eab10d511fa507e5b0d221c06cabd24ac387 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:56:55 +0000 Subject: [PATCH 29/51] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 77cf4ceb..04b4dcbe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-694b951024e473f931ddc34fbb03eaf84d12ff16a5f240cc0f788a3492c6034c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-125ed1dc6eb78b3802cf828af209640cef63eac30cc05e71ebf690d5d4787763.yml openapi_spec_hash: ddee21c9720ff566514acf1989ac4dc5 -config_hash: 66e3fd0a8171a922070c46769ac48c06 +config_hash: 7a2e424e03cb85a2277f2bc93f069c6d From e41ea535fcf45e539691eef3dcde4217967fd2d8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:58:22 +0000 Subject: [PATCH 30/51] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 04b4dcbe..ad73cd7a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-125ed1dc6eb78b3802cf828af209640cef63eac30cc05e71ebf690d5d4787763.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-102c4061ead71aab16d636b627daaeeaf580df500ada3fa926e29cc83fe59ee2.yml openapi_spec_hash: ddee21c9720ff566514acf1989ac4dc5 -config_hash: 7a2e424e03cb85a2277f2bc93f069c6d +config_hash: 1a97103fd01d808c075879aade7b1412 From 966a8903fc2b492130603466247c125f3c40b947 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 20:39:47 +0000 Subject: [PATCH 31/51] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ad73cd7a..77cf4ceb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-102c4061ead71aab16d636b627daaeeaf580df500ada3fa926e29cc83fe59ee2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-694b951024e473f931ddc34fbb03eaf84d12ff16a5f240cc0f788a3492c6034c.yml openapi_spec_hash: ddee21c9720ff566514acf1989ac4dc5 -config_hash: 1a97103fd01d808c075879aade7b1412 +config_hash: 66e3fd0a8171a922070c46769ac48c06 From 943a8ceb15eee13c5ca5b169d649c9bbb63cfd03 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 18:34:33 +0000 Subject: [PATCH 32/51] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 77cf4ceb..35577612 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-694b951024e473f931ddc34fbb03eaf84d12ff16a5f240cc0f788a3492c6034c.yml -openapi_spec_hash: ddee21c9720ff566514acf1989ac4dc5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-c267813b478ae4346aeeccd7ac916001c9007356e8c1a4683bd28c0ef6cc45e5.yml +openapi_spec_hash: d23f58dc40061a406761b2e4ddb795f7 config_hash: 66e3fd0a8171a922070c46769ac48c06 From 4e019271f0a92b4caf85799c0fe8a4039edec5f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 20:41:48 +0000 Subject: [PATCH 33/51] feat(api): api update --- .stats.yml | 4 ++-- .../api/models/v1/accounts/AccountBalancesSod.kt | 5 +++++ .../api/models/v1/accounts/MarginDetails.kt | 13 +++++++++++++ .../InstrumentSearchInstrumentsParams.kt | 5 +++-- .../api/services/async/v1/InstrumentServiceAsync.kt | 3 ++- .../api/services/blocking/v1/InstrumentService.kt | 3 ++- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 35577612..8fca429c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-c267813b478ae4346aeeccd7ac916001c9007356e8c1a4683bd28c0ef6cc45e5.yml -openapi_spec_hash: d23f58dc40061a406761b2e4ddb795f7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-f83e27ec873f5c68b23d230c69d464f44779fd6adabd244825450d748b979204.yml +openapi_spec_hash: adf08b20847a6ffdb64048150e2502d1 config_hash: 66e3fd0a8171a922070c46769ac48c06 diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt index 354c7de5..ff2d0eeb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt @@ -115,6 +115,7 @@ private constructor( * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ + @Deprecated("deprecated") fun dayTradeBuyingPower(): Optional = dayTradeBuyingPower.getOptional("day_trade_buying_power") @@ -192,6 +193,7 @@ private constructor( * Unlike [dayTradeBuyingPower], this method doesn't throw if the JSON field has an unexpected * type. */ + @Deprecated("deprecated") @JsonProperty("day_trade_buying_power") @ExcludeMissing fun _dayTradeBuyingPower(): JsonField = dayTradeBuyingPower @@ -347,12 +349,14 @@ private constructor( fun asof(asof: JsonField) = apply { this.asof = asof } /** Start-of-day day-trade buying power. */ + @Deprecated("deprecated") fun dayTradeBuyingPower(dayTradeBuyingPower: String?) = dayTradeBuyingPower(JsonField.ofNullable(dayTradeBuyingPower)) /** * Alias for calling [Builder.dayTradeBuyingPower] with `dayTradeBuyingPower.orElse(null)`. */ + @Deprecated("deprecated") fun dayTradeBuyingPower(dayTradeBuyingPower: Optional) = dayTradeBuyingPower(dayTradeBuyingPower.getOrNull()) @@ -363,6 +367,7 @@ private constructor( * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ + @Deprecated("deprecated") fun dayTradeBuyingPower(dayTradeBuyingPower: JsonField) = apply { this.dayTradeBuyingPower = dayTradeBuyingPower } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt index 63e45538..6b625cdd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt @@ -82,6 +82,7 @@ private constructor( * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ + @Deprecated("deprecated") fun dayTradeCount(): Int = dayTradeCount.getRequired("day_trade_count") /** @@ -125,6 +126,7 @@ private constructor( * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ + @Deprecated("deprecated") fun patternDayTrader(): Boolean = patternDayTrader.getRequired("pattern_day_trader") /** @@ -133,6 +135,7 @@ private constructor( * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ + @Deprecated("deprecated") fun dayTradeBuyingPowerUsage(): Optional = dayTradeBuyingPowerUsage.getOptional("day_trade_buying_power_usage") @@ -158,6 +161,7 @@ private constructor( * * Unlike [dayTradeCount], this method doesn't throw if the JSON field has an unexpected type. */ + @Deprecated("deprecated") @JsonProperty("day_trade_count") @ExcludeMissing fun _dayTradeCount(): JsonField = dayTradeCount @@ -208,6 +212,7 @@ private constructor( * Unlike [patternDayTrader], this method doesn't throw if the JSON field has an unexpected * type. */ + @Deprecated("deprecated") @JsonProperty("pattern_day_trader") @ExcludeMissing fun _patternDayTrader(): JsonField = patternDayTrader @@ -218,6 +223,7 @@ private constructor( * Unlike [dayTradeBuyingPowerUsage], this method doesn't throw if the JSON field has an * unexpected type. */ + @Deprecated("deprecated") @JsonProperty("day_trade_buying_power_usage") @ExcludeMissing fun _dayTradeBuyingPowerUsage(): JsonField = dayTradeBuyingPowerUsage @@ -297,6 +303,7 @@ private constructor( } /** The number of day trades executed over the 5 most recent trading days. */ + @Deprecated("deprecated") fun dayTradeCount(dayTradeCount: Int) = dayTradeCount(JsonField.of(dayTradeCount)) /** @@ -306,6 +313,7 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet supported * value. */ + @Deprecated("deprecated") fun dayTradeCount(dayTradeCount: JsonField) = apply { this.dayTradeCount = dayTradeCount } @@ -371,6 +379,7 @@ private constructor( } /** `true` if the account is currently flagged as a PDT, otherwise `false`. */ + @Deprecated("deprecated") fun patternDayTrader(patternDayTrader: Boolean) = patternDayTrader(JsonField.of(patternDayTrader)) @@ -381,11 +390,13 @@ private constructor( * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ + @Deprecated("deprecated") fun patternDayTrader(patternDayTrader: JsonField) = apply { this.patternDayTrader = patternDayTrader } /** The amount of day-trade buying power used during the current trading day. */ + @Deprecated("deprecated") fun dayTradeBuyingPowerUsage(dayTradeBuyingPowerUsage: String?) = dayTradeBuyingPowerUsage(JsonField.ofNullable(dayTradeBuyingPowerUsage)) @@ -393,6 +404,7 @@ private constructor( * Alias for calling [Builder.dayTradeBuyingPowerUsage] with * `dayTradeBuyingPowerUsage.orElse(null)`. */ + @Deprecated("deprecated") fun dayTradeBuyingPowerUsage(dayTradeBuyingPowerUsage: Optional) = dayTradeBuyingPowerUsage(dayTradeBuyingPowerUsage.getOrNull()) @@ -403,6 +415,7 @@ private constructor( * value instead. This method is primarily for setting the field to an undocumented or not * yet supported value. */ + @Deprecated("deprecated") fun dayTradeBuyingPowerUsage(dayTradeBuyingPowerUsage: JsonField) = apply { this.dayTradeBuyingPowerUsage = dayTradeBuyingPowerUsage } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt index 71e8cbea..7794cf75 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt @@ -18,8 +18,9 @@ import kotlin.jvm.optionals.getOrNull * Results are ranked by match quality plus instrument quality signals including log-scaled ADV, * listing status, marginability, easy-to-borrow status, and OTC, restricted, and liquidation-only * penalties. Defaults to the `EQUITY` asset class (common stocks, preferred shares, ADRs, ETFs, and - * exchange-traded mutual funds). Pass `asset_class=OPTION` to search option contracts by symbol or - * alternate identifier. + * exchange-traded mutual funds). Pass `asset_class=OPTION` to search option contracts: by full OSI + * symbol, by an OSI prefix (root + `YYMMDD` expiry, e.g. `AAPL 261217`), or by a root-scoped phrase + * such as `AAPL Dec 250 call`. */ class InstrumentSearchInstrumentsParams private constructor( diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt index a6d81303..cf5ad93c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt @@ -129,7 +129,8 @@ interface InstrumentServiceAsync { * listing status, marginability, easy-to-borrow status, and OTC, restricted, and * liquidation-only penalties. Defaults to the `EQUITY` asset class (common stocks, preferred * shares, ADRs, ETFs, and exchange-traded mutual funds). Pass `asset_class=OPTION` to search - * option contracts by symbol or alternate identifier. + * option contracts: by full OSI symbol, by an OSI prefix (root + `YYMMDD` expiry, e.g. `AAPL + * 261217`), or by a root-scoped phrase such as `AAPL Dec 250 call`. */ fun searchInstruments( params: InstrumentSearchInstrumentsParams diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt index 7e16d09f..adb9b822 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt @@ -120,7 +120,8 @@ interface InstrumentService { * listing status, marginability, easy-to-borrow status, and OTC, restricted, and * liquidation-only penalties. Defaults to the `EQUITY` asset class (common stocks, preferred * shares, ADRs, ETFs, and exchange-traded mutual funds). Pass `asset_class=OPTION` to search - * option contracts by symbol or alternate identifier. + * option contracts: by full OSI symbol, by an OSI prefix (root + `YYMMDD` expiry, e.g. `AAPL + * 261217`), or by a root-scoped phrase such as `AAPL Dec 250 call`. */ fun searchInstruments( params: InstrumentSearchInstrumentsParams From e2ddaff65fc8720fdb04385fea0fef5adf290bd2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 13:54:58 +0000 Subject: [PATCH 34/51] feat(api): api update --- .stats.yml | 4 ++-- .../api/models/v1/accounts/MarginTopContributor.kt | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8fca429c..1d338b1c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-f83e27ec873f5c68b23d230c69d464f44779fd6adabd244825450d748b979204.yml -openapi_spec_hash: adf08b20847a6ffdb64048150e2502d1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-bc29ea32129d128f5b7498a3e7e1670ed85be60b8c3920f8002b1e15f9768af4.yml +openapi_spec_hash: 04ea962809dcff08e68242cc8f170be1 config_hash: 66e3fd0a8171a922070c46769ac48c06 diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributor.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributor.kt index bb9e0823..e1030fd2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributor.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginTopContributor.kt @@ -59,6 +59,7 @@ private constructor( * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ + @Deprecated("deprecated") fun dayTradeBuyingPowerUsage(): String = dayTradeBuyingPowerUsage.getRequired("day_trade_buying_power_usage") @@ -103,6 +104,7 @@ private constructor( * Unlike [dayTradeBuyingPowerUsage], this method doesn't throw if the JSON field has an * unexpected type. */ + @Deprecated("deprecated") @JsonProperty("day_trade_buying_power_usage") @ExcludeMissing fun _dayTradeBuyingPowerUsage(): JsonField = dayTradeBuyingPowerUsage @@ -199,6 +201,7 @@ private constructor( * Day-trade buying power consumed by fills against this underlying on the current trade * date. Populated only for pattern day trader accounts. */ + @Deprecated("deprecated") fun dayTradeBuyingPowerUsage(dayTradeBuyingPowerUsage: String) = dayTradeBuyingPowerUsage(JsonField.of(dayTradeBuyingPowerUsage)) @@ -209,6 +212,7 @@ private constructor( * value instead. This method is primarily for setting the field to an undocumented or not * yet supported value. */ + @Deprecated("deprecated") fun dayTradeBuyingPowerUsage(dayTradeBuyingPowerUsage: JsonField) = apply { this.dayTradeBuyingPowerUsage = dayTradeBuyingPowerUsage } From 0e09a072ba6b2d4734169355929d8b91f6a270a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:27:48 +0000 Subject: [PATCH 35/51] feat(api): api update --- .stats.yml | 6 +- .../api/models/v1/accounts/MarginDetails.kt | 95 +++++++- .../v1/accounts/MarginSessionDetails.kt | 230 ++++++++++++++++++ .../models/v1/accounts/AccountBalancesTest.kt | 36 +++ .../AccountGetAccountBalancesResponseTest.kt | 36 +++ .../models/v1/accounts/MarginDetailsTest.kt | 20 ++ .../v1/accounts/MarginSessionDetailsTest.kt | 35 +++ 7 files changed, 454 insertions(+), 4 deletions(-) create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginSessionDetails.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginSessionDetailsTest.kt diff --git a/.stats.yml b/.stats.yml index 1d338b1c..7a53cd4f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-bc29ea32129d128f5b7498a3e7e1670ed85be60b8c3920f8002b1e15f9768af4.yml -openapi_spec_hash: 04ea962809dcff08e68242cc8f170be1 -config_hash: 66e3fd0a8171a922070c46769ac48c06 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-a5177eb9a347903de01cceff474937088f4cbb67d893b934fa719ebb4c30f7c0.yml +openapi_spec_hash: 96177a60bb3ada6d205857d8cbf5e1f1 +config_hash: f4e0d70a371aa59c47bdbaf7fc99b80a diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt index 6b625cdd..d4df4371 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt @@ -25,8 +25,10 @@ private constructor( private val dayTradeCount: JsonField, private val initialMarginExcess: JsonField, private val initialMarginRequirement: JsonField, + private val intradayDetails: JsonField, private val maintenanceMarginExcess: JsonField, private val maintenanceMarginRequirement: JsonField, + private val overnightDetails: JsonField, private val patternDayTrader: JsonField, private val dayTradeBuyingPowerUsage: JsonField, private val topContributors: JsonField>, @@ -45,12 +47,18 @@ private constructor( @JsonProperty("initial_margin_requirement") @ExcludeMissing initialMarginRequirement: JsonField = JsonMissing.of(), + @JsonProperty("intraday_details") + @ExcludeMissing + intradayDetails: JsonField = JsonMissing.of(), @JsonProperty("maintenance_margin_excess") @ExcludeMissing maintenanceMarginExcess: JsonField = JsonMissing.of(), @JsonProperty("maintenance_margin_requirement") @ExcludeMissing maintenanceMarginRequirement: JsonField = JsonMissing.of(), + @JsonProperty("overnight_details") + @ExcludeMissing + overnightDetails: JsonField = JsonMissing.of(), @JsonProperty("pattern_day_trader") @ExcludeMissing patternDayTrader: JsonField = JsonMissing.of(), @@ -67,8 +75,10 @@ private constructor( dayTradeCount, initialMarginExcess, initialMarginRequirement, + intradayDetails, maintenanceMarginExcess, maintenanceMarginRequirement, + overnightDetails, patternDayTrader, dayTradeBuyingPowerUsage, topContributors, @@ -102,6 +112,14 @@ private constructor( fun initialMarginRequirement(): String = initialMarginRequirement.getRequired("initial_margin_requirement") + /** + * Intraday session margin calculation details. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun intradayDetails(): MarginSessionDetails = intradayDetails.getRequired("intraday_details") + /** * Maintenance margin excess for trade-date balances. * @@ -120,6 +138,14 @@ private constructor( fun maintenanceMarginRequirement(): String = maintenanceMarginRequirement.getRequired("maintenance_margin_requirement") + /** + * Overnight session margin calculation details. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun overnightDetails(): MarginSessionDetails = overnightDetails.getRequired("overnight_details") + /** * `true` if the account is currently flagged as a PDT, otherwise `false`. * @@ -186,6 +212,15 @@ private constructor( @ExcludeMissing fun _initialMarginRequirement(): JsonField = initialMarginRequirement + /** + * Returns the raw JSON value of [intradayDetails]. + * + * Unlike [intradayDetails], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("intraday_details") + @ExcludeMissing + fun _intradayDetails(): JsonField = intradayDetails + /** * Returns the raw JSON value of [maintenanceMarginExcess]. * @@ -206,6 +241,16 @@ private constructor( @ExcludeMissing fun _maintenanceMarginRequirement(): JsonField = maintenanceMarginRequirement + /** + * Returns the raw JSON value of [overnightDetails]. + * + * Unlike [overnightDetails], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("overnight_details") + @ExcludeMissing + fun _overnightDetails(): JsonField = overnightDetails + /** * Returns the raw JSON value of [patternDayTrader]. * @@ -266,8 +311,10 @@ private constructor( * .dayTradeCount() * .initialMarginExcess() * .initialMarginRequirement() + * .intradayDetails() * .maintenanceMarginExcess() * .maintenanceMarginRequirement() + * .overnightDetails() * .patternDayTrader() * ``` */ @@ -280,8 +327,10 @@ private constructor( private var dayTradeCount: JsonField? = null private var initialMarginExcess: JsonField? = null private var initialMarginRequirement: JsonField? = null + private var intradayDetails: JsonField? = null private var maintenanceMarginExcess: JsonField? = null private var maintenanceMarginRequirement: JsonField? = null + private var overnightDetails: JsonField? = null private var patternDayTrader: JsonField? = null private var dayTradeBuyingPowerUsage: JsonField = JsonMissing.of() private var topContributors: JsonField>? = null @@ -293,8 +342,10 @@ private constructor( dayTradeCount = marginDetails.dayTradeCount initialMarginExcess = marginDetails.initialMarginExcess initialMarginRequirement = marginDetails.initialMarginRequirement + intradayDetails = marginDetails.intradayDetails maintenanceMarginExcess = marginDetails.maintenanceMarginExcess maintenanceMarginRequirement = marginDetails.maintenanceMarginRequirement + overnightDetails = marginDetails.overnightDetails patternDayTrader = marginDetails.patternDayTrader dayTradeBuyingPowerUsage = marginDetails.dayTradeBuyingPowerUsage topContributors = marginDetails.topContributors.map { it.toMutableList() } @@ -348,6 +399,21 @@ private constructor( this.initialMarginRequirement = initialMarginRequirement } + /** Intraday session margin calculation details. */ + fun intradayDetails(intradayDetails: MarginSessionDetails) = + intradayDetails(JsonField.of(intradayDetails)) + + /** + * Sets [Builder.intradayDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.intradayDetails] with a well-typed + * [MarginSessionDetails] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun intradayDetails(intradayDetails: JsonField) = apply { + this.intradayDetails = intradayDetails + } + /** Maintenance margin excess for trade-date balances. */ fun maintenanceMarginExcess(maintenanceMarginExcess: String) = maintenanceMarginExcess(JsonField.of(maintenanceMarginExcess)) @@ -378,6 +444,21 @@ private constructor( this.maintenanceMarginRequirement = maintenanceMarginRequirement } + /** Overnight session margin calculation details. */ + fun overnightDetails(overnightDetails: MarginSessionDetails) = + overnightDetails(JsonField.of(overnightDetails)) + + /** + * Sets [Builder.overnightDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.overnightDetails] with a well-typed + * [MarginSessionDetails] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun overnightDetails(overnightDetails: JsonField) = apply { + this.overnightDetails = overnightDetails + } + /** `true` if the account is currently flagged as a PDT, otherwise `false`. */ @Deprecated("deprecated") fun patternDayTrader(patternDayTrader: Boolean) = @@ -491,8 +572,10 @@ private constructor( * .dayTradeCount() * .initialMarginExcess() * .initialMarginRequirement() + * .intradayDetails() * .maintenanceMarginExcess() * .maintenanceMarginRequirement() + * .overnightDetails() * .patternDayTrader() * ``` * @@ -503,8 +586,10 @@ private constructor( checkRequired("dayTradeCount", dayTradeCount), checkRequired("initialMarginExcess", initialMarginExcess), checkRequired("initialMarginRequirement", initialMarginRequirement), + checkRequired("intradayDetails", intradayDetails), checkRequired("maintenanceMarginExcess", maintenanceMarginExcess), checkRequired("maintenanceMarginRequirement", maintenanceMarginRequirement), + checkRequired("overnightDetails", overnightDetails), checkRequired("patternDayTrader", patternDayTrader), dayTradeBuyingPowerUsage, (topContributors ?: JsonMissing.of()).map { it.toImmutable() }, @@ -531,8 +616,10 @@ private constructor( dayTradeCount() initialMarginExcess() initialMarginRequirement() + intradayDetails().validate() maintenanceMarginExcess() maintenanceMarginRequirement() + overnightDetails().validate() patternDayTrader() dayTradeBuyingPowerUsage() topContributors().ifPresent { it.forEach { it.validate() } } @@ -558,8 +645,10 @@ private constructor( (if (dayTradeCount.asKnown().isPresent) 1 else 0) + (if (initialMarginExcess.asKnown().isPresent) 1 else 0) + (if (initialMarginRequirement.asKnown().isPresent) 1 else 0) + + (intradayDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (maintenanceMarginExcess.asKnown().isPresent) 1 else 0) + (if (maintenanceMarginRequirement.asKnown().isPresent) 1 else 0) + + (overnightDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (patternDayTrader.asKnown().isPresent) 1 else 0) + (if (dayTradeBuyingPowerUsage.asKnown().isPresent) 1 else 0) + (topContributors.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + @@ -574,8 +663,10 @@ private constructor( dayTradeCount == other.dayTradeCount && initialMarginExcess == other.initialMarginExcess && initialMarginRequirement == other.initialMarginRequirement && + intradayDetails == other.intradayDetails && maintenanceMarginExcess == other.maintenanceMarginExcess && maintenanceMarginRequirement == other.maintenanceMarginRequirement && + overnightDetails == other.overnightDetails && patternDayTrader == other.patternDayTrader && dayTradeBuyingPowerUsage == other.dayTradeBuyingPowerUsage && topContributors == other.topContributors && @@ -588,8 +679,10 @@ private constructor( dayTradeCount, initialMarginExcess, initialMarginRequirement, + intradayDetails, maintenanceMarginExcess, maintenanceMarginRequirement, + overnightDetails, patternDayTrader, dayTradeBuyingPowerUsage, topContributors, @@ -601,5 +694,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MarginDetails{dayTradeCount=$dayTradeCount, initialMarginExcess=$initialMarginExcess, initialMarginRequirement=$initialMarginRequirement, maintenanceMarginExcess=$maintenanceMarginExcess, maintenanceMarginRequirement=$maintenanceMarginRequirement, patternDayTrader=$patternDayTrader, dayTradeBuyingPowerUsage=$dayTradeBuyingPowerUsage, topContributors=$topContributors, usage=$usage, additionalProperties=$additionalProperties}" + "MarginDetails{dayTradeCount=$dayTradeCount, initialMarginExcess=$initialMarginExcess, initialMarginRequirement=$initialMarginRequirement, intradayDetails=$intradayDetails, maintenanceMarginExcess=$maintenanceMarginExcess, maintenanceMarginRequirement=$maintenanceMarginRequirement, overnightDetails=$overnightDetails, patternDayTrader=$patternDayTrader, dayTradeBuyingPowerUsage=$dayTradeBuyingPowerUsage, topContributors=$topContributors, usage=$usage, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginSessionDetails.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginSessionDetails.kt new file mode 100644 index 00000000..02c16bfd --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginSessionDetails.kt @@ -0,0 +1,230 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class MarginSessionDetails +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val buyingPower: JsonField, + private val multiplier: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("buying_power") + @ExcludeMissing + buyingPower: JsonField = JsonMissing.of(), + @JsonProperty("multiplier") @ExcludeMissing multiplier: JsonField = JsonMissing.of(), + ) : this(buyingPower, multiplier, mutableMapOf()) + + /** + * Maximum buying power available in the account during the session. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun buyingPower(): String = buyingPower.getRequired("buying_power") + + /** + * Effective multiplier for margin calculations during the session. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun multiplier(): Optional = multiplier.getOptional("multiplier") + + /** + * Returns the raw JSON value of [buyingPower]. + * + * Unlike [buyingPower], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("buying_power") + @ExcludeMissing + fun _buyingPower(): JsonField = buyingPower + + /** + * Returns the raw JSON value of [multiplier]. + * + * Unlike [multiplier], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("multiplier") @ExcludeMissing fun _multiplier(): JsonField = multiplier + + @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 [MarginSessionDetails]. + * + * The following fields are required: + * ```java + * .buyingPower() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MarginSessionDetails]. */ + class Builder internal constructor() { + + private var buyingPower: JsonField? = null + private var multiplier: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(marginSessionDetails: MarginSessionDetails) = apply { + buyingPower = marginSessionDetails.buyingPower + multiplier = marginSessionDetails.multiplier + additionalProperties = marginSessionDetails.additionalProperties.toMutableMap() + } + + /** Maximum buying power available in the account during the session. */ + fun buyingPower(buyingPower: String) = buyingPower(JsonField.of(buyingPower)) + + /** + * Sets [Builder.buyingPower] to an arbitrary JSON value. + * + * You should usually call [Builder.buyingPower] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun buyingPower(buyingPower: JsonField) = apply { this.buyingPower = buyingPower } + + /** Effective multiplier for margin calculations during the session. */ + fun multiplier(multiplier: String?) = multiplier(JsonField.ofNullable(multiplier)) + + /** Alias for calling [Builder.multiplier] with `multiplier.orElse(null)`. */ + fun multiplier(multiplier: Optional) = multiplier(multiplier.getOrNull()) + + /** + * Sets [Builder.multiplier] to an arbitrary JSON value. + * + * You should usually call [Builder.multiplier] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun multiplier(multiplier: JsonField) = apply { this.multiplier = multiplier } + + 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 [MarginSessionDetails]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .buyingPower() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): MarginSessionDetails = + MarginSessionDetails( + checkRequired("buyingPower", buyingPower), + multiplier, + 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(): MarginSessionDetails = apply { + if (validated) { + return@apply + } + + buyingPower() + multiplier() + 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 = + (if (buyingPower.asKnown().isPresent) 1 else 0) + + (if (multiplier.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MarginSessionDetails && + buyingPower == other.buyingPower && + multiplier == other.multiplier && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(buyingPower, multiplier, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MarginSessionDetails{buyingPower=$buyingPower, multiplier=$multiplier, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt index d13c45bc..ddfed0bc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt @@ -47,8 +47,20 @@ internal class AccountBalancesTest { .dayTradeCount(2) .initialMarginExcess("50000.00") .initialMarginRequirement("50000.00") + .intradayDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .maintenanceMarginExcess("75000.00") .maintenanceMarginRequirement("25000.00") + .overnightDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .patternDayTrader(false) .dayTradeBuyingPowerUsage("0.00") .addTopContributor( @@ -104,8 +116,20 @@ internal class AccountBalancesTest { .dayTradeCount(2) .initialMarginExcess("50000.00") .initialMarginRequirement("50000.00") + .intradayDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .maintenanceMarginExcess("75000.00") .maintenanceMarginRequirement("25000.00") + .overnightDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .patternDayTrader(false) .dayTradeBuyingPowerUsage("0.00") .addTopContributor( @@ -162,8 +186,20 @@ internal class AccountBalancesTest { .dayTradeCount(2) .initialMarginExcess("50000.00") .initialMarginRequirement("50000.00") + .intradayDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .maintenanceMarginExcess("75000.00") .maintenanceMarginRequirement("25000.00") + .overnightDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .patternDayTrader(false) .dayTradeBuyingPowerUsage("0.00") .addTopContributor( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt index 4d765f59..573871e0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt @@ -73,8 +73,20 @@ internal class AccountGetAccountBalancesResponseTest { .dayTradeCount(2) .initialMarginExcess("50000.00") .initialMarginRequirement("50000.00") + .intradayDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .maintenanceMarginExcess("75000.00") .maintenanceMarginRequirement("25000.00") + .overnightDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .patternDayTrader(false) .dayTradeBuyingPowerUsage("0.00") .addTopContributor( @@ -161,8 +173,20 @@ internal class AccountGetAccountBalancesResponseTest { .dayTradeCount(2) .initialMarginExcess("50000.00") .initialMarginRequirement("50000.00") + .intradayDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .maintenanceMarginExcess("75000.00") .maintenanceMarginRequirement("25000.00") + .overnightDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .patternDayTrader(false) .dayTradeBuyingPowerUsage("0.00") .addTopContributor( @@ -249,8 +273,20 @@ internal class AccountGetAccountBalancesResponseTest { .dayTradeCount(2) .initialMarginExcess("50000.00") .initialMarginRequirement("50000.00") + .intradayDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .maintenanceMarginExcess("75000.00") .maintenanceMarginRequirement("25000.00") + .overnightDetails( + MarginSessionDetails.builder() + .buyingPower("90000.00") + .multiplier("2") + .build() + ) .patternDayTrader(false) .dayTradeBuyingPowerUsage("0.00") .addTopContributor( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsTest.kt index 81f59e8c..bbd7619e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetailsTest.kt @@ -17,8 +17,14 @@ internal class MarginDetailsTest { .dayTradeCount(0) .initialMarginExcess("50000.00") .initialMarginRequirement("50000.00") + .intradayDetails( + MarginSessionDetails.builder().buyingPower("500000.00").multiplier("2").build() + ) .maintenanceMarginExcess("75000.00") .maintenanceMarginRequirement("25000.00") + .overnightDetails( + MarginSessionDetails.builder().buyingPower("500000.00").multiplier("2").build() + ) .patternDayTrader(true) .dayTradeBuyingPowerUsage("50000.00") .addTopContributor( @@ -36,8 +42,16 @@ internal class MarginDetailsTest { assertThat(marginDetails.dayTradeCount()).isEqualTo(0) assertThat(marginDetails.initialMarginExcess()).isEqualTo("50000.00") assertThat(marginDetails.initialMarginRequirement()).isEqualTo("50000.00") + assertThat(marginDetails.intradayDetails()) + .isEqualTo( + MarginSessionDetails.builder().buyingPower("500000.00").multiplier("2").build() + ) assertThat(marginDetails.maintenanceMarginExcess()).isEqualTo("75000.00") assertThat(marginDetails.maintenanceMarginRequirement()).isEqualTo("25000.00") + assertThat(marginDetails.overnightDetails()) + .isEqualTo( + MarginSessionDetails.builder().buyingPower("500000.00").multiplier("2").build() + ) assertThat(marginDetails.patternDayTrader()).isEqualTo(true) assertThat(marginDetails.dayTradeBuyingPowerUsage()).contains("50000.00") assertThat(marginDetails.topContributors().getOrNull()) @@ -62,8 +76,14 @@ internal class MarginDetailsTest { .dayTradeCount(0) .initialMarginExcess("50000.00") .initialMarginRequirement("50000.00") + .intradayDetails( + MarginSessionDetails.builder().buyingPower("500000.00").multiplier("2").build() + ) .maintenanceMarginExcess("75000.00") .maintenanceMarginRequirement("25000.00") + .overnightDetails( + MarginSessionDetails.builder().buyingPower("500000.00").multiplier("2").build() + ) .patternDayTrader(true) .dayTradeBuyingPowerUsage("50000.00") .addTopContributor( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginSessionDetailsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginSessionDetailsTest.kt new file mode 100644 index 00000000..91160342 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/MarginSessionDetailsTest.kt @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.accounts + +import com.clearstreet.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class MarginSessionDetailsTest { + + @Test + fun create() { + val marginSessionDetails = + MarginSessionDetails.builder().buyingPower("500000.00").multiplier("2").build() + + assertThat(marginSessionDetails.buyingPower()).isEqualTo("500000.00") + assertThat(marginSessionDetails.multiplier()).contains("2") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val marginSessionDetails = + MarginSessionDetails.builder().buyingPower("500000.00").multiplier("2").build() + + val roundtrippedMarginSessionDetails = + jsonMapper.readValue( + jsonMapper.writeValueAsString(marginSessionDetails), + jacksonTypeRef(), + ) + + assertThat(roundtrippedMarginSessionDetails).isEqualTo(marginSessionDetails) + } +} From fbf70dfef19774d8e6af47c382d0866b786ea0b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:45:44 +0000 Subject: [PATCH 36/51] feat(api): api update --- .stats.yml | 4 ++-- .../kotlin/clear-street.publish.gradle.kts | 2 +- .../AccountGetAccountBalancesParams.kt | 4 ++-- ...trumentDataGetAllInstrumentEventsParams.kt | 4 ++-- ...DataGetInstrumentAnalystConsensusParams.kt | 4 ++-- ...tInstrumentBalanceSheetStatementsParams.kt | 4 ++-- ...taGetInstrumentCashFlowStatementsParams.kt | 4 ++-- ...InstrumentDataGetInstrumentEventsParams.kt | 4 ++-- ...mentDataGetInstrumentFundamentalsParams.kt | 4 ++-- ...DataGetInstrumentIncomeStatementsParams.kt | 4 ++-- .../instrumentdata/InstrumentEventEnvelope.kt | 4 ++-- .../v1/instrumentdata/InstrumentEventsData.kt | 4 ++-- .../instrumentdata/marketdata/DailySummary.kt | 4 ++-- .../MarketDataGetDailySummariesParams.kt | 15 +++++--------- .../MarketDataGetSnapshotsParams.kt | 4 ++-- .../marketdata/MarketDataSnapshot.kt | 4 ++-- .../marketdata/SnapshotGreeks.kt | 8 ++++---- .../instrumentdata/news/NewsGetNewsParams.kt | 4 ++-- .../v1/instrumentdata/news/NewsInstrument.kt | 12 +++++------ .../api/models/v1/instruments/Instrument.kt | 14 ++++--------- .../models/v1/instruments/InstrumentCore.kt | 14 ++++--------- .../InstrumentGetInstrumentByIdParams.kt | 4 ++-- .../InstrumentGetInstrumentsParams.kt | 4 ++-- .../InstrumentGetOptionContractsParams.kt | 4 ++-- .../InstrumentSearchInstrumentsParams.kt | 20 +++++++++---------- .../models/v1/instruments/OptionsContract.kt | 8 ++++---- .../api/models/v1/orders/Execution.kt | 4 ++-- .../api/models/v1/orders/NewOrderRequest.kt | 4 ++-- .../clearstreet/api/models/v1/orders/Order.kt | 18 ++++++++--------- .../orders/OrderCancelAllOpenOrdersParams.kt | 4 ++-- .../v1/orders/OrderGetExecutionsParams.kt | 8 ++++---- .../models/v1/orders/OrderGetOrdersParams.kt | 12 +++++------ .../api/models/v1/positions/Position.kt | 8 ++++---- .../positions/PositionClosePositionParams.kt | 4 ++-- .../positions/PositionGetPositionsParams.kt | 4 ++-- .../v1/positions/PositionInstructionStatus.kt | 12 +++++------ .../WatchlistAddWatchlistItemParams.kt | 8 ++++---- .../async/v1/InstrumentServiceAsync.kt | 13 ++++++------ .../instrumentdata/MarketDataServiceAsync.kt | 11 +++------- .../services/blocking/v1/InstrumentService.kt | 13 ++++++------ .../v1/instrumentdata/MarketDataService.kt | 11 +++------- 41 files changed, 132 insertions(+), 167 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7a53cd4f..256ee9f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-a5177eb9a347903de01cceff474937088f4cbb67d893b934fa719ebb4c30f7c0.yml -openapi_spec_hash: 96177a60bb3ada6d205857d8cbf5e1f1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-d5701ada74a30287bc9f07b5919cb38f2f21b7a7042c8ae6ebd0fbe53f1b19bb.yml +openapi_spec_hash: 591bc8e46ba022314c75d1dc51206aab config_hash: f4e0d70a371aa59c47bdbaf7fc99b80a diff --git a/buildSrc/src/main/kotlin/clear-street.publish.gradle.kts b/buildSrc/src/main/kotlin/clear-street.publish.gradle.kts index 64200c48..f7df7b75 100644 --- a/buildSrc/src/main/kotlin/clear-street.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/clear-street.publish.gradle.kts @@ -43,7 +43,7 @@ configure { 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.") + 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") licenses { diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParams.kt index b051fa7d..071ba7c7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesParams.kt @@ -20,7 +20,7 @@ private constructor( fun accountId(): Optional = Optional.ofNullable(accountId) - /** Limit the number of top margin contributors returned by the engine. */ + /** Limit the number of top margin contributors returned. */ fun topMarginContributorsLimit(): Optional = Optional.ofNullable(topMarginContributorsLimit) @@ -74,7 +74,7 @@ private constructor( /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) - /** Limit the number of top margin contributors returned by the engine. */ + /** Limit the number of top margin contributors returned. */ fun topMarginContributorsLimit(topMarginContributorsLimit: Int?) = apply { this.topMarginContributorsLimit = topMarginContributorsLimit } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt index 9cc0e715..21f1bf7d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetAllInstrumentEventsParams.kt @@ -32,7 +32,7 @@ private constructor( fun fromDate(): Optional = Optional.ofNullable(fromDate) /** - * Filter by OEMS instrument ID(s). Comma-delimited list of UUIDs. Example: + * Filter by instrument ID(s). Comma-delimited list of UUIDs. Example: * `instrument_ids=550e8400-e29b-41d4-a716-446655440000`. */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) @@ -109,7 +109,7 @@ private constructor( fun fromDate(fromDate: Optional) = fromDate(fromDate.getOrNull()) /** - * Filter by OEMS instrument ID(s). Comma-delimited list of UUIDs. Example: + * Filter by instrument ID(s). Comma-delimited list of UUIDs. Example: * `instrument_ids=550e8400-e29b-41d4-a716-446655440000`. */ fun instrumentIds(instrumentIds: List?) = apply { diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt index 478ff044..f418c8dd 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentAnalystConsensusParams.kt @@ -20,7 +20,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** The start date for the query range, inclusive (YYYY-MM-DD) */ @@ -71,7 +71,7 @@ private constructor( instrumentDataGetInstrumentAnalystConsensusParams.additionalQueryParams.toBuilder() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt index 3271f66a..b826e742 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentBalanceSheetStatementsParams.kt @@ -30,7 +30,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** The start date for the query range, inclusive (YYYY-MM-DD). */ @@ -97,7 +97,7 @@ private constructor( .toBuilder() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt index 24e4b9fc..72c3f0cb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentCashFlowStatementsParams.kt @@ -26,7 +26,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** The start date for the query range, inclusive (YYYY-MM-DD). */ @@ -92,7 +92,7 @@ private constructor( .toBuilder() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt index b6840f16..4bc270b1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentEventsParams.kt @@ -25,7 +25,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** The start date for the query range, inclusive (YYYY-MM-DD). */ @@ -75,7 +75,7 @@ private constructor( instrumentDataGetInstrumentEventsParams.additionalQueryParams.toBuilder() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt index 0c574a8c..25171903 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentFundamentalsParams.kt @@ -17,7 +17,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** Additional headers to send with the request. */ @@ -58,7 +58,7 @@ private constructor( instrumentDataGetInstrumentFundamentalsParams.additionalQueryParams.toBuilder() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt index 2f110ee8..243029ee 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDataGetInstrumentIncomeStatementsParams.kt @@ -28,7 +28,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** The start date for the query range, inclusive (YYYY-MM-DD). */ @@ -92,7 +92,7 @@ private constructor( instrumentDataGetInstrumentIncomeStatementsParams.additionalQueryParams.toBuilder() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt index 3f86f871..b271374d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt @@ -106,7 +106,7 @@ private constructor( earningsEventData.getOptional("earnings_event_data") /** - * OEMS instrument identifier, when the instrument is found in the instrument cache. + * Instrument identifier, when available. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -341,7 +341,7 @@ private constructor( this.earningsEventData = earningsEventData } - /** OEMS instrument identifier, when the instrument is found in the instrument cache. */ + /** Instrument identifier, when available. */ fun instrumentId(instrumentId: String?) = instrumentId(JsonField.ofNullable(instrumentId)) /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt index 9e62ef9a..fc714f92 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt @@ -67,7 +67,7 @@ private constructor( fun earnings(): List = earnings.getRequired("earnings") /** - * OEMS instrument UUID from the request + * Instrument identifier * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -236,7 +236,7 @@ private constructor( } } - /** OEMS instrument UUID from the request */ + /** Instrument identifier */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt index b7742054..aaa922c2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt @@ -57,7 +57,7 @@ private constructor( ) : this(instrumentId, high, low, open, symbol, tradeDate, volume, mutableMapOf()) /** - * OEMS instrument identifier. Always populated; echoes the request ID. + * Unique instrument identifier. Always populated; echoes the request ID. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -212,7 +212,7 @@ private constructor( additionalProperties = dailySummary.additionalProperties.toMutableMap() } - /** OEMS instrument identifier. Always populated; echoes the request ID. */ + /** Unique instrument identifier. Always populated; echoes the request ID. */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt index e092a1f0..6a311e94 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetDailySummariesParams.kt @@ -9,18 +9,13 @@ import com.clearstreet.api.core.http.QueryParams import java.util.Objects /** - * Returns the most recent OHLV and current price for the requested OEMS instruments. Backed by the - * in-memory Polygon snapshot cache. + * Returns the most recent open, high, low, volume (OHLV) and current price for the requested + * instruments. * * Response contract: every request returns one row per **unique** `instrument_id`, in first-seen * request order. Unresolvable IDs come back with `symbol = null` and every market-data field - * `null`; resolvable IDs with no cache entry come back with `symbol` populated but market-data + * `null`; resolvable IDs with no available data come back with `symbol` populated but market-data * fields `null`. - * - * **Note (temporary):** ID resolution currently goes through the supplemental screener (OEMS - * instrument_id → FMP fmp_symbol → metadata_id → realtime cache). Removed when the market-data - * service serves daily aggregates directly, or when Polygon symbology is loaded into the instrument - * cache. */ class MarketDataGetDailySummariesParams private constructor( @@ -29,7 +24,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** Comma-separated OEMS instrument UUIDs (required, 1..=100) */ + /** Comma-separated instrument identifiers (required, 1..=100) */ fun instrumentIds(): String = instrumentIds /** Additional headers to send with the request. */ @@ -70,7 +65,7 @@ private constructor( marketDataGetDailySummariesParams.additionalQueryParams.toBuilder() } - /** Comma-separated OEMS instrument UUIDs (required, 1..=100) */ + /** Comma-separated instrument identifiers (required, 1..=100) */ fun instrumentIds(instrumentIds: String) = apply { this.instrumentIds = instrumentIds } fun additionalHeaders(additionalHeaders: Headers) = apply { diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt index 940b3f2f..e687cf28 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsParams.kt @@ -18,7 +18,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** Comma-separated OEMS instrument UUIDs. */ + /** Comma-separated instrument identifiers. */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) /** Additional headers to send with the request. */ @@ -53,7 +53,7 @@ private constructor( additionalQueryParams = marketDataGetSnapshotsParams.additionalQueryParams.toBuilder() } - /** Comma-separated OEMS instrument UUIDs. */ + /** Comma-separated instrument identifiers. */ fun instrumentIds(instrumentIds: List?) = apply { this.instrumentIds = instrumentIds?.toMutableList() } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt index 7e3ce1dd..e13bb6be 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt @@ -67,7 +67,7 @@ private constructor( ) /** - * OEMS instrument identifier. + * Unique instrument identifier. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -249,7 +249,7 @@ private constructor( additionalProperties = marketDataSnapshot.additionalProperties.toMutableMap() } - /** OEMS instrument identifier. */ + /** Unique instrument identifier. */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt index 978e1de8..9e0584ce 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotGreeks.kt @@ -17,8 +17,8 @@ import java.util.Collections import java.util.Objects /** - * Theoretical price and Greeks for an options snapshot. All values are **per share** as published - * by RENG; no contract multiplier is applied. + * Theoretical price and Greeks for an options snapshot. All values are **per share**; no contract + * multiplier is applied. */ class SnapshotGreeks @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -97,7 +97,7 @@ private constructor( fun theta(): String = theta.getRequired("theta") /** - * Event timestamp published by RENG. + * Timestamp when the Greeks were calculated. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -295,7 +295,7 @@ private constructor( */ fun theta(theta: JsonField) = apply { this.theta = theta } - /** Event timestamp published by RENG. */ + /** Timestamp when the Greeks were calculated. */ fun timestamp(timestamp: OffsetDateTime) = timestamp(JsonField.of(timestamp)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt index 884cff06..cd9f07c9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsGetNewsParams.kt @@ -47,7 +47,7 @@ private constructor( */ fun includePublishers(): Optional = Optional.ofNullable(includePublishers) - /** Comma-delimited OEMS instrument UUIDs to filter by. */ + /** Comma-delimited instrument identifiers to filter by. */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) /** Filter by news type. */ @@ -149,7 +149,7 @@ private constructor( fun includePublishers(includePublishers: Optional) = includePublishers(includePublishers.getOrNull()) - /** Comma-delimited OEMS instrument UUIDs to filter by. */ + /** Comma-delimited instrument identifiers to filter by. */ fun instrumentIds(instrumentIds: List?) = apply { this.instrumentIds = instrumentIds?.toMutableList() } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt index 806b63d6..cabe6396 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt @@ -37,7 +37,7 @@ private constructor( ) : this(instrumentId, name, symbol, mutableMapOf()) /** - * OEMS instrument UUID. + * Instrument identifier. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -45,7 +45,7 @@ private constructor( fun instrumentId(): String = instrumentId.getRequired("instrument_id") /** - * Instrument name/description, if available from instrument cache enrichment. + * Instrument name/description, if available. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -53,7 +53,7 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Trading symbol, if available from instrument cache enrichment. + * Trading symbol, if available. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -124,7 +124,7 @@ private constructor( additionalProperties = newsInstrument.additionalProperties.toMutableMap() } - /** OEMS instrument UUID. */ + /** Instrument identifier. */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** @@ -138,7 +138,7 @@ private constructor( this.instrumentId = instrumentId } - /** Instrument name/description, if available from instrument cache enrichment. */ + /** Instrument name/description, if available. */ fun name(name: String?) = name(JsonField.ofNullable(name)) /** Alias for calling [Builder.name] with `name.orElse(null)`. */ @@ -152,7 +152,7 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - /** Trading symbol, if available from instrument cache enrichment. */ + /** Trading symbol, if available. */ fun symbol(symbol: String?) = symbol(JsonField.ofNullable(symbol)) /** Alias for calling [Builder.symbol] with `symbol.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt index 9cf568e7..69d2e883 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt @@ -134,7 +134,7 @@ private constructor( ) /** - * Unique OEMS instrument identifier (UUID) + * Unique instrument identifier (UUID) * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -279,9 +279,7 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Notional ADV (`adv × previous_close`). The primary liquidity signal used by - * `/instruments/search` ranking. Computed at response time so it stays consistent with whatever - * `adv` and `previous_close` show. + * Notional average daily volume (ADV multiplied by previous close price). * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -608,7 +606,7 @@ private constructor( additionalProperties = instrument.additionalProperties.toMutableMap() } - /** Unique OEMS instrument identifier (UUID) */ + /** Unique instrument identifier (UUID) */ fun id(id: String) = id(JsonField.of(id)) /** @@ -860,11 +858,7 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - /** - * Notional ADV (`adv × previous_close`). The primary liquidity signal used by - * `/instruments/search` ranking. Computed at response time so it stays consistent with - * whatever `adv` and `previous_close` show. - */ + /** Notional average daily volume (ADV multiplied by previous close price). */ fun notionalAdv(notionalAdv: String?) = notionalAdv(JsonField.ofNullable(notionalAdv)) /** Alias for calling [Builder.notionalAdv] with `notionalAdv.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt index eaaaa840..8bc29cd2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt @@ -126,7 +126,7 @@ private constructor( ) /** - * Unique OEMS instrument identifier (UUID) + * Unique instrument identifier (UUID) * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -271,9 +271,7 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Notional ADV (`adv × previous_close`). The primary liquidity signal used by - * `/instruments/search` ranking. Computed at response time so it stays consistent with whatever - * `adv` and `previous_close` show. + * Notional average daily volume (ADV multiplied by previous close price). * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -578,7 +576,7 @@ private constructor( additionalProperties = instrumentCore.additionalProperties.toMutableMap() } - /** Unique OEMS instrument identifier (UUID) */ + /** Unique instrument identifier (UUID) */ fun id(id: String) = id(JsonField.of(id)) /** @@ -830,11 +828,7 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - /** - * Notional ADV (`adv × previous_close`). The primary liquidity signal used by - * `/instruments/search` ranking. Computed at response time so it stays consistent with - * whatever `adv` and `previous_close` show. - */ + /** Notional average daily volume (ADV multiplied by previous close price). */ fun notionalAdv(notionalAdv: String?) = notionalAdv(JsonField.ofNullable(notionalAdv)) /** Alias for calling [Builder.notionalAdv] with `notionalAdv.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt index 62ccf994..f1713b81 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdParams.kt @@ -18,7 +18,7 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** When true, include unique options expiry dates for this instrument */ @@ -63,7 +63,7 @@ private constructor( instrumentGetInstrumentByIdParams.additionalQueryParams.toBuilder() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt index 3b2cb9d9..14f9b0be 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt @@ -34,7 +34,7 @@ private constructor( /** Filter by easy to borrow status */ fun easyToBorrow(): Optional = Optional.ofNullable(easyToBorrow) - /** Comma-separated OEMS instrument UUIDs */ + /** Comma-separated instrument identifiers */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) /** Filter by instrument type (e.g. COMMON_STOCK, OPTION) */ @@ -128,7 +128,7 @@ private constructor( /** Alias for calling [Builder.easyToBorrow] with `easyToBorrow.orElse(null)`. */ fun easyToBorrow(easyToBorrow: Optional) = easyToBorrow(easyToBorrow.getOrNull()) - /** Comma-separated OEMS instrument UUIDs */ + /** Comma-separated instrument identifiers */ fun instrumentIds(instrumentIds: List?) = apply { this.instrumentIds = instrumentIds?.toMutableList() } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt index 58dfc272..db453636 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetOptionContractsParams.kt @@ -46,7 +46,7 @@ private constructor( /** Underlier symbol (e.g., AAPL, SPX) */ fun underlier(): Optional = Optional.ofNullable(underlier) - /** OEMS instrument UUID or symbol of the underlying equity/index */ + /** Instrument identifier or symbol of the underlying equity/index */ fun underlyingInstrumentId(): Optional = Optional.ofNullable(underlyingInstrumentId) /** Additional headers to send with the request. */ @@ -135,7 +135,7 @@ private constructor( /** Alias for calling [Builder.underlier] with `underlier.orElse(null)`. */ fun underlier(underlier: Optional) = underlier(underlier.getOrNull()) - /** OEMS instrument UUID or symbol of the underlying equity/index */ + /** Instrument identifier or symbol of the underlying equity/index */ fun underlyingInstrumentId(underlyingInstrumentId: String?) = apply { this.underlyingInstrumentId = underlyingInstrumentId } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt index 7794cf75..0a256e41 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsParams.kt @@ -14,13 +14,11 @@ import kotlin.jvm.optionals.getOrNull * Search instruments by symbol, alternate identifier, or company name. * * The `q` parameter is case-insensitive and supports ticker symbols, alternate identifiers such as - * CUSIP, ISIN, OPRA root, and CMS identifiers, and company names for non-option instruments. - * Results are ranked by match quality plus instrument quality signals including log-scaled ADV, - * listing status, marginability, easy-to-borrow status, and OTC, restricted, and liquidation-only - * penalties. Defaults to the `EQUITY` asset class (common stocks, preferred shares, ADRs, ETFs, and - * exchange-traded mutual funds). Pass `asset_class=OPTION` to search option contracts: by full OSI - * symbol, by an OSI prefix (root + `YYMMDD` expiry, e.g. `AAPL 261217`), or by a root-scoped phrase - * such as `AAPL Dec 250 call`. + * CUSIP, ISIN, and OPRA root, and company names for non-option instruments. Results are ranked by + * match quality plus instrument quality signals and relevance. Defaults to the `EQUITY` asset class + * (common stocks, preferred shares, ADRs, ETFs, and exchange-traded mutual funds). Pass + * `asset_class=OPTION` to search option contracts: by full OSI symbol, by an OSI prefix (root + + * `YYMMDD` expiry, e.g. `AAPL 261217`), or by a root-scoped phrase such as `AAPL Dec 250 call`. */ class InstrumentSearchInstrumentsParams private constructor( @@ -38,8 +36,8 @@ private constructor( /** * Search term applied case-insensitively to ticker symbols, alternate identifiers (CUSIP, ISIN, - * OPRA root, CMS), and company names for non-option instruments. Option searches match symbols - * and alternate identifiers. + * OPRA root), and company names for non-option instruments. Option searches match symbols and + * alternate identifiers. */ fun q(): String = q @@ -123,8 +121,8 @@ private constructor( /** * Search term applied case-insensitively to ticker symbols, alternate identifiers (CUSIP, - * ISIN, OPRA root, CMS), and company names for non-option instruments. Option searches - * match symbols and alternate identifiers. + * ISIN, OPRA root), and company names for non-option instruments. Option searches match + * symbols and alternate identifiers. */ fun q(q: String) = apply { this.q = q } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt index 057a467a..079f37ef 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt @@ -92,7 +92,7 @@ private constructor( ) /** - * OEMS instrument identifier + * Instrument identifier * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -196,7 +196,7 @@ private constructor( fun openInterest(): Optional = openInterest.getOptional("open_interest") /** - * OEMS instrument ID of the underlying instrument, if resolvable + * Instrument ID of the underlying instrument, when available * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -394,7 +394,7 @@ private constructor( additionalProperties = optionsContract.additionalProperties.toMutableMap() } - /** OEMS instrument identifier */ + /** Instrument identifier */ fun id(id: String) = id(JsonField.of(id)) /** @@ -567,7 +567,7 @@ private constructor( */ fun openInterest(openInterest: JsonField) = apply { this.openInterest = openInterest } - /** OEMS instrument ID of the underlying instrument, if resolvable */ + /** Instrument ID of the underlying instrument, when available */ fun underlyingInstrumentId(underlyingInstrumentId: String?) = underlyingInstrumentId(JsonField.ofNullable(underlyingInstrumentId)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Execution.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Execution.kt index 6d146fc1..20b7c736 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Execution.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Execution.kt @@ -67,7 +67,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * OEMS instrument identifier. + * Unique instrument identifier. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -251,7 +251,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** OEMS instrument identifier. */ + /** Unique instrument identifier. */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt index 0f1f90df..d7721ff0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt @@ -155,7 +155,7 @@ private constructor( fun extendedHours(): Optional = extendedHours.getOptional("extended_hours") /** - * OEMS instrument UUID + * Instrument identifier * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -523,7 +523,7 @@ private constructor( this.extendedHours = extendedHours } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = instrumentId(JsonField.ofNullable(instrumentId)) /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt index 60823ace..5f24cba1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt @@ -200,7 +200,7 @@ private constructor( fun accountId(): Long = accountId.getRequired("account_id") /** - * Client-provided identifier echoed back (FIX tag 11). + * Client-provided identifier echoed back. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -224,7 +224,7 @@ private constructor( fun filledQuantity(): String = filledQuantity.getRequired("filled_quantity") /** - * OEMS instrument UUID for the traded instrument. + * Instrument identifier for the traded instrument. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -435,9 +435,8 @@ private constructor( trailingWatermarkTs.getOptional("trailing_watermark_ts") /** - * OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS orders; - * `null` for non-options and for options whose underlier cannot be resolved from the instrument - * cache. + * Instrument ID of the option's underlying instrument. Populated only for options orders; + * `null` for non-options and for options whose underlier cannot be resolved. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -852,7 +851,7 @@ private constructor( */ fun accountId(accountId: JsonField) = apply { this.accountId = accountId } - /** Client-provided identifier echoed back (FIX tag 11). */ + /** Client-provided identifier echoed back. */ fun clientOrderId(clientOrderId: String) = clientOrderId(JsonField.of(clientOrderId)) /** @@ -892,7 +891,7 @@ private constructor( this.filledQuantity = filledQuantity } - /** OEMS instrument UUID for the traded instrument. */ + /** Instrument identifier for the traded instrument. */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** @@ -1315,9 +1314,8 @@ private constructor( } /** - * OEMS instrument ID of the option's underlying instrument. Populated only for OPTIONS - * orders; `null` for non-options and for options whose underlier cannot be resolved from - * the instrument cache. + * Instrument ID of the option's underlying instrument. Populated only for options orders; + * `null` for non-options and for options whose underlier cannot be resolved. */ fun underlyingInstrumentId(underlyingInstrumentId: String?) = underlyingInstrumentId(JsonField.ofNullable(underlyingInstrumentId)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt index 55d85145..d2a79903 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersParams.kt @@ -30,7 +30,7 @@ private constructor( fun accountId(): Optional = Optional.ofNullable(accountId) - /** Comma-separated OEMS instrument UUIDs */ + /** Comma-separated instrument identifiers */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) /** Filter by instrument type (e.g., COMMON_STOCK, OPTION) */ @@ -101,7 +101,7 @@ private constructor( /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) - /** Comma-separated OEMS instrument UUIDs */ + /** Comma-separated instrument identifiers */ fun instrumentIds(instrumentIds: List?) = apply { this.instrumentIds = instrumentIds?.toMutableList() } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParams.kt index 6502779f..c2b65b61 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetExecutionsParams.kt @@ -33,8 +33,8 @@ private constructor( fun from(): Optional = Optional.ofNullable(from) /** - * Optional instrument to filter by. Accepts either a symbol (e.g. `AAPL`) or an OEMS instrument - * UUID. + * Optional instrument to filter by. Accepts either a symbol (e.g. `AAPL`) or an instrument + * identifier. */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) @@ -109,8 +109,8 @@ private constructor( fun from(from: Optional) = from(from.getOrNull()) /** - * Optional instrument to filter by. Accepts either a symbol (e.g. `AAPL`) or an OEMS - * instrument UUID. + * Optional instrument to filter by. Accepts either a symbol (e.g. `AAPL`) or an instrument + * identifier. */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt index f64a6fa3..86e65ac3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt @@ -38,7 +38,7 @@ private constructor( /** The start date and time for the query range, inclusive (ISO 8601 format) */ fun from(): Optional = Optional.ofNullable(from) - /** Comma-separated OEMS instrument UUIDs */ + /** Comma-separated instrument identifiers */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) /** Instrument type filter (e.g., COMMON_STOCK, OPTION) */ @@ -63,8 +63,8 @@ private constructor( fun to(): Optional = Optional.ofNullable(to) /** - * Comma-separated OEMS instrument UUIDs. Matches options orders whose resolved underlier is any - * of the given IDs. + * Comma-separated instrument identifiers. Matches options orders whose resolved underlier is + * any of the given IDs. */ fun underlyingInstrumentIds(): Optional> = Optional.ofNullable(underlyingInstrumentIds) @@ -135,7 +135,7 @@ private constructor( /** Alias for calling [Builder.from] with `from.orElse(null)`. */ fun from(from: Optional) = from(from.getOrNull()) - /** Comma-separated OEMS instrument UUIDs */ + /** Comma-separated instrument identifiers */ fun instrumentIds(instrumentIds: List?) = apply { this.instrumentIds = instrumentIds?.toMutableList() } @@ -212,8 +212,8 @@ private constructor( fun to(to: Optional) = to(to.getOrNull()) /** - * Comma-separated OEMS instrument UUIDs. Matches options orders whose resolved underlier is - * any of the given IDs. + * Comma-separated instrument identifiers. Matches options orders whose resolved underlier + * is any of the given IDs. */ fun underlyingInstrumentIds(underlyingInstrumentIds: List?) = apply { this.underlyingInstrumentIds = underlyingInstrumentIds?.toMutableList() diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt index 640c8d0f..55828a22 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt @@ -129,7 +129,7 @@ private constructor( fun availableQuantity(): String = availableQuantity.getRequired("available_quantity") /** - * OEMS instrument UUID + * Unique instrument identifier * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -236,7 +236,7 @@ private constructor( fun instrumentPrice(): Optional = instrumentPrice.getOptional("instrument_price") /** - * OEMS instrument identifier of the underlying instrument, if resolvable + * Identifier of the underlying instrument, when available * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -523,7 +523,7 @@ private constructor( this.availableQuantity = availableQuantity } - /** OEMS instrument UUID */ + /** Unique instrument identifier */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** @@ -730,7 +730,7 @@ private constructor( this.instrumentPrice = instrumentPrice } - /** OEMS instrument identifier of the underlying instrument, if resolvable */ + /** Identifier of the underlying instrument, when available */ fun underlyingInstrumentId(underlyingInstrumentId: String?) = underlyingInstrumentId(JsonField.ofNullable(underlyingInstrumentId)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParams.kt index 61491c87..ec6ebdea 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionParams.kt @@ -36,7 +36,7 @@ private constructor( fun accountId(): Long = accountId - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** @@ -97,7 +97,7 @@ private constructor( fun accountId(accountId: Long) = apply { this.accountId = accountId } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt index 0e699bd6..acb858ef 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt @@ -29,7 +29,7 @@ private constructor( fun accountId(): Optional = Optional.ofNullable(accountId) - /** Comma-separated OEMS instrument UUIDs */ + /** Comma-separated instrument identifiers */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) /** The number of items to return per page. Only used when page_token is not provided. */ @@ -101,7 +101,7 @@ private constructor( /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) - /** Comma-separated OEMS instrument UUIDs */ + /** Comma-separated instrument identifiers */ fun instrumentIds(instrumentIds: List?) = apply { this.instrumentIds = instrumentIds?.toMutableList() } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt index 78724957..f2c2c051 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt @@ -9,20 +9,18 @@ import com.fasterxml.jackson.annotation.JsonCreator /** * Lifecycle status of a position instruction. - * - `SENT`: accepted and forwarded to the clearing venue. + * - `SENT`: accepted and submitted to the clearing venue. * - `ACCEPTED`: terminal — accepted by the clearing venue. * - `REJECTED`: terminal rejection from the clearing venue; `rejection_reason` carries the * venue-reported detail. - * - `ENGINE_REJECTED`: terminal rejection raised before the instruction reached the clearing venue; - * `rejection_reason` carries the detail. Typical causes: duplicate `instruction_id`, - * `DO_NOT_EXERCISE` / `CONTRARY_EXERCISE` submitted on a non-expiry day, insufficient position, - * or an instrument that does not resolve. + * - `ENGINE_REJECTED`: terminal rejection from validation; `rejection_reason` carries the detail. + * Typical causes: duplicate `instruction_id`, `DO_NOT_EXERCISE` / `CONTRARY_EXERCISE` submitted + * on a non-expiry day, insufficient position, or an invalid instrument. * - `CANCEL_REQUESTED`: cancel accepted; final cancel state pending. * - `CANCELLED`: terminal — cancel completed. * - `CANCEL_FAILED`: cancel could not be completed; operator attention required. `rejection_reason` * carries the detail. - * - `UNKNOWN`: status could not be mapped from the upstream service. Not expected in practice; - * surfaces a service version skew. + * - `UNKNOWN`: status could not be determined. */ class PositionInstructionStatus @JsonCreator diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt index f3d4abb9..9dc37b55 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistAddWatchlistItemParams.kt @@ -32,7 +32,7 @@ private constructor( fun watchlistId(): Optional = Optional.ofNullable(watchlistId) /** - * OEMS instrument UUID + * Instrument identifier * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -102,7 +102,7 @@ private constructor( */ fun body(body: Body) = apply { this.body = body.toBuilder() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String) = apply { body.instrumentId(instrumentId) } /** @@ -282,7 +282,7 @@ private constructor( ) : this(instrumentId, mutableMapOf()) /** - * OEMS instrument UUID + * Instrument identifier * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -336,7 +336,7 @@ private constructor( additionalProperties = body.additionalProperties.toMutableMap() } - /** OEMS instrument UUID */ + /** Instrument identifier */ fun instrumentId(instrumentId: String) = instrumentId(JsonField.of(instrumentId)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt index cf5ad93c..7aa2216c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsync.kt @@ -124,13 +124,12 @@ interface InstrumentServiceAsync { * Search instruments by symbol, alternate identifier, or company name. * * The `q` parameter is case-insensitive and supports ticker symbols, alternate identifiers such - * as CUSIP, ISIN, OPRA root, and CMS identifiers, and company names for non-option instruments. - * Results are ranked by match quality plus instrument quality signals including log-scaled ADV, - * listing status, marginability, easy-to-borrow status, and OTC, restricted, and - * liquidation-only penalties. Defaults to the `EQUITY` asset class (common stocks, preferred - * shares, ADRs, ETFs, and exchange-traded mutual funds). Pass `asset_class=OPTION` to search - * option contracts: by full OSI symbol, by an OSI prefix (root + `YYMMDD` expiry, e.g. `AAPL - * 261217`), or by a root-scoped phrase such as `AAPL Dec 250 call`. + * as CUSIP, ISIN, and OPRA root, and company names for non-option instruments. Results are + * ranked by match quality plus instrument quality signals and relevance. Defaults to the + * `EQUITY` asset class (common stocks, preferred shares, ADRs, ETFs, and exchange-traded mutual + * funds). Pass `asset_class=OPTION` to search option contracts: by full OSI symbol, by an OSI + * prefix (root + `YYMMDD` expiry, e.g. `AAPL 261217`), or by a root-scoped phrase such as `AAPL + * Dec 250 call`. */ fun searchInstruments( params: InstrumentSearchInstrumentsParams diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt index 37e2775e..f937951c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsync.kt @@ -28,18 +28,13 @@ interface MarketDataServiceAsync { fun withOptions(modifier: Consumer): MarketDataServiceAsync /** - * Returns the most recent OHLV and current price for the requested OEMS instruments. Backed by - * the in-memory Polygon snapshot cache. + * Returns the most recent open, high, low, volume (OHLV) and current price for the requested + * instruments. * * Response contract: every request returns one row per **unique** `instrument_id`, in * first-seen request order. Unresolvable IDs come back with `symbol = null` and every - * market-data field `null`; resolvable IDs with no cache entry come back with `symbol` + * market-data field `null`; resolvable IDs with no available data come back with `symbol` * populated but market-data fields `null`. - * - * **Note (temporary):** ID resolution currently goes through the supplemental screener (OEMS - * instrument_id → FMP fmp_symbol → metadata_id → realtime cache). Removed when the market-data - * service serves daily aggregates directly, or when Polygon symbology is loaded into the - * instrument cache. */ fun getDailySummaries( params: MarketDataGetDailySummariesParams diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt index adb9b822..eaf5e23b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentService.kt @@ -115,13 +115,12 @@ interface InstrumentService { * Search instruments by symbol, alternate identifier, or company name. * * The `q` parameter is case-insensitive and supports ticker symbols, alternate identifiers such - * as CUSIP, ISIN, OPRA root, and CMS identifiers, and company names for non-option instruments. - * Results are ranked by match quality plus instrument quality signals including log-scaled ADV, - * listing status, marginability, easy-to-borrow status, and OTC, restricted, and - * liquidation-only penalties. Defaults to the `EQUITY` asset class (common stocks, preferred - * shares, ADRs, ETFs, and exchange-traded mutual funds). Pass `asset_class=OPTION` to search - * option contracts: by full OSI symbol, by an OSI prefix (root + `YYMMDD` expiry, e.g. `AAPL - * 261217`), or by a root-scoped phrase such as `AAPL Dec 250 call`. + * as CUSIP, ISIN, and OPRA root, and company names for non-option instruments. Results are + * ranked by match quality plus instrument quality signals and relevance. Defaults to the + * `EQUITY` asset class (common stocks, preferred shares, ADRs, ETFs, and exchange-traded mutual + * funds). Pass `asset_class=OPTION` to search option contracts: by full OSI symbol, by an OSI + * prefix (root + `YYMMDD` expiry, e.g. `AAPL 261217`), or by a root-scoped phrase such as `AAPL + * Dec 250 call`. */ fun searchInstruments( params: InstrumentSearchInstrumentsParams diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataService.kt index 513f9c14..de6de99d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataService.kt @@ -28,18 +28,13 @@ interface MarketDataService { fun withOptions(modifier: Consumer): MarketDataService /** - * Returns the most recent OHLV and current price for the requested OEMS instruments. Backed by - * the in-memory Polygon snapshot cache. + * Returns the most recent open, high, low, volume (OHLV) and current price for the requested + * instruments. * * Response contract: every request returns one row per **unique** `instrument_id`, in * first-seen request order. Unresolvable IDs come back with `symbol = null` and every - * market-data field `null`; resolvable IDs with no cache entry come back with `symbol` + * market-data field `null`; resolvable IDs with no available data come back with `symbol` * populated but market-data fields `null`. - * - * **Note (temporary):** ID resolution currently goes through the supplemental screener (OEMS - * instrument_id → FMP fmp_symbol → metadata_id → realtime cache). Removed when the market-data - * service serves daily aggregates directly, or when Polygon symbology is loaded into the - * instrument cache. */ fun getDailySummaries( params: MarketDataGetDailySummariesParams From 3cb8eecffa17d006a143666247e4e0965710adad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 18:40:51 +0000 Subject: [PATCH 37/51] feat(api): api update --- .stats.yml | 6 +-- .../clearstreet/api/TestServerExtension.kt | 49 +++++++++++++++++ .../api/services/ServiceParamsTest.kt | 2 - .../async/v1/AccountServiceAsyncTest.kt | 39 ++++++++++---- .../async/v1/ApiVersionServiceAsyncTest.kt | 11 ++-- .../async/v1/CalendarServiceAsyncTest.kt | 18 +++++-- .../v1/InstrumentDataServiceAsyncTest.kt | 53 +++++++++++++------ .../async/v1/InstrumentServiceAsyncTest.kt | 32 +++++++---- .../async/v1/OrderServiceAsyncTest.kt | 53 +++++++++++++------ .../async/v1/PositionServiceAsyncTest.kt | 46 +++++++++++----- .../async/v1/WatchlistServiceAsyncTest.kt | 46 +++++++++++----- .../async/v1/WebsocketServiceAsyncTest.kt | 11 +++- .../MarketDataServiceAsyncTest.kt | 18 +++++-- .../v1/instrumentdata/NewsServiceAsyncTest.kt | 11 ++-- .../v1/omniai/EntitlementServiceAsyncTest.kt | 32 +++++++---- .../v1/omniai/MessageServiceAsyncTest.kt | 18 +++++-- .../v1/omniai/ResponseServiceAsyncTest.kt | 18 +++++-- .../async/v1/omniai/ThreadServiceAsyncTest.kt | 46 +++++++++++----- .../blocking/v1/AccountServiceTest.kt | 39 ++++++++++---- .../blocking/v1/ApiVersionServiceTest.kt | 11 ++-- .../blocking/v1/CalendarServiceTest.kt | 18 +++++-- .../blocking/v1/InstrumentDataServiceTest.kt | 53 +++++++++++++------ .../blocking/v1/InstrumentServiceTest.kt | 32 +++++++---- .../services/blocking/v1/OrderServiceTest.kt | 53 +++++++++++++------ .../blocking/v1/PositionServiceTest.kt | 46 +++++++++++----- .../blocking/v1/WatchlistServiceTest.kt | 46 +++++++++++----- .../blocking/v1/WebsocketServiceTest.kt | 11 +++- .../instrumentdata/MarketDataServiceTest.kt | 18 +++++-- .../v1/instrumentdata/NewsServiceTest.kt | 11 ++-- .../v1/omniai/EntitlementServiceTest.kt | 32 +++++++---- .../blocking/v1/omniai/MessageServiceTest.kt | 18 +++++-- .../blocking/v1/omniai/ResponseServiceTest.kt | 18 +++++-- .../blocking/v1/omniai/ThreadServiceTest.kt | 46 +++++++++++----- scripts/mock | 52 ++++++++++++++++++ scripts/test | 46 ++++++++++++++++ 35 files changed, 802 insertions(+), 257 deletions(-) create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/TestServerExtension.kt create mode 100755 scripts/mock diff --git a/.stats.yml b/.stats.yml index 256ee9f6..1b7e68d2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-d5701ada74a30287bc9f07b5919cb38f2f21b7a7042c8ae6ebd0fbe53f1b19bb.yml -openapi_spec_hash: 591bc8e46ba022314c75d1dc51206aab -config_hash: f4e0d70a371aa59c47bdbaf7fc99b80a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-86d0e8705f28ab0ae1e3f25000d4ad3f6c0afaa47e92dd75129e81e38ec7bbb1.yml +openapi_spec_hash: 99eeff93e8f4870b0000733aacd2af7f +config_hash: 39a6f3e7ce9a1c7a43a865fe7a6aec70 diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/TestServerExtension.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/TestServerExtension.kt new file mode 100644 index 00000000..558f886d --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/TestServerExtension.kt @@ -0,0 +1,49 @@ +package com.clearstreet.api + +import java.lang.RuntimeException +import java.net.URL +import org.junit.jupiter.api.extension.BeforeAllCallback +import org.junit.jupiter.api.extension.ConditionEvaluationResult +import org.junit.jupiter.api.extension.ExecutionCondition +import org.junit.jupiter.api.extension.ExtensionContext + +class TestServerExtension : BeforeAllCallback, ExecutionCondition { + + override fun beforeAll(context: ExtensionContext?) { + try { + URL(BASE_URL).openConnection().connect() + } catch (e: Exception) { + throw RuntimeException( + """ + The test suite will not run without a mock server running against your OpenAPI spec. + + You can set the environment variable `SKIP_MOCK_TESTS` to `true` to skip running any tests + that require the mock server. + + To fix run `./scripts/mock` in a separate terminal. + """ + .trimIndent(), + e, + ) + } + } + + override fun evaluateExecutionCondition(context: ExtensionContext): ConditionEvaluationResult { + return if (System.getenv(SKIP_TESTS_ENV).toBoolean()) { + ConditionEvaluationResult.disabled( + "Environment variable $SKIP_TESTS_ENV is set to true" + ) + } else { + ConditionEvaluationResult.enabled( + "Environment variable $SKIP_TESTS_ENV is not set to true" + ) + } + } + + companion object { + + val BASE_URL = System.getenv("TEST_API_BASE_URL") ?: "http://localhost:4010" + + const val SKIP_TESTS_ENV: String = "SKIP_MOCK_TESTS" + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt index aa126f1f..d8bd5ed7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt @@ -15,7 +15,6 @@ import com.github.tomakehurst.wiremock.client.WireMock.verify import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.junit.jupiter.api.parallel.ResourceLock @@ -34,7 +33,6 @@ internal class ServiceParamsTest { .build() } - @Disabled("Mock server tests are disabled") @Test fun getAccounts() { val accountService = client.v1().accounts() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt index 87471ceb..1dbc1504 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams @@ -9,15 +10,19 @@ import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryParams import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams import com.clearstreet.api.models.v1.accounts.RiskSettings import java.time.LocalDate -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class AccountServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun getAccountBalances() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountServiceAsync = client.v1().accounts() val responseFuture = @@ -32,10 +37,13 @@ internal class AccountServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getAccountById() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountServiceAsync = client.v1().accounts() val responseFuture = accountServiceAsync.getAccountById(0L) @@ -44,10 +52,13 @@ internal class AccountServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getAccounts() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountServiceAsync = client.v1().accounts() val responseFuture = @@ -62,10 +73,13 @@ internal class AccountServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getPortfolioHistory() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountServiceAsync = client.v1().accounts() val responseFuture = @@ -81,10 +95,13 @@ internal class AccountServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun patchAccountById() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountServiceAsync = client.v1().accounts() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncTest.kt index a7aff11c..05a107a8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ApiVersionServiceAsyncTest.kt @@ -2,16 +2,21 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class ApiVersionServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun getVersion() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val apiVersionServiceAsync = client.v1().apiVersion() val responseFuture = apiVersionServiceAsync.getVersion() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsyncTest.kt index 871cc855..304767e4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/CalendarServiceAsyncTest.kt @@ -2,18 +2,23 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams import com.clearstreet.api.models.v1.calendar.MarketType -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class CalendarServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun getClock() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val calendarServiceAsync = client.v1().calendar() val responseFuture = calendarServiceAsync.getClock() @@ -22,10 +27,13 @@ internal class CalendarServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getMarketHoursCalendar() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val calendarServiceAsync = client.v1().calendar() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncTest.kt index 8a6a8851..d31c4f6b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentDataServiceAsyncTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.instrumentdata.AllEventsEventType import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams @@ -11,15 +12,19 @@ import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentC import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams import java.time.LocalDate -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class InstrumentDataServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun getAllInstrumentEvents() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataServiceAsync = client.v1().instrumentData() val responseFuture = @@ -36,10 +41,13 @@ internal class InstrumentDataServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentAnalystConsensus() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataServiceAsync = client.v1().instrumentData() val responseFuture = @@ -55,10 +63,13 @@ internal class InstrumentDataServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentBalanceSheetStatements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataServiceAsync = client.v1().instrumentData() val responseFuture = @@ -76,10 +87,13 @@ internal class InstrumentDataServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentCashFlowStatements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataServiceAsync = client.v1().instrumentData() val responseFuture = @@ -97,10 +111,13 @@ internal class InstrumentDataServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentEvents() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataServiceAsync = client.v1().instrumentData() val responseFuture = @@ -116,10 +133,13 @@ internal class InstrumentDataServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentFundamentals() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataServiceAsync = client.v1().instrumentData() val responseFuture = @@ -131,10 +151,13 @@ internal class InstrumentDataServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentIncomeStatements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataServiceAsync = client.v1().instrumentData() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncTest.kt index 9ec3a7c5..2c0ddae8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/InstrumentServiceAsyncTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.instruments.ContractType import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdParams @@ -9,15 +10,19 @@ import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsParams import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsParams import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsParams import java.time.LocalDate -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class InstrumentServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun getInstrumentById() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentServiceAsync = client.v1().instruments() val responseFuture = @@ -32,10 +37,13 @@ internal class InstrumentServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstruments() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentServiceAsync = client.v1().instruments() val responseFuture = @@ -58,10 +66,13 @@ internal class InstrumentServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getOptionContracts() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentServiceAsync = client.v1().instruments() val responseFuture = @@ -80,10 +91,13 @@ internal class InstrumentServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun searchInstruments() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentServiceAsync = client.v1().instruments() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt index f9107db4..895b7b96 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams @@ -15,15 +16,19 @@ import com.clearstreet.api.models.v1.orders.RequestOrderType import com.clearstreet.api.models.v1.orders.RequestTimeInForce import com.clearstreet.api.models.v1.orders.Side import java.time.OffsetDateTime -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class OrderServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun cancelAllOpenOrders() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderServiceAsync = client.v1().orders() val responseFuture = @@ -41,10 +46,13 @@ internal class OrderServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun cancelOpenOrder() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderServiceAsync = client.v1().orders() val responseFuture = @@ -56,10 +64,13 @@ internal class OrderServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getExecutions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderServiceAsync = client.v1().orders() val responseFuture = @@ -78,10 +89,13 @@ internal class OrderServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getOrderById() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderServiceAsync = client.v1().orders() val responseFuture = @@ -93,10 +107,13 @@ internal class OrderServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getOrders() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderServiceAsync = client.v1().orders() val responseFuture = @@ -119,10 +136,13 @@ internal class OrderServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun replaceOrder() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderServiceAsync = client.v1().orders() val responseFuture = @@ -141,10 +161,13 @@ internal class OrderServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun submitOrders() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderServiceAsync = client.v1().orders() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncTest.kt index 8b7df1d6..d8fe5536 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsyncTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionParams import com.clearstreet.api.models.v1.positions.PositionClosePositionParams @@ -10,15 +11,19 @@ import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsPa import com.clearstreet.api.models.v1.positions.PositionGetPositionsParams import com.clearstreet.api.models.v1.positions.PositionInstructionType import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class PositionServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun cancelPositionInstruction() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionServiceAsync = client.v1().positions() val responseFuture = @@ -33,10 +38,13 @@ internal class PositionServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun closePosition() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionServiceAsync = client.v1().positions() val responseFuture = @@ -52,10 +60,13 @@ internal class PositionServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun closePositions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionServiceAsync = client.v1().positions() val responseFuture = @@ -67,10 +78,13 @@ internal class PositionServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getPositionInstructions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionServiceAsync = client.v1().positions() val responseFuture = @@ -85,10 +99,13 @@ internal class PositionServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getPositions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionServiceAsync = client.v1().positions() val responseFuture = @@ -107,10 +124,13 @@ internal class PositionServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun submitPositionInstructions() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionServiceAsync = client.v1().positions() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncTest.kt index fe8e1b93..7f1f7c88 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WatchlistServiceAsyncTest.kt @@ -2,20 +2,25 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemParams import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistParams import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class WatchlistServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun addWatchlistItem() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistServiceAsync = client.v1().watchlist() val responseFuture = @@ -30,10 +35,13 @@ internal class WatchlistServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun createWatchlist() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistServiceAsync = client.v1().watchlist() val responseFuture = @@ -45,10 +53,13 @@ internal class WatchlistServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun deleteWatchlist() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistServiceAsync = client.v1().watchlist() val responseFuture = @@ -58,10 +69,13 @@ internal class WatchlistServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun deleteWatchlistItem() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistServiceAsync = client.v1().watchlist() val responseFuture = @@ -76,10 +90,13 @@ internal class WatchlistServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getWatchlistById() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistServiceAsync = client.v1().watchlist() val responseFuture = @@ -89,10 +106,13 @@ internal class WatchlistServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getWatchlists() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistServiceAsync = client.v1().watchlist() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt index 8c1a09b3..cf4b04d6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt @@ -2,16 +2,23 @@ package com.clearstreet.api.services.async.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class WebsocketServiceAsyncTest { - @Disabled("Mock server tests are disabled") + @Disabled("websocket upgrade endpoint is currently not modeled correctly for stainless") @Test fun websocketHandler() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val websocketServiceAsync = client.v1().websocket() val future = websocketServiceAsync.websocketHandler() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt index 8a8cb95b..a92c9d5c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/MarketDataServiceAsyncTest.kt @@ -2,18 +2,23 @@ package com.clearstreet.api.services.async.v1.instrumentdata +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class MarketDataServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun getDailySummaries() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val marketDataServiceAsync = client.v1().instrumentData().marketData() val responseFuture = @@ -25,10 +30,13 @@ internal class MarketDataServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getSnapshots() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val marketDataServiceAsync = client.v1().instrumentData().marketData() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt index cb68f760..791d48c1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/instrumentdata/NewsServiceAsyncTest.kt @@ -2,17 +2,22 @@ package com.clearstreet.api.services.async.v1.instrumentdata +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class NewsServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun getNews() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val newsServiceAsync = client.v1().instrumentData().news() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt index 4f49dad8..3edd2642 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/EntitlementServiceAsyncTest.kt @@ -2,19 +2,24 @@ package com.clearstreet.api.services.async.v1.omniai +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class EntitlementServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun createEntitlements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val entitlementServiceAsync = client.v1().omniAi().entitlements() val responseFuture = @@ -31,10 +36,13 @@ internal class EntitlementServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun deleteEntitlement() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val entitlementServiceAsync = client.v1().omniAi().entitlements() val responseFuture = entitlementServiceAsync.deleteEntitlement("entitlement_id") @@ -43,10 +51,13 @@ internal class EntitlementServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getEntitlementAgreements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val entitlementServiceAsync = client.v1().omniAi().entitlements() val responseFuture = entitlementServiceAsync.getEntitlementAgreements() @@ -55,10 +66,13 @@ internal class EntitlementServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getEntitlements() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val entitlementServiceAsync = client.v1().omniAi().entitlements() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncTest.kt index 7e3620bb..1de6a656 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/MessageServiceAsyncTest.kt @@ -2,19 +2,24 @@ package com.clearstreet.api.services.async.v1.omniai +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.core.JsonValue import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdParams import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class MessageServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun getMessageById() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val messageServiceAsync = client.v1().omniAi().messages() val responseFuture = @@ -29,10 +34,13 @@ internal class MessageServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun submitFeedback() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val messageServiceAsync = client.v1().omniAi().messages() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt index c70397a1..d5284a65 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ResponseServiceAsyncTest.kt @@ -2,18 +2,23 @@ package com.clearstreet.api.services.async.v1.omniai +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseParams import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class ResponseServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun cancelResponse() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val responseServiceAsync = client.v1().omniAi().responses() val responseFuture = @@ -28,10 +33,13 @@ internal class ResponseServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getResponseById() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val responseServiceAsync = client.v1().omniAi().responses() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt index 62b7e470..9ae62f61 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/omniai/ThreadServiceAsyncTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.async.v1.omniai +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageParams import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadParams @@ -9,15 +10,19 @@ import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesParams import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdParams import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseParams import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class ThreadServiceAsyncTest { - @Disabled("Mock server tests are disabled") @Test fun createMessage() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadServiceAsync = client.v1().omniAi().threads() val responseFuture = @@ -34,10 +39,13 @@ internal class ThreadServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun createThread() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadServiceAsync = client.v1().omniAi().threads() val responseFuture = @@ -61,10 +69,13 @@ internal class ThreadServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getMessages() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadServiceAsync = client.v1().omniAi().threads() val responseFuture = @@ -81,10 +92,13 @@ internal class ThreadServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getThreadById() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadServiceAsync = client.v1().omniAi().threads() val responseFuture = @@ -99,10 +113,13 @@ internal class ThreadServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getThreadResponse() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadServiceAsync = client.v1().omniAi().threads() val responseFuture = @@ -117,10 +134,13 @@ internal class ThreadServiceAsyncTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getThreads() { - val client = ClearStreetOkHttpClientAsync.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadServiceAsync = client.v1().omniAi().threads() val responseFuture = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt index 3ef13b67..77b48ecc 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams @@ -9,15 +10,19 @@ import com.clearstreet.api.models.v1.accounts.AccountGetPortfolioHistoryParams import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams import com.clearstreet.api.models.v1.accounts.RiskSettings import java.time.LocalDate -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class AccountServiceTest { - @Disabled("Mock server tests are disabled") @Test fun getAccountBalances() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountService = client.v1().accounts() val response = @@ -31,10 +36,13 @@ internal class AccountServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getAccountById() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountService = client.v1().accounts() val response = accountService.getAccountById(0L) @@ -42,10 +50,13 @@ internal class AccountServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getAccounts() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountService = client.v1().accounts() val response = @@ -59,10 +70,13 @@ internal class AccountServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getPortfolioHistory() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountService = client.v1().accounts() val response = @@ -77,10 +91,13 @@ internal class AccountServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun patchAccountById() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val accountService = client.v1().accounts() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceTest.kt index 8e5a4350..3950f6ba 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ApiVersionServiceTest.kt @@ -2,16 +2,21 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class ApiVersionServiceTest { - @Disabled("Mock server tests are disabled") @Test fun getVersion() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val apiVersionService = client.v1().apiVersion() val response = apiVersionService.getVersion() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceTest.kt index d062a347..8ec81d2e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/CalendarServiceTest.kt @@ -2,18 +2,23 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.calendar.CalendarGetMarketHoursCalendarParams import com.clearstreet.api.models.v1.calendar.MarketType -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class CalendarServiceTest { - @Disabled("Mock server tests are disabled") @Test fun getClock() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val calendarService = client.v1().calendar() val response = calendarService.getClock() @@ -21,10 +26,13 @@ internal class CalendarServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getMarketHoursCalendar() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val calendarService = client.v1().calendar() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceTest.kt index 2d10aa2a..efe0eb90 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentDataServiceTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.instrumentdata.AllEventsEventType import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetAllInstrumentEventsParams @@ -11,15 +12,19 @@ import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentC import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentEventsParams import com.clearstreet.api.models.v1.instrumentdata.InstrumentDataGetInstrumentIncomeStatementsParams import java.time.LocalDate -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class InstrumentDataServiceTest { - @Disabled("Mock server tests are disabled") @Test fun getAllInstrumentEvents() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataService = client.v1().instrumentData() val response = @@ -35,10 +40,13 @@ internal class InstrumentDataServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentAnalystConsensus() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataService = client.v1().instrumentData() val response = @@ -53,10 +61,13 @@ internal class InstrumentDataServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentBalanceSheetStatements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataService = client.v1().instrumentData() val response = @@ -73,10 +84,13 @@ internal class InstrumentDataServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentCashFlowStatements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataService = client.v1().instrumentData() val response = @@ -93,10 +107,13 @@ internal class InstrumentDataServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentEvents() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataService = client.v1().instrumentData() val response = @@ -111,10 +128,13 @@ internal class InstrumentDataServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentFundamentals() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataService = client.v1().instrumentData() val response = @@ -123,10 +143,13 @@ internal class InstrumentDataServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstrumentIncomeStatements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentDataService = client.v1().instrumentData() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceTest.kt index f6923e9a..0e7caed3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/InstrumentServiceTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.instruments.ContractType import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentByIdParams @@ -9,15 +10,19 @@ import com.clearstreet.api.models.v1.instruments.InstrumentGetInstrumentsParams import com.clearstreet.api.models.v1.instruments.InstrumentGetOptionContractsParams import com.clearstreet.api.models.v1.instruments.InstrumentSearchInstrumentsParams import java.time.LocalDate -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class InstrumentServiceTest { - @Disabled("Mock server tests are disabled") @Test fun getInstrumentById() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentService = client.v1().instruments() val response = @@ -31,10 +36,13 @@ internal class InstrumentServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getInstruments() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentService = client.v1().instruments() val response = @@ -56,10 +64,13 @@ internal class InstrumentServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getOptionContracts() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentService = client.v1().instruments() val response = @@ -77,10 +88,13 @@ internal class InstrumentServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun searchInstruments() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val instrumentService = client.v1().instruments() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt index 2252a370..66ab2907 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams @@ -15,15 +16,19 @@ import com.clearstreet.api.models.v1.orders.RequestOrderType import com.clearstreet.api.models.v1.orders.RequestTimeInForce import com.clearstreet.api.models.v1.orders.Side import java.time.OffsetDateTime -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class OrderServiceTest { - @Disabled("Mock server tests are disabled") @Test fun cancelAllOpenOrders() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderService = client.v1().orders() val response = @@ -40,10 +45,13 @@ internal class OrderServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun cancelOpenOrder() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderService = client.v1().orders() val response = @@ -54,10 +62,13 @@ internal class OrderServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getExecutions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderService = client.v1().orders() val response = @@ -75,10 +86,13 @@ internal class OrderServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getOrderById() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderService = client.v1().orders() val response = @@ -89,10 +103,13 @@ internal class OrderServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getOrders() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderService = client.v1().orders() val response = @@ -114,10 +131,13 @@ internal class OrderServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun replaceOrder() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderService = client.v1().orders() val response = @@ -135,10 +155,13 @@ internal class OrderServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun submitOrders() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val orderService = client.v1().orders() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceTest.kt index 250ddac6..9fa892e7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/PositionServiceTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.positions.PositionCancelPositionInstructionParams import com.clearstreet.api.models.v1.positions.PositionClosePositionParams @@ -10,15 +11,19 @@ import com.clearstreet.api.models.v1.positions.PositionGetPositionInstructionsPa import com.clearstreet.api.models.v1.positions.PositionGetPositionsParams import com.clearstreet.api.models.v1.positions.PositionInstructionType import com.clearstreet.api.models.v1.positions.PositionSubmitPositionInstructionsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class PositionServiceTest { - @Disabled("Mock server tests are disabled") @Test fun cancelPositionInstruction() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionService = client.v1().positions() val response = @@ -32,10 +37,13 @@ internal class PositionServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun closePosition() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionService = client.v1().positions() val response = @@ -50,10 +58,13 @@ internal class PositionServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun closePositions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionService = client.v1().positions() val response = @@ -64,10 +75,13 @@ internal class PositionServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getPositionInstructions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionService = client.v1().positions() val response = @@ -81,10 +95,13 @@ internal class PositionServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getPositions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionService = client.v1().positions() val response = @@ -102,10 +119,13 @@ internal class PositionServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun submitPositionInstructions() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val positionService = client.v1().positions() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceTest.kt index cf53593d..b6a7f95f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WatchlistServiceTest.kt @@ -2,20 +2,25 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.watchlist.WatchlistAddWatchlistItemParams import com.clearstreet.api.models.v1.watchlist.WatchlistCreateWatchlistParams import com.clearstreet.api.models.v1.watchlist.WatchlistDeleteWatchlistItemParams import com.clearstreet.api.models.v1.watchlist.WatchlistGetWatchlistsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class WatchlistServiceTest { - @Disabled("Mock server tests are disabled") @Test fun addWatchlistItem() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistService = client.v1().watchlist() val response = @@ -29,10 +34,13 @@ internal class WatchlistServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun createWatchlist() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistService = client.v1().watchlist() val response = @@ -43,10 +51,13 @@ internal class WatchlistServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun deleteWatchlist() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistService = client.v1().watchlist() val response = watchlistService.deleteWatchlist("550e8400-e29b-41d4-a716-446655440000") @@ -54,10 +65,13 @@ internal class WatchlistServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun deleteWatchlistItem() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistService = client.v1().watchlist() val response = @@ -71,10 +85,13 @@ internal class WatchlistServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getWatchlistById() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistService = client.v1().watchlist() val response = watchlistService.getWatchlistById("550e8400-e29b-41d4-a716-446655440000") @@ -82,10 +99,13 @@ internal class WatchlistServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getWatchlists() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val watchlistService = client.v1().watchlist() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt index a3a34297..5a5adaa5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt @@ -2,16 +2,23 @@ package com.clearstreet.api.services.blocking.v1 +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class WebsocketServiceTest { - @Disabled("Mock server tests are disabled") + @Disabled("websocket upgrade endpoint is currently not modeled correctly for stainless") @Test fun websocketHandler() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val websocketService = client.v1().websocket() websocketService.websocketHandler() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt index 069fa7c4..7b1fe591 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/MarketDataServiceTest.kt @@ -2,18 +2,23 @@ package com.clearstreet.api.services.blocking.v1.instrumentdata +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetDailySummariesParams import com.clearstreet.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class MarketDataServiceTest { - @Disabled("Mock server tests are disabled") @Test fun getDailySummaries() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val marketDataService = client.v1().instrumentData().marketData() val response = @@ -24,10 +29,13 @@ internal class MarketDataServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getSnapshots() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val marketDataService = client.v1().instrumentData().marketData() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt index a3aab3d9..148e39ca 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/instrumentdata/NewsServiceTest.kt @@ -2,17 +2,22 @@ package com.clearstreet.api.services.blocking.v1.instrumentdata +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.instrumentdata.news.NewsGetNewsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class NewsServiceTest { - @Disabled("Mock server tests are disabled") @Test fun getNews() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val newsService = client.v1().instrumentData().news() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceTest.kt index f338bd35..2c031eef 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/EntitlementServiceTest.kt @@ -2,19 +2,24 @@ package com.clearstreet.api.services.blocking.v1.omniai +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.omniai.EntitlementCode import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementCreateEntitlementsParams import com.clearstreet.api.models.v1.omniai.entitlements.EntitlementGetEntitlementsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class EntitlementServiceTest { - @Disabled("Mock server tests are disabled") @Test fun createEntitlements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val entitlementService = client.v1().omniAi().entitlements() val response = @@ -30,10 +35,13 @@ internal class EntitlementServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun deleteEntitlement() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val entitlementService = client.v1().omniAi().entitlements() val response = entitlementService.deleteEntitlement("entitlement_id") @@ -41,10 +49,13 @@ internal class EntitlementServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getEntitlementAgreements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val entitlementService = client.v1().omniAi().entitlements() val response = entitlementService.getEntitlementAgreements() @@ -52,10 +63,13 @@ internal class EntitlementServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getEntitlements() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val entitlementService = client.v1().omniAi().entitlements() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceTest.kt index e01d82ab..06d02704 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/MessageServiceTest.kt @@ -2,19 +2,24 @@ package com.clearstreet.api.services.blocking.v1.omniai +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.core.JsonValue import com.clearstreet.api.models.v1.omniai.messages.MessageGetMessageByIdParams import com.clearstreet.api.models.v1.omniai.messages.MessageSubmitFeedbackParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class MessageServiceTest { - @Disabled("Mock server tests are disabled") @Test fun getMessageById() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val messageService = client.v1().omniAi().messages() val response = @@ -28,10 +33,13 @@ internal class MessageServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun submitFeedback() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val messageService = client.v1().omniAi().messages() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceTest.kt index 083773fa..a697570b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ResponseServiceTest.kt @@ -2,18 +2,23 @@ package com.clearstreet.api.services.blocking.v1.omniai +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.omniai.responses.ResponseCancelResponseParams import com.clearstreet.api.models.v1.omniai.responses.ResponseGetResponseByIdParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class ResponseServiceTest { - @Disabled("Mock server tests are disabled") @Test fun cancelResponse() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val responseService = client.v1().omniAi().responses() val response = @@ -27,10 +32,13 @@ internal class ResponseServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getResponseById() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val responseService = client.v1().omniAi().responses() val response = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceTest.kt index 618d64b0..886b8a75 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/omniai/ThreadServiceTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.services.blocking.v1.omniai +import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateMessageParams import com.clearstreet.api.models.v1.omniai.threads.ThreadCreateThreadParams @@ -9,15 +10,19 @@ import com.clearstreet.api.models.v1.omniai.threads.ThreadGetMessagesParams import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadByIdParams import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadResponseParams import com.clearstreet.api.models.v1.omniai.threads.ThreadGetThreadsParams -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +@ExtendWith(TestServerExtension::class) internal class ThreadServiceTest { - @Disabled("Mock server tests are disabled") @Test fun createMessage() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadService = client.v1().omniAi().threads() val response = @@ -33,10 +38,13 @@ internal class ThreadServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun createThread() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadService = client.v1().omniAi().threads() val response = @@ -59,10 +67,13 @@ internal class ThreadServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getMessages() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadService = client.v1().omniAi().threads() val response = @@ -78,10 +89,13 @@ internal class ThreadServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getThreadById() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadService = client.v1().omniAi().threads() val response = @@ -95,10 +109,13 @@ internal class ThreadServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getThreadResponse() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadService = client.v1().omniAi().threads() val response = @@ -112,10 +129,13 @@ internal class ThreadServiceTest { response.validate() } - @Disabled("Mock server tests are disabled") @Test fun getThreads() { - val client = ClearStreetOkHttpClient.builder().apiKey("My API Key").build() + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() val threadService = client.v1().omniAi().threads() val response = diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 00000000..feebe5ed --- /dev/null +++ b/scripts/mock @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run steady mock on the given spec +if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stdy/cli@0.22.1 -- steady --version + + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + + # Wait for server to come online via health endpoint (max 30s) + echo -n "Waiting for server" + attempts=0 + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Steady server to start" + cat .stdy.log + exit 1 + fi + echo -n "." + sleep 0.1 + done + + echo +else + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" +fi diff --git a/scripts/test b/scripts/test index 904aea60..7d7f08e3 100755 --- a/scripts/test +++ b/scripts/test @@ -4,7 +4,53 @@ set -e cd "$(dirname "$0")/.." +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! steady_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the steady command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" + echo +fi echo "==> Running tests" ./gradlew test "$@" From 4435f31bd53999dee1ba1470170bd8d39ab2ed75 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 18:17:33 +0000 Subject: [PATCH 38/51] feat(api): api update --- .stats.yml | 4 ++-- .../PositionGetPositionInstructionsParams.kt | 5 +++++ .../models/v1/positions/PositionInstruction.kt | 12 ++++++------ .../v1/positions/PositionInstructionStatus.kt | 15 ++++----------- .../PositionSubmitPositionInstructionsParams.kt | 7 +++---- .../api/services/async/v1/PositionServiceAsync.kt | 12 +++++++++--- .../api/services/blocking/v1/PositionService.kt | 12 +++++++++--- 7 files changed, 38 insertions(+), 29 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1b7e68d2..04711664 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-86d0e8705f28ab0ae1e3f25000d4ad3f6c0afaa47e92dd75129e81e38ec7bbb1.yml -openapi_spec_hash: 99eeff93e8f4870b0000733aacd2af7f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-4e49615152bd80f4693fef696b1f24e35fa5cf353432c460736f657d2855ea73.yml +openapi_spec_hash: 0f1c85fc2ddfc74763d39bd77706c381 config_hash: 39a6f3e7ce9a1c7a43a865fe7a6aec70 diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt index 4e254c18..32e10cf3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt @@ -12,6 +12,11 @@ import kotlin.jvm.optionals.getOrNull /** * Returns the current lifecycle state of the account's position instructions. Optionally filter by * a specific contract. + * + * Note: instructions that fail pre-acceptance validation on `POST` — duplicates, `DO_NOT_EXERCISE` + * / `CONTRARY_EXERCISE` on a non-expiry day, insufficient position, or an unresolvable instrument — + * are rejected (with `status = REJECTED` and a `rejection_reason`) without being persisted, so they + * surface only in the `POST` response and never appear in this list. */ class PositionGetPositionInstructionsParams private constructor( diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt index aaf9c46d..913c530e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt @@ -166,9 +166,9 @@ private constructor( fun createdAt(): Optional = createdAt.getOptional("created_at") /** - * Human-readable explanation populated on any non-success terminal status — `REJECTED`, - * `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level - * `error` field summarizes the batch; per-row detail continues to live here. + * Human-readable explanation populated on any non-success terminal status — `REJECTED` or + * `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes + * the batch; per-row detail continues to live here. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -490,9 +490,9 @@ private constructor( fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } /** - * Human-readable explanation populated on any non-success terminal status — `REJECTED`, - * `ENGINE_REJECTED`, or `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level - * `error` field summarizes the batch; per-row detail continues to live here. + * Human-readable explanation populated on any non-success terminal status — `REJECTED` or + * `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field + * summarizes the batch; per-row detail continues to live here. */ fun rejectionReason(rejectionReason: String?) = rejectionReason(JsonField.ofNullable(rejectionReason)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt index f2c2c051..2aab92ed 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstructionStatus.kt @@ -11,11 +11,10 @@ import com.fasterxml.jackson.annotation.JsonCreator * Lifecycle status of a position instruction. * - `SENT`: accepted and submitted to the clearing venue. * - `ACCEPTED`: terminal — accepted by the clearing venue. - * - `REJECTED`: terminal rejection from the clearing venue; `rejection_reason` carries the - * venue-reported detail. - * - `ENGINE_REJECTED`: terminal rejection from validation; `rejection_reason` carries the detail. - * Typical causes: duplicate `instruction_id`, `DO_NOT_EXERCISE` / `CONTRARY_EXERCISE` submitted - * on a non-expiry day, insufficient position, or an invalid instrument. + * - `REJECTED`: terminal rejection; `rejection_reason` carries the detail. Covers both + * venue-reported rejections and rejections raised before the instruction reached the clearing + * venue (e.g. duplicate `instruction_id`, `DO_NOT_EXERCISE` / `CONTRARY_EXERCISE` submitted on a + * non-expiry day, insufficient position, or an instrument that does not resolve). * - `CANCEL_REQUESTED`: cancel accepted; final cancel state pending. * - `CANCELLED`: terminal — cancel completed. * - `CANCEL_FAILED`: cancel could not be completed; operator attention required. `rejection_reason` @@ -43,8 +42,6 @@ private constructor(private val value: JsonField) : Enum { @JvmField val REJECTED = of("REJECTED") - @JvmField val ENGINE_REJECTED = of("ENGINE_REJECTED") - @JvmField val CANCEL_REQUESTED = of("CANCEL_REQUESTED") @JvmField val CANCELLED = of("CANCELLED") @@ -61,7 +58,6 @@ private constructor(private val value: JsonField) : Enum { SENT, ACCEPTED, REJECTED, - ENGINE_REJECTED, CANCEL_REQUESTED, CANCELLED, CANCEL_FAILED, @@ -82,7 +78,6 @@ private constructor(private val value: JsonField) : Enum { SENT, ACCEPTED, REJECTED, - ENGINE_REJECTED, CANCEL_REQUESTED, CANCELLED, CANCEL_FAILED, @@ -106,7 +101,6 @@ private constructor(private val value: JsonField) : Enum { SENT -> Value.SENT ACCEPTED -> Value.ACCEPTED REJECTED -> Value.REJECTED - ENGINE_REJECTED -> Value.ENGINE_REJECTED CANCEL_REQUESTED -> Value.CANCEL_REQUESTED CANCELLED -> Value.CANCELLED CANCEL_FAILED -> Value.CANCEL_FAILED @@ -128,7 +122,6 @@ private constructor(private val value: JsonField) : Enum { SENT -> Known.SENT ACCEPTED -> Known.ACCEPTED REJECTED -> Known.REJECTED - ENGINE_REJECTED -> Known.ENGINE_REJECTED CANCEL_REQUESTED -> Known.CANCEL_REQUESTED CANCELLED -> Known.CANCELLED CANCEL_FAILED -> Known.CANCEL_FAILED diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt index aeebb52c..a7ce1901 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionSubmitPositionInstructionsParams.kt @@ -28,13 +28,12 @@ import kotlin.jvm.optionals.getOrNull * Batch semantics: * - **All rows accepted** → `200 OK`. Every row is in `data` with `status = SENT`. * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry - * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` - * summarizes the batch failure. + * `status = REJECTED` and `rejection_reason`. The top-level `error` summarizes the batch failure. * - **All rows rejected** → `4xx`/`5xx`. The HTTP status reflects the aggregate cause: `409` when * every row was a duplicate, `400` for validation failures like DNE/CEA on a non-expiry day, * `503` if the clearing service is unavailable. `data` still contains every row carrying `status - * = ENGINE_REJECTED` and `rejection_reason` so callers can attribute failures by - * `instruction_id`; the top-level `error` summarizes the batch. + * = REJECTED` and `rejection_reason` so callers can attribute failures by `instruction_id`; the + * top-level `error` summarizes the batch. */ class PositionSubmitPositionInstructionsParams private constructor( diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt index d7bd9e16..21594dcf 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/PositionServiceAsync.kt @@ -145,6 +145,12 @@ interface PositionServiceAsync { /** * Returns the current lifecycle state of the account's position instructions. Optionally filter * by a specific contract. + * + * Note: instructions that fail pre-acceptance validation on `POST` — duplicates, + * `DO_NOT_EXERCISE` / `CONTRARY_EXERCISE` on a non-expiry day, insufficient position, or an + * unresolvable instrument — are rejected (with `status = REJECTED` and a `rejection_reason`) + * without being persisted, so they surface only in the `POST` response and never appear in this + * list. */ fun getPositionInstructions( accountId: Long @@ -234,12 +240,12 @@ interface PositionServiceAsync { * Batch semantics: * - **All rows accepted** → `200 OK`. Every row is in `data` with `status = SENT`. * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry - * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` - * summarizes the batch failure. + * `status = REJECTED` and `rejection_reason`. The top-level `error` summarizes the batch + * failure. * - **All rows rejected** → `4xx`/`5xx`. The HTTP status reflects the aggregate cause: `409` * when every row was a duplicate, `400` for validation failures like DNE/CEA on a non-expiry * day, `503` if the clearing service is unavailable. `data` still contains every row carrying - * `status = ENGINE_REJECTED` and `rejection_reason` so callers can attribute failures by + * `status = REJECTED` and `rejection_reason` so callers can attribute failures by * `instruction_id`; the top-level `error` summarizes the batch. */ fun submitPositionInstructions( diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt index 31cc0076..3183baaa 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/PositionService.kt @@ -139,6 +139,12 @@ interface PositionService { /** * Returns the current lifecycle state of the account's position instructions. Optionally filter * by a specific contract. + * + * Note: instructions that fail pre-acceptance validation on `POST` — duplicates, + * `DO_NOT_EXERCISE` / `CONTRARY_EXERCISE` on a non-expiry day, insufficient position, or an + * unresolvable instrument — are rejected (with `status = REJECTED` and a `rejection_reason`) + * without being persisted, so they surface only in the `POST` response and never appear in this + * list. */ fun getPositionInstructions(accountId: Long): PositionGetPositionInstructionsResponse = getPositionInstructions(accountId, PositionGetPositionInstructionsParams.none()) @@ -224,12 +230,12 @@ interface PositionService { * Batch semantics: * - **All rows accepted** → `200 OK`. Every row is in `data` with `status = SENT`. * - **Partial success** → `207 Multi-Status`. `data` contains every row; rejected rows carry - * `status = ENGINE_REJECTED` (or `REJECTED`) and `rejection_reason`. The top-level `error` - * summarizes the batch failure. + * `status = REJECTED` and `rejection_reason`. The top-level `error` summarizes the batch + * failure. * - **All rows rejected** → `4xx`/`5xx`. The HTTP status reflects the aggregate cause: `409` * when every row was a duplicate, `400` for validation failures like DNE/CEA on a non-expiry * day, `503` if the clearing service is unavailable. `data` still contains every row carrying - * `status = ENGINE_REJECTED` and `rejection_reason` so callers can attribute failures by + * `status = REJECTED` and `rejection_reason` so callers can attribute failures by * `instruction_id`; the top-level `error` summarizes the batch. */ fun submitPositionInstructions( From afbc4ccf603557090e34d9c8ce85d42008064c84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 13:45:50 +0000 Subject: [PATCH 39/51] feat(api): api update --- .stats.yml | 8 +- .../api/core/handlers/EmptyHandler.kt | 12 -- .../WebsocketWebsocketHandlerParams.kt | 178 ------------------ .../api/services/async/V1ServiceAsync.kt | 7 - .../api/services/async/V1ServiceAsyncImpl.kt | 16 -- .../async/v1/WebsocketServiceAsync.kt | 82 -------- .../async/v1/WebsocketServiceAsyncImpl.kt | 76 -------- .../api/services/blocking/V1Service.kt | 7 - .../api/services/blocking/V1ServiceImpl.kt | 14 -- .../services/blocking/v1/WebsocketService.kt | 81 -------- .../blocking/v1/WebsocketServiceImpl.kt | 73 ------- .../WebsocketWebsocketHandlerParamsTest.kt | 13 -- .../async/v1/WebsocketServiceAsyncTest.kt | 28 --- .../blocking/v1/WebsocketServiceTest.kt | 26 --- 14 files changed, 4 insertions(+), 617 deletions(-) delete mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsync.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncImpl.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketService.kt delete mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceImpl.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt delete mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt diff --git a/.stats.yml b/.stats.yml index 04711664..5d3a1b48 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 56 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-4e49615152bd80f4693fef696b1f24e35fa5cf353432c460736f657d2855ea73.yml -openapi_spec_hash: 0f1c85fc2ddfc74763d39bd77706c381 -config_hash: 39a6f3e7ce9a1c7a43a865fe7a6aec70 +configured_endpoints: 55 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-48f7d399b9463303d62cc40dfeb0c069c0276d5a9baa942db9b76d89377f6688.yml +openapi_spec_hash: dd3b0d9aaea1865897f87fd5a70ef2e9 +config_hash: 66d7f41361e2a6d4a8623d5719a896de diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt deleted file mode 100644 index d989fd70..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt +++ /dev/null @@ -1,12 +0,0 @@ -@file:JvmName("EmptyHandler") - -package com.clearstreet.api.core.handlers - -import com.clearstreet.api.core.http.HttpResponse -import com.clearstreet.api.core.http.HttpResponse.Handler - -@JvmSynthetic internal fun emptyHandler(): Handler = EmptyHandlerInternal - -private object EmptyHandlerInternal : Handler { - override fun handle(response: HttpResponse): Void? = null -} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt deleted file mode 100644 index 53b597a0..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParams.kt +++ /dev/null @@ -1,178 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clearstreet.api.models.v1.websocket - -import com.clearstreet.api.core.Params -import com.clearstreet.api.core.http.Headers -import com.clearstreet.api.core.http.QueryParams -import java.util.Objects - -/** Upgrade the HTTP connection to a WebSocket and echo incoming messages. */ -class WebsocketWebsocketHandlerParams -private constructor( - private val additionalHeaders: Headers, - private val additionalQueryParams: QueryParams, -) : Params { - - /** Additional headers to send with the request. */ - fun _additionalHeaders(): Headers = additionalHeaders - - /** Additional query param to send with the request. */ - fun _additionalQueryParams(): QueryParams = additionalQueryParams - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun none(): WebsocketWebsocketHandlerParams = builder().build() - - /** - * Returns a mutable builder for constructing an instance of - * [WebsocketWebsocketHandlerParams]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [WebsocketWebsocketHandlerParams]. */ - class Builder internal constructor() { - - private var additionalHeaders: Headers.Builder = Headers.builder() - private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - - @JvmSynthetic - internal fun from(websocketWebsocketHandlerParams: WebsocketWebsocketHandlerParams) = - apply { - additionalHeaders = websocketWebsocketHandlerParams.additionalHeaders.toBuilder() - additionalQueryParams = - websocketWebsocketHandlerParams.additionalQueryParams.toBuilder() - } - - fun additionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun putAdditionalHeader(name: String, value: String) = apply { - additionalHeaders.put(name, value) - } - - fun putAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.put(name, values) - } - - fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun replaceAdditionalHeaders(name: String, value: String) = apply { - additionalHeaders.replace(name, value) - } - - fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.replace(name, values) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } - - fun removeAllAdditionalHeaders(names: Set) = apply { - additionalHeaders.removeAll(names) - } - - fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun putAdditionalQueryParam(key: String, value: String) = apply { - additionalQueryParams.put(key, value) - } - - fun putAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.put(key, values) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun replaceAdditionalQueryParams(key: String, value: String) = apply { - additionalQueryParams.replace(key, value) - } - - fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.replace(key, values) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } - - fun removeAllAdditionalQueryParams(keys: Set) = apply { - additionalQueryParams.removeAll(keys) - } - - /** - * Returns an immutable instance of [WebsocketWebsocketHandlerParams]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): WebsocketWebsocketHandlerParams = - WebsocketWebsocketHandlerParams( - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } - - override fun _headers(): Headers = additionalHeaders - - override fun _queryParams(): QueryParams = additionalQueryParams - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is WebsocketWebsocketHandlerParams && - additionalHeaders == other.additionalHeaders && - additionalQueryParams == other.additionalQueryParams - } - - override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) - - override fun toString() = - "WebsocketWebsocketHandlerParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" -} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt index c66d61df..4bb88953 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt @@ -12,7 +12,6 @@ import com.clearstreet.api.services.async.v1.OmniAiServiceAsync import com.clearstreet.api.services.async.v1.OrderServiceAsync import com.clearstreet.api.services.async.v1.PositionServiceAsync import com.clearstreet.api.services.async.v1.WatchlistServiceAsync -import com.clearstreet.api.services.async.v1.WebsocketServiceAsync import java.util.function.Consumer interface V1ServiceAsync { @@ -55,9 +54,6 @@ interface V1ServiceAsync { /** Create and manage watchlists. */ fun watchlist(): WatchlistServiceAsync - /** Active Websocket. */ - fun websocket(): WebsocketServiceAsync - /** A view of [V1ServiceAsync] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -93,8 +89,5 @@ interface V1ServiceAsync { /** Create and manage watchlists. */ fun watchlist(): WatchlistServiceAsync.WithRawResponse - - /** Active Websocket. */ - fun websocket(): WebsocketServiceAsync.WithRawResponse } } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt index 77fae320..d8d5936c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt @@ -21,8 +21,6 @@ import com.clearstreet.api.services.async.v1.PositionServiceAsync import com.clearstreet.api.services.async.v1.PositionServiceAsyncImpl import com.clearstreet.api.services.async.v1.WatchlistServiceAsync import com.clearstreet.api.services.async.v1.WatchlistServiceAsyncImpl -import com.clearstreet.api.services.async.v1.WebsocketServiceAsync -import com.clearstreet.api.services.async.v1.WebsocketServiceAsyncImpl import java.util.function.Consumer class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : @@ -58,10 +56,6 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO WatchlistServiceAsyncImpl(clientOptions) } - private val websocket: WebsocketServiceAsync by lazy { - WebsocketServiceAsyncImpl(clientOptions) - } - override fun withRawResponse(): V1ServiceAsync.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): V1ServiceAsync = @@ -93,9 +87,6 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** Create and manage watchlists. */ override fun watchlist(): WatchlistServiceAsync = watchlist - /** Active Websocket. */ - override fun websocket(): WebsocketServiceAsync = websocket - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : V1ServiceAsync.WithRawResponse { @@ -135,10 +126,6 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO WatchlistServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val websocket: WebsocketServiceAsync.WithRawResponse by lazy { - WebsocketServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): V1ServiceAsync.WithRawResponse = @@ -171,8 +158,5 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** Create and manage watchlists. */ override fun watchlist(): WatchlistServiceAsync.WithRawResponse = watchlist - - /** Active Websocket. */ - override fun websocket(): WebsocketServiceAsync.WithRawResponse = websocket } } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsync.kt deleted file mode 100644 index b99f3a34..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsync.kt +++ /dev/null @@ -1,82 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clearstreet.api.services.async.v1 - -import com.clearstreet.api.core.ClientOptions -import com.clearstreet.api.core.RequestOptions -import com.clearstreet.api.core.http.HttpResponse -import com.clearstreet.api.models.v1.websocket.WebsocketWebsocketHandlerParams -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Active Websocket. */ -interface WebsocketServiceAsync { - - /** - * 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): WebsocketServiceAsync - - /** Upgrade the HTTP connection to a WebSocket and echo incoming messages. */ - fun websocketHandler(): CompletableFuture = - websocketHandler(WebsocketWebsocketHandlerParams.none()) - - /** @see websocketHandler */ - fun websocketHandler( - params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see websocketHandler */ - fun websocketHandler( - params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none() - ): CompletableFuture = websocketHandler(params, RequestOptions.none()) - - /** @see websocketHandler */ - fun websocketHandler(requestOptions: RequestOptions): CompletableFuture = - websocketHandler(WebsocketWebsocketHandlerParams.none(), requestOptions) - - /** - * A view of [WebsocketServiceAsync] 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 - ): WebsocketServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/ws`, but is otherwise the same as - * [WebsocketServiceAsync.websocketHandler]. - */ - fun websocketHandler(): CompletableFuture = - websocketHandler(WebsocketWebsocketHandlerParams.none()) - - /** @see websocketHandler */ - fun websocketHandler( - params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see websocketHandler */ - fun websocketHandler( - params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none() - ): CompletableFuture = websocketHandler(params, RequestOptions.none()) - - /** @see websocketHandler */ - fun websocketHandler(requestOptions: RequestOptions): CompletableFuture = - websocketHandler(WebsocketWebsocketHandlerParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncImpl.kt deleted file mode 100644 index 120f918f..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncImpl.kt +++ /dev/null @@ -1,76 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clearstreet.api.services.async.v1 - -import com.clearstreet.api.core.ClientOptions -import com.clearstreet.api.core.RequestOptions -import com.clearstreet.api.core.handlers.emptyHandler -import com.clearstreet.api.core.handlers.errorBodyHandler -import com.clearstreet.api.core.handlers.errorHandler -import com.clearstreet.api.core.http.HttpMethod -import com.clearstreet.api.core.http.HttpRequest -import com.clearstreet.api.core.http.HttpResponse -import com.clearstreet.api.core.http.HttpResponse.Handler -import com.clearstreet.api.core.http.parseable -import com.clearstreet.api.core.prepareAsync -import com.clearstreet.api.models.v1.websocket.WebsocketWebsocketHandlerParams -import java.util.concurrent.CompletableFuture -import java.util.function.Consumer - -/** Active Websocket. */ -class WebsocketServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - WebsocketServiceAsync { - - private val withRawResponse: WebsocketServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): WebsocketServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): WebsocketServiceAsync = - WebsocketServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun websocketHandler( - params: WebsocketWebsocketHandlerParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /v1/ws - withRawResponse().websocketHandler(params, requestOptions).thenAccept {} - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - WebsocketServiceAsync.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): WebsocketServiceAsync.WithRawResponse = - WebsocketServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val websocketHandlerHandler: Handler = emptyHandler() - - override fun websocketHandler( - params: WebsocketWebsocketHandlerParams, - 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/clearstreet/api/services/blocking/V1Service.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt index 00e8fa92..626dfe0b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt @@ -12,7 +12,6 @@ import com.clearstreet.api.services.blocking.v1.OmniAiService import com.clearstreet.api.services.blocking.v1.OrderService import com.clearstreet.api.services.blocking.v1.PositionService import com.clearstreet.api.services.blocking.v1.WatchlistService -import com.clearstreet.api.services.blocking.v1.WebsocketService import java.util.function.Consumer interface V1Service { @@ -55,9 +54,6 @@ interface V1Service { /** Create and manage watchlists. */ fun watchlist(): WatchlistService - /** Active Websocket. */ - fun websocket(): WebsocketService - /** A view of [V1Service] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -93,8 +89,5 @@ interface V1Service { /** Create and manage watchlists. */ fun watchlist(): WatchlistService.WithRawResponse - - /** Active Websocket. */ - fun websocket(): WebsocketService.WithRawResponse } } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt index bd244a6b..479c98f2 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt @@ -21,8 +21,6 @@ import com.clearstreet.api.services.blocking.v1.PositionService import com.clearstreet.api.services.blocking.v1.PositionServiceImpl import com.clearstreet.api.services.blocking.v1.WatchlistService import com.clearstreet.api.services.blocking.v1.WatchlistServiceImpl -import com.clearstreet.api.services.blocking.v1.WebsocketService -import com.clearstreet.api.services.blocking.v1.WebsocketServiceImpl import java.util.function.Consumer class V1ServiceImpl internal constructor(private val clientOptions: ClientOptions) : V1Service { @@ -51,8 +49,6 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption private val watchlist: WatchlistService by lazy { WatchlistServiceImpl(clientOptions) } - private val websocket: WebsocketService by lazy { WebsocketServiceImpl(clientOptions) } - override fun withRawResponse(): V1Service.WithRawResponse = withRawResponse override fun withOptions(modifier: Consumer): V1Service = @@ -84,9 +80,6 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** Create and manage watchlists. */ override fun watchlist(): WatchlistService = watchlist - /** Active Websocket. */ - override fun websocket(): WebsocketService = websocket - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : V1Service.WithRawResponse { @@ -126,10 +119,6 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption WatchlistServiceImpl.WithRawResponseImpl(clientOptions) } - private val websocket: WebsocketService.WithRawResponse by lazy { - WebsocketServiceImpl.WithRawResponseImpl(clientOptions) - } - override fun withOptions( modifier: Consumer ): V1Service.WithRawResponse = @@ -162,8 +151,5 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** Create and manage watchlists. */ override fun watchlist(): WatchlistService.WithRawResponse = watchlist - - /** Active Websocket. */ - override fun websocket(): WebsocketService.WithRawResponse = websocket } } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketService.kt deleted file mode 100644 index f7225703..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketService.kt +++ /dev/null @@ -1,81 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clearstreet.api.services.blocking.v1 - -import com.clearstreet.api.core.ClientOptions -import com.clearstreet.api.core.RequestOptions -import com.clearstreet.api.core.http.HttpResponse -import com.clearstreet.api.models.v1.websocket.WebsocketWebsocketHandlerParams -import com.google.errorprone.annotations.MustBeClosed -import java.util.function.Consumer - -/** Active Websocket. */ -interface WebsocketService { - - /** - * 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): WebsocketService - - /** Upgrade the HTTP connection to a WebSocket and echo incoming messages. */ - fun websocketHandler() = websocketHandler(WebsocketWebsocketHandlerParams.none()) - - /** @see websocketHandler */ - fun websocketHandler( - params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ) - - /** @see websocketHandler */ - fun websocketHandler( - params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none() - ) = websocketHandler(params, RequestOptions.none()) - - /** @see websocketHandler */ - fun websocketHandler(requestOptions: RequestOptions) = - websocketHandler(WebsocketWebsocketHandlerParams.none(), requestOptions) - - /** A view of [WebsocketService] 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): WebsocketService.WithRawResponse - - /** - * Returns a raw HTTP response for `get /v1/ws`, but is otherwise the same as - * [WebsocketService.websocketHandler]. - */ - @MustBeClosed - fun websocketHandler(): HttpResponse = - websocketHandler(WebsocketWebsocketHandlerParams.none()) - - /** @see websocketHandler */ - @MustBeClosed - fun websocketHandler( - params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponse - - /** @see websocketHandler */ - @MustBeClosed - fun websocketHandler( - params: WebsocketWebsocketHandlerParams = WebsocketWebsocketHandlerParams.none() - ): HttpResponse = websocketHandler(params, RequestOptions.none()) - - /** @see websocketHandler */ - @MustBeClosed - fun websocketHandler(requestOptions: RequestOptions): HttpResponse = - websocketHandler(WebsocketWebsocketHandlerParams.none(), requestOptions) - } -} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceImpl.kt deleted file mode 100644 index 85074f51..00000000 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceImpl.kt +++ /dev/null @@ -1,73 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clearstreet.api.services.blocking.v1 - -import com.clearstreet.api.core.ClientOptions -import com.clearstreet.api.core.RequestOptions -import com.clearstreet.api.core.handlers.emptyHandler -import com.clearstreet.api.core.handlers.errorBodyHandler -import com.clearstreet.api.core.handlers.errorHandler -import com.clearstreet.api.core.http.HttpMethod -import com.clearstreet.api.core.http.HttpRequest -import com.clearstreet.api.core.http.HttpResponse -import com.clearstreet.api.core.http.HttpResponse.Handler -import com.clearstreet.api.core.http.parseable -import com.clearstreet.api.core.prepare -import com.clearstreet.api.models.v1.websocket.WebsocketWebsocketHandlerParams -import java.util.function.Consumer - -/** Active Websocket. */ -class WebsocketServiceImpl internal constructor(private val clientOptions: ClientOptions) : - WebsocketService { - - private val withRawResponse: WebsocketService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): WebsocketService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): WebsocketService = - WebsocketServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - override fun websocketHandler( - params: WebsocketWebsocketHandlerParams, - requestOptions: RequestOptions, - ) { - // get /v1/ws - withRawResponse().websocketHandler(params, requestOptions) - } - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - WebsocketService.WithRawResponse { - - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - - override fun withOptions( - modifier: Consumer - ): WebsocketService.WithRawResponse = - WebsocketServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - - private val websocketHandlerHandler: Handler = emptyHandler() - - override fun websocketHandler( - params: WebsocketWebsocketHandlerParams, - requestOptions: RequestOptions, - ): HttpResponse { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("v1", "ws") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response.use { websocketHandlerHandler.handle(it) } - } - } - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt deleted file mode 100644 index 3c6d5089..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/websocket/WebsocketWebsocketHandlerParamsTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clearstreet.api.models.v1.websocket - -import org.junit.jupiter.api.Test - -internal class WebsocketWebsocketHandlerParamsTest { - - @Test - fun create() { - WebsocketWebsocketHandlerParams.builder().build() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt deleted file mode 100644 index cf4b04d6..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/WebsocketServiceAsyncTest.kt +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clearstreet.api.services.async.v1 - -import com.clearstreet.api.TestServerExtension -import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith(TestServerExtension::class) -internal class WebsocketServiceAsyncTest { - - @Disabled("websocket upgrade endpoint is currently not modeled correctly for stainless") - @Test - fun websocketHandler() { - val client = - ClearStreetOkHttpClientAsync.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .build() - val websocketServiceAsync = client.v1().websocket() - - val future = websocketServiceAsync.websocketHandler() - - val response = future.get() - } -} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt deleted file mode 100644 index 5a5adaa5..00000000 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/WebsocketServiceTest.kt +++ /dev/null @@ -1,26 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.clearstreet.api.services.blocking.v1 - -import com.clearstreet.api.TestServerExtension -import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith - -@ExtendWith(TestServerExtension::class) -internal class WebsocketServiceTest { - - @Disabled("websocket upgrade endpoint is currently not modeled correctly for stainless") - @Test - fun websocketHandler() { - val client = - ClearStreetOkHttpClient.builder() - .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") - .build() - val websocketService = client.v1().websocket() - - websocketService.websocketHandler() - } -} From e9755c970417260e481f1e0f83552777fabc3ad4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 13:29:45 +0000 Subject: [PATCH 40/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/accounts/Account.kt | 8 +- .../api/models/v1/accounts/AccountBalances.kt | 24 +++- .../models/v1/accounts/AccountBalancesSod.kt | 40 ++++-- .../api/models/v1/accounts/AccountSettings.kt | 8 +- .../api/models/v1/accounts/MarginDetails.kt | 18 ++- .../api/models/v1/accounts/RiskSettings.kt | 8 +- .../api/models/v1/calendar/MarketStatus.kt | 8 +- .../api/models/v1/calendar/SessionSchedule.kt | 16 ++- .../api/models/v1/calendar/TradingSessions.kt | 24 +++- .../InstrumentAnalystConsensus.kt | 24 +++- .../instrumentdata/InstrumentDividendEvent.kt | 42 ++++-- .../v1/instrumentdata/InstrumentEarnings.kt | 48 +++++-- .../instrumentdata/InstrumentEventEnvelope.kt | 56 ++++++-- .../instrumentdata/InstrumentEventIpoItem.kt | 56 ++++++-- .../v1/instrumentdata/InstrumentEventsData.kt | 8 +- .../instrumentdata/InstrumentFundamentals.kt | 120 +++++++++++++----- .../instrumentdata/marketdata/DailySummary.kt | 48 +++++-- .../marketdata/MarketDataSnapshot.kt | 44 +++++-- .../marketdata/SnapshotQuote.kt | 16 ++- .../v1/instrumentdata/news/NewsInstrument.kt | 16 ++- .../models/v1/instrumentdata/news/NewsItem.kt | 24 +++- .../api/models/v1/instruments/Instrument.kt | 78 +++++++++--- .../models/v1/instruments/InstrumentCore.kt | 72 ++++++++--- .../models/v1/instruments/OptionsContract.kt | 16 ++- .../api/models/v1/omniai/ActionButton.kt | 16 ++- .../api/models/v1/omniai/ChartPayload.kt | 8 +- .../api/models/v1/omniai/OpenChartAction.kt | 16 ++- .../models/v1/omniai/OpenScreenerAction.kt | 31 +++-- .../v1/omniai/StructuredActionButtonAction.kt | 8 +- .../omniai/messages/CreateFeedbackResponse.kt | 5 + .../models/v1/omniai/responses/ErrorStatus.kt | 3 + .../models/v1/omniai/responses/Response.kt | 13 +- .../api/models/v1/omniai/threads/Message.kt | 4 +- .../clearstreet/api/models/v1/orders/Order.kt | 110 ++++++++++++---- .../api/models/v1/positions/Position.kt | 76 ++++++++--- .../v1/positions/PositionInstruction.kt | 28 ++-- .../models/v1/watchlist/WatchlistItemEntry.kt | 16 ++- 38 files changed, 865 insertions(+), 295 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5d3a1b48..28963c55 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-48f7d399b9463303d62cc40dfeb0c069c0276d5a9baa942db9b76d89377f6688.yml -openapi_spec_hash: dd3b0d9aaea1865897f87fd5a70ef2e9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-ff1eb241bd08c1bbdd6873d0b89358236cb9fc37ce1bfe8ac700dc761e45d422.yml +openapi_spec_hash: 53211716653645a73497edaad7e8131d config_hash: 66d7f41361e2a6d4a8623d5719a896de diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/Account.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/Account.kt index db7170c4..f4be7379 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/Account.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/Account.kt @@ -145,7 +145,8 @@ private constructor( fun type(): AccountType = type.getRequired("type") /** - * The date the account was closed, if applicable + * The date the account was closed, if applicable When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -399,7 +400,10 @@ private constructor( */ fun type(type: JsonField) = apply { this.type = type } - /** The date the account was closed, if applicable */ + /** + * The date the account was closed, if applicable When a null/undefined value is observed, + * it indicates it does not apply. + */ fun closeDate(closeDate: LocalDate?) = closeDate(JsonField.ofNullable(closeDate)) /** Alias for calling [Builder.closeDate] with `closeDate.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt index ed671d63..d432a26e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt @@ -244,7 +244,8 @@ private constructor( fun withdrawableCash(): String = withdrawableCash.getRequired("withdrawable_cash") /** - * Margin-account-only details. + * Margin-account-only details. When a null/undefined value is observed, it indicates it does + * not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -252,7 +253,8 @@ private constructor( fun marginDetails(): Optional = marginDetails.getOptional("margin_details") /** - * Applied multiplier for margin calculations. + * Applied multiplier for margin calculations. When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -260,7 +262,8 @@ private constructor( fun multiplier(): Optional = multiplier.getOptional("multiplier") /** - * The total market value of all short positions. + * The total market value of all short positions. When null/undefined, the value should be + * assumed to be zero. The field is omitted to simplify the response. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -732,7 +735,10 @@ private constructor( this.withdrawableCash = withdrawableCash } - /** Margin-account-only details. */ + /** + * Margin-account-only details. When a null/undefined value is observed, it indicates it + * does not apply. + */ fun marginDetails(marginDetails: MarginDetails?) = marginDetails(JsonField.ofNullable(marginDetails)) @@ -751,7 +757,10 @@ private constructor( this.marginDetails = marginDetails } - /** Applied multiplier for margin calculations. */ + /** + * Applied multiplier for margin calculations. When a null/undefined value is observed, it + * indicates it does not apply. + */ fun multiplier(multiplier: String?) = multiplier(JsonField.ofNullable(multiplier)) /** Alias for calling [Builder.multiplier] with `multiplier.orElse(null)`. */ @@ -766,7 +775,10 @@ private constructor( */ fun multiplier(multiplier: JsonField) = apply { this.multiplier = multiplier } - /** The total market value of all short positions. */ + /** + * The total market value of all short positions. When null/undefined, the value should be + * assumed to be zero. The field is omitted to simplify the response. + */ fun shortMarketValue(shortMarketValue: String?) = shortMarketValue(JsonField.ofNullable(shortMarketValue)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt index ff2d0eeb..5bef3d53 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesSod.kt @@ -102,7 +102,8 @@ private constructor( fun shortMarketValue(): String = shortMarketValue.getRequired("short_market_value") /** - * Timestamp for the start-of-day values. + * Timestamp for the start-of-day values. When a null/undefined value is observed, it indicates + * that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -110,7 +111,8 @@ private constructor( fun asof(): Optional = asof.getOptional("asof") /** - * Start-of-day day-trade buying power. + * Start-of-day day-trade buying power. When a null/undefined value is observed, it indicates it + * does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -120,7 +122,8 @@ private constructor( dayTradeBuyingPower.getOptional("day_trade_buying_power") /** - * Start-of-day maintenance margin excess. + * Start-of-day maintenance margin excess. When a null/undefined value is observed, it indicates + * it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -129,7 +132,8 @@ private constructor( maintenanceMarginExcess.getOptional("maintenance_margin_excess") /** - * Start-of-day maintenance margin requirement. + * Start-of-day maintenance margin requirement. When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -138,7 +142,8 @@ private constructor( maintenanceMarginRequirement.getOptional("maintenance_margin_requirement") /** - * Start-of-day trade cash. + * Start-of-day trade cash. When a null/undefined value is observed, it indicates it does not + * apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -334,7 +339,10 @@ private constructor( this.shortMarketValue = shortMarketValue } - /** Timestamp for the start-of-day values. */ + /** + * Timestamp for the start-of-day values. When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun asof(asof: LocalDate?) = asof(JsonField.ofNullable(asof)) /** Alias for calling [Builder.asof] with `asof.orElse(null)`. */ @@ -348,7 +356,10 @@ private constructor( */ fun asof(asof: JsonField) = apply { this.asof = asof } - /** Start-of-day day-trade buying power. */ + /** + * Start-of-day day-trade buying power. When a null/undefined value is observed, it + * indicates it does not apply. + */ @Deprecated("deprecated") fun dayTradeBuyingPower(dayTradeBuyingPower: String?) = dayTradeBuyingPower(JsonField.ofNullable(dayTradeBuyingPower)) @@ -372,7 +383,10 @@ private constructor( this.dayTradeBuyingPower = dayTradeBuyingPower } - /** Start-of-day maintenance margin excess. */ + /** + * Start-of-day maintenance margin excess. When a null/undefined value is observed, it + * indicates it does not apply. + */ fun maintenanceMarginExcess(maintenanceMarginExcess: String?) = maintenanceMarginExcess(JsonField.ofNullable(maintenanceMarginExcess)) @@ -394,7 +408,10 @@ private constructor( this.maintenanceMarginExcess = maintenanceMarginExcess } - /** Start-of-day maintenance margin requirement. */ + /** + * Start-of-day maintenance margin requirement. When a null/undefined value is observed, it + * indicates it does not apply. + */ fun maintenanceMarginRequirement(maintenanceMarginRequirement: String?) = maintenanceMarginRequirement(JsonField.ofNullable(maintenanceMarginRequirement)) @@ -416,7 +433,10 @@ private constructor( this.maintenanceMarginRequirement = maintenanceMarginRequirement } - /** Start-of-day trade cash. */ + /** + * Start-of-day trade cash. When a null/undefined value is observed, it indicates it does + * not apply. + */ fun tradeCash(tradeCash: String?) = tradeCash(JsonField.ofNullable(tradeCash)) /** Alias for calling [Builder.tradeCash] with `tradeCash.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettings.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettings.kt index 2fddaf4d..15daac62 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettings.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountSettings.kt @@ -29,7 +29,8 @@ private constructor( ) : this(risk, mutableMapOf()) /** - * Risk settings for the account + * Risk settings for the account When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -73,7 +74,10 @@ private constructor( additionalProperties = accountSettings.additionalProperties.toMutableMap() } - /** Risk settings for the account */ + /** + * Risk settings for the account When a null/undefined value is observed, it indicates that + * there is no available data. + */ fun risk(risk: RiskSettings?) = risk(JsonField.ofNullable(risk)) /** Alias for calling [Builder.risk] with `risk.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt index d4df4371..63c9fd22 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/MarginDetails.kt @@ -156,7 +156,9 @@ private constructor( fun patternDayTrader(): Boolean = patternDayTrader.getRequired("pattern_day_trader") /** - * The amount of day-trade buying power used during the current trading day. + * The amount of day-trade buying power used during the current trading day. When + * null/undefined, the value should be assumed to be zero. The field is omitted to simplify the + * response. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -175,7 +177,8 @@ private constructor( topContributors.getOptional("top_contributors") /** - * Current usage totals. + * Current usage totals. When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -476,7 +479,11 @@ private constructor( this.patternDayTrader = patternDayTrader } - /** The amount of day-trade buying power used during the current trading day. */ + /** + * The amount of day-trade buying power used during the current trading day. When + * null/undefined, the value should be assumed to be zero. The field is omitted to simplify + * the response. + */ @Deprecated("deprecated") fun dayTradeBuyingPowerUsage(dayTradeBuyingPowerUsage: String?) = dayTradeBuyingPowerUsage(JsonField.ofNullable(dayTradeBuyingPowerUsage)) @@ -528,7 +535,10 @@ private constructor( } } - /** Current usage totals. */ + /** + * Current usage totals. When a null/undefined value is observed, it indicates that there is + * no available data. + */ fun usage(usage: MarginDetailsUsage?) = usage(JsonField.ofNullable(usage)) /** Alias for calling [Builder.usage] with `usage.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettings.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettings.kt index f420b555..b3bb092a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettings.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/RiskSettings.kt @@ -32,7 +32,8 @@ private constructor( ) : this(maxNotional, mutableMapOf()) /** - * The maximum notional value available to the account + * The maximum notional value available to the account When a null/undefined value is observed, + * it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -78,7 +79,10 @@ private constructor( additionalProperties = riskSettings.additionalProperties.toMutableMap() } - /** The maximum notional value available to the account */ + /** + * The maximum notional value available to the account When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun maxNotional(maxNotional: String?) = maxNotional(JsonField.ofNullable(maxNotional)) /** Alias for calling [Builder.maxNotional] with `maxNotional.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatus.kt index 425092fe..5727398a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/MarketStatus.kt @@ -53,7 +53,8 @@ private constructor( fun isOpen(): Boolean = isOpen.getRequired("is_open") /** - * Current session type if market is open, null if closed + * Current session type if market is open, null if closed When a null/undefined value is + * observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -148,7 +149,10 @@ private constructor( */ fun isOpen(isOpen: JsonField) = apply { this.isOpen = isOpen } - /** Current session type if market is open, null if closed */ + /** + * Current session type if market is open, null if closed When a null/undefined value is + * observed, it indicates it does not apply. + */ fun currentSession(currentSession: MarketSessionType?) = currentSession(JsonField.ofNullable(currentSession)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/SessionSchedule.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/SessionSchedule.kt index 238d5d96..973d95ac 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/SessionSchedule.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/SessionSchedule.kt @@ -58,7 +58,8 @@ private constructor( fun open(): OffsetDateTime = open.getRequired("open") /** - * ISO 8601 duration until session closes. Null if session is not currently open. + * ISO 8601 duration until session closes. Null if session is not currently open. When a + * null/undefined value is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -66,7 +67,8 @@ private constructor( fun timeUntilClose(): Optional = timeUntilClose.getOptional("time_until_close") /** - * ISO 8601 duration until session opens. Null if session has already started or closed. + * ISO 8601 duration until session opens. Null if session has already started or closed. When a + * null/undefined value is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -173,7 +175,10 @@ private constructor( */ fun open(open: JsonField) = apply { this.open = open } - /** ISO 8601 duration until session closes. Null if session is not currently open. */ + /** + * ISO 8601 duration until session closes. Null if session is not currently open. When a + * null/undefined value is observed, it indicates it does not apply. + */ fun timeUntilClose(timeUntilClose: String?) = timeUntilClose(JsonField.ofNullable(timeUntilClose)) @@ -192,7 +197,10 @@ private constructor( this.timeUntilClose = timeUntilClose } - /** ISO 8601 duration until session opens. Null if session has already started or closed. */ + /** + * ISO 8601 duration until session opens. Null if session has already started or closed. + * When a null/undefined value is observed, it indicates it does not apply. + */ fun timeUntilOpen(timeUntilOpen: String?) = timeUntilOpen(JsonField.ofNullable(timeUntilOpen)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessions.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessions.kt index ed02b532..82df4f6d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessions.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/calendar/TradingSessions.kt @@ -40,7 +40,8 @@ private constructor( ) : this(afterHours, preMarket, regular, mutableMapOf()) /** - * After-hours session schedule, null if not available + * After-hours session schedule, null if not available When a null/undefined value is observed, + * it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -48,7 +49,8 @@ private constructor( fun afterHours(): Optional = afterHours.getOptional("after_hours") /** - * Pre-market session schedule, null if not available + * Pre-market session schedule, null if not available When a null/undefined value is observed, + * it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -56,7 +58,8 @@ private constructor( fun preMarket(): Optional = preMarket.getOptional("pre_market") /** - * Regular trading session schedule, null if holiday/weekend + * Regular trading session schedule, null if holiday/weekend When a null/undefined value is + * observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -122,7 +125,10 @@ private constructor( additionalProperties = tradingSessions.additionalProperties.toMutableMap() } - /** After-hours session schedule, null if not available */ + /** + * After-hours session schedule, null if not available When a null/undefined value is + * observed, it indicates it does not apply. + */ fun afterHours(afterHours: SessionSchedule?) = afterHours(JsonField.ofNullable(afterHours)) /** Alias for calling [Builder.afterHours] with `afterHours.orElse(null)`. */ @@ -139,7 +145,10 @@ private constructor( this.afterHours = afterHours } - /** Pre-market session schedule, null if not available */ + /** + * Pre-market session schedule, null if not available When a null/undefined value is + * observed, it indicates it does not apply. + */ fun preMarket(preMarket: SessionSchedule?) = preMarket(JsonField.ofNullable(preMarket)) /** Alias for calling [Builder.preMarket] with `preMarket.orElse(null)`. */ @@ -154,7 +163,10 @@ private constructor( */ fun preMarket(preMarket: JsonField) = apply { this.preMarket = preMarket } - /** Regular trading session schedule, null if holiday/weekend */ + /** + * Regular trading session schedule, null if holiday/weekend When a null/undefined value is + * observed, it indicates it does not apply. + */ fun regular(regular: SessionSchedule?) = regular(JsonField.ofNullable(regular)) /** Alias for calling [Builder.regular] with `regular.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt index 3d553fdc..d1e044fb 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentAnalystConsensus.kt @@ -50,7 +50,8 @@ private constructor( fun date(): LocalDate = date.getRequired("date") /** - * Count of individual analyst recommendations by category + * Count of individual analyst recommendations by category When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -58,7 +59,8 @@ private constructor( fun distribution(): Optional = distribution.getOptional("distribution") /** - * Aggregated analyst price target statistics + * Aggregated analyst price target statistics When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -66,7 +68,8 @@ private constructor( fun priceTarget(): Optional = priceTarget.getOptional("price_target") /** - * Consensus analyst rating + * Consensus analyst rating When a null/undefined value is observed, it indicates that there is + * no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -159,7 +162,10 @@ private constructor( */ fun date(date: JsonField) = apply { this.date = date } - /** Count of individual analyst recommendations by category */ + /** + * Count of individual analyst recommendations by category When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun distribution(distribution: AnalystDistribution?) = distribution(JsonField.ofNullable(distribution)) @@ -178,7 +184,10 @@ private constructor( this.distribution = distribution } - /** Aggregated analyst price target statistics */ + /** + * Aggregated analyst price target statistics When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun priceTarget(priceTarget: PriceTarget?) = priceTarget(JsonField.ofNullable(priceTarget)) /** Alias for calling [Builder.priceTarget] with `priceTarget.orElse(null)`. */ @@ -195,7 +204,10 @@ private constructor( this.priceTarget = priceTarget } - /** Consensus analyst rating */ + /** + * Consensus analyst rating When a null/undefined value is observed, it indicates that there + * is no available data. + */ fun rating(rating: AnalystRating?) = rating(JsonField.ofNullable(rating)) /** Alias for calling [Builder.rating] with `rating.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEvent.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEvent.kt index bed81b24..a41debaa 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEvent.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentDividendEvent.kt @@ -85,7 +85,8 @@ private constructor( fun exDate(): LocalDate = exDate.getRequired("ex_date") /** - * The declaration date of the dividend + * The declaration date of the dividend When a null/undefined value is observed, it indicates + * that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -93,7 +94,8 @@ private constructor( fun declarationDate(): Optional = declarationDate.getOptional("declaration_date") /** - * The dividend amount per share. + * The dividend amount per share. When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -101,7 +103,8 @@ private constructor( fun dividendAmount(): Optional = dividendAmount.getOptional("dividend_amount") /** - * The dividend yield as a percentage of the stock price. + * The dividend yield as a percentage of the stock price. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -109,7 +112,8 @@ private constructor( fun dividendYield(): Optional = dividendYield.getOptional("dividend_yield") /** - * The frequency of the dividend payments (e.g., "Quarterly", "Annual"). + * The frequency of the dividend payments (e.g., "Quarterly", "Annual"). When a null/undefined + * value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -117,7 +121,8 @@ private constructor( fun frequency(): Optional = frequency.getOptional("frequency") /** - * The payment date is the date on which a declared stock dividend is scheduled to be paid. + * The payment date is the date on which a declared stock dividend is scheduled to be paid. When + * a null/undefined value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -126,7 +131,8 @@ private constructor( /** * The record date, set by a company's board of directors, is when a company compiles a list of - * shareholders of the stock for which it has declared a dividend. + * shareholders of the stock for which it has declared a dividend. When a null/undefined value + * is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -281,7 +287,10 @@ private constructor( */ fun exDate(exDate: JsonField) = apply { this.exDate = exDate } - /** The declaration date of the dividend */ + /** + * The declaration date of the dividend When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun declarationDate(declarationDate: LocalDate?) = declarationDate(JsonField.ofNullable(declarationDate)) @@ -300,7 +309,10 @@ private constructor( this.declarationDate = declarationDate } - /** The dividend amount per share. */ + /** + * The dividend amount per share. When a null/undefined value is observed, it indicates that + * there is no available data. + */ fun dividendAmount(dividendAmount: String?) = dividendAmount(JsonField.ofNullable(dividendAmount)) @@ -319,7 +331,10 @@ private constructor( this.dividendAmount = dividendAmount } - /** The dividend yield as a percentage of the stock price. */ + /** + * The dividend yield as a percentage of the stock price. When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun dividendYield(dividendYield: String?) = dividendYield(JsonField.ofNullable(dividendYield)) @@ -338,7 +353,10 @@ private constructor( this.dividendYield = dividendYield } - /** The frequency of the dividend payments (e.g., "Quarterly", "Annual"). */ + /** + * The frequency of the dividend payments (e.g., "Quarterly", "Annual"). When a + * null/undefined value is observed, it indicates that there is no available data. + */ fun frequency(frequency: String?) = frequency(JsonField.ofNullable(frequency)) /** Alias for calling [Builder.frequency] with `frequency.orElse(null)`. */ @@ -355,6 +373,7 @@ private constructor( /** * The payment date is the date on which a declared stock dividend is scheduled to be paid. + * When a null/undefined value is observed, it indicates that there is no available data. */ fun paymentDate(paymentDate: LocalDate?) = paymentDate(JsonField.ofNullable(paymentDate)) @@ -374,7 +393,8 @@ private constructor( /** * The record date, set by a company's board of directors, is when a company compiles a list - * of shareholders of the stock for which it has declared a dividend. + * of shareholders of the stock for which it has declared a dividend. When a null/undefined + * value is observed, it indicates that there is no available data. */ fun recordDate(recordDate: LocalDate?) = recordDate(JsonField.ofNullable(recordDate)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarnings.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarnings.kt index c15d7f5b..c1e4f129 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarnings.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEarnings.kt @@ -71,7 +71,8 @@ private constructor( fun date(): LocalDate = date.getRequired("date") /** - * The actual earnings per share (EPS) for the period + * The actual earnings per share (EPS) for the period When a null/undefined value is observed, + * it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -79,7 +80,8 @@ private constructor( fun epsActual(): Optional = epsActual.getOptional("eps_actual") /** - * The estimated earnings per share (EPS) for the period + * The estimated earnings per share (EPS) for the period When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -87,7 +89,8 @@ private constructor( fun epsEstimate(): Optional = epsEstimate.getOptional("eps_estimate") /** - * The percentage difference between actual and estimated EPS + * The percentage difference between actual and estimated EPS When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -96,7 +99,8 @@ private constructor( epsSurprisePercent.getOptional("eps_surprise_percent") /** - * The actual total revenue for the period + * The actual total revenue for the period When a null/undefined value is observed, it indicates + * that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -104,7 +108,8 @@ private constructor( fun revenueActual(): Optional = revenueActual.getOptional("revenue_actual") /** - * The estimated total revenue for the period + * The estimated total revenue for the period When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -112,7 +117,8 @@ private constructor( fun revenueEstimate(): Optional = revenueEstimate.getOptional("revenue_estimate") /** - * The percentage difference between actual and estimated revenue + * The percentage difference between actual and estimated revenue When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -241,7 +247,10 @@ private constructor( */ fun date(date: JsonField) = apply { this.date = date } - /** The actual earnings per share (EPS) for the period */ + /** + * The actual earnings per share (EPS) for the period When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun epsActual(epsActual: String?) = epsActual(JsonField.ofNullable(epsActual)) /** Alias for calling [Builder.epsActual] with `epsActual.orElse(null)`. */ @@ -256,7 +265,10 @@ private constructor( */ fun epsActual(epsActual: JsonField) = apply { this.epsActual = epsActual } - /** The estimated earnings per share (EPS) for the period */ + /** + * The estimated earnings per share (EPS) for the period When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun epsEstimate(epsEstimate: String?) = epsEstimate(JsonField.ofNullable(epsEstimate)) /** Alias for calling [Builder.epsEstimate] with `epsEstimate.orElse(null)`. */ @@ -271,7 +283,10 @@ private constructor( */ fun epsEstimate(epsEstimate: JsonField) = apply { this.epsEstimate = epsEstimate } - /** The percentage difference between actual and estimated EPS */ + /** + * The percentage difference between actual and estimated EPS When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun epsSurprisePercent(epsSurprisePercent: String?) = epsSurprisePercent(JsonField.ofNullable(epsSurprisePercent)) @@ -292,7 +307,10 @@ private constructor( this.epsSurprisePercent = epsSurprisePercent } - /** The actual total revenue for the period */ + /** + * The actual total revenue for the period When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun revenueActual(revenueActual: String?) = revenueActual(JsonField.ofNullable(revenueActual)) @@ -311,7 +329,10 @@ private constructor( this.revenueActual = revenueActual } - /** The estimated total revenue for the period */ + /** + * The estimated total revenue for the period When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun revenueEstimate(revenueEstimate: String?) = revenueEstimate(JsonField.ofNullable(revenueEstimate)) @@ -330,7 +351,10 @@ private constructor( this.revenueEstimate = revenueEstimate } - /** The percentage difference between actual and estimated revenue */ + /** + * The percentage difference between actual and estimated revenue When a null/undefined + * value is observed, it indicates that there is no available data. + */ fun revenueSurprisePercent(revenueSurprisePercent: String?) = revenueSurprisePercent(JsonField.ofNullable(revenueSurprisePercent)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt index b271374d..79858898 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventEnvelope.kt @@ -88,7 +88,8 @@ private constructor( fun type(): AllEventsEventType = type.getRequired("type") /** - * Dividend payload when type is DIVIDEND. + * Dividend payload when type is DIVIDEND. When a null/undefined value is observed, it indicates + * it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -97,7 +98,8 @@ private constructor( dividendEventData.getOptional("dividend_event_data") /** - * Earnings payload when type is EARNINGS. + * Earnings payload when type is EARNINGS. When a null/undefined value is observed, it indicates + * it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -106,7 +108,8 @@ private constructor( earningsEventData.getOptional("earnings_event_data") /** - * Instrument identifier, when available. + * Instrument identifier, when available. When a null/undefined value is observed, it indicates + * that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -114,7 +117,8 @@ private constructor( fun instrumentId(): Optional = instrumentId.getOptional("instrument_id") /** - * IPO payload when type is IPO. + * IPO payload when type is IPO. When a null/undefined value is observed, it indicates it does + * not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -123,7 +127,8 @@ private constructor( ipoEventData.getOptional("ipo_event_data") /** - * Instrument name associated with the event, when available. + * Instrument name associated with the event, when available. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -131,7 +136,8 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * The currency used for reporting financial data. + * The currency used for reporting financial data. When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -139,7 +145,8 @@ private constructor( fun reportingCurrency(): Optional = reportingCurrency.getOptional("reporting_currency") /** - * Stock split payload when type is STOCK_SPLIT. + * Stock split payload when type is STOCK_SPLIT. When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -303,7 +310,10 @@ private constructor( */ fun type(type: JsonField) = apply { this.type = type } - /** Dividend payload when type is DIVIDEND. */ + /** + * Dividend payload when type is DIVIDEND. When a null/undefined value is observed, it + * indicates it does not apply. + */ fun dividendEventData(dividendEventData: InstrumentDividendEvent?) = dividendEventData(JsonField.ofNullable(dividendEventData)) @@ -322,7 +332,10 @@ private constructor( this.dividendEventData = dividendEventData } - /** Earnings payload when type is EARNINGS. */ + /** + * Earnings payload when type is EARNINGS. When a null/undefined value is observed, it + * indicates it does not apply. + */ fun earningsEventData(earningsEventData: InstrumentEarnings?) = earningsEventData(JsonField.ofNullable(earningsEventData)) @@ -341,7 +354,10 @@ private constructor( this.earningsEventData = earningsEventData } - /** Instrument identifier, when available. */ + /** + * Instrument identifier, when available. When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun instrumentId(instrumentId: String?) = instrumentId(JsonField.ofNullable(instrumentId)) /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ @@ -358,7 +374,10 @@ private constructor( this.instrumentId = instrumentId } - /** IPO payload when type is IPO. */ + /** + * IPO payload when type is IPO. When a null/undefined value is observed, it indicates it + * does not apply. + */ fun ipoEventData(ipoEventData: InstrumentEventIpoItem?) = ipoEventData(JsonField.ofNullable(ipoEventData)) @@ -377,7 +396,10 @@ private constructor( this.ipoEventData = ipoEventData } - /** Instrument name associated with the event, when available. */ + /** + * Instrument name associated with the event, when available. When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun name(name: String?) = name(JsonField.ofNullable(name)) /** Alias for calling [Builder.name] with `name.orElse(null)`. */ @@ -391,7 +413,10 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - /** The currency used for reporting financial data. */ + /** + * The currency used for reporting financial data. When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun reportingCurrency(reportingCurrency: String?) = reportingCurrency(JsonField.ofNullable(reportingCurrency)) @@ -410,7 +435,10 @@ private constructor( this.reportingCurrency = reportingCurrency } - /** Stock split payload when type is STOCK_SPLIT. */ + /** + * Stock split payload when type is STOCK_SPLIT. When a null/undefined value is observed, it + * indicates it does not apply. + */ fun stockSplitEventData(stockSplitEventData: InstrumentSplitEvent?) = stockSplitEventData(JsonField.ofNullable(stockSplitEventData)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt index f33aeb6b..ff3b4243 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventIpoItem.kt @@ -47,7 +47,8 @@ private constructor( ) : this(actions, announcedAt, company, exchange, marketCap, priceRange, shares, mutableMapOf()) /** - * IPO action. + * IPO action. When a null/undefined value is observed, it indicates that there is no available + * data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -55,7 +56,8 @@ private constructor( fun actions(): Optional = actions.getOptional("actions") /** - * IPO announced timestamp. + * IPO announced timestamp. When a null/undefined value is observed, it indicates that there is + * no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -63,7 +65,8 @@ private constructor( fun announcedAt(): Optional = announcedAt.getOptional("announced_at") /** - * IPO company name. + * IPO company name. When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -71,7 +74,8 @@ private constructor( fun company(): Optional = company.getOptional("company") /** - * IPO exchange. + * IPO exchange. When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -79,7 +83,8 @@ private constructor( fun exchange(): Optional = exchange.getOptional("exchange") /** - * IPO market cap. + * IPO market cap. When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -87,7 +92,8 @@ private constructor( fun marketCap(): Optional = marketCap.getOptional("market_cap") /** - * IPO price range. + * IPO price range. When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -95,7 +101,8 @@ private constructor( fun priceRange(): Optional = priceRange.getOptional("price_range") /** - * IPO shares offered. + * IPO shares offered. When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -195,7 +202,10 @@ private constructor( additionalProperties = instrumentEventIpoItem.additionalProperties.toMutableMap() } - /** IPO action. */ + /** + * IPO action. When a null/undefined value is observed, it indicates that there is no + * available data. + */ fun actions(actions: String?) = actions(JsonField.ofNullable(actions)) /** Alias for calling [Builder.actions] with `actions.orElse(null)`. */ @@ -209,7 +219,10 @@ private constructor( */ fun actions(actions: JsonField) = apply { this.actions = actions } - /** IPO announced timestamp. */ + /** + * IPO announced timestamp. When a null/undefined value is observed, it indicates that there + * is no available data. + */ fun announcedAt(announcedAt: OffsetDateTime?) = announcedAt(JsonField.ofNullable(announcedAt)) @@ -228,7 +241,10 @@ private constructor( this.announcedAt = announcedAt } - /** IPO company name. */ + /** + * IPO company name. When a null/undefined value is observed, it indicates that there is no + * available data. + */ fun company(company: String?) = company(JsonField.ofNullable(company)) /** Alias for calling [Builder.company] with `company.orElse(null)`. */ @@ -242,7 +258,10 @@ private constructor( */ fun company(company: JsonField) = apply { this.company = company } - /** IPO exchange. */ + /** + * IPO exchange. When a null/undefined value is observed, it indicates that there is no + * available data. + */ fun exchange(exchange: String?) = exchange(JsonField.ofNullable(exchange)) /** Alias for calling [Builder.exchange] with `exchange.orElse(null)`. */ @@ -256,7 +275,10 @@ private constructor( */ fun exchange(exchange: JsonField) = apply { this.exchange = exchange } - /** IPO market cap. */ + /** + * IPO market cap. When a null/undefined value is observed, it indicates that there is no + * available data. + */ fun marketCap(marketCap: String?) = marketCap(JsonField.ofNullable(marketCap)) /** Alias for calling [Builder.marketCap] with `marketCap.orElse(null)`. */ @@ -271,7 +293,10 @@ private constructor( */ fun marketCap(marketCap: JsonField) = apply { this.marketCap = marketCap } - /** IPO price range. */ + /** + * IPO price range. When a null/undefined value is observed, it indicates that there is no + * available data. + */ fun priceRange(priceRange: String?) = priceRange(JsonField.ofNullable(priceRange)) /** Alias for calling [Builder.priceRange] with `priceRange.orElse(null)`. */ @@ -286,7 +311,10 @@ private constructor( */ fun priceRange(priceRange: JsonField) = apply { this.priceRange = priceRange } - /** IPO shares offered. */ + /** + * IPO shares offered. When a null/undefined value is observed, it indicates that there is + * no available data. + */ fun shares(shares: String?) = shares(JsonField.ofNullable(shares)) /** Alias for calling [Builder.shares] with `shares.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt index fc714f92..0efb7b94 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentEventsData.kt @@ -83,7 +83,8 @@ private constructor( fun splits(): List = splits.getRequired("splits") /** - * The currency used for reporting financial data + * The currency used for reporting financial data When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -276,7 +277,10 @@ private constructor( } } - /** The currency used for reporting financial data */ + /** + * The currency used for reporting financial data When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun reportingCurrency(reportingCurrency: String?) = reportingCurrency(JsonField.ofNullable(reportingCurrency)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentals.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentals.kt index 98253ddc..3ec3ef85 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentals.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/InstrumentFundamentals.kt @@ -96,7 +96,8 @@ private constructor( ) /** - * The average daily trading volume over the past 30 days + * The average daily trading volume over the past 30 days When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -104,7 +105,8 @@ private constructor( fun averageVolume(): Optional = averageVolume.getOptional("average_volume") /** - * The beta value, measuring the instrument's volatility relative to the overall market + * The beta value, measuring the instrument's volatility relative to the overall market When a + * null/undefined value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -112,7 +114,8 @@ private constructor( fun beta(): Optional = beta.getOptional("beta") /** - * A detailed description of the instrument or company + * A detailed description of the instrument or company When a null/undefined value is observed, + * it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -120,7 +123,8 @@ private constructor( fun description(): Optional = description.getOptional("description") /** - * The trailing twelve months (TTM) dividend yield + * The trailing twelve months (TTM) dividend yield When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -128,7 +132,8 @@ private constructor( fun dividendYield(): Optional = dividendYield.getOptional("dividend_yield") /** - * The trailing twelve months (TTM) earnings per share + * The trailing twelve months (TTM) earnings per share When a null/undefined value is observed, + * it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -136,7 +141,8 @@ private constructor( fun earningsPerShare(): Optional = earningsPerShare.getOptional("earnings_per_share") /** - * The highest price over the last 52 weeks + * The highest price over the last 52 weeks When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -144,7 +150,8 @@ private constructor( fun fiftyTwoWeekHigh(): Optional = fiftyTwoWeekHigh.getOptional("fifty_two_week_high") /** - * The lowest price over the last 52 weeks + * The lowest price over the last 52 weeks When a null/undefined value is observed, it indicates + * that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -152,7 +159,8 @@ private constructor( fun fiftyTwoWeekLow(): Optional = fiftyTwoWeekLow.getOptional("fifty_two_week_low") /** - * The specific industry of the instrument's issuer + * The specific industry of the instrument's issuer When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -160,7 +168,8 @@ private constructor( fun industry(): Optional = industry.getOptional("industry") /** - * The date the instrument was first listed + * The date the instrument was first listed When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -168,7 +177,8 @@ private constructor( fun listDate(): Optional = listDate.getOptional("list_date") /** - * URL to a representative logo image for the instrument or issuer + * URL to a representative logo image for the instrument or issuer When a null/undefined value + * is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -176,7 +186,8 @@ private constructor( fun logoUrl(): Optional = logoUrl.getOptional("logo_url") /** - * The total market capitalization + * The total market capitalization When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -184,7 +195,8 @@ private constructor( fun marketCap(): Optional = marketCap.getOptional("market_cap") /** - * The closing price from the previous trading day + * The closing price from the previous trading day When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -192,7 +204,8 @@ private constructor( fun previousClose(): Optional = previousClose.getOptional("previous_close") /** - * The price-to-earnings (P/E) ratio for the trailing twelve months (TTM) + * The price-to-earnings (P/E) ratio for the trailing twelve months (TTM) When a null/undefined + * value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -200,7 +213,8 @@ private constructor( fun priceToEarnings(): Optional = priceToEarnings.getOptional("price_to_earnings") /** - * The currency used for reporting financial data + * The currency used for reporting financial data When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -208,7 +222,8 @@ private constructor( fun reportingCurrency(): Optional = reportingCurrency.getOptional("reporting_currency") /** - * The business sector of the instrument's issuer + * The business sector of the instrument's issuer When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -397,7 +412,10 @@ private constructor( additionalProperties = instrumentFundamentals.additionalProperties.toMutableMap() } - /** The average daily trading volume over the past 30 days */ + /** + * The average daily trading volume over the past 30 days When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun averageVolume(averageVolume: Long?) = averageVolume(JsonField.ofNullable(averageVolume)) /** @@ -421,7 +439,10 @@ private constructor( this.averageVolume = averageVolume } - /** The beta value, measuring the instrument's volatility relative to the overall market */ + /** + * The beta value, measuring the instrument's volatility relative to the overall market When + * a null/undefined value is observed, it indicates that there is no available data. + */ fun beta(beta: String?) = beta(JsonField.ofNullable(beta)) /** Alias for calling [Builder.beta] with `beta.orElse(null)`. */ @@ -435,7 +456,10 @@ private constructor( */ fun beta(beta: JsonField) = apply { this.beta = beta } - /** A detailed description of the instrument or company */ + /** + * A detailed description of the instrument or company When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun description(description: String?) = description(JsonField.ofNullable(description)) /** Alias for calling [Builder.description] with `description.orElse(null)`. */ @@ -450,7 +474,10 @@ private constructor( */ fun description(description: JsonField) = apply { this.description = description } - /** The trailing twelve months (TTM) dividend yield */ + /** + * The trailing twelve months (TTM) dividend yield When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun dividendYield(dividendYield: String?) = dividendYield(JsonField.ofNullable(dividendYield)) @@ -469,7 +496,10 @@ private constructor( this.dividendYield = dividendYield } - /** The trailing twelve months (TTM) earnings per share */ + /** + * The trailing twelve months (TTM) earnings per share When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun earningsPerShare(earningsPerShare: String?) = earningsPerShare(JsonField.ofNullable(earningsPerShare)) @@ -488,7 +518,10 @@ private constructor( this.earningsPerShare = earningsPerShare } - /** The highest price over the last 52 weeks */ + /** + * The highest price over the last 52 weeks When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun fiftyTwoWeekHigh(fiftyTwoWeekHigh: String?) = fiftyTwoWeekHigh(JsonField.ofNullable(fiftyTwoWeekHigh)) @@ -507,7 +540,10 @@ private constructor( this.fiftyTwoWeekHigh = fiftyTwoWeekHigh } - /** The lowest price over the last 52 weeks */ + /** + * The lowest price over the last 52 weeks When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun fiftyTwoWeekLow(fiftyTwoWeekLow: String?) = fiftyTwoWeekLow(JsonField.ofNullable(fiftyTwoWeekLow)) @@ -526,7 +562,10 @@ private constructor( this.fiftyTwoWeekLow = fiftyTwoWeekLow } - /** The specific industry of the instrument's issuer */ + /** + * The specific industry of the instrument's issuer When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun industry(industry: String?) = industry(JsonField.ofNullable(industry)) /** Alias for calling [Builder.industry] with `industry.orElse(null)`. */ @@ -540,7 +579,10 @@ private constructor( */ fun industry(industry: JsonField) = apply { this.industry = industry } - /** The date the instrument was first listed */ + /** + * The date the instrument was first listed When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun listDate(listDate: LocalDate?) = listDate(JsonField.ofNullable(listDate)) /** Alias for calling [Builder.listDate] with `listDate.orElse(null)`. */ @@ -555,7 +597,10 @@ private constructor( */ fun listDate(listDate: JsonField) = apply { this.listDate = listDate } - /** URL to a representative logo image for the instrument or issuer */ + /** + * URL to a representative logo image for the instrument or issuer When a null/undefined + * value is observed, it indicates that there is no available data. + */ fun logoUrl(logoUrl: String?) = logoUrl(JsonField.ofNullable(logoUrl)) /** Alias for calling [Builder.logoUrl] with `logoUrl.orElse(null)`. */ @@ -569,7 +614,10 @@ private constructor( */ fun logoUrl(logoUrl: JsonField) = apply { this.logoUrl = logoUrl } - /** The total market capitalization */ + /** + * The total market capitalization When a null/undefined value is observed, it indicates + * that there is no available data. + */ fun marketCap(marketCap: String?) = marketCap(JsonField.ofNullable(marketCap)) /** Alias for calling [Builder.marketCap] with `marketCap.orElse(null)`. */ @@ -584,7 +632,10 @@ private constructor( */ fun marketCap(marketCap: JsonField) = apply { this.marketCap = marketCap } - /** The closing price from the previous trading day */ + /** + * The closing price from the previous trading day When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun previousClose(previousClose: String?) = previousClose(JsonField.ofNullable(previousClose)) @@ -603,7 +654,10 @@ private constructor( this.previousClose = previousClose } - /** The price-to-earnings (P/E) ratio for the trailing twelve months (TTM) */ + /** + * The price-to-earnings (P/E) ratio for the trailing twelve months (TTM) When a + * null/undefined value is observed, it indicates that there is no available data. + */ fun priceToEarnings(priceToEarnings: String?) = priceToEarnings(JsonField.ofNullable(priceToEarnings)) @@ -622,7 +676,10 @@ private constructor( this.priceToEarnings = priceToEarnings } - /** The currency used for reporting financial data */ + /** + * The currency used for reporting financial data When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun reportingCurrency(reportingCurrency: String?) = reportingCurrency(JsonField.ofNullable(reportingCurrency)) @@ -641,7 +698,10 @@ private constructor( this.reportingCurrency = reportingCurrency } - /** The business sector of the instrument's issuer */ + /** + * The business sector of the instrument's issuer When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun sector(sector: String?) = sector(JsonField.ofNullable(sector)) /** Alias for calling [Builder.sector] with `sector.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt index aaa922c2..13d6273c 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/DailySummary.kt @@ -65,7 +65,8 @@ private constructor( fun instrumentId(): String = instrumentId.getRequired("instrument_id") /** - * Session high. + * Session high. When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -73,7 +74,8 @@ private constructor( fun high(): Optional = high.getOptional("high") /** - * Session low. + * Session low. When a null/undefined value is observed, it indicates that there is no available + * data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -81,7 +83,8 @@ private constructor( fun low(): Optional = low.getOptional("low") /** - * Opening price for the session. + * Opening price for the session. When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -89,7 +92,8 @@ private constructor( fun open(): Optional = open.getOptional("open") /** - * Display symbol for the security. `None` for unresolvable IDs. + * Display symbol for the security. `None` for unresolvable IDs. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -97,7 +101,8 @@ private constructor( fun symbol(): Optional = symbol.getOptional("symbol") /** - * Session date the OHLV represents, US/Eastern. + * Session date the OHLV represents, US/Eastern. When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -105,7 +110,8 @@ private constructor( fun tradeDate(): Optional = tradeDate.getOptional("trade_date") /** - * Session cumulative trading volume. + * Session cumulative trading volume. When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -226,7 +232,10 @@ private constructor( this.instrumentId = instrumentId } - /** Session high. */ + /** + * Session high. When a null/undefined value is observed, it indicates that there is no + * available data. + */ fun high(high: String?) = high(JsonField.ofNullable(high)) /** Alias for calling [Builder.high] with `high.orElse(null)`. */ @@ -240,7 +249,10 @@ private constructor( */ fun high(high: JsonField) = apply { this.high = high } - /** Session low. */ + /** + * Session low. When a null/undefined value is observed, it indicates that there is no + * available data. + */ fun low(low: String?) = low(JsonField.ofNullable(low)) /** Alias for calling [Builder.low] with `low.orElse(null)`. */ @@ -254,7 +266,10 @@ private constructor( */ fun low(low: JsonField) = apply { this.low = low } - /** Opening price for the session. */ + /** + * Opening price for the session. When a null/undefined value is observed, it indicates that + * there is no available data. + */ fun open(open: String?) = open(JsonField.ofNullable(open)) /** Alias for calling [Builder.open] with `open.orElse(null)`. */ @@ -268,7 +283,10 @@ private constructor( */ fun open(open: JsonField) = apply { this.open = open } - /** Display symbol for the security. `None` for unresolvable IDs. */ + /** + * Display symbol for the security. `None` for unresolvable IDs. When a null/undefined value + * is observed, it indicates that there is no available data. + */ fun symbol(symbol: String?) = symbol(JsonField.ofNullable(symbol)) /** Alias for calling [Builder.symbol] with `symbol.orElse(null)`. */ @@ -282,7 +300,10 @@ private constructor( */ fun symbol(symbol: JsonField) = apply { this.symbol = symbol } - /** Session date the OHLV represents, US/Eastern. */ + /** + * Session date the OHLV represents, US/Eastern. When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun tradeDate(tradeDate: LocalDate?) = tradeDate(JsonField.ofNullable(tradeDate)) /** Alias for calling [Builder.tradeDate] with `tradeDate.orElse(null)`. */ @@ -297,7 +318,10 @@ private constructor( */ fun tradeDate(tradeDate: JsonField) = apply { this.tradeDate = tradeDate } - /** Session cumulative trading volume. */ + /** + * Session cumulative trading volume. When a null/undefined value is observed, it indicates + * that there is no available data. + */ fun volume(volume: Long?) = volume(JsonField.ofNullable(volume)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt index e13bb6be..7495b4c6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshot.kt @@ -84,7 +84,8 @@ private constructor( /** * Cumulative traded volume reported on the most recent trade, in shares for equities or - * contracts for options. Absent when no trade is available. + * contracts for options. Absent when no trade is available. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -93,7 +94,8 @@ private constructor( /** * Theoretical price and Greeks for option instruments. `None` for equities, and for options - * whose Greeks have not yet been observed + * whose Greeks have not yet been observed When a null/undefined value is observed, it indicates + * that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -101,7 +103,8 @@ private constructor( fun greeks(): Optional = greeks.getOptional("greeks") /** - * Most recent quote if available. + * Most recent quote if available. When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -109,7 +112,8 @@ private constructor( fun lastQuote(): Optional = lastQuote.getOptional("last_quote") /** - * Most recent last-sale trade if available. + * Most recent last-sale trade if available. When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -117,7 +121,8 @@ private constructor( fun lastTrade(): Optional = lastTrade.getOptional("last_trade") /** - * Security name if available. + * Security name if available. When a null/undefined value is observed, it indicates that there + * is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -125,7 +130,8 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Session metrics computed from previous close and last trade, if available. + * Session metrics computed from previous close and last trade, if available. When a + * null/undefined value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -276,7 +282,8 @@ private constructor( /** * Cumulative traded volume reported on the most recent trade, in shares for equities or - * contracts for options. Absent when no trade is available. + * contracts for options. Absent when no trade is available. When a null/undefined value is + * observed, it indicates that there is no available data. */ fun cumulativeVolume(cumulativeVolume: Long?) = cumulativeVolume(JsonField.ofNullable(cumulativeVolume)) @@ -305,7 +312,8 @@ private constructor( /** * Theoretical price and Greeks for option instruments. `None` for equities, and for options - * whose Greeks have not yet been observed + * whose Greeks have not yet been observed When a null/undefined value is observed, it + * indicates that there is no available data. */ fun greeks(greeks: SnapshotGreeks?) = greeks(JsonField.ofNullable(greeks)) @@ -321,7 +329,10 @@ private constructor( */ fun greeks(greeks: JsonField) = apply { this.greeks = greeks } - /** Most recent quote if available. */ + /** + * Most recent quote if available. When a null/undefined value is observed, it indicates + * that there is no available data. + */ fun lastQuote(lastQuote: SnapshotQuote?) = lastQuote(JsonField.ofNullable(lastQuote)) /** Alias for calling [Builder.lastQuote] with `lastQuote.orElse(null)`. */ @@ -336,7 +347,10 @@ private constructor( */ fun lastQuote(lastQuote: JsonField) = apply { this.lastQuote = lastQuote } - /** Most recent last-sale trade if available. */ + /** + * Most recent last-sale trade if available. When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun lastTrade(lastTrade: SnapshotLastTrade?) = lastTrade(JsonField.ofNullable(lastTrade)) /** Alias for calling [Builder.lastTrade] with `lastTrade.orElse(null)`. */ @@ -353,7 +367,10 @@ private constructor( this.lastTrade = lastTrade } - /** Security name if available. */ + /** + * Security name if available. When a null/undefined value is observed, it indicates that + * there is no available data. + */ fun name(name: String?) = name(JsonField.ofNullable(name)) /** Alias for calling [Builder.name] with `name.orElse(null)`. */ @@ -367,7 +384,10 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - /** Session metrics computed from previous close and last trade, if available. */ + /** + * Session metrics computed from previous close and last trade, if available. When a + * null/undefined value is observed, it indicates that there is no available data. + */ fun session(session: SnapshotSession?) = session(JsonField.ofNullable(session)) /** Alias for calling [Builder.session] with `session.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt index 9a9e660f..6d6a2562 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt @@ -63,7 +63,8 @@ private constructor( fun midpoint(): String = midpoint.getRequired("midpoint") /** - * Size at the best ask, in shares. + * Size at the best ask, in shares. When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -71,7 +72,8 @@ private constructor( fun askSize(): Optional = askSize.getOptional("ask_size") /** - * Size at the best bid, in shares. + * Size at the best bid, in shares. When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -193,7 +195,10 @@ private constructor( */ fun midpoint(midpoint: JsonField) = apply { this.midpoint = midpoint } - /** Size at the best ask, in shares. */ + /** + * Size at the best ask, in shares. When a null/undefined value is observed, it indicates + * that there is no available data. + */ fun askSize(askSize: Int?) = askSize(JsonField.ofNullable(askSize)) /** @@ -214,7 +219,10 @@ private constructor( */ fun askSize(askSize: JsonField) = apply { this.askSize = askSize } - /** Size at the best bid, in shares. */ + /** + * Size at the best bid, in shares. When a null/undefined value is observed, it indicates + * that there is no available data. + */ fun bidSize(bidSize: Int?) = bidSize(JsonField.ofNullable(bidSize)) /** diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt index cabe6396..21591a7d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsInstrument.kt @@ -45,7 +45,8 @@ private constructor( fun instrumentId(): String = instrumentId.getRequired("instrument_id") /** - * Instrument name/description, if available. + * Instrument name/description, if available. When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -53,7 +54,8 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Trading symbol, if available. + * Trading symbol, if available. When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -138,7 +140,10 @@ private constructor( this.instrumentId = instrumentId } - /** Instrument name/description, if available. */ + /** + * Instrument name/description, if available. When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun name(name: String?) = name(JsonField.ofNullable(name)) /** Alias for calling [Builder.name] with `name.orElse(null)`. */ @@ -152,7 +157,10 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - /** Trading symbol, if available. */ + /** + * Trading symbol, if available. When a null/undefined value is observed, it indicates that + * there is no available data. + */ fun symbol(symbol: String?) = symbol(JsonField.ofNullable(symbol)) /** Alias for calling [Builder.symbol] with `symbol.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItem.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItem.kt index 61fde33e..e9f38bd4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItem.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/news/NewsItem.kt @@ -113,7 +113,8 @@ private constructor( fun url(): String = url.getRequired("url") /** - * URL of an associated image if provided by the source. + * URL of an associated image if provided by the source. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -121,7 +122,8 @@ private constructor( fun imageUrl(): Optional = imageUrl.getOptional("image_url") /** - * The primary domain/site of the publisher. + * The primary domain/site of the publisher. When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -129,7 +131,8 @@ private constructor( fun site(): Optional = site.getOptional("site") /** - * The full or excerpted article body. + * The full or excerpted article body. When a null/undefined value is observed, it indicates + * that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -347,7 +350,10 @@ private constructor( */ fun url(url: JsonField) = apply { this.url = url } - /** URL of an associated image if provided by the source. */ + /** + * URL of an associated image if provided by the source. When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun imageUrl(imageUrl: String?) = imageUrl(JsonField.ofNullable(imageUrl)) /** Alias for calling [Builder.imageUrl] with `imageUrl.orElse(null)`. */ @@ -361,7 +367,10 @@ private constructor( */ fun imageUrl(imageUrl: JsonField) = apply { this.imageUrl = imageUrl } - /** The primary domain/site of the publisher. */ + /** + * The primary domain/site of the publisher. When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun site(site: String?) = site(JsonField.ofNullable(site)) /** Alias for calling [Builder.site] with `site.orElse(null)`. */ @@ -375,7 +384,10 @@ private constructor( */ fun site(site: JsonField) = apply { this.site = site } - /** The full or excerpted article body. */ + /** + * The full or excerpted article body. When a null/undefined value is observed, it indicates + * that there is no available data. + */ fun text(text: String?) = text(JsonField.ofNullable(text)) /** Alias for calling [Builder.text] with `text.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt index 69d2e883..5d0416da 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt @@ -239,7 +239,8 @@ private constructor( fun venue(): String = venue.getRequired("venue") /** - * Average daily share volume from the security definition. + * Average daily share volume from the security definition. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -247,7 +248,8 @@ private constructor( fun adv(): Optional = adv.getOptional("adv") /** - * The expiration date for options instruments + * The expiration date for options instruments When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -255,7 +257,8 @@ private constructor( fun expiry(): Optional = expiry.getOptional("expiry") /** - * The type of security (e.g., Common Stock, ETF) + * The type of security (e.g., Common Stock, ETF) When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -263,7 +266,8 @@ private constructor( fun instrumentType(): Optional = instrumentType.getOptional("instrument_type") /** - * The percent of a long position's value you must post as margin + * The percent of a long position's value you must post as margin When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -271,7 +275,8 @@ private constructor( fun longMarginRate(): Optional = longMarginRate.getOptional("long_margin_rate") /** - * The full name of the instrument or its issuer + * The full name of the instrument or its issuer When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -279,7 +284,8 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Notional average daily volume (ADV multiplied by previous close price). + * Notional average daily volume (ADV multiplied by previous close price). When a null/undefined + * value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -288,7 +294,8 @@ private constructor( /** * Available options expiration dates for this instrument. Present only when - * `include_options_expiry_dates=true` in the request. + * `include_options_expiry_dates=true` in the request. When a null/undefined value is observed, + * it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -297,7 +304,8 @@ private constructor( optionsExpiryDates.getOptional("options_expiry_dates") /** - * Last close price from the security definition. + * Last close price from the security definition. When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -305,7 +313,8 @@ private constructor( fun previousClose(): Optional = previousClose.getOptional("previous_close") /** - * The percent of a short position's value you must post as margin + * The percent of a short position's value you must post as margin When a null/undefined value + * is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -313,7 +322,8 @@ private constructor( fun shortMarginRate(): Optional = shortMarginRate.getOptional("short_margin_rate") /** - * The strike price for options instruments + * The strike price for options instruments When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -777,7 +787,10 @@ private constructor( */ fun venue(venue: JsonField) = apply { this.venue = venue } - /** Average daily share volume from the security definition. */ + /** + * Average daily share volume from the security definition. When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun adv(adv: String?) = adv(JsonField.ofNullable(adv)) /** Alias for calling [Builder.adv] with `adv.orElse(null)`. */ @@ -791,7 +804,10 @@ private constructor( */ fun adv(adv: JsonField) = apply { this.adv = adv } - /** The expiration date for options instruments */ + /** + * The expiration date for options instruments When a null/undefined value is observed, it + * indicates it does not apply. + */ fun expiry(expiry: LocalDate?) = expiry(JsonField.ofNullable(expiry)) /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ @@ -806,7 +822,10 @@ private constructor( */ fun expiry(expiry: JsonField) = apply { this.expiry = expiry } - /** The type of security (e.g., Common Stock, ETF) */ + /** + * The type of security (e.g., Common Stock, ETF) When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun instrumentType(instrumentType: SecurityType?) = instrumentType(JsonField.ofNullable(instrumentType)) @@ -825,7 +844,10 @@ private constructor( this.instrumentType = instrumentType } - /** The percent of a long position's value you must post as margin */ + /** + * The percent of a long position's value you must post as margin When a null/undefined + * value is observed, it indicates that there is no available data. + */ fun longMarginRate(longMarginRate: String?) = longMarginRate(JsonField.ofNullable(longMarginRate)) @@ -844,7 +866,10 @@ private constructor( this.longMarginRate = longMarginRate } - /** The full name of the instrument or its issuer */ + /** + * The full name of the instrument or its issuer When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun name(name: String?) = name(JsonField.ofNullable(name)) /** Alias for calling [Builder.name] with `name.orElse(null)`. */ @@ -858,7 +883,10 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - /** Notional average daily volume (ADV multiplied by previous close price). */ + /** + * Notional average daily volume (ADV multiplied by previous close price). When a + * null/undefined value is observed, it indicates that there is no available data. + */ fun notionalAdv(notionalAdv: String?) = notionalAdv(JsonField.ofNullable(notionalAdv)) /** Alias for calling [Builder.notionalAdv] with `notionalAdv.orElse(null)`. */ @@ -875,7 +903,8 @@ private constructor( /** * Available options expiration dates for this instrument. Present only when - * `include_options_expiry_dates=true` in the request. + * `include_options_expiry_dates=true` in the request. When a null/undefined value is + * observed, it indicates it does not apply. */ fun optionsExpiryDates(optionsExpiryDates: List?) = optionsExpiryDates(JsonField.ofNullable(optionsExpiryDates)) @@ -909,7 +938,10 @@ private constructor( } } - /** Last close price from the security definition. */ + /** + * Last close price from the security definition. When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun previousClose(previousClose: String?) = previousClose(JsonField.ofNullable(previousClose)) @@ -928,7 +960,10 @@ private constructor( this.previousClose = previousClose } - /** The percent of a short position's value you must post as margin */ + /** + * The percent of a short position's value you must post as margin When a null/undefined + * value is observed, it indicates that there is no available data. + */ fun shortMarginRate(shortMarginRate: String?) = shortMarginRate(JsonField.ofNullable(shortMarginRate)) @@ -947,7 +982,10 @@ private constructor( this.shortMarginRate = shortMarginRate } - /** The strike price for options instruments */ + /** + * The strike price for options instruments When a null/undefined value is observed, it + * indicates it does not apply. + */ fun strikePrice(strikePrice: String?) = strikePrice(JsonField.ofNullable(strikePrice)) /** Alias for calling [Builder.strikePrice] with `strikePrice.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt index 8bc29cd2..7c31f5ea 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt @@ -231,7 +231,8 @@ private constructor( fun venue(): String = venue.getRequired("venue") /** - * Average daily share volume from the security definition. + * Average daily share volume from the security definition. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -239,7 +240,8 @@ private constructor( fun adv(): Optional = adv.getOptional("adv") /** - * The expiration date for options instruments + * The expiration date for options instruments When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -247,7 +249,8 @@ private constructor( fun expiry(): Optional = expiry.getOptional("expiry") /** - * The type of security (e.g., Common Stock, ETF) + * The type of security (e.g., Common Stock, ETF) When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -255,7 +258,8 @@ private constructor( fun instrumentType(): Optional = instrumentType.getOptional("instrument_type") /** - * The percent of a long position's value you must post as margin + * The percent of a long position's value you must post as margin When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -263,7 +267,8 @@ private constructor( fun longMarginRate(): Optional = longMarginRate.getOptional("long_margin_rate") /** - * The full name of the instrument or its issuer + * The full name of the instrument or its issuer When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -271,7 +276,8 @@ private constructor( fun name(): Optional = name.getOptional("name") /** - * Notional average daily volume (ADV multiplied by previous close price). + * Notional average daily volume (ADV multiplied by previous close price). When a null/undefined + * value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -279,7 +285,8 @@ private constructor( fun notionalAdv(): Optional = notionalAdv.getOptional("notional_adv") /** - * Last close price from the security definition. + * Last close price from the security definition. When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -287,7 +294,8 @@ private constructor( fun previousClose(): Optional = previousClose.getOptional("previous_close") /** - * The percent of a short position's value you must post as margin + * The percent of a short position's value you must post as margin When a null/undefined value + * is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -295,7 +303,8 @@ private constructor( fun shortMarginRate(): Optional = shortMarginRate.getOptional("short_margin_rate") /** - * The strike price for options instruments + * The strike price for options instruments When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -747,7 +756,10 @@ private constructor( */ fun venue(venue: JsonField) = apply { this.venue = venue } - /** Average daily share volume from the security definition. */ + /** + * Average daily share volume from the security definition. When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun adv(adv: String?) = adv(JsonField.ofNullable(adv)) /** Alias for calling [Builder.adv] with `adv.orElse(null)`. */ @@ -761,7 +773,10 @@ private constructor( */ fun adv(adv: JsonField) = apply { this.adv = adv } - /** The expiration date for options instruments */ + /** + * The expiration date for options instruments When a null/undefined value is observed, it + * indicates it does not apply. + */ fun expiry(expiry: LocalDate?) = expiry(JsonField.ofNullable(expiry)) /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ @@ -776,7 +791,10 @@ private constructor( */ fun expiry(expiry: JsonField) = apply { this.expiry = expiry } - /** The type of security (e.g., Common Stock, ETF) */ + /** + * The type of security (e.g., Common Stock, ETF) When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun instrumentType(instrumentType: SecurityType?) = instrumentType(JsonField.ofNullable(instrumentType)) @@ -795,7 +813,10 @@ private constructor( this.instrumentType = instrumentType } - /** The percent of a long position's value you must post as margin */ + /** + * The percent of a long position's value you must post as margin When a null/undefined + * value is observed, it indicates that there is no available data. + */ fun longMarginRate(longMarginRate: String?) = longMarginRate(JsonField.ofNullable(longMarginRate)) @@ -814,7 +835,10 @@ private constructor( this.longMarginRate = longMarginRate } - /** The full name of the instrument or its issuer */ + /** + * The full name of the instrument or its issuer When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun name(name: String?) = name(JsonField.ofNullable(name)) /** Alias for calling [Builder.name] with `name.orElse(null)`. */ @@ -828,7 +852,10 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } - /** Notional average daily volume (ADV multiplied by previous close price). */ + /** + * Notional average daily volume (ADV multiplied by previous close price). When a + * null/undefined value is observed, it indicates that there is no available data. + */ fun notionalAdv(notionalAdv: String?) = notionalAdv(JsonField.ofNullable(notionalAdv)) /** Alias for calling [Builder.notionalAdv] with `notionalAdv.orElse(null)`. */ @@ -843,7 +870,10 @@ private constructor( */ fun notionalAdv(notionalAdv: JsonField) = apply { this.notionalAdv = notionalAdv } - /** Last close price from the security definition. */ + /** + * Last close price from the security definition. When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun previousClose(previousClose: String?) = previousClose(JsonField.ofNullable(previousClose)) @@ -862,7 +892,10 @@ private constructor( this.previousClose = previousClose } - /** The percent of a short position's value you must post as margin */ + /** + * The percent of a short position's value you must post as margin When a null/undefined + * value is observed, it indicates that there is no available data. + */ fun shortMarginRate(shortMarginRate: String?) = shortMarginRate(JsonField.ofNullable(shortMarginRate)) @@ -881,7 +914,10 @@ private constructor( this.shortMarginRate = shortMarginRate } - /** The strike price for options instruments */ + /** + * The strike price for options instruments When a null/undefined value is observed, it + * indicates it does not apply. + */ fun strikePrice(strikePrice: String?) = strikePrice(JsonField.ofNullable(strikePrice)) /** Alias for calling [Builder.strikePrice] with `strikePrice.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt index 079f37ef..c85668c4 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/OptionsContract.kt @@ -188,7 +188,8 @@ private constructor( fun symbol(): String = symbol.getRequired("symbol") /** - * Open interest (number of outstanding contracts), if available + * Open interest (number of outstanding contracts), if available When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -196,7 +197,8 @@ private constructor( fun openInterest(): Optional = openInterest.getOptional("open_interest") /** - * Instrument ID of the underlying instrument, when available + * Instrument ID of the underlying instrument, when available When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -545,7 +547,10 @@ private constructor( */ fun symbol(symbol: JsonField) = apply { this.symbol = symbol } - /** Open interest (number of outstanding contracts), if available */ + /** + * Open interest (number of outstanding contracts), if available When a null/undefined value + * is observed, it indicates that there is no available data. + */ fun openInterest(openInterest: Long?) = openInterest(JsonField.ofNullable(openInterest)) /** @@ -567,7 +572,10 @@ private constructor( */ fun openInterest(openInterest: JsonField) = apply { this.openInterest = openInterest } - /** Instrument ID of the underlying instrument, when available */ + /** + * Instrument ID of the underlying instrument, when available When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun underlyingInstrumentId(underlyingInstrumentId: String?) = underlyingInstrumentId(JsonField.ofNullable(underlyingInstrumentId)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ActionButton.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ActionButton.kt index 5ca61917..5a978576 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ActionButton.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ActionButton.kt @@ -57,7 +57,8 @@ private constructor( fun label(): String = label.getRequired("label") /** - * Follow-up prompt to submit as the next user message. + * Follow-up prompt to submit as the next user message. When a null/undefined value is observed, + * it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -65,7 +66,8 @@ private constructor( fun prompt(): Optional = prompt.getOptional("prompt") /** - * Structured action in the same message to execute on click. + * Structured action in the same message to execute on click. When a null/undefined value is + * observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -170,7 +172,10 @@ private constructor( */ fun label(label: JsonField) = apply { this.label = label } - /** Follow-up prompt to submit as the next user message. */ + /** + * Follow-up prompt to submit as the next user message. When a null/undefined value is + * observed, it indicates it does not apply. + */ fun prompt(prompt: PromptButtonAction?) = prompt(JsonField.ofNullable(prompt)) /** Alias for calling [Builder.prompt] with `prompt.orElse(null)`. */ @@ -185,7 +190,10 @@ private constructor( */ fun prompt(prompt: JsonField) = apply { this.prompt = prompt } - /** Structured action in the same message to execute on click. */ + /** + * Structured action in the same message to execute on click. When a null/undefined value is + * observed, it indicates it does not apply. + */ fun structuredAction(structuredAction: StructuredActionButtonAction?) = structuredAction(JsonField.ofNullable(structuredAction)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayload.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayload.kt index 0802aba0..27435d01 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayload.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ChartPayload.kt @@ -57,7 +57,8 @@ private constructor( fun actionButtons(): Optional> = actionButtons.getOptional("actionButtons") /** - * Explicit series-driven chart definition. + * Explicit series-driven chart definition. When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -166,7 +167,10 @@ private constructor( } } - /** Explicit series-driven chart definition. */ + /** + * Explicit series-driven chart definition. When a null/undefined value is observed, it + * indicates it does not apply. + */ fun dataChart(dataChart: DataChart?) = dataChart(JsonField.ofNullable(dataChart)) /** Alias for calling [Builder.dataChart] with `dataChart.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartAction.kt index 8c677fee..97379be9 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenChartAction.kt @@ -43,7 +43,8 @@ private constructor( fun symbol(): String = symbol.getRequired("symbol") /** - * Additional chart configuration (indicators, overlays, etc.) + * Additional chart configuration (indicators, overlays, etc.) When a null/undefined value is + * observed, it indicates it does not apply. * * This arbitrary value can be deserialized into a custom type using the `convert` method: * ```java @@ -53,7 +54,8 @@ private constructor( @JsonProperty("extras") @ExcludeMissing fun _extras(): JsonValue = extras /** - * Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") + * Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") When a null/undefined value is + * observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -126,10 +128,16 @@ private constructor( */ fun symbol(symbol: JsonField) = apply { this.symbol = symbol } - /** Additional chart configuration (indicators, overlays, etc.) */ + /** + * Additional chart configuration (indicators, overlays, etc.) When a null/undefined value + * is observed, it indicates it does not apply. + */ fun extras(extras: JsonValue) = apply { this.extras = extras } - /** Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") */ + /** + * Chart timeframe (e.g., "1D", "1W", "1M", "3M", "1Y", "5Y") When a null/undefined value is + * observed, it indicates it does not apply. + */ fun timeframe(timeframe: String?) = timeframe(JsonField.ofNullable(timeframe)) /** Alias for calling [Builder.timeframe] with `timeframe.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt index 009c8e68..8318b1a7 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt @@ -55,7 +55,8 @@ private constructor( fun filters(): List = filters.getRequired("filters") /** - * Optional field/column selection for screener results. + * Optional field/column selection for screener results. When a null/undefined value is + * observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -63,7 +64,7 @@ private constructor( fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") /** - * Optional page size. + * Optional page size. When a null/undefined value is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -71,7 +72,8 @@ private constructor( fun pageSize(): Optional = pageSize.getOptional("page_size") /** - * Optional sort field for screener rows. + * Optional sort field for screener rows. When a null/undefined value is observed, it indicates + * it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -79,7 +81,8 @@ private constructor( fun sortBy(): Optional = sortBy.getOptional("sort_by") /** - * Optional sort direction (`ASC` or `DESC`). + * Optional sort direction (`ASC` or `DESC`). When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -198,7 +201,10 @@ private constructor( } } - /** Optional field/column selection for screener results. */ + /** + * Optional field/column selection for screener results. When a null/undefined value is + * observed, it indicates it does not apply. + */ fun fieldFilter(fieldFilter: List?) = fieldFilter(JsonField.ofNullable(fieldFilter)) /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ @@ -227,7 +233,10 @@ private constructor( } } - /** Optional page size. */ + /** + * Optional page size. When a null/undefined value is observed, it indicates it does not + * apply. + */ fun pageSize(pageSize: Int?) = pageSize(JsonField.ofNullable(pageSize)) /** @@ -248,7 +257,10 @@ private constructor( */ fun pageSize(pageSize: JsonField) = apply { this.pageSize = pageSize } - /** Optional sort field for screener rows. */ + /** + * Optional sort field for screener rows. When a null/undefined value is observed, it + * indicates it does not apply. + */ fun sortBy(sortBy: String?) = sortBy(JsonField.ofNullable(sortBy)) /** Alias for calling [Builder.sortBy] with `sortBy.orElse(null)`. */ @@ -262,7 +274,10 @@ private constructor( */ fun sortBy(sortBy: JsonField) = apply { this.sortBy = sortBy } - /** Optional sort direction (`ASC` or `DESC`). */ + /** + * Optional sort direction (`ASC` or `DESC`). When a null/undefined value is observed, it + * indicates it does not apply. + */ fun sortDirection(sortDirection: String?) = sortDirection(JsonField.ofNullable(sortDirection)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonAction.kt index bd464048..de584cec 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionButtonAction.kt @@ -30,7 +30,8 @@ private constructor( ) : this(actionId, mutableMapOf()) /** - * UUID of a `structured_action` content part in the same message. + * UUID of a `structured_action` content part in the same message. When a null/undefined value + * is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -76,7 +77,10 @@ private constructor( additionalProperties = structuredActionButtonAction.additionalProperties.toMutableMap() } - /** UUID of a `structured_action` content part in the same message. */ + /** + * UUID of a `structured_action` content part in the same message. When a null/undefined + * value is observed, it indicates it does not apply. + */ fun actionId(actionId: String?) = actionId(JsonField.ofNullable(actionId)) /** Alias for calling [Builder.actionId] with `actionId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponse.kt index 99902280..bbdf0622 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/messages/CreateFeedbackResponse.kt @@ -40,6 +40,8 @@ private constructor( fun createdAt(): String = createdAt.getRequired("created_at") /** + * When a null/undefined value is observed, it indicates that there is no available data. + * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ @@ -109,6 +111,9 @@ private constructor( */ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + /** + * When a null/undefined value is observed, it indicates that there is no available data. + */ fun feedbackId(feedbackId: String?) = feedbackId(JsonField.ofNullable(feedbackId)) /** Alias for calling [Builder.feedbackId] with `feedbackId.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatus.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatus.kt index 26a8c58e..ab3a151e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatus.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/ErrorStatus.kt @@ -45,6 +45,8 @@ private constructor( fun message(): String = message.getRequired("message") /** + * When a null/undefined value is observed, it indicates it does not apply. + * * This arbitrary value can be deserialized into a custom type using the `convert` method: * ```java * MyClass myObject = errorStatus.details().convert(MyClass.class); @@ -128,6 +130,7 @@ private constructor( */ fun message(message: JsonField) = apply { this.message = message } + /** When a null/undefined value is observed, it indicates it does not apply. */ fun details(details: JsonValue) = apply { this.details = details } fun additionalProperties(additionalProperties: Map) = apply { diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/Response.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/Response.kt index 6e14bf47..3e6de128 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/Response.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/responses/Response.kt @@ -77,7 +77,7 @@ private constructor( fun userMessageId(): String = userMessageId.getRequired("user_message_id") /** - * Dynamic response content container. May include thinking parts. + * When a null/undefined value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -85,7 +85,7 @@ private constructor( fun content(): Optional = content.getOptional("content") /** - * Shared sanitized error payload. + * When a null/undefined value is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -93,6 +93,8 @@ private constructor( fun error(): Optional = error.getOptional("error") /** + * When a null/undefined value is observed, it indicates it does not apply. + * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ @@ -248,7 +250,9 @@ private constructor( this.userMessageId = userMessageId } - /** Dynamic response content container. May include thinking parts. */ + /** + * When a null/undefined value is observed, it indicates that there is no available data. + */ fun content(content: ResponseContent?) = content(JsonField.ofNullable(content)) /** Alias for calling [Builder.content] with `content.orElse(null)`. */ @@ -263,7 +267,7 @@ private constructor( */ fun content(content: JsonField) = apply { this.content = content } - /** Shared sanitized error payload. */ + /** When a null/undefined value is observed, it indicates it does not apply. */ fun error(error: ErrorStatus?) = error(JsonField.ofNullable(error)) /** Alias for calling [Builder.error] with `error.orElse(null)`. */ @@ -278,6 +282,7 @@ private constructor( */ fun error(error: JsonField) = apply { this.error = error } + /** When a null/undefined value is observed, it indicates it does not apply. */ fun outputMessageId(outputMessageId: String?) = outputMessageId(JsonField.ofNullable(outputMessageId)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Message.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Message.kt index ced4a9fa..3e4272a0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Message.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/Message.kt @@ -98,7 +98,7 @@ private constructor( fun threadId(): String = threadId.getRequired("thread_id") /** - * Shared sanitized error payload. + * When a null/undefined value is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -295,7 +295,7 @@ private constructor( */ fun threadId(threadId: JsonField) = apply { this.threadId = threadId } - /** Shared sanitized error payload. */ + /** When a null/undefined value is observed, it indicates it does not apply. */ fun error(error: ErrorStatus?) = error(JsonField.ofNullable(error)) /** Alias for calling [Builder.error] with `error.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt index 5f24cba1..75d47560 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/Order.kt @@ -312,7 +312,8 @@ private constructor( fun venue(): String = venue.getRequired("venue") /** - * Average fill price across all executions + * Average fill price across all executions When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -329,6 +330,7 @@ private constructor( /** * Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. + * When a null/undefined value is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -344,7 +346,8 @@ private constructor( fun extendedHours(): Optional = extendedHours.getOptional("extended_hours") /** - * Limit offset for trailing stop-limit orders (signed) + * Limit offset for trailing stop-limit orders (signed) When a null/undefined value is observed, + * it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -352,7 +355,8 @@ private constructor( fun limitOffset(): Optional = limitOffset.getOptional("limit_offset") /** - * Limit price (for LIMIT and STOP_LIMIT orders) + * Limit price (for LIMIT and STOP_LIMIT orders) When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -360,7 +364,8 @@ private constructor( fun limitPrice(): Optional = limitPrice.getOptional("limit_price") /** - * Parent order queue state, present when the order is awaiting release or released. + * Parent order queue state, present when the order is awaiting release or released. When a + * null/undefined value is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -368,7 +373,8 @@ private constructor( fun queueState(): Optional = queueState.getOptional("queue_state") /** - * Scheduled release time for orders awaiting release. + * Scheduled release time for orders awaiting release. When a null/undefined value is observed, + * it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -376,7 +382,8 @@ private constructor( fun releasesAt(): Optional = releasesAt.getOptional("releases_at") /** - * Stop price (for STOP and STOP_LIMIT orders) + * Stop price (for STOP and STOP_LIMIT orders) When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -384,7 +391,8 @@ private constructor( fun stopPrice(): Optional = stopPrice.getOptional("stop_price") /** - * Current trailing limit price computed by the trailing strategy + * Current trailing limit price computed by the trailing strategy When a null/undefined value is + * observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -392,7 +400,8 @@ private constructor( fun trailingLimitPx(): Optional = trailingLimitPx.getOptional("trailing_limit_px") /** - * Trailing offset amount for trailing orders + * Trailing offset amount for trailing orders When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -400,7 +409,8 @@ private constructor( fun trailingOffset(): Optional = trailingOffset.getOptional("trailing_offset") /** - * Trailing offset type for trailing orders + * Trailing offset type for trailing orders When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -409,7 +419,8 @@ private constructor( trailingOffsetType.getOptional("trailing_offset_type") /** - * Current trailing stop price computed by the trailing strategy + * Current trailing stop price computed by the trailing strategy When a null/undefined value is + * observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -417,7 +428,8 @@ private constructor( fun trailingStopPx(): Optional = trailingStopPx.getOptional("trailing_stop_px") /** - * Trailing watermark price for trailing orders + * Trailing watermark price for trailing orders When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -426,7 +438,8 @@ private constructor( trailingWatermarkPx.getOptional("trailing_watermark_px") /** - * Trailing watermark timestamp for trailing orders + * Trailing watermark timestamp for trailing orders When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -435,8 +448,10 @@ private constructor( trailingWatermarkTs.getOptional("trailing_watermark_ts") /** - * Instrument ID of the option's underlying instrument. Populated only for options orders; - * `null` for non-options and for options whose underlier cannot be resolved. + * Instrument ID of the option's underlying instrument. Populated only for options orders. A + * `null` means one of two things: the order is not an option, so the field does not apply; or + * the order is an option whose underlier has not yet been resolved. When a null/undefined value + * is observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -1028,7 +1043,10 @@ private constructor( */ fun venue(venue: JsonField) = apply { this.venue = venue } - /** Average fill price across all executions */ + /** + * Average fill price across all executions When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun averageFillPrice(averageFillPrice: String?) = averageFillPrice(JsonField.ofNullable(averageFillPrice)) @@ -1075,6 +1093,7 @@ private constructor( /** * Timestamp when the order will expire (UTC). Present when time_in_force is GOOD_TILL_DATE. + * When a null/undefined value is observed, it indicates it does not apply. */ fun expiresAt(expiresAt: OffsetDateTime?) = expiresAt(JsonField.ofNullable(expiresAt)) @@ -1116,7 +1135,10 @@ private constructor( this.extendedHours = extendedHours } - /** Limit offset for trailing stop-limit orders (signed) */ + /** + * Limit offset for trailing stop-limit orders (signed) When a null/undefined value is + * observed, it indicates it does not apply. + */ fun limitOffset(limitOffset: String?) = limitOffset(JsonField.ofNullable(limitOffset)) /** Alias for calling [Builder.limitOffset] with `limitOffset.orElse(null)`. */ @@ -1131,7 +1153,10 @@ private constructor( */ fun limitOffset(limitOffset: JsonField) = apply { this.limitOffset = limitOffset } - /** Limit price (for LIMIT and STOP_LIMIT orders) */ + /** + * Limit price (for LIMIT and STOP_LIMIT orders) When a null/undefined value is observed, it + * indicates it does not apply. + */ fun limitPrice(limitPrice: String?) = limitPrice(JsonField.ofNullable(limitPrice)) /** Alias for calling [Builder.limitPrice] with `limitPrice.orElse(null)`. */ @@ -1146,7 +1171,10 @@ private constructor( */ fun limitPrice(limitPrice: JsonField) = apply { this.limitPrice = limitPrice } - /** Parent order queue state, present when the order is awaiting release or released. */ + /** + * Parent order queue state, present when the order is awaiting release or released. When a + * null/undefined value is observed, it indicates it does not apply. + */ fun queueState(queueState: QueueState?) = queueState(JsonField.ofNullable(queueState)) /** Alias for calling [Builder.queueState] with `queueState.orElse(null)`. */ @@ -1161,7 +1189,10 @@ private constructor( */ fun queueState(queueState: JsonField) = apply { this.queueState = queueState } - /** Scheduled release time for orders awaiting release. */ + /** + * Scheduled release time for orders awaiting release. When a null/undefined value is + * observed, it indicates it does not apply. + */ fun releasesAt(releasesAt: OffsetDateTime?) = releasesAt(JsonField.ofNullable(releasesAt)) /** Alias for calling [Builder.releasesAt] with `releasesAt.orElse(null)`. */ @@ -1178,7 +1209,10 @@ private constructor( this.releasesAt = releasesAt } - /** Stop price (for STOP and STOP_LIMIT orders) */ + /** + * Stop price (for STOP and STOP_LIMIT orders) When a null/undefined value is observed, it + * indicates it does not apply. + */ fun stopPrice(stopPrice: String?) = stopPrice(JsonField.ofNullable(stopPrice)) /** Alias for calling [Builder.stopPrice] with `stopPrice.orElse(null)`. */ @@ -1193,7 +1227,10 @@ private constructor( */ fun stopPrice(stopPrice: JsonField) = apply { this.stopPrice = stopPrice } - /** Current trailing limit price computed by the trailing strategy */ + /** + * Current trailing limit price computed by the trailing strategy When a null/undefined + * value is observed, it indicates it does not apply. + */ fun trailingLimitPx(trailingLimitPx: String?) = trailingLimitPx(JsonField.ofNullable(trailingLimitPx)) @@ -1212,7 +1249,10 @@ private constructor( this.trailingLimitPx = trailingLimitPx } - /** Trailing offset amount for trailing orders */ + /** + * Trailing offset amount for trailing orders When a null/undefined value is observed, it + * indicates it does not apply. + */ fun trailingOffset(trailingOffset: String?) = trailingOffset(JsonField.ofNullable(trailingOffset)) @@ -1231,7 +1271,10 @@ private constructor( this.trailingOffset = trailingOffset } - /** Trailing offset type for trailing orders */ + /** + * Trailing offset type for trailing orders When a null/undefined value is observed, it + * indicates it does not apply. + */ fun trailingOffsetType(trailingOffsetType: TrailingOffsetType?) = trailingOffsetType(JsonField.ofNullable(trailingOffsetType)) @@ -1252,7 +1295,10 @@ private constructor( this.trailingOffsetType = trailingOffsetType } - /** Current trailing stop price computed by the trailing strategy */ + /** + * Current trailing stop price computed by the trailing strategy When a null/undefined value + * is observed, it indicates it does not apply. + */ fun trailingStopPx(trailingStopPx: String?) = trailingStopPx(JsonField.ofNullable(trailingStopPx)) @@ -1271,7 +1317,10 @@ private constructor( this.trailingStopPx = trailingStopPx } - /** Trailing watermark price for trailing orders */ + /** + * Trailing watermark price for trailing orders When a null/undefined value is observed, it + * indicates it does not apply. + */ fun trailingWatermarkPx(trailingWatermarkPx: String?) = trailingWatermarkPx(JsonField.ofNullable(trailingWatermarkPx)) @@ -1292,7 +1341,10 @@ private constructor( this.trailingWatermarkPx = trailingWatermarkPx } - /** Trailing watermark timestamp for trailing orders */ + /** + * Trailing watermark timestamp for trailing orders When a null/undefined value is observed, + * it indicates it does not apply. + */ fun trailingWatermarkTs(trailingWatermarkTs: OffsetDateTime?) = trailingWatermarkTs(JsonField.ofNullable(trailingWatermarkTs)) @@ -1314,8 +1366,10 @@ private constructor( } /** - * Instrument ID of the option's underlying instrument. Populated only for options orders; - * `null` for non-options and for options whose underlier cannot be resolved. + * Instrument ID of the option's underlying instrument. Populated only for options orders. A + * `null` means one of two things: the order is not an option, so the field does not apply; + * or the order is an option whose underlier has not yet been resolved. When a + * null/undefined value is observed, it indicates it does not apply. */ fun underlyingInstrumentId(underlyingInstrumentId: String?) = underlyingInstrumentId(JsonField.ofNullable(underlyingInstrumentId)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt index 55828a22..805ece06 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt @@ -177,7 +177,8 @@ private constructor( fun symbol(): String = symbol.getRequired("symbol") /** - * The average price paid per share or contract for this position + * The average price paid per share or contract for this position When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -185,7 +186,8 @@ private constructor( fun avgPrice(): Optional = avgPrice.getOptional("avg_price") /** - * The closing price used to value the position for the last trading day + * The closing price used to value the position for the last trading day When a null/undefined + * value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -193,7 +195,8 @@ private constructor( fun closingPrice(): Optional = closingPrice.getOptional("closing_price") /** - * The market date associated with `closing_price` + * The market date associated with `closing_price` When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -201,7 +204,8 @@ private constructor( fun closingPriceDate(): Optional = closingPriceDate.getOptional("closing_price_date") /** - * The total cost basis for this position + * The total cost basis for this position When a null/undefined value is observed, it indicates + * that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -209,7 +213,8 @@ private constructor( fun costBasis(): Optional = costBasis.getOptional("cost_basis") /** - * The unrealized profit or loss for this position relative to the previous close + * The unrealized profit or loss for this position relative to the previous close When a + * null/undefined value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -219,7 +224,8 @@ private constructor( /** * The unrealized profit/loss for the position for the current day, expressed as a percentage of - * the baseline value (range: 0-100). + * the baseline value (range: 0-100). When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -228,7 +234,8 @@ private constructor( dailyUnrealizedPnlPct.getOptional("daily_unrealized_pnl_pct") /** - * The current market price of the instrument + * The current market price of the instrument When a null/undefined value is observed, it + * indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -236,7 +243,8 @@ private constructor( fun instrumentPrice(): Optional = instrumentPrice.getOptional("instrument_price") /** - * Identifier of the underlying instrument, when available + * Identifier of the underlying instrument, when available When a null/undefined value is + * observed, it indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -245,7 +253,8 @@ private constructor( underlyingInstrumentId.getOptional("underlying_instrument_id") /** - * The total unrealized profit or loss for this position based on current market value + * The total unrealized profit or loss for this position based on current market value When a + * null/undefined value is observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -254,7 +263,8 @@ private constructor( /** * The unrealized profit/loss for the position, expressed as a percentage of the position's cost - * basis (range: 0-100). + * basis (range: 0-100). When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -600,7 +610,10 @@ private constructor( */ fun symbol(symbol: JsonField) = apply { this.symbol = symbol } - /** The average price paid per share or contract for this position */ + /** + * The average price paid per share or contract for this position When a null/undefined + * value is observed, it indicates that there is no available data. + */ fun avgPrice(avgPrice: String?) = avgPrice(JsonField.ofNullable(avgPrice)) /** Alias for calling [Builder.avgPrice] with `avgPrice.orElse(null)`. */ @@ -614,7 +627,10 @@ private constructor( */ fun avgPrice(avgPrice: JsonField) = apply { this.avgPrice = avgPrice } - /** The closing price used to value the position for the last trading day */ + /** + * The closing price used to value the position for the last trading day When a + * null/undefined value is observed, it indicates that there is no available data. + */ fun closingPrice(closingPrice: String?) = closingPrice(JsonField.ofNullable(closingPrice)) /** Alias for calling [Builder.closingPrice] with `closingPrice.orElse(null)`. */ @@ -631,7 +647,10 @@ private constructor( this.closingPrice = closingPrice } - /** The market date associated with `closing_price` */ + /** + * The market date associated with `closing_price` When a null/undefined value is observed, + * it indicates that there is no available data. + */ fun closingPriceDate(closingPriceDate: LocalDate?) = closingPriceDate(JsonField.ofNullable(closingPriceDate)) @@ -650,7 +669,10 @@ private constructor( this.closingPriceDate = closingPriceDate } - /** The total cost basis for this position */ + /** + * The total cost basis for this position When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun costBasis(costBasis: String?) = costBasis(JsonField.ofNullable(costBasis)) /** Alias for calling [Builder.costBasis] with `costBasis.orElse(null)`. */ @@ -665,7 +687,10 @@ private constructor( */ fun costBasis(costBasis: JsonField) = apply { this.costBasis = costBasis } - /** The unrealized profit or loss for this position relative to the previous close */ + /** + * The unrealized profit or loss for this position relative to the previous close When a + * null/undefined value is observed, it indicates that there is no available data. + */ fun dailyUnrealizedPnl(dailyUnrealizedPnl: String?) = dailyUnrealizedPnl(JsonField.ofNullable(dailyUnrealizedPnl)) @@ -688,7 +713,8 @@ private constructor( /** * The unrealized profit/loss for the position for the current day, expressed as a - * percentage of the baseline value (range: 0-100). + * percentage of the baseline value (range: 0-100). When a null/undefined value is observed, + * it indicates that there is no available data. */ fun dailyUnrealizedPnlPct(dailyUnrealizedPnlPct: String?) = dailyUnrealizedPnlPct(JsonField.ofNullable(dailyUnrealizedPnlPct)) @@ -711,7 +737,10 @@ private constructor( this.dailyUnrealizedPnlPct = dailyUnrealizedPnlPct } - /** The current market price of the instrument */ + /** + * The current market price of the instrument When a null/undefined value is observed, it + * indicates that there is no available data. + */ fun instrumentPrice(instrumentPrice: String?) = instrumentPrice(JsonField.ofNullable(instrumentPrice)) @@ -730,7 +759,10 @@ private constructor( this.instrumentPrice = instrumentPrice } - /** Identifier of the underlying instrument, when available */ + /** + * Identifier of the underlying instrument, when available When a null/undefined value is + * observed, it indicates it does not apply. + */ fun underlyingInstrumentId(underlyingInstrumentId: String?) = underlyingInstrumentId(JsonField.ofNullable(underlyingInstrumentId)) @@ -752,7 +784,10 @@ private constructor( this.underlyingInstrumentId = underlyingInstrumentId } - /** The total unrealized profit or loss for this position based on current market value */ + /** + * The total unrealized profit or loss for this position based on current market value When + * a null/undefined value is observed, it indicates that there is no available data. + */ fun unrealizedPnl(unrealizedPnl: String?) = unrealizedPnl(JsonField.ofNullable(unrealizedPnl)) @@ -773,7 +808,8 @@ private constructor( /** * The unrealized profit/loss for the position, expressed as a percentage of the position's - * cost basis (range: 0-100). + * cost basis (range: 0-100). When a null/undefined value is observed, it indicates that + * there is no available data. */ fun unrealizedPnlPct(unrealizedPnlPct: String?) = unrealizedPnlPct(JsonField.ofNullable(unrealizedPnlPct)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt index 913c530e..0000bfc1 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionInstruction.kt @@ -150,7 +150,8 @@ private constructor( /** * Number of contracts accepted by the clearing venue. Populated once the instruction reaches - * `ACCEPTED`. + * `ACCEPTED`. When a null/undefined value is observed, it indicates that there is no available + * data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -158,7 +159,8 @@ private constructor( fun acceptedQuantity(): Optional = acceptedQuantity.getOptional("accepted_quantity") /** - * When the instruction was first accepted by the service. + * When the instruction was first accepted by the service. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -168,7 +170,8 @@ private constructor( /** * Human-readable explanation populated on any non-success terminal status — `REJECTED` or * `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field summarizes - * the batch; per-row detail continues to live here. + * the batch; per-row detail continues to live here. When a null/undefined value is observed, it + * indicates it does not apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -176,7 +179,8 @@ private constructor( fun rejectionReason(): Optional = rejectionReason.getOptional("rejection_reason") /** - * When the instruction's lifecycle state last changed. + * When the instruction's lifecycle state last changed. When a null/undefined value is observed, + * it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -454,7 +458,8 @@ private constructor( /** * Number of contracts accepted by the clearing venue. Populated once the instruction - * reaches `ACCEPTED`. + * reaches `ACCEPTED`. When a null/undefined value is observed, it indicates that there is + * no available data. */ fun acceptedQuantity(acceptedQuantity: String?) = acceptedQuantity(JsonField.ofNullable(acceptedQuantity)) @@ -474,7 +479,10 @@ private constructor( this.acceptedQuantity = acceptedQuantity } - /** When the instruction was first accepted by the service. */ + /** + * When the instruction was first accepted by the service. When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun createdAt(createdAt: OffsetDateTime?) = createdAt(JsonField.ofNullable(createdAt)) /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */ @@ -492,7 +500,8 @@ private constructor( /** * Human-readable explanation populated on any non-success terminal status — `REJECTED` or * `CANCEL_FAILED`. On a `207 Multi-Status` batch submit the top-level `error` field - * summarizes the batch; per-row detail continues to live here. + * summarizes the batch; per-row detail continues to live here. When a null/undefined value + * is observed, it indicates it does not apply. */ fun rejectionReason(rejectionReason: String?) = rejectionReason(JsonField.ofNullable(rejectionReason)) @@ -512,7 +521,10 @@ private constructor( this.rejectionReason = rejectionReason } - /** When the instruction's lifecycle state last changed. */ + /** + * When the instruction's lifecycle state last changed. When a null/undefined value is + * observed, it indicates that there is no available data. + */ fun updatedAt(updatedAt: OffsetDateTime?) = updatedAt(JsonField.ofNullable(updatedAt)) /** Alias for calling [Builder.updatedAt] with `updatedAt.orElse(null)`. */ diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntry.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntry.kt index a6838e9e..de78761d 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntry.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntry.kt @@ -61,7 +61,8 @@ private constructor( fun addedAt(): OffsetDateTime = addedAt.getRequired("added_at") /** - * Price when the item was added + * Price when the item was added When a null/undefined value is observed, it indicates that + * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -69,7 +70,8 @@ private constructor( fun addedPrice(): Optional = addedPrice.getOptional("added_price") /** - * Instrument details + * Instrument details When a null/undefined value is observed, it indicates that there is no + * available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -173,7 +175,10 @@ private constructor( */ fun addedAt(addedAt: JsonField) = apply { this.addedAt = addedAt } - /** Price when the item was added */ + /** + * Price when the item was added When a null/undefined value is observed, it indicates that + * there is no available data. + */ fun addedPrice(addedPrice: String?) = addedPrice(JsonField.ofNullable(addedPrice)) /** Alias for calling [Builder.addedPrice] with `addedPrice.orElse(null)`. */ @@ -188,7 +193,10 @@ private constructor( */ fun addedPrice(addedPrice: JsonField) = apply { this.addedPrice = addedPrice } - /** Instrument details */ + /** + * Instrument details When a null/undefined value is observed, it indicates that there is no + * available data. + */ fun instrument(instrument: Instrument?) = instrument(JsonField.ofNullable(instrument)) /** Alias for calling [Builder.instrument] with `instrument.orElse(null)`. */ From 3d6d5ab6dd15f7c8bc1531bccb27a1a9793a9750 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 18:26:13 +0000 Subject: [PATCH 41/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/accounts/AccountBalances.kt | 128 +++++++++++++++++- .../api/models/v1/positions/Position.kt | 55 +++++++- .../positions/PositionGetPositionsParams.kt | 6 + .../models/v1/accounts/AccountBalancesTest.kt | 9 ++ .../AccountGetAccountBalancesResponseTest.kt | 9 ++ .../PositionGetPositionsResponseTest.kt | 3 + .../api/models/v1/positions/PositionTest.kt | 3 + 8 files changed, 213 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 28963c55..00a300e9 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-ff1eb241bd08c1bbdd6873d0b89358236cb9fc37ce1bfe8ac700dc761e45d422.yml -openapi_spec_hash: 53211716653645a73497edaad7e8131d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-013f50843639ae3ee25abd3f081b91d99a6c626af1f1b14f3a783ac43fd2417f.yml +openapi_spec_hash: b4bcd467d59a34883cb7666f5092b9b4 config_hash: 66d7f41361e2a6d4a8623d5719a896de diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt index d432a26e..9dfe5c6f 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalances.kt @@ -24,6 +24,8 @@ private constructor( private val accountId: JsonField, private val buyingPower: JsonField, private val currency: JsonField, + private val dailyChange: JsonField, + private val dailyPnl: JsonField, private val dailyRealizedPnl: JsonField, private val dailyTotalPnl: JsonField, private val dailyUnrealizedPnl: JsonField, @@ -34,6 +36,7 @@ private constructor( private val settledCash: JsonField, private val sod: JsonField, private val tradeCash: JsonField, + private val unrealizedPnl: JsonField, private val unsettledCredits: JsonField, private val unsettledDebits: JsonField, private val withdrawableCash: JsonField, @@ -50,6 +53,10 @@ private constructor( @ExcludeMissing buyingPower: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("daily_change") + @ExcludeMissing + dailyChange: JsonField = JsonMissing.of(), + @JsonProperty("daily_pnl") @ExcludeMissing dailyPnl: JsonField = JsonMissing.of(), @JsonProperty("daily_realized_pnl") @ExcludeMissing dailyRealizedPnl: JsonField = JsonMissing.of(), @@ -74,6 +81,9 @@ private constructor( settledCash: JsonField = JsonMissing.of(), @JsonProperty("sod") @ExcludeMissing sod: JsonField = JsonMissing.of(), @JsonProperty("trade_cash") @ExcludeMissing tradeCash: JsonField = JsonMissing.of(), + @JsonProperty("unrealized_pnl") + @ExcludeMissing + unrealizedPnl: JsonField = JsonMissing.of(), @JsonProperty("unsettled_credits") @ExcludeMissing unsettledCredits: JsonField = JsonMissing.of(), @@ -96,6 +106,8 @@ private constructor( accountId, buyingPower, currency, + dailyChange, + dailyPnl, dailyRealizedPnl, dailyTotalPnl, dailyUnrealizedPnl, @@ -106,6 +118,7 @@ private constructor( settledCash, sod, tradeCash, + unrealizedPnl, unsettledCredits, unsettledDebits, withdrawableCash, @@ -139,6 +152,22 @@ private constructor( */ fun currency(): String = currency.getRequired("currency") + /** + * Difference between current equity and start-of-day equity. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun dailyChange(): String = dailyChange.getRequired("daily_change") + + /** + * Total profit or loss since start of day. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun dailyPnl(): String = dailyPnl.getRequired("daily_pnl") + /** * Realized profit or loss since start of day. * @@ -219,6 +248,14 @@ private constructor( */ fun tradeCash(): String = tradeCash.getRequired("trade_cash") + /** + * Total unrealized profit or loss across all open positions. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun unrealizedPnl(): String = unrealizedPnl.getRequired("unrealized_pnl") + /** * Trade-date unsettled cash credits. * @@ -293,6 +330,22 @@ private constructor( */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + /** + * Returns the raw JSON value of [dailyChange]. + * + * Unlike [dailyChange], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("daily_change") + @ExcludeMissing + fun _dailyChange(): JsonField = dailyChange + + /** + * Returns the raw JSON value of [dailyPnl]. + * + * Unlike [dailyPnl], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("daily_pnl") @ExcludeMissing fun _dailyPnl(): JsonField = dailyPnl + /** * Returns the raw JSON value of [dailyRealizedPnl]. * @@ -380,6 +433,15 @@ private constructor( */ @JsonProperty("trade_cash") @ExcludeMissing fun _tradeCash(): JsonField = tradeCash + /** + * Returns the raw JSON value of [unrealizedPnl]. + * + * Unlike [unrealizedPnl], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("unrealized_pnl") + @ExcludeMissing + fun _unrealizedPnl(): JsonField = unrealizedPnl + /** * Returns the raw JSON value of [unsettledCredits]. * @@ -457,6 +519,8 @@ private constructor( * .accountId() * .buyingPower() * .currency() + * .dailyChange() + * .dailyPnl() * .dailyRealizedPnl() * .dailyTotalPnl() * .dailyUnrealizedPnl() @@ -467,6 +531,7 @@ private constructor( * .settledCash() * .sod() * .tradeCash() + * .unrealizedPnl() * .unsettledCredits() * .unsettledDebits() * .withdrawableCash() @@ -481,6 +546,8 @@ private constructor( private var accountId: JsonField? = null private var buyingPower: JsonField? = null private var currency: JsonField? = null + private var dailyChange: JsonField? = null + private var dailyPnl: JsonField? = null private var dailyRealizedPnl: JsonField? = null private var dailyTotalPnl: JsonField? = null private var dailyUnrealizedPnl: JsonField? = null @@ -491,6 +558,7 @@ private constructor( private var settledCash: JsonField? = null private var sod: JsonField? = null private var tradeCash: JsonField? = null + private var unrealizedPnl: JsonField? = null private var unsettledCredits: JsonField? = null private var unsettledDebits: JsonField? = null private var withdrawableCash: JsonField? = null @@ -504,6 +572,8 @@ private constructor( accountId = accountBalances.accountId buyingPower = accountBalances.buyingPower currency = accountBalances.currency + dailyChange = accountBalances.dailyChange + dailyPnl = accountBalances.dailyPnl dailyRealizedPnl = accountBalances.dailyRealizedPnl dailyTotalPnl = accountBalances.dailyTotalPnl dailyUnrealizedPnl = accountBalances.dailyUnrealizedPnl @@ -514,6 +584,7 @@ private constructor( settledCash = accountBalances.settledCash sod = accountBalances.sod tradeCash = accountBalances.tradeCash + unrealizedPnl = accountBalances.unrealizedPnl unsettledCredits = accountBalances.unsettledCredits unsettledDebits = accountBalances.unsettledDebits withdrawableCash = accountBalances.withdrawableCash @@ -557,6 +628,29 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } + /** Difference between current equity and start-of-day equity. */ + fun dailyChange(dailyChange: String) = dailyChange(JsonField.of(dailyChange)) + + /** + * Sets [Builder.dailyChange] to an arbitrary JSON value. + * + * You should usually call [Builder.dailyChange] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun dailyChange(dailyChange: JsonField) = apply { this.dailyChange = dailyChange } + + /** Total profit or loss since start of day. */ + fun dailyPnl(dailyPnl: String) = dailyPnl(JsonField.of(dailyPnl)) + + /** + * Sets [Builder.dailyPnl] to an arbitrary JSON value. + * + * You should usually call [Builder.dailyPnl] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun dailyPnl(dailyPnl: JsonField) = apply { this.dailyPnl = dailyPnl } + /** Realized profit or loss since start of day. */ fun dailyRealizedPnl(dailyRealizedPnl: String) = dailyRealizedPnl(JsonField.of(dailyRealizedPnl)) @@ -690,6 +784,20 @@ private constructor( */ fun tradeCash(tradeCash: JsonField) = apply { this.tradeCash = tradeCash } + /** Total unrealized profit or loss across all open positions. */ + fun unrealizedPnl(unrealizedPnl: String) = unrealizedPnl(JsonField.of(unrealizedPnl)) + + /** + * Sets [Builder.unrealizedPnl] to an arbitrary JSON value. + * + * You should usually call [Builder.unrealizedPnl] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun unrealizedPnl(unrealizedPnl: JsonField) = apply { + this.unrealizedPnl = unrealizedPnl + } + /** Trade-date unsettled cash credits. */ fun unsettledCredits(unsettledCredits: String) = unsettledCredits(JsonField.of(unsettledCredits)) @@ -826,6 +934,8 @@ private constructor( * .accountId() * .buyingPower() * .currency() + * .dailyChange() + * .dailyPnl() * .dailyRealizedPnl() * .dailyTotalPnl() * .dailyUnrealizedPnl() @@ -836,6 +946,7 @@ private constructor( * .settledCash() * .sod() * .tradeCash() + * .unrealizedPnl() * .unsettledCredits() * .unsettledDebits() * .withdrawableCash() @@ -848,6 +959,8 @@ private constructor( checkRequired("accountId", accountId), checkRequired("buyingPower", buyingPower), checkRequired("currency", currency), + checkRequired("dailyChange", dailyChange), + checkRequired("dailyPnl", dailyPnl), checkRequired("dailyRealizedPnl", dailyRealizedPnl), checkRequired("dailyTotalPnl", dailyTotalPnl), checkRequired("dailyUnrealizedPnl", dailyUnrealizedPnl), @@ -858,6 +971,7 @@ private constructor( checkRequired("settledCash", settledCash), checkRequired("sod", sod), checkRequired("tradeCash", tradeCash), + checkRequired("unrealizedPnl", unrealizedPnl), checkRequired("unsettledCredits", unsettledCredits), checkRequired("unsettledDebits", unsettledDebits), checkRequired("withdrawableCash", withdrawableCash), @@ -886,6 +1000,8 @@ private constructor( accountId() buyingPower() currency() + dailyChange() + dailyPnl() dailyRealizedPnl() dailyTotalPnl() dailyUnrealizedPnl() @@ -896,6 +1012,7 @@ private constructor( settledCash() sod().validate() tradeCash() + unrealizedPnl() unsettledCredits() unsettledDebits() withdrawableCash() @@ -923,6 +1040,8 @@ private constructor( (if (accountId.asKnown().isPresent) 1 else 0) + (if (buyingPower.asKnown().isPresent) 1 else 0) + (if (currency.asKnown().isPresent) 1 else 0) + + (if (dailyChange.asKnown().isPresent) 1 else 0) + + (if (dailyPnl.asKnown().isPresent) 1 else 0) + (if (dailyRealizedPnl.asKnown().isPresent) 1 else 0) + (if (dailyTotalPnl.asKnown().isPresent) 1 else 0) + (if (dailyUnrealizedPnl.asKnown().isPresent) 1 else 0) + @@ -933,6 +1052,7 @@ private constructor( (if (settledCash.asKnown().isPresent) 1 else 0) + (sod.asKnown().getOrNull()?.validity() ?: 0) + (if (tradeCash.asKnown().isPresent) 1 else 0) + + (if (unrealizedPnl.asKnown().isPresent) 1 else 0) + (if (unsettledCredits.asKnown().isPresent) 1 else 0) + (if (unsettledDebits.asKnown().isPresent) 1 else 0) + (if (withdrawableCash.asKnown().isPresent) 1 else 0) + @@ -949,6 +1069,8 @@ private constructor( accountId == other.accountId && buyingPower == other.buyingPower && currency == other.currency && + dailyChange == other.dailyChange && + dailyPnl == other.dailyPnl && dailyRealizedPnl == other.dailyRealizedPnl && dailyTotalPnl == other.dailyTotalPnl && dailyUnrealizedPnl == other.dailyUnrealizedPnl && @@ -959,6 +1081,7 @@ private constructor( settledCash == other.settledCash && sod == other.sod && tradeCash == other.tradeCash && + unrealizedPnl == other.unrealizedPnl && unsettledCredits == other.unsettledCredits && unsettledDebits == other.unsettledDebits && withdrawableCash == other.withdrawableCash && @@ -973,6 +1096,8 @@ private constructor( accountId, buyingPower, currency, + dailyChange, + dailyPnl, dailyRealizedPnl, dailyTotalPnl, dailyUnrealizedPnl, @@ -983,6 +1108,7 @@ private constructor( settledCash, sod, tradeCash, + unrealizedPnl, unsettledCredits, unsettledDebits, withdrawableCash, @@ -996,5 +1122,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AccountBalances{accountId=$accountId, buyingPower=$buyingPower, currency=$currency, dailyRealizedPnl=$dailyRealizedPnl, dailyTotalPnl=$dailyTotalPnl, dailyUnrealizedPnl=$dailyUnrealizedPnl, equity=$equity, longMarketValue=$longMarketValue, marginType=$marginType, openOrderAdjustment=$openOrderAdjustment, settledCash=$settledCash, sod=$sod, tradeCash=$tradeCash, unsettledCredits=$unsettledCredits, unsettledDebits=$unsettledDebits, withdrawableCash=$withdrawableCash, marginDetails=$marginDetails, multiplier=$multiplier, shortMarketValue=$shortMarketValue, additionalProperties=$additionalProperties}" + "AccountBalances{accountId=$accountId, buyingPower=$buyingPower, currency=$currency, dailyChange=$dailyChange, dailyPnl=$dailyPnl, dailyRealizedPnl=$dailyRealizedPnl, dailyTotalPnl=$dailyTotalPnl, dailyUnrealizedPnl=$dailyUnrealizedPnl, equity=$equity, longMarketValue=$longMarketValue, marginType=$marginType, openOrderAdjustment=$openOrderAdjustment, settledCash=$settledCash, sod=$sod, tradeCash=$tradeCash, unrealizedPnl=$unrealizedPnl, unsettledCredits=$unsettledCredits, unsettledDebits=$unsettledDebits, withdrawableCash=$withdrawableCash, marginDetails=$marginDetails, multiplier=$multiplier, shortMarketValue=$shortMarketValue, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt index 805ece06..ed47d502 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/Position.kt @@ -35,6 +35,7 @@ private constructor( private val closingPrice: JsonField, private val closingPriceDate: JsonField, private val costBasis: JsonField, + private val dailyRealizedPnl: JsonField, private val dailyUnrealizedPnl: JsonField, private val dailyUnrealizedPnlPct: JsonField, private val instrumentPrice: JsonField, @@ -72,6 +73,9 @@ private constructor( @ExcludeMissing closingPriceDate: JsonField = JsonMissing.of(), @JsonProperty("cost_basis") @ExcludeMissing costBasis: JsonField = JsonMissing.of(), + @JsonProperty("daily_realized_pnl") + @ExcludeMissing + dailyRealizedPnl: JsonField = JsonMissing.of(), @JsonProperty("daily_unrealized_pnl") @ExcludeMissing dailyUnrealizedPnl: JsonField = JsonMissing.of(), @@ -103,6 +107,7 @@ private constructor( closingPrice, closingPriceDate, costBasis, + dailyRealizedPnl, dailyUnrealizedPnl, dailyUnrealizedPnlPct, instrumentPrice, @@ -212,6 +217,15 @@ private constructor( */ fun costBasis(): Optional = costBasis.getOptional("cost_basis") + /** + * The realized profit or loss for this position for the current day When a null/undefined value + * is observed, it indicates that there is no available data. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun dailyRealizedPnl(): Optional = dailyRealizedPnl.getOptional("daily_realized_pnl") + /** * The unrealized profit or loss for this position relative to the previous close When a * null/undefined value is observed, it indicates that there is no available data. @@ -371,6 +385,16 @@ private constructor( */ @JsonProperty("cost_basis") @ExcludeMissing fun _costBasis(): JsonField = costBasis + /** + * Returns the raw JSON value of [dailyRealizedPnl]. + * + * Unlike [dailyRealizedPnl], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("daily_realized_pnl") + @ExcludeMissing + fun _dailyRealizedPnl(): JsonField = dailyRealizedPnl + /** * Returns the raw JSON value of [dailyUnrealizedPnl]. * @@ -476,6 +500,7 @@ private constructor( private var closingPrice: JsonField = JsonMissing.of() private var closingPriceDate: JsonField = JsonMissing.of() private var costBasis: JsonField = JsonMissing.of() + private var dailyRealizedPnl: JsonField = JsonMissing.of() private var dailyUnrealizedPnl: JsonField = JsonMissing.of() private var dailyUnrealizedPnlPct: JsonField = JsonMissing.of() private var instrumentPrice: JsonField = JsonMissing.of() @@ -498,6 +523,7 @@ private constructor( closingPrice = position.closingPrice closingPriceDate = position.closingPriceDate costBasis = position.costBasis + dailyRealizedPnl = position.dailyRealizedPnl dailyUnrealizedPnl = position.dailyUnrealizedPnl dailyUnrealizedPnlPct = position.dailyUnrealizedPnlPct instrumentPrice = position.instrumentPrice @@ -687,6 +713,28 @@ private constructor( */ fun costBasis(costBasis: JsonField) = apply { this.costBasis = costBasis } + /** + * The realized profit or loss for this position for the current day When a null/undefined + * value is observed, it indicates that there is no available data. + */ + fun dailyRealizedPnl(dailyRealizedPnl: String?) = + dailyRealizedPnl(JsonField.ofNullable(dailyRealizedPnl)) + + /** Alias for calling [Builder.dailyRealizedPnl] with `dailyRealizedPnl.orElse(null)`. */ + fun dailyRealizedPnl(dailyRealizedPnl: Optional) = + dailyRealizedPnl(dailyRealizedPnl.getOrNull()) + + /** + * Sets [Builder.dailyRealizedPnl] to an arbitrary JSON value. + * + * You should usually call [Builder.dailyRealizedPnl] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dailyRealizedPnl(dailyRealizedPnl: JsonField) = apply { + this.dailyRealizedPnl = dailyRealizedPnl + } + /** * The unrealized profit or loss for this position relative to the previous close When a * null/undefined value is observed, it indicates that there is no available data. @@ -881,6 +929,7 @@ private constructor( closingPrice, closingPriceDate, costBasis, + dailyRealizedPnl, dailyUnrealizedPnl, dailyUnrealizedPnlPct, instrumentPrice, @@ -918,6 +967,7 @@ private constructor( closingPrice() closingPriceDate() costBasis() + dailyRealizedPnl() dailyUnrealizedPnl() dailyUnrealizedPnlPct() instrumentPrice() @@ -954,6 +1004,7 @@ private constructor( (if (closingPrice.asKnown().isPresent) 1 else 0) + (if (closingPriceDate.asKnown().isPresent) 1 else 0) + (if (costBasis.asKnown().isPresent) 1 else 0) + + (if (dailyRealizedPnl.asKnown().isPresent) 1 else 0) + (if (dailyUnrealizedPnl.asKnown().isPresent) 1 else 0) + (if (dailyUnrealizedPnlPct.asKnown().isPresent) 1 else 0) + (if (instrumentPrice.asKnown().isPresent) 1 else 0) + @@ -979,6 +1030,7 @@ private constructor( closingPrice == other.closingPrice && closingPriceDate == other.closingPriceDate && costBasis == other.costBasis && + dailyRealizedPnl == other.dailyRealizedPnl && dailyUnrealizedPnl == other.dailyUnrealizedPnl && dailyUnrealizedPnlPct == other.dailyUnrealizedPnlPct && instrumentPrice == other.instrumentPrice && @@ -1002,6 +1054,7 @@ private constructor( closingPrice, closingPriceDate, costBasis, + dailyRealizedPnl, dailyUnrealizedPnl, dailyUnrealizedPnlPct, instrumentPrice, @@ -1015,5 +1068,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Position{accountId=$accountId, availableQuantity=$availableQuantity, instrumentId=$instrumentId, instrumentType=$instrumentType, marketValue=$marketValue, positionType=$positionType, quantity=$quantity, symbol=$symbol, avgPrice=$avgPrice, closingPrice=$closingPrice, closingPriceDate=$closingPriceDate, costBasis=$costBasis, dailyUnrealizedPnl=$dailyUnrealizedPnl, dailyUnrealizedPnlPct=$dailyUnrealizedPnlPct, instrumentPrice=$instrumentPrice, underlyingInstrumentId=$underlyingInstrumentId, unrealizedPnl=$unrealizedPnl, unrealizedPnlPct=$unrealizedPnlPct, additionalProperties=$additionalProperties}" + "Position{accountId=$accountId, availableQuantity=$availableQuantity, instrumentId=$instrumentId, instrumentType=$instrumentType, marketValue=$marketValue, positionType=$positionType, quantity=$quantity, symbol=$symbol, avgPrice=$avgPrice, closingPrice=$closingPrice, closingPriceDate=$closingPriceDate, costBasis=$costBasis, dailyRealizedPnl=$dailyRealizedPnl, dailyUnrealizedPnl=$dailyUnrealizedPnl, dailyUnrealizedPnlPct=$dailyUnrealizedPnlPct, instrumentPrice=$instrumentPrice, underlyingInstrumentId=$underlyingInstrumentId, unrealizedPnl=$unrealizedPnl, unrealizedPnlPct=$unrealizedPnlPct, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt index acb858ef..9f7e4e84 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsParams.kt @@ -321,6 +321,8 @@ private constructor( @JvmField val DAILY_UNREALIZED_PNL = of("DAILY_UNREALIZED_PNL") + @JvmField val DAILY_REALIZED_PNL = of("DAILY_REALIZED_PNL") + @JvmStatic fun of(value: String) = SortBy(JsonField.of(value)) } @@ -333,6 +335,7 @@ private constructor( POSITION_TYPE, UNREALIZED_PNL, DAILY_UNREALIZED_PNL, + DAILY_REALIZED_PNL, } /** @@ -352,6 +355,7 @@ private constructor( POSITION_TYPE, UNREALIZED_PNL, DAILY_UNREALIZED_PNL, + DAILY_REALIZED_PNL, /** An enum member indicating that [SortBy] was instantiated with an unknown value. */ _UNKNOWN, } @@ -372,6 +376,7 @@ private constructor( POSITION_TYPE -> Value.POSITION_TYPE UNREALIZED_PNL -> Value.UNREALIZED_PNL DAILY_UNREALIZED_PNL -> Value.DAILY_UNREALIZED_PNL + DAILY_REALIZED_PNL -> Value.DAILY_REALIZED_PNL else -> Value._UNKNOWN } @@ -393,6 +398,7 @@ private constructor( POSITION_TYPE -> Known.POSITION_TYPE UNREALIZED_PNL -> Known.UNREALIZED_PNL DAILY_UNREALIZED_PNL -> Known.DAILY_UNREALIZED_PNL + DAILY_REALIZED_PNL -> Known.DAILY_REALIZED_PNL else -> throw ClearStreetInvalidDataException("Unknown SortBy: $value") } diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt index ddfed0bc..b7e1032e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountBalancesTest.kt @@ -17,6 +17,8 @@ internal class AccountBalancesTest { .accountId(19816L) .buyingPower("90000.00") .currency("USD") + .dailyChange("0.00") + .dailyPnl("1250.00") .dailyRealizedPnl("700.00") .dailyTotalPnl("1250.00") .dailyUnrealizedPnl("550.00") @@ -39,6 +41,7 @@ internal class AccountBalancesTest { .build() ) .tradeCash("70000.00") + .unrealizedPnl("1500.00") .unsettledCredits("20000.00") .unsettledDebits("10000.00") .withdrawableCash("75000.00") @@ -84,6 +87,8 @@ internal class AccountBalancesTest { assertThat(accountBalances.accountId()).isEqualTo(19816L) assertThat(accountBalances.buyingPower()).isEqualTo("90000.00") assertThat(accountBalances.currency()).isEqualTo("USD") + assertThat(accountBalances.dailyChange()).isEqualTo("0.00") + assertThat(accountBalances.dailyPnl()).isEqualTo("1250.00") assertThat(accountBalances.dailyRealizedPnl()).isEqualTo("700.00") assertThat(accountBalances.dailyTotalPnl()).isEqualTo("1250.00") assertThat(accountBalances.dailyUnrealizedPnl()).isEqualTo("550.00") @@ -107,6 +112,7 @@ internal class AccountBalancesTest { .build() ) assertThat(accountBalances.tradeCash()).isEqualTo("70000.00") + assertThat(accountBalances.unrealizedPnl()).isEqualTo("1500.00") assertThat(accountBalances.unsettledCredits()).isEqualTo("20000.00") assertThat(accountBalances.unsettledDebits()).isEqualTo("10000.00") assertThat(accountBalances.withdrawableCash()).isEqualTo("75000.00") @@ -156,6 +162,8 @@ internal class AccountBalancesTest { .accountId(19816L) .buyingPower("90000.00") .currency("USD") + .dailyChange("0.00") + .dailyPnl("1250.00") .dailyRealizedPnl("700.00") .dailyTotalPnl("1250.00") .dailyUnrealizedPnl("550.00") @@ -178,6 +186,7 @@ internal class AccountBalancesTest { .build() ) .tradeCash("70000.00") + .unrealizedPnl("1500.00") .unsettledCredits("20000.00") .unsettledDebits("10000.00") .withdrawableCash("75000.00") diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt index 573871e0..0fe3107d 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountBalancesResponseTest.kt @@ -43,6 +43,8 @@ internal class AccountGetAccountBalancesResponseTest { .accountId(19816L) .buyingPower("90000.00") .currency("USD") + .dailyChange("0.00") + .dailyPnl("1250.00") .dailyRealizedPnl("700.00") .dailyTotalPnl("1250.00") .dailyUnrealizedPnl("550.00") @@ -65,6 +67,7 @@ internal class AccountGetAccountBalancesResponseTest { .build() ) .tradeCash("70000.00") + .unrealizedPnl("1500.00") .unsettledCredits("20000.00") .unsettledDebits("10000.00") .withdrawableCash("75000.00") @@ -143,6 +146,8 @@ internal class AccountGetAccountBalancesResponseTest { .accountId(19816L) .buyingPower("90000.00") .currency("USD") + .dailyChange("0.00") + .dailyPnl("1250.00") .dailyRealizedPnl("700.00") .dailyTotalPnl("1250.00") .dailyUnrealizedPnl("550.00") @@ -165,6 +170,7 @@ internal class AccountGetAccountBalancesResponseTest { .build() ) .tradeCash("70000.00") + .unrealizedPnl("1500.00") .unsettledCredits("20000.00") .unsettledDebits("10000.00") .withdrawableCash("75000.00") @@ -243,6 +249,8 @@ internal class AccountGetAccountBalancesResponseTest { .accountId(19816L) .buyingPower("90000.00") .currency("USD") + .dailyChange("0.00") + .dailyPnl("1250.00") .dailyRealizedPnl("700.00") .dailyTotalPnl("1250.00") .dailyUnrealizedPnl("550.00") @@ -265,6 +273,7 @@ internal class AccountGetAccountBalancesResponseTest { .build() ) .tradeCash("70000.00") + .unrealizedPnl("1500.00") .unsettledCredits("20000.00") .unsettledDebits("10000.00") .withdrawableCash("75000.00") diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponseTest.kt index 127ae7ba..5bf0d7a2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionsResponseTest.kt @@ -53,6 +53,7 @@ internal class PositionGetPositionsResponseTest { .closingPrice("150.50") .closingPriceDate(LocalDate.parse("2025-10-31")) .costBasis("14500.00") + .dailyRealizedPnl("700.00") .dailyUnrealizedPnl("550.00") .dailyUnrealizedPnlPct("3.65") .instrumentPrice("151.00") @@ -101,6 +102,7 @@ internal class PositionGetPositionsResponseTest { .closingPrice("150.50") .closingPriceDate(LocalDate.parse("2025-10-31")) .costBasis("14500.00") + .dailyRealizedPnl("700.00") .dailyUnrealizedPnl("550.00") .dailyUnrealizedPnlPct("3.65") .instrumentPrice("151.00") @@ -151,6 +153,7 @@ internal class PositionGetPositionsResponseTest { .closingPrice("150.50") .closingPriceDate(LocalDate.parse("2025-10-31")) .costBasis("14500.00") + .dailyRealizedPnl("700.00") .dailyUnrealizedPnl("550.00") .dailyUnrealizedPnlPct("3.65") .instrumentPrice("151.00") diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionTest.kt index 7a32aa05..0e34c1da 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionTest.kt @@ -27,6 +27,7 @@ internal class PositionTest { .closingPrice("150.50") .closingPriceDate(LocalDate.parse("2025-10-31")) .costBasis("14500.00") + .dailyRealizedPnl("700.00") .dailyUnrealizedPnl("550.00") .dailyUnrealizedPnlPct("3.65") .instrumentPrice("151.00") @@ -47,6 +48,7 @@ internal class PositionTest { assertThat(position.closingPrice()).contains("150.50") assertThat(position.closingPriceDate()).contains(LocalDate.parse("2025-10-31")) assertThat(position.costBasis()).contains("14500.00") + assertThat(position.dailyRealizedPnl()).contains("700.00") assertThat(position.dailyUnrealizedPnl()).contains("550.00") assertThat(position.dailyUnrealizedPnlPct()).contains("3.65") assertThat(position.instrumentPrice()).contains("151.00") @@ -73,6 +75,7 @@ internal class PositionTest { .closingPrice("150.50") .closingPriceDate(LocalDate.parse("2025-10-31")) .costBasis("14500.00") + .dailyRealizedPnl("700.00") .dailyUnrealizedPnl("550.00") .dailyUnrealizedPnlPct("3.65") .instrumentPrice("151.00") From 99400dbe8dd584f36b33b6d250662fa399c9d3b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Jun 2026 10:47:55 +0000 Subject: [PATCH 42/51] feat(api): api update --- .stats.yml | 8 +- .../api/core/handlers/EmptyHandler.kt | 12 + .../api/models/v1/SortDirection.kt | 142 +++ .../models/v1/omniai/OpenScreenerAction.kt | 75 +- .../api/models/v1/screener/FieldLookback.kt | 172 +++ .../api/models/v1/screener/FieldPeriod.kt | 140 +++ .../api/models/v1/screener/FieldRef.kt | 306 +++++ .../api/models/v1/screener/FieldType.kt | 158 +++ .../api/models/v1/screener/FilterOpSpec.kt | 235 ++++ .../api/models/v1/screener/FilterOperator.kt | 219 ++++ .../api/models/v1/screener/FilterValue.kt | 426 +++++++ .../api/models/v1/screener/Modifier.kt | 451 ++++++++ .../api/models/v1/screener/ModifierOp.kt | 140 +++ .../api/models/v1/screener/OperatorArg.kt | 158 +++ .../api/models/v1/screener/ScreenerColumn.kt | 523 +++++++++ .../screener/ScreenerCreateScreenerParams.kt | 809 +++++++++++++ .../ScreenerCreateScreenerResponse.kt | 272 +++++ .../screener/ScreenerDeleteScreenerParams.kt | 236 ++++ .../api/models/v1/screener/ScreenerEntry.kt | 522 +++++++++ .../v1/{omniai => screener}/ScreenerFilter.kt | 2 +- .../screener/ScreenerGetScreenerByIdParams.kt | 201 ++++ .../ScreenerGetScreenerByIdResponse.kt | 273 +++++ .../v1/screener/ScreenerGetScreenersParams.kt | 176 +++ .../screener/ScreenerGetScreenersResponse.kt | 285 +++++ .../screener/ScreenerReplaceScreenerParams.kt | 830 +++++++++++++ .../ScreenerReplaceScreenerResponse.kt | 273 +++++ .../screener/ScreenerSearchScreenerParams.kt | 1028 +++++++++++++++++ .../ScreenerSearchScreenerResponse.kt | 287 +++++ .../api/models/v1/screener/SearchFilter.kt | 287 +++++ .../api/models/v1/screener/SortSpec.kt | 222 ++++ .../api/models/v1/screener/Variable.kt | 304 +++++ .../api/services/async/V1ServiceAsync.kt | 7 + .../api/services/async/V1ServiceAsyncImpl.kt | 14 + .../services/async/v1/ScreenerServiceAsync.kt | 458 ++++++++ .../async/v1/ScreenerServiceAsyncImpl.kt | 289 +++++ .../api/services/blocking/V1Service.kt | 7 + .../api/services/blocking/V1ServiceImpl.kt | 14 + .../services/blocking/v1/ScreenerService.kt | 458 ++++++++ .../blocking/v1/ScreenerServiceImpl.kt | 271 +++++ .../v1/omniai/OpenScreenerActionTest.kt | 4 + .../models/v1/omniai/StructuredActionTest.kt | 3 + .../api/models/v1/screener/FieldRefTest.kt | 47 + .../models/v1/screener/FilterOpSpecTest.kt | 42 + .../api/models/v1/screener/FilterValueTest.kt | 81 ++ .../api/models/v1/screener/ModifierTest.kt | 36 + .../models/v1/screener/ScreenerColumnTest.kt | 69 ++ .../ScreenerCreateScreenerParamsTest.kt | 239 ++++ .../ScreenerCreateScreenerResponseTest.kt | 329 ++++++ .../ScreenerDeleteScreenerParamsTest.kt | 28 + .../models/v1/screener/ScreenerEntryTest.kt | 254 ++++ .../ScreenerFilterTest.kt | 2 +- .../ScreenerGetScreenerByIdParamsTest.kt | 28 + .../ScreenerGetScreenerByIdResponseTest.kt | 329 ++++++ .../ScreenerGetScreenersParamsTest.kt | 13 + .../ScreenerGetScreenersResponseTest.kt | 328 ++++++ .../ScreenerReplaceScreenerParamsTest.kt | 256 ++++ .../ScreenerReplaceScreenerResponseTest.kt | 329 ++++++ .../ScreenerSearchScreenerParamsTest.kt | 285 +++++ .../ScreenerSearchScreenerResponseTest.kt | 156 +++ .../models/v1/screener/SearchFilterTest.kt | 138 +++ .../api/models/v1/screener/SortSpecTest.kt | 64 + .../api/models/v1/screener/VariableTest.kt | 54 + .../async/v1/ScreenerServiceAsyncTest.kt | 349 ++++++ .../blocking/v1/ScreenerServiceTest.kt | 341 ++++++ 64 files changed, 14485 insertions(+), 9 deletions(-) create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/SortDirection.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldLookback.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldPeriod.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldRef.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldType.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpec.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterOperator.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterValue.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/Modifier.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ModifierOp.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/OperatorArg.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerColumn.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParams.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponse.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerDeleteScreenerParams.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntry.kt rename clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/{omniai => screener}/ScreenerFilter.kt (99%) create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdParams.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponse.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersParams.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponse.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParams.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponse.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParams.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerResponse.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/SearchFilter.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/SortSpec.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/Variable.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsync.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncImpl.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerService.kt create mode 100644 clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceImpl.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FieldRefTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpecTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterValueTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ModifierTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerColumnTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerDeleteScreenerParamsTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt rename clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/{omniai => screener}/ScreenerFilterTest.kt (96%) create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdParamsTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersParamsTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerResponseTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SearchFilterTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SortSpecTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/VariableTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt create mode 100644 clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt diff --git a/.stats.yml b/.stats.yml index 00a300e9..ee1a5879 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-013f50843639ae3ee25abd3f081b91d99a6c626af1f1b14f3a783ac43fd2417f.yml -openapi_spec_hash: b4bcd467d59a34883cb7666f5092b9b4 -config_hash: 66d7f41361e2a6d4a8623d5719a896de +configured_endpoints: 61 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-2b0b1f4a89c24a376aed1482e7494a2abf4965e01886cc96451bcc3e1579e4d0.yml +openapi_spec_hash: 0e4e96791d68f8fd7c895b4d14665bef +config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt new file mode 100644 index 00000000..d989fd70 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/handlers/EmptyHandler.kt @@ -0,0 +1,12 @@ +@file:JvmName("EmptyHandler") + +package com.clearstreet.api.core.handlers + +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler + +@JvmSynthetic internal fun emptyHandler(): Handler = EmptyHandlerInternal + +private object EmptyHandlerInternal : Handler { + override fun handle(response: HttpResponse): Void? = null +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/SortDirection.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/SortDirection.kt new file mode 100644 index 00000000..cfaf66a5 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/SortDirection.kt @@ -0,0 +1,142 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1 + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonCreator + +/** Sort direction sorted results */ +class SortDirection @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ASC = of("ASC") + + @JvmField val DESC = of("DESC") + + @JvmStatic fun of(value: String) = SortDirection(JsonField.of(value)) + } + + /** An enum containing [SortDirection]'s known values. */ + enum class Known { + ASC, + DESC, + } + + /** + * An enum containing [SortDirection]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [SortDirection] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ASC, + DESC, + /** + * An enum member indicating that [SortDirection] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ + fun value(): Value = + when (this) { + ASC -> Value.ASC + DESC -> Value.DESC + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws ClearStreetInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ASC -> Known.ASC + DESC -> Known.DESC + else -> throw ClearStreetInvalidDataException("Unknown SortDirection: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws ClearStreetInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { ClearStreetInvalidDataException("Value is not a String") } + + 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(): SortDirection = apply { + if (validated) { + return@apply + } + + known() + 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 = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is SortDirection && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt index 8318b1a7..e0c0762b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt @@ -10,6 +10,7 @@ import com.clearstreet.api.core.checkKnown import com.clearstreet.api.core.checkRequired import com.clearstreet.api.core.toImmutable import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.screener.ScreenerFilter import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -24,6 +25,7 @@ class OpenScreenerAction @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val filters: JsonField>, + private val columns: JsonField>, private val fieldFilter: JsonField>, private val pageSize: JsonField, private val sortBy: JsonField, @@ -36,6 +38,9 @@ private constructor( @JsonProperty("filters") @ExcludeMissing filters: JsonField> = JsonMissing.of(), + @JsonProperty("columns") + @ExcludeMissing + columns: JsonField> = JsonMissing.of(), @JsonProperty("field_filter") @ExcludeMissing fieldFilter: JsonField> = JsonMissing.of(), @@ -44,7 +49,7 @@ private constructor( @JsonProperty("sort_direction") @ExcludeMissing sortDirection: JsonField = JsonMissing.of(), - ) : this(filters, fieldFilter, pageSize, sortBy, sortDirection, mutableMapOf()) + ) : this(filters, columns, fieldFilter, pageSize, sortBy, sortDirection, mutableMapOf()) /** * Filter criteria for the screener @@ -61,6 +66,15 @@ private constructor( * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ + fun columns(): Optional> = columns.getOptional("columns") + + /** + * Deprecated: use `columns` instead. Mirrors `columns`. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") /** @@ -98,11 +112,19 @@ private constructor( @ExcludeMissing fun _filters(): JsonField> = filters + /** + * Returns the raw JSON value of [columns]. + * + * Unlike [columns], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns + /** * Returns the raw JSON value of [fieldFilter]. * * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. */ + @Deprecated("deprecated") @JsonProperty("field_filter") @ExcludeMissing fun _fieldFilter(): JsonField> = fieldFilter @@ -159,6 +181,7 @@ private constructor( class Builder internal constructor() { private var filters: JsonField>? = null + private var columns: JsonField>? = null private var fieldFilter: JsonField>? = null private var pageSize: JsonField = JsonMissing.of() private var sortBy: JsonField = JsonMissing.of() @@ -168,6 +191,7 @@ private constructor( @JvmSynthetic internal fun from(openScreenerAction: OpenScreenerAction) = apply { filters = openScreenerAction.filters.map { it.toMutableList() } + columns = openScreenerAction.columns.map { it.toMutableList() } fieldFilter = openScreenerAction.fieldFilter.map { it.toMutableList() } pageSize = openScreenerAction.pageSize sortBy = openScreenerAction.sortBy @@ -205,9 +229,40 @@ private constructor( * Optional field/column selection for screener results. When a null/undefined value is * observed, it indicates it does not apply. */ + fun columns(columns: List?) = columns(JsonField.ofNullable(columns)) + + /** Alias for calling [Builder.columns] with `columns.orElse(null)`. */ + fun columns(columns: Optional>) = columns(columns.getOrNull()) + + /** + * Sets [Builder.columns] to an arbitrary JSON value. + * + * You should usually call [Builder.columns] with a well-typed `List` value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun columns(columns: JsonField>) = apply { + this.columns = columns.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [columns]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addColumn(column: String) = apply { + columns = + (columns ?: JsonField.of(mutableListOf())).also { + checkKnown("columns", it).add(column) + } + } + + /** Deprecated: use `columns` instead. Mirrors `columns`. */ + @Deprecated("deprecated") fun fieldFilter(fieldFilter: List?) = fieldFilter(JsonField.ofNullable(fieldFilter)) /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ + @Deprecated("deprecated") fun fieldFilter(fieldFilter: Optional>) = fieldFilter(fieldFilter.getOrNull()) /** @@ -217,6 +272,7 @@ private constructor( * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ + @Deprecated("deprecated") fun fieldFilter(fieldFilter: JsonField>) = apply { this.fieldFilter = fieldFilter.map { it.toMutableList() } } @@ -226,6 +282,7 @@ private constructor( * * @throws IllegalStateException if the field was previously set to a non-list. */ + @Deprecated("deprecated") fun addFieldFilter(fieldFilter: String) = apply { this.fieldFilter = (this.fieldFilter ?: JsonField.of(mutableListOf())).also { @@ -330,6 +387,7 @@ private constructor( fun build(): OpenScreenerAction = OpenScreenerAction( checkRequired("filters", filters).map { it.toImmutable() }, + (columns ?: JsonMissing.of()).map { it.toImmutable() }, (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, pageSize, sortBy, @@ -354,6 +412,7 @@ private constructor( } filters().forEach { it.validate() } + columns() fieldFilter() pageSize() sortBy() @@ -377,6 +436,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (columns.asKnown().getOrNull()?.size ?: 0) + (fieldFilter.asKnown().getOrNull()?.size ?: 0) + (if (pageSize.asKnown().isPresent) 1 else 0) + (if (sortBy.asKnown().isPresent) 1 else 0) + @@ -389,6 +449,7 @@ private constructor( return other is OpenScreenerAction && filters == other.filters && + columns == other.columns && fieldFilter == other.fieldFilter && pageSize == other.pageSize && sortBy == other.sortBy && @@ -397,11 +458,19 @@ private constructor( } private val hashCode: Int by lazy { - Objects.hash(filters, fieldFilter, pageSize, sortBy, sortDirection, additionalProperties) + Objects.hash( + filters, + columns, + fieldFilter, + pageSize, + sortBy, + sortDirection, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "OpenScreenerAction{filters=$filters, fieldFilter=$fieldFilter, pageSize=$pageSize, sortBy=$sortBy, sortDirection=$sortDirection, additionalProperties=$additionalProperties}" + "OpenScreenerAction{filters=$filters, columns=$columns, fieldFilter=$fieldFilter, pageSize=$pageSize, sortBy=$sortBy, sortDirection=$sortDirection, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldLookback.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldLookback.kt new file mode 100644 index 00000000..558a9621 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldLookback.kt @@ -0,0 +1,172 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonCreator + +/** Historical lookback window for price/change fields. */ +class FieldLookback @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ONE_DAY = of("ONE_DAY") + + @JvmField val ONE_WEEK = of("ONE_WEEK") + + @JvmField val ONE_MONTH = of("ONE_MONTH") + + @JvmField val THREE_MONTHS = of("THREE_MONTHS") + + @JvmField val SIX_MONTHS = of("SIX_MONTHS") + + @JvmField val YEAR_TO_DATE = of("YEAR_TO_DATE") + + @JvmField val ONE_YEAR = of("ONE_YEAR") + + @JvmStatic fun of(value: String) = FieldLookback(JsonField.of(value)) + } + + /** An enum containing [FieldLookback]'s known values. */ + enum class Known { + ONE_DAY, + ONE_WEEK, + ONE_MONTH, + THREE_MONTHS, + SIX_MONTHS, + YEAR_TO_DATE, + ONE_YEAR, + } + + /** + * An enum containing [FieldLookback]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [FieldLookback] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ONE_DAY, + ONE_WEEK, + ONE_MONTH, + THREE_MONTHS, + SIX_MONTHS, + YEAR_TO_DATE, + ONE_YEAR, + /** + * An enum member indicating that [FieldLookback] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ + fun value(): Value = + when (this) { + ONE_DAY -> Value.ONE_DAY + ONE_WEEK -> Value.ONE_WEEK + ONE_MONTH -> Value.ONE_MONTH + THREE_MONTHS -> Value.THREE_MONTHS + SIX_MONTHS -> Value.SIX_MONTHS + YEAR_TO_DATE -> Value.YEAR_TO_DATE + ONE_YEAR -> Value.ONE_YEAR + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws ClearStreetInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ONE_DAY -> Known.ONE_DAY + ONE_WEEK -> Known.ONE_WEEK + ONE_MONTH -> Known.ONE_MONTH + THREE_MONTHS -> Known.THREE_MONTHS + SIX_MONTHS -> Known.SIX_MONTHS + YEAR_TO_DATE -> Known.YEAR_TO_DATE + ONE_YEAR -> Known.ONE_YEAR + else -> throw ClearStreetInvalidDataException("Unknown FieldLookback: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws ClearStreetInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { ClearStreetInvalidDataException("Value is not a String") } + + 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(): FieldLookback = apply { + if (validated) { + return@apply + } + + known() + 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 = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FieldLookback && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldPeriod.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldPeriod.kt new file mode 100644 index 00000000..ae578cee --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldPeriod.kt @@ -0,0 +1,140 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonCreator + +/** Reporting period for financial data fields. */ +class FieldPeriod @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val QUARTER = of("QUARTER") + + @JvmField val TRAILING_TWELVE_MONTHS = of("TRAILING_TWELVE_MONTHS") + + @JvmStatic fun of(value: String) = FieldPeriod(JsonField.of(value)) + } + + /** An enum containing [FieldPeriod]'s known values. */ + enum class Known { + QUARTER, + TRAILING_TWELVE_MONTHS, + } + + /** + * An enum containing [FieldPeriod]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [FieldPeriod] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + QUARTER, + TRAILING_TWELVE_MONTHS, + /** An enum member indicating that [FieldPeriod] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ + fun value(): Value = + when (this) { + QUARTER -> Value.QUARTER + TRAILING_TWELVE_MONTHS -> Value.TRAILING_TWELVE_MONTHS + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws ClearStreetInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + QUARTER -> Known.QUARTER + TRAILING_TWELVE_MONTHS -> Known.TRAILING_TWELVE_MONTHS + else -> throw ClearStreetInvalidDataException("Unknown FieldPeriod: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws ClearStreetInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { ClearStreetInvalidDataException("Value is not a String") } + + 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(): FieldPeriod = apply { + if (validated) { + return@apply + } + + known() + 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 = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FieldPeriod && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldRef.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldRef.kt new file mode 100644 index 00000000..edb9fff9 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldRef.kt @@ -0,0 +1,306 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A reference to a screener field. */ +class FieldRef +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val name: JsonField, + private val lookback: JsonField, + private val period: JsonField, + private val valueType: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("lookback") + @ExcludeMissing + lookback: JsonField = JsonMissing.of(), + @JsonProperty("period") @ExcludeMissing period: JsonField = JsonMissing.of(), + @JsonProperty("value_type") + @ExcludeMissing + valueType: JsonField = JsonMissing.of(), + ) : this(name, lookback, period, valueType, mutableMapOf()) + + /** + * The field name. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * Optional historical lookback window. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun lookback(): Optional = lookback.getOptional("lookback") + + /** + * Optional reporting period (e.g. quarter or TTM). + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun period(): Optional = period.getOptional("period") + + /** + * The data type of the field value. Present only in responses. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun valueType(): Optional = valueType.getOptional("value_type") + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [lookback]. + * + * Unlike [lookback], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lookback") @ExcludeMissing fun _lookback(): JsonField = lookback + + /** + * Returns the raw JSON value of [period]. + * + * Unlike [period], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("period") @ExcludeMissing fun _period(): JsonField = period + + /** + * Returns the raw JSON value of [valueType]. + * + * Unlike [valueType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("value_type") @ExcludeMissing fun _valueType(): JsonField = valueType + + @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 [FieldRef]. + * + * The following fields are required: + * ```java + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FieldRef]. */ + class Builder internal constructor() { + + private var name: JsonField? = null + private var lookback: JsonField = JsonMissing.of() + private var period: JsonField = JsonMissing.of() + private var valueType: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fieldRef: FieldRef) = apply { + name = fieldRef.name + lookback = fieldRef.lookback + period = fieldRef.period + valueType = fieldRef.valueType + additionalProperties = fieldRef.additionalProperties.toMutableMap() + } + + /** The field name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Optional historical lookback window. */ + fun lookback(lookback: FieldLookback?) = lookback(JsonField.ofNullable(lookback)) + + /** Alias for calling [Builder.lookback] with `lookback.orElse(null)`. */ + fun lookback(lookback: Optional) = lookback(lookback.getOrNull()) + + /** + * Sets [Builder.lookback] to an arbitrary JSON value. + * + * You should usually call [Builder.lookback] with a well-typed [FieldLookback] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lookback(lookback: JsonField) = apply { this.lookback = lookback } + + /** Optional reporting period (e.g. quarter or TTM). */ + fun period(period: FieldPeriod?) = period(JsonField.ofNullable(period)) + + /** Alias for calling [Builder.period] with `period.orElse(null)`. */ + fun period(period: Optional) = period(period.getOrNull()) + + /** + * Sets [Builder.period] to an arbitrary JSON value. + * + * You should usually call [Builder.period] with a well-typed [FieldPeriod] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun period(period: JsonField) = apply { this.period = period } + + /** The data type of the field value. Present only in responses. */ + fun valueType(valueType: FieldType?) = valueType(JsonField.ofNullable(valueType)) + + /** Alias for calling [Builder.valueType] with `valueType.orElse(null)`. */ + fun valueType(valueType: Optional) = valueType(valueType.getOrNull()) + + /** + * Sets [Builder.valueType] to an arbitrary JSON value. + * + * You should usually call [Builder.valueType] with a well-typed [FieldType] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun valueType(valueType: JsonField) = apply { this.valueType = valueType } + + 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 [FieldRef]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FieldRef = + FieldRef( + checkRequired("name", name), + lookback, + period, + valueType, + 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(): FieldRef = apply { + if (validated) { + return@apply + } + + name() + lookback().ifPresent { it.validate() } + period().ifPresent { it.validate() } + valueType().ifPresent { it.validate() } + 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 = + (if (name.asKnown().isPresent) 1 else 0) + + (lookback.asKnown().getOrNull()?.validity() ?: 0) + + (period.asKnown().getOrNull()?.validity() ?: 0) + + (valueType.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FieldRef && + name == other.name && + lookback == other.lookback && + period == other.period && + valueType == other.valueType && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(name, lookback, period, valueType, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "FieldRef{name=$name, lookback=$lookback, period=$period, valueType=$valueType, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldType.kt new file mode 100644 index 00000000..323898c7 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FieldType.kt @@ -0,0 +1,158 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonCreator + +/** The data type of a screener field value. */ +class FieldType @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val DECIMAL = of("DECIMAL") + + @JvmField val INTEGER = of("INTEGER") + + @JvmField val STRING = of("STRING") + + @JvmField val ANALYST_RATING = of("ANALYST_RATING") + + @JvmField val DATE = of("DATE") + + @JvmStatic fun of(value: String) = FieldType(JsonField.of(value)) + } + + /** An enum containing [FieldType]'s known values. */ + enum class Known { + DECIMAL, + INTEGER, + STRING, + ANALYST_RATING, + DATE, + } + + /** + * An enum containing [FieldType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [FieldType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DECIMAL, + INTEGER, + STRING, + ANALYST_RATING, + DATE, + /** An enum member indicating that [FieldType] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ + fun value(): Value = + when (this) { + DECIMAL -> Value.DECIMAL + INTEGER -> Value.INTEGER + STRING -> Value.STRING + ANALYST_RATING -> Value.ANALYST_RATING + DATE -> Value.DATE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws ClearStreetInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + DECIMAL -> Known.DECIMAL + INTEGER -> Known.INTEGER + STRING -> Known.STRING + ANALYST_RATING -> Known.ANALYST_RATING + DATE -> Known.DATE + else -> throw ClearStreetInvalidDataException("Unknown FieldType: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws ClearStreetInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { ClearStreetInvalidDataException("Value is not a String") } + + 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(): FieldType = apply { + if (validated) { + return@apply + } + + known() + 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 = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FieldType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpec.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpec.kt new file mode 100644 index 00000000..0b4fe2f5 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpec.kt @@ -0,0 +1,235 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Operator specification with optional behavioral arguments. */ +class FilterOpSpec +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val name: JsonField, + private val args: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("args") @ExcludeMissing args: JsonField> = JsonMissing.of(), + ) : this(name, args, mutableMapOf()) + + /** + * The operator to apply. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): FilterOperator = name.getRequired("name") + + /** + * Optional arguments that modify operator behavior. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun args(): Optional> = args.getOptional("args") + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [args]. + * + * Unlike [args], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("args") @ExcludeMissing fun _args(): JsonField> = args + + @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 [FilterOpSpec]. + * + * The following fields are required: + * ```java + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FilterOpSpec]. */ + class Builder internal constructor() { + + private var name: JsonField? = null + private var args: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(filterOpSpec: FilterOpSpec) = apply { + name = filterOpSpec.name + args = filterOpSpec.args.map { it.toMutableList() } + additionalProperties = filterOpSpec.additionalProperties.toMutableMap() + } + + /** The operator to apply. */ + fun name(name: FilterOperator) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [FilterOperator] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Optional arguments that modify operator behavior. */ + fun args(args: List) = args(JsonField.of(args)) + + /** + * Sets [Builder.args] to an arbitrary JSON value. + * + * You should usually call [Builder.args] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun args(args: JsonField>) = apply { + this.args = args.map { it.toMutableList() } + } + + /** + * Adds a single [OperatorArg] to [args]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addArg(arg: OperatorArg) = apply { + args = (args ?: JsonField.of(mutableListOf())).also { checkKnown("args", it).add(arg) } + } + + 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 [FilterOpSpec]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FilterOpSpec = + FilterOpSpec( + checkRequired("name", name), + (args ?: JsonMissing.of()).map { it.toImmutable() }, + 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(): FilterOpSpec = apply { + if (validated) { + return@apply + } + + name().validate() + args().ifPresent { it.forEach { it.validate() } } + 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 = + (name.asKnown().getOrNull()?.validity() ?: 0) + + (args.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FilterOpSpec && + name == other.name && + args == other.args && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(name, args, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "FilterOpSpec{name=$name, args=$args, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterOperator.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterOperator.kt new file mode 100644 index 00000000..875ce120 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterOperator.kt @@ -0,0 +1,219 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonCreator + +/** + * Filter operators supported by the screener. + * + * Abbreviated and lowercase forms are accepted as serde aliases for backward compatibility with + * earlier API revisions; the canonical wire form is the SCREAMING_SNAKE_CASE rendering. + */ +class FilterOperator @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LESS_THAN = of("LESS_THAN") + + @JvmField val LESS_OR_EQUAL = of("LESS_OR_EQUAL") + + @JvmField val GREATER_THAN = of("GREATER_THAN") + + @JvmField val GREATER_OR_EQUAL = of("GREATER_OR_EQUAL") + + @JvmField val EQUAL = of("EQUAL") + + @JvmField val BETWEEN = of("BETWEEN") + + @JvmField val NOT_BETWEEN = of("NOT_BETWEEN") + + @JvmField val ONE_OF = of("ONE_OF") + + @JvmField val REGEX = of("REGEX") + + @JvmField val BEGINS_WITH = of("BEGINS_WITH") + + @JvmField val ENDS_WITH = of("ENDS_WITH") + + @JvmField val CONTAINS = of("CONTAINS") + + @JvmField val IS_NULL = of("IS_NULL") + + @JvmField val IS_NOT_NULL = of("IS_NOT_NULL") + + @JvmStatic fun of(value: String) = FilterOperator(JsonField.of(value)) + } + + /** An enum containing [FilterOperator]'s known values. */ + enum class Known { + LESS_THAN, + LESS_OR_EQUAL, + GREATER_THAN, + GREATER_OR_EQUAL, + EQUAL, + BETWEEN, + NOT_BETWEEN, + ONE_OF, + REGEX, + BEGINS_WITH, + ENDS_WITH, + CONTAINS, + IS_NULL, + IS_NOT_NULL, + } + + /** + * An enum containing [FilterOperator]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [FilterOperator] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LESS_THAN, + LESS_OR_EQUAL, + GREATER_THAN, + GREATER_OR_EQUAL, + EQUAL, + BETWEEN, + NOT_BETWEEN, + ONE_OF, + REGEX, + BEGINS_WITH, + ENDS_WITH, + CONTAINS, + IS_NULL, + IS_NOT_NULL, + /** + * An enum member indicating that [FilterOperator] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ + fun value(): Value = + when (this) { + LESS_THAN -> Value.LESS_THAN + LESS_OR_EQUAL -> Value.LESS_OR_EQUAL + GREATER_THAN -> Value.GREATER_THAN + GREATER_OR_EQUAL -> Value.GREATER_OR_EQUAL + EQUAL -> Value.EQUAL + BETWEEN -> Value.BETWEEN + NOT_BETWEEN -> Value.NOT_BETWEEN + ONE_OF -> Value.ONE_OF + REGEX -> Value.REGEX + BEGINS_WITH -> Value.BEGINS_WITH + ENDS_WITH -> Value.ENDS_WITH + CONTAINS -> Value.CONTAINS + IS_NULL -> Value.IS_NULL + IS_NOT_NULL -> Value.IS_NOT_NULL + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws ClearStreetInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + LESS_THAN -> Known.LESS_THAN + LESS_OR_EQUAL -> Known.LESS_OR_EQUAL + GREATER_THAN -> Known.GREATER_THAN + GREATER_OR_EQUAL -> Known.GREATER_OR_EQUAL + EQUAL -> Known.EQUAL + BETWEEN -> Known.BETWEEN + NOT_BETWEEN -> Known.NOT_BETWEEN + ONE_OF -> Known.ONE_OF + REGEX -> Known.REGEX + BEGINS_WITH -> Known.BEGINS_WITH + ENDS_WITH -> Known.ENDS_WITH + CONTAINS -> Known.CONTAINS + IS_NULL -> Known.IS_NULL + IS_NOT_NULL -> Known.IS_NOT_NULL + else -> throw ClearStreetInvalidDataException("Unknown FilterOperator: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws ClearStreetInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { ClearStreetInvalidDataException("Value is not a String") } + + 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(): FilterOperator = apply { + if (validated) { + return@apply + } + + known() + 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 = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FilterOperator && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterValue.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterValue.kt new file mode 100644 index 00000000..700c4368 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/FilterValue.kt @@ -0,0 +1,426 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.BaseDeserializer +import com.clearstreet.api.core.BaseSerializer +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.allMaxBy +import com.clearstreet.api.core.getOrThrow +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.ObjectCodec +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.SerializerProvider +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.databind.annotation.JsonSerialize +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A filter value: either a literal or a variable reference. */ +class FilterValue +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val value: JsonField, + private val variable: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(), + @JsonProperty("variable") @ExcludeMissing variable: JsonField = JsonMissing.of(), + ) : this(value, variable, mutableMapOf()) + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun value(): Optional = value.getOptional("value") + + /** + * A variable reference. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun variable(): Optional = variable.getOptional("variable") + + /** + * Returns the raw JSON value of [value]. + * + * Unlike [value], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value + + /** + * Returns the raw JSON value of [variable]. + * + * Unlike [variable], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("variable") @ExcludeMissing fun _variable(): JsonField = variable + + @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 [FilterValue]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FilterValue]. */ + class Builder internal constructor() { + + private var value: JsonField = JsonMissing.of() + private var variable: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(filterValue: FilterValue) = apply { + value = filterValue.value + variable = filterValue.variable + additionalProperties = filterValue.additionalProperties.toMutableMap() + } + + fun value(value: Value?) = value(JsonField.ofNullable(value)) + + /** Alias for calling [Builder.value] with `value.orElse(null)`. */ + fun value(value: Optional) = value(value.getOrNull()) + + /** + * Sets [Builder.value] to an arbitrary JSON value. + * + * You should usually call [Builder.value] with a well-typed [Value] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun value(value: JsonField) = apply { this.value = value } + + /** Alias for calling [value] with `Value.ofNumber(number)`. */ + fun value(number: Double) = value(Value.ofNumber(number)) + + /** Alias for calling [value] with `Value.ofString(string)`. */ + fun value(string: String) = value(Value.ofString(string)) + + /** A variable reference. */ + fun variable(variable: Variable?) = variable(JsonField.ofNullable(variable)) + + /** Alias for calling [Builder.variable] with `variable.orElse(null)`. */ + fun variable(variable: Optional) = variable(variable.getOrNull()) + + /** + * Sets [Builder.variable] to an arbitrary JSON value. + * + * You should usually call [Builder.variable] with a well-typed [Variable] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun variable(variable: JsonField) = apply { this.variable = variable } + + 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 [FilterValue]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FilterValue = FilterValue(value, variable, 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(): FilterValue = apply { + if (validated) { + return@apply + } + + value().ifPresent { it.validate() } + variable().ifPresent { it.validate() } + 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 = + (value.asKnown().getOrNull()?.validity() ?: 0) + + (variable.asKnown().getOrNull()?.validity() ?: 0) + + @JsonDeserialize(using = Value.Deserializer::class) + @JsonSerialize(using = Value.Serializer::class) + class Value + private constructor( + private val number: Double? = null, + private val string: String? = null, + private val _json: JsonValue? = null, + ) { + + fun number(): Optional = Optional.ofNullable(number) + + fun string(): Optional = Optional.ofNullable(string) + + fun isNumber(): Boolean = number != null + + fun isString(): Boolean = string != null + + fun asNumber(): Double = number.getOrThrow("number") + + fun asString(): String = string.getOrThrow("string") + + fun _json(): Optional = Optional.ofNullable(_json) + + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.clearstreet.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws ClearStreetInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ + fun accept(visitor: Visitor): T = + when { + number != null -> visitor.visitNumber(number) + string != null -> visitor.visitString(string) + else -> visitor.unknown(_json) + } + + 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(): Value = apply { + if (validated) { + return@apply + } + + accept( + object : Visitor { + override fun visitNumber(number: Double) {} + + override fun visitString(string: String) {} + } + ) + 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 = + accept( + object : Visitor { + override fun visitNumber(number: Double) = 1 + + override fun visitString(string: String) = 1 + + override fun unknown(json: JsonValue?) = 0 + } + ) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Value && number == other.number && string == other.string + } + + override fun hashCode(): Int = Objects.hash(number, string) + + override fun toString(): String = + when { + number != null -> "Value{number=$number}" + string != null -> "Value{string=$string}" + _json != null -> "Value{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Value") + } + + companion object { + + @JvmStatic fun ofNumber(number: Double) = Value(number = number) + + @JvmStatic fun ofString(string: String) = Value(string = string) + } + + /** An interface that defines how to map each variant of [Value] to a value of type [T]. */ + interface Visitor { + + fun visitNumber(number: Double): T + + fun visitString(string: String): T + + /** + * Maps an unknown variant of [Value] to a value of type [T]. + * + * An instance of [Value] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws ClearStreetInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw ClearStreetInvalidDataException("Unknown Value: $json") + } + } + + internal class Deserializer : BaseDeserializer(Value::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): Value { + val json = JsonValue.fromJsonNode(node) + + val bestMatches = + sequenceOf( + tryDeserialize(node, jacksonTypeRef())?.let { + Value(string = it, _json = json) + }, + tryDeserialize(node, jacksonTypeRef())?.let { + Value(number = it, _json = json) + }, + ) + .filterNotNull() + .allMaxBy { it.validity() } + .toList() + return when (bestMatches.size) { + // This can happen if what we're deserializing is completely incompatible with + // all the possible variants (e.g. deserializing from boolean). + 0 -> Value(_json = json) + 1 -> bestMatches.single() + // If there's more than one match with the highest validity, then use the first + // completely valid match, or simply the first match if none are completely + // valid. + else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + } + } + } + + internal class Serializer : BaseSerializer(Value::class) { + + override fun serialize( + value: Value, + generator: JsonGenerator, + provider: SerializerProvider, + ) { + when { + value.number != null -> generator.writeObject(value.number) + value.string != null -> generator.writeObject(value.string) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid Value") + } + } + } + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FilterValue && + value == other.value && + variable == other.variable && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(value, variable, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "FilterValue{value=$value, variable=$variable, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/Modifier.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/Modifier.kt new file mode 100644 index 00000000..58455cd6 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/Modifier.kt @@ -0,0 +1,451 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.BaseDeserializer +import com.clearstreet.api.core.BaseSerializer +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.allMaxBy +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.getOrThrow +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.ObjectCodec +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.SerializerProvider +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.databind.annotation.JsonSerialize +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Arithmetic modifier applied to a variable value. */ +class Modifier +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val args: JsonField>, + private val name: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("args") @ExcludeMissing args: JsonField> = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(args, name, mutableMapOf()) + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun args(): List = args.getRequired("args") + + /** + * The modifier operation. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): ModifierOp = name.getRequired("name") + + /** + * Returns the raw JSON value of [args]. + * + * Unlike [args], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("args") @ExcludeMissing fun _args(): JsonField> = args + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @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 [Modifier]. + * + * The following fields are required: + * ```java + * .args() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Modifier]. */ + class Builder internal constructor() { + + private var args: JsonField>? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(modifier: Modifier) = apply { + args = modifier.args.map { it.toMutableList() } + name = modifier.name + additionalProperties = modifier.additionalProperties.toMutableMap() + } + + fun args(args: List) = args(JsonField.of(args)) + + /** + * Sets [Builder.args] to an arbitrary JSON value. + * + * You should usually call [Builder.args] with a well-typed `List` value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun args(args: JsonField>) = apply { this.args = args.map { it.toMutableList() } } + + /** + * Adds a single [Arg] to [args]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addArg(arg: Arg) = apply { + args = (args ?: JsonField.of(mutableListOf())).also { checkKnown("args", it).add(arg) } + } + + /** Alias for calling [addArg] with `Arg.ofNumber(number)`. */ + fun addArg(number: Double) = addArg(Arg.ofNumber(number)) + + /** Alias for calling [addArg] with `Arg.ofString(string)`. */ + fun addArg(string: String) = addArg(Arg.ofString(string)) + + /** The modifier operation. */ + fun name(name: ModifierOp) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [ModifierOp] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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 [Modifier]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .args() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Modifier = + Modifier( + checkRequired("args", args).map { it.toImmutable() }, + checkRequired("name", name), + 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(): Modifier = apply { + if (validated) { + return@apply + } + + args().forEach { it.validate() } + name().validate() + 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 = + (args.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (name.asKnown().getOrNull()?.validity() ?: 0) + + @JsonDeserialize(using = Arg.Deserializer::class) + @JsonSerialize(using = Arg.Serializer::class) + class Arg + private constructor( + private val number: Double? = null, + private val string: String? = null, + private val _json: JsonValue? = null, + ) { + + fun number(): Optional = Optional.ofNullable(number) + + fun string(): Optional = Optional.ofNullable(string) + + fun isNumber(): Boolean = number != null + + fun isString(): Boolean = string != null + + fun asNumber(): Double = number.getOrThrow("number") + + fun asString(): String = string.getOrThrow("string") + + fun _json(): Optional = Optional.ofNullable(_json) + + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.clearstreet.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = arg.accept(new Arg.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws ClearStreetInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ + fun accept(visitor: Visitor): T = + when { + number != null -> visitor.visitNumber(number) + string != null -> visitor.visitString(string) + else -> visitor.unknown(_json) + } + + 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(): Arg = apply { + if (validated) { + return@apply + } + + accept( + object : Visitor { + override fun visitNumber(number: Double) {} + + override fun visitString(string: String) {} + } + ) + 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 = + accept( + object : Visitor { + override fun visitNumber(number: Double) = 1 + + override fun visitString(string: String) = 1 + + override fun unknown(json: JsonValue?) = 0 + } + ) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Arg && number == other.number && string == other.string + } + + override fun hashCode(): Int = Objects.hash(number, string) + + override fun toString(): String = + when { + number != null -> "Arg{number=$number}" + string != null -> "Arg{string=$string}" + _json != null -> "Arg{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Arg") + } + + companion object { + + @JvmStatic fun ofNumber(number: Double) = Arg(number = number) + + @JvmStatic fun ofString(string: String) = Arg(string = string) + } + + /** An interface that defines how to map each variant of [Arg] to a value of type [T]. */ + interface Visitor { + + fun visitNumber(number: Double): T + + fun visitString(string: String): T + + /** + * Maps an unknown variant of [Arg] to a value of type [T]. + * + * An instance of [Arg] can contain an unknown variant if it was deserialized from data + * that doesn't match any known variant. For example, if the SDK is on an older version + * than the API, then the API may respond with new variants that the SDK is unaware of. + * + * @throws ClearStreetInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw ClearStreetInvalidDataException("Unknown Arg: $json") + } + } + + internal class Deserializer : BaseDeserializer(Arg::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): Arg { + val json = JsonValue.fromJsonNode(node) + + val bestMatches = + sequenceOf( + tryDeserialize(node, jacksonTypeRef())?.let { + Arg(string = it, _json = json) + }, + tryDeserialize(node, jacksonTypeRef())?.let { + Arg(number = it, _json = json) + }, + ) + .filterNotNull() + .allMaxBy { it.validity() } + .toList() + return when (bestMatches.size) { + // This can happen if what we're deserializing is completely incompatible with + // all the possible variants (e.g. deserializing from boolean). + 0 -> Arg(_json = json) + 1 -> bestMatches.single() + // If there's more than one match with the highest validity, then use the first + // completely valid match, or simply the first match if none are completely + // valid. + else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + } + } + } + + internal class Serializer : BaseSerializer(Arg::class) { + + override fun serialize( + value: Arg, + generator: JsonGenerator, + provider: SerializerProvider, + ) { + when { + value.number != null -> generator.writeObject(value.number) + value.string != null -> generator.writeObject(value.string) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid Arg") + } + } + } + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Modifier && + args == other.args && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(args, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Modifier{args=$args, name=$name, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ModifierOp.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ModifierOp.kt new file mode 100644 index 00000000..e6916bf7 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ModifierOp.kt @@ -0,0 +1,140 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonCreator + +/** Modifier operation applied to a variable. */ +class ModifierOp @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ADD = of("ADD") + + @JvmField val SUBTRACT = of("SUBTRACT") + + @JvmStatic fun of(value: String) = ModifierOp(JsonField.of(value)) + } + + /** An enum containing [ModifierOp]'s known values. */ + enum class Known { + ADD, + SUBTRACT, + } + + /** + * An enum containing [ModifierOp]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModifierOp] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ADD, + SUBTRACT, + /** An enum member indicating that [ModifierOp] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ + fun value(): Value = + when (this) { + ADD -> Value.ADD + SUBTRACT -> Value.SUBTRACT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws ClearStreetInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ADD -> Known.ADD + SUBTRACT -> Known.SUBTRACT + else -> throw ClearStreetInvalidDataException("Unknown ModifierOp: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws ClearStreetInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { ClearStreetInvalidDataException("Value is not a String") } + + 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(): ModifierOp = apply { + if (validated) { + return@apply + } + + known() + 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 = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ModifierOp && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/OperatorArg.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/OperatorArg.kt new file mode 100644 index 00000000..d91cf78a --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/OperatorArg.kt @@ -0,0 +1,158 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.Enum +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonCreator + +/** Argument that modifies operator behavior. */ +class OperatorArg @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LEFT_INCLUSIVE = of("LEFT_INCLUSIVE") + + @JvmField val RIGHT_INCLUSIVE = of("RIGHT_INCLUSIVE") + + @JvmField val LEFT_EXCLUSIVE = of("LEFT_EXCLUSIVE") + + @JvmField val RIGHT_EXCLUSIVE = of("RIGHT_EXCLUSIVE") + + @JvmField val CASE_INSENSITIVE = of("CASE_INSENSITIVE") + + @JvmStatic fun of(value: String) = OperatorArg(JsonField.of(value)) + } + + /** An enum containing [OperatorArg]'s known values. */ + enum class Known { + LEFT_INCLUSIVE, + RIGHT_INCLUSIVE, + LEFT_EXCLUSIVE, + RIGHT_EXCLUSIVE, + CASE_INSENSITIVE, + } + + /** + * An enum containing [OperatorArg]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [OperatorArg] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LEFT_INCLUSIVE, + RIGHT_INCLUSIVE, + LEFT_EXCLUSIVE, + RIGHT_EXCLUSIVE, + CASE_INSENSITIVE, + /** An enum member indicating that [OperatorArg] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ + fun value(): Value = + when (this) { + LEFT_INCLUSIVE -> Value.LEFT_INCLUSIVE + RIGHT_INCLUSIVE -> Value.RIGHT_INCLUSIVE + LEFT_EXCLUSIVE -> Value.LEFT_EXCLUSIVE + RIGHT_EXCLUSIVE -> Value.RIGHT_EXCLUSIVE + CASE_INSENSITIVE -> Value.CASE_INSENSITIVE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws ClearStreetInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + LEFT_INCLUSIVE -> Known.LEFT_INCLUSIVE + RIGHT_INCLUSIVE -> Known.RIGHT_INCLUSIVE + LEFT_EXCLUSIVE -> Known.LEFT_EXCLUSIVE + RIGHT_EXCLUSIVE -> Known.RIGHT_EXCLUSIVE + CASE_INSENSITIVE -> Known.CASE_INSENSITIVE + else -> throw ClearStreetInvalidDataException("Unknown OperatorArg: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws ClearStreetInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { ClearStreetInvalidDataException("Value is not a String") } + + 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(): OperatorArg = apply { + if (validated) { + return@apply + } + + known() + 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 = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OperatorArg && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerColumn.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerColumn.kt new file mode 100644 index 00000000..8cb562f1 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerColumn.kt @@ -0,0 +1,523 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.BaseDeserializer +import com.clearstreet.api.core.BaseSerializer +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.allMaxBy +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.getOrThrow +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.ObjectCodec +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.SerializerProvider +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.databind.annotation.JsonSerialize +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A single column in the screener search response. */ +class ScreenerColumn +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val field: JsonField, + private val name: JsonField, + private val value: JsonField, + private val type: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("field") @ExcludeMissing field: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + ) : this(field, name, value, type, mutableMapOf()) + + /** + * Field reference (same shape as filter/sort field references) + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun field(): FieldRef = field.getRequired("field") + + /** + * Human-readable display name for this field + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun value(): Optional = value.getOptional("value") + + /** + * Value format hint: "CURR_USD", "PERCENT", etc. Omitted when not applicable. When a + * null/undefined value is observed, it indicates it does not apply. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun type(): Optional = type.getOptional("type") + + /** + * Returns the raw JSON value of [field]. + * + * Unlike [field], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("field") @ExcludeMissing fun _field(): JsonField = field + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [value]. + * + * Unlike [value], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value + + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + + @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 [ScreenerColumn]. + * + * The following fields are required: + * ```java + * .field() + * .name() + * .value() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerColumn]. */ + class Builder internal constructor() { + + private var field: JsonField? = null + private var name: JsonField? = null + private var value: JsonField? = null + private var type: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(screenerColumn: ScreenerColumn) = apply { + field = screenerColumn.field + name = screenerColumn.name + value = screenerColumn.value + type = screenerColumn.type + additionalProperties = screenerColumn.additionalProperties.toMutableMap() + } + + /** Field reference (same shape as filter/sort field references) */ + fun field(field: FieldRef) = field(JsonField.of(field)) + + /** + * Sets [Builder.field] to an arbitrary JSON value. + * + * You should usually call [Builder.field] with a well-typed [FieldRef] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun field(field: JsonField) = apply { this.field = field } + + /** Human-readable display name for this field */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + fun value(value: Value?) = value(JsonField.ofNullable(value)) + + /** Alias for calling [Builder.value] with `value.orElse(null)`. */ + fun value(value: Optional) = value(value.getOrNull()) + + /** + * Sets [Builder.value] to an arbitrary JSON value. + * + * You should usually call [Builder.value] with a well-typed [Value] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun value(value: JsonField) = apply { this.value = value } + + /** Alias for calling [value] with `Value.ofNumber(number)`. */ + fun value(number: Double) = value(Value.ofNumber(number)) + + /** Alias for calling [value] with `Value.ofString(string)`. */ + fun value(string: String) = value(Value.ofString(string)) + + /** + * Value format hint: "CURR_USD", "PERCENT", etc. Omitted when not applicable. When a + * null/undefined value is observed, it indicates it does not apply. + */ + fun type(type: String?) = type(JsonField.ofNullable(type)) + + /** Alias for calling [Builder.type] with `type.orElse(null)`. */ + fun type(type: Optional) = type(type.getOrNull()) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun type(type: JsonField) = apply { this.type = type } + + 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 [ScreenerColumn]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .field() + * .name() + * .value() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ScreenerColumn = + ScreenerColumn( + checkRequired("field", field), + checkRequired("name", name), + checkRequired("value", value), + type, + 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(): ScreenerColumn = apply { + if (validated) { + return@apply + } + + field().validate() + name() + value().ifPresent { it.validate() } + type() + 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 = + (field.asKnown().getOrNull()?.validity() ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (value.asKnown().getOrNull()?.validity() ?: 0) + + (if (type.asKnown().isPresent) 1 else 0) + + @JsonDeserialize(using = Value.Deserializer::class) + @JsonSerialize(using = Value.Serializer::class) + class Value + private constructor( + private val number: Double? = null, + private val string: String? = null, + private val _json: JsonValue? = null, + ) { + + fun number(): Optional = Optional.ofNullable(number) + + fun string(): Optional = Optional.ofNullable(string) + + fun isNumber(): Boolean = number != null + + fun isString(): Boolean = string != null + + fun asNumber(): Double = number.getOrThrow("number") + + fun asString(): String = string.getOrThrow("string") + + fun _json(): Optional = Optional.ofNullable(_json) + + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.clearstreet.api.core.JsonValue; + * import java.util.Optional; + * + * Optional result = value.accept(new Value.Visitor>() { + * @Override + * public Optional visitNumber(Double number) { + * return Optional.of(number.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws ClearStreetInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ + fun accept(visitor: Visitor): T = + when { + number != null -> visitor.visitNumber(number) + string != null -> visitor.visitString(string) + else -> visitor.unknown(_json) + } + + 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(): Value = apply { + if (validated) { + return@apply + } + + accept( + object : Visitor { + override fun visitNumber(number: Double) {} + + override fun visitString(string: String) {} + } + ) + 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 = + accept( + object : Visitor { + override fun visitNumber(number: Double) = 1 + + override fun visitString(string: String) = 1 + + override fun unknown(json: JsonValue?) = 0 + } + ) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Value && number == other.number && string == other.string + } + + override fun hashCode(): Int = Objects.hash(number, string) + + override fun toString(): String = + when { + number != null -> "Value{number=$number}" + string != null -> "Value{string=$string}" + _json != null -> "Value{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Value") + } + + companion object { + + @JvmStatic fun ofNumber(number: Double) = Value(number = number) + + @JvmStatic fun ofString(string: String) = Value(string = string) + } + + /** An interface that defines how to map each variant of [Value] to a value of type [T]. */ + interface Visitor { + + fun visitNumber(number: Double): T + + fun visitString(string: String): T + + /** + * Maps an unknown variant of [Value] to a value of type [T]. + * + * An instance of [Value] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws ClearStreetInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw ClearStreetInvalidDataException("Unknown Value: $json") + } + } + + internal class Deserializer : BaseDeserializer(Value::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): Value { + val json = JsonValue.fromJsonNode(node) + + val bestMatches = + sequenceOf( + tryDeserialize(node, jacksonTypeRef())?.let { + Value(string = it, _json = json) + }, + tryDeserialize(node, jacksonTypeRef())?.let { + Value(number = it, _json = json) + }, + ) + .filterNotNull() + .allMaxBy { it.validity() } + .toList() + return when (bestMatches.size) { + // This can happen if what we're deserializing is completely incompatible with + // all the possible variants (e.g. deserializing from boolean). + 0 -> Value(_json = json) + 1 -> bestMatches.single() + // If there's more than one match with the highest validity, then use the first + // completely valid match, or simply the first match if none are completely + // valid. + else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + } + } + } + + internal class Serializer : BaseSerializer(Value::class) { + + override fun serialize( + value: Value, + generator: JsonGenerator, + provider: SerializerProvider, + ) { + when { + value.number != null -> generator.writeObject(value.number) + value.string != null -> generator.writeObject(value.string) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid Value") + } + } + } + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerColumn && + field == other.field && + name == other.name && + value == other.value && + type == other.type && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(field, name, value, type, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ScreenerColumn{field=$field, name=$name, value=$value, type=$type, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParams.kt new file mode 100644 index 00000000..801f999c --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParams.kt @@ -0,0 +1,809 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Create a saved screener configuration. + * + * Persists a screener configuration for the authenticated user. + */ +class ScreenerCreateScreenerParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * Structured field references to include when running this screener + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun columns(): Optional> = body.columns() + + /** + * Deprecated: use `columns` instead. Ignored when `columns` is provided. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") fun fieldFilter(): Optional> = body.fieldFilter() + + /** + * Structured search filter criteria + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun filters(): Optional> = body.filters() + + /** + * The name for this screener configuration + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = body.name() + + /** + * Multi-field sort specifications + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun sorts(): Optional> = body.sorts() + + /** + * Returns the raw JSON value of [columns]. + * + * Unlike [columns], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _columns(): JsonField> = body._columns() + + /** + * Returns the raw JSON value of [fieldFilter]. + * + * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") fun _fieldFilter(): JsonField> = body._fieldFilter() + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _filters(): JsonField> = body._filters() + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _name(): JsonField = body._name() + + /** + * Returns the raw JSON value of [sorts]. + * + * Unlike [sorts], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _sorts(): JsonField> = body._sorts() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): ScreenerCreateScreenerParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [ScreenerCreateScreenerParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerCreateScreenerParams]. */ + class Builder internal constructor() { + + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(screenerCreateScreenerParams: ScreenerCreateScreenerParams) = apply { + body = screenerCreateScreenerParams.body.toBuilder() + additionalHeaders = screenerCreateScreenerParams.additionalHeaders.toBuilder() + additionalQueryParams = screenerCreateScreenerParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [columns] + * - [fieldFilter] + * - [filters] + * - [name] + * - [sorts] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** Structured field references to include when running this screener */ + fun columns(columns: List?) = apply { body.columns(columns) } + + /** Alias for calling [Builder.columns] with `columns.orElse(null)`. */ + fun columns(columns: Optional>) = columns(columns.getOrNull()) + + /** + * Sets [Builder.columns] to an arbitrary JSON value. + * + * You should usually call [Builder.columns] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun columns(columns: JsonField>) = apply { body.columns(columns) } + + /** + * Adds a single [FieldRef] to [columns]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addColumn(column: FieldRef) = apply { body.addColumn(column) } + + /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: List?) = apply { body.fieldFilter(fieldFilter) } + + /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: Optional>) = + fieldFilter(fieldFilter.getOrNull()) + + /** + * Sets [Builder.fieldFilter] to an arbitrary JSON value. + * + * You should usually call [Builder.fieldFilter] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: JsonField>) = apply { + body.fieldFilter(fieldFilter) + } + + /** + * Adds a single [FieldRef] to [Builder.fieldFilter]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + @Deprecated("deprecated") + fun addFieldFilter(fieldFilter: FieldRef) = apply { body.addFieldFilter(fieldFilter) } + + /** Structured search filter criteria */ + fun filters(filters: List?) = apply { body.filters(filters) } + + /** Alias for calling [Builder.filters] with `filters.orElse(null)`. */ + fun filters(filters: Optional>) = filters(filters.getOrNull()) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun filters(filters: JsonField>) = apply { body.filters(filters) } + + /** + * Adds a single [SearchFilter] to [filters]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFilter(filter: SearchFilter) = apply { body.addFilter(filter) } + + /** The name for this screener configuration */ + fun name(name: String?) = apply { body.name(name) } + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { body.name(name) } + + /** Multi-field sort specifications */ + fun sorts(sorts: List?) = apply { body.sorts(sorts) } + + /** Alias for calling [Builder.sorts] with `sorts.orElse(null)`. */ + fun sorts(sorts: Optional>) = sorts(sorts.getOrNull()) + + /** + * Sets [Builder.sorts] to an arbitrary JSON value. + * + * You should usually call [Builder.sorts] with a well-typed `List` value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun sorts(sorts: JsonField>) = apply { body.sorts(sorts) } + + /** + * Adds a single [SortSpec] to [sorts]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addSort(sort: SortSpec) = apply { body.addSort(sort) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [ScreenerCreateScreenerParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ScreenerCreateScreenerParams = + ScreenerCreateScreenerParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + /** Request body for creating or updating a saved screener configuration */ + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val columns: JsonField>, + private val fieldFilter: JsonField>, + private val filters: JsonField>, + private val name: JsonField, + private val sorts: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("columns") + @ExcludeMissing + columns: JsonField> = JsonMissing.of(), + @JsonProperty("field_filter") + @ExcludeMissing + fieldFilter: JsonField> = JsonMissing.of(), + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField> = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("sorts") + @ExcludeMissing + sorts: JsonField> = JsonMissing.of(), + ) : this(columns, fieldFilter, filters, name, sorts, mutableMapOf()) + + /** + * Structured field references to include when running this screener + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun columns(): Optional> = columns.getOptional("columns") + + /** + * Deprecated: use `columns` instead. Ignored when `columns` is provided. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + @Deprecated("deprecated") + fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") + + /** + * Structured search filter criteria + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun filters(): Optional> = filters.getOptional("filters") + + /** + * The name for this screener configuration + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * Multi-field sort specifications + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun sorts(): Optional> = sorts.getOptional("sorts") + + /** + * Returns the raw JSON value of [columns]. + * + * Unlike [columns], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns + + /** + * Returns the raw JSON value of [fieldFilter]. + * + * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") + @JsonProperty("field_filter") + @ExcludeMissing + fun _fieldFilter(): JsonField> = fieldFilter + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") + @ExcludeMissing + fun _filters(): JsonField> = filters + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [sorts]. + * + * Unlike [sorts], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("sorts") @ExcludeMissing fun _sorts(): JsonField> = sorts + + @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 [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var columns: JsonField>? = null + private var fieldFilter: JsonField>? = null + private var filters: JsonField>? = null + private var name: JsonField = JsonMissing.of() + private var sorts: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + columns = body.columns.map { it.toMutableList() } + fieldFilter = body.fieldFilter.map { it.toMutableList() } + filters = body.filters.map { it.toMutableList() } + name = body.name + sorts = body.sorts.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** Structured field references to include when running this screener */ + fun columns(columns: List?) = columns(JsonField.ofNullable(columns)) + + /** Alias for calling [Builder.columns] with `columns.orElse(null)`. */ + fun columns(columns: Optional>) = columns(columns.getOrNull()) + + /** + * Sets [Builder.columns] to an arbitrary JSON value. + * + * You should usually call [Builder.columns] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun columns(columns: JsonField>) = apply { + this.columns = columns.map { it.toMutableList() } + } + + /** + * Adds a single [FieldRef] to [columns]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addColumn(column: FieldRef) = apply { + columns = + (columns ?: JsonField.of(mutableListOf())).also { + checkKnown("columns", it).add(column) + } + } + + /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: List?) = + fieldFilter(JsonField.ofNullable(fieldFilter)) + + /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: Optional>) = + fieldFilter(fieldFilter.getOrNull()) + + /** + * Sets [Builder.fieldFilter] to an arbitrary JSON value. + * + * You should usually call [Builder.fieldFilter] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: JsonField>) = apply { + this.fieldFilter = fieldFilter.map { it.toMutableList() } + } + + /** + * Adds a single [FieldRef] to [Builder.fieldFilter]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + @Deprecated("deprecated") + fun addFieldFilter(fieldFilter: FieldRef) = apply { + this.fieldFilter = + (this.fieldFilter ?: JsonField.of(mutableListOf())).also { + checkKnown("fieldFilter", it).add(fieldFilter) + } + } + + /** Structured search filter criteria */ + fun filters(filters: List?) = filters(JsonField.ofNullable(filters)) + + /** Alias for calling [Builder.filters] with `filters.orElse(null)`. */ + fun filters(filters: Optional>) = filters(filters.getOrNull()) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun filters(filters: JsonField>) = apply { + this.filters = filters.map { it.toMutableList() } + } + + /** + * Adds a single [SearchFilter] to [filters]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFilter(filter: SearchFilter) = apply { + filters = + (filters ?: JsonField.of(mutableListOf())).also { + checkKnown("filters", it).add(filter) + } + } + + /** The name for this screener configuration */ + fun name(name: String?) = name(JsonField.ofNullable(name)) + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Multi-field sort specifications */ + fun sorts(sorts: List?) = sorts(JsonField.ofNullable(sorts)) + + /** Alias for calling [Builder.sorts] with `sorts.orElse(null)`. */ + fun sorts(sorts: Optional>) = sorts(sorts.getOrNull()) + + /** + * Sets [Builder.sorts] to an arbitrary JSON value. + * + * You should usually call [Builder.sorts] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sorts(sorts: JsonField>) = apply { + this.sorts = sorts.map { it.toMutableList() } + } + + /** + * Adds a single [SortSpec] to [sorts]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addSort(sort: SortSpec) = apply { + sorts = + (sorts ?: JsonField.of(mutableListOf())).also { + checkKnown("sorts", it).add(sort) + } + } + + 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = + Body( + (columns ?: JsonMissing.of()).map { it.toImmutable() }, + (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, + (filters ?: JsonMissing.of()).map { it.toImmutable() }, + name, + (sorts ?: JsonMissing.of()).map { it.toImmutable() }, + 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(): Body = apply { + if (validated) { + return@apply + } + + columns().ifPresent { it.forEach { it.validate() } } + fieldFilter().ifPresent { it.forEach { it.validate() } } + filters().ifPresent { it.forEach { it.validate() } } + name() + sorts().ifPresent { it.forEach { it.validate() } } + 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 = + (columns.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (fieldFilter.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (sorts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + columns == other.columns && + fieldFilter == other.fieldFilter && + filters == other.filters && + name == other.name && + sorts == other.sorts && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(columns, fieldFilter, filters, name, sorts, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{columns=$columns, fieldFilter=$fieldFilter, filters=$filters, name=$name, sorts=$sorts, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerCreateScreenerParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "ScreenerCreateScreenerParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponse.kt new file mode 100644 index 00000000..fc75396e --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponse.kt @@ -0,0 +1,272 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class ScreenerCreateScreenerResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val metadata: JsonField, + private val error: JsonField, + private val data: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing data: JsonField = JsonMissing.of(), + ) : this(metadata, error, data, mutableMapOf()) + + fun toBaseResponse(): BaseResponse = + BaseResponse.builder().metadata(metadata).error(error).build() + + /** + * Response metadata, including the request ID and optional pagination info. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): ResponseMetadata = metadata.getRequired("metadata") + + /** + * Structured error details when the request is unsuccessful. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun error(): Optional = error.getOptional("error") + + /** + * A saved screener configuration entry + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): ScreenerEntry = data.getRequired("data") + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [error]. + * + * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField = data + + @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 + * [ScreenerCreateScreenerResponse]. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerCreateScreenerResponse]. */ + class Builder internal constructor() { + + private var metadata: JsonField? = null + private var error: JsonField = JsonMissing.of() + private var data: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(screenerCreateScreenerResponse: ScreenerCreateScreenerResponse) = apply { + metadata = screenerCreateScreenerResponse.metadata + error = screenerCreateScreenerResponse.error + data = screenerCreateScreenerResponse.data + additionalProperties = + screenerCreateScreenerResponse.additionalProperties.toMutableMap() + } + + /** Response metadata, including the request ID and optional pagination info. */ + fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [ResponseMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** Structured error details when the request is unsuccessful. */ + fun error(error: ApiError?) = error(JsonField.ofNullable(error)) + + /** Alias for calling [Builder.error] with `error.orElse(null)`. */ + fun error(error: Optional) = error(error.getOrNull()) + + /** + * Sets [Builder.error] to an arbitrary JSON value. + * + * You should usually call [Builder.error] with a well-typed [ApiError] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun error(error: JsonField) = apply { this.error = error } + + /** A saved screener configuration entry */ + fun data(data: ScreenerEntry) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed [ScreenerEntry] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun data(data: JsonField) = apply { this.data = data } + + 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 [ScreenerCreateScreenerResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ScreenerCreateScreenerResponse = + ScreenerCreateScreenerResponse( + checkRequired("metadata", metadata), + error, + checkRequired("data", data), + 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(): ScreenerCreateScreenerResponse = apply { + if (validated) { + return@apply + } + + metadata().validate() + error().ifPresent { it.validate() } + data().validate() + 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 = + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (error.asKnown().getOrNull()?.validity() ?: 0) + + (data.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerCreateScreenerResponse && + metadata == other.metadata && + error == other.error && + data == other.data && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(metadata, error, data, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ScreenerCreateScreenerResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerDeleteScreenerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerDeleteScreenerParams.kt new file mode 100644 index 00000000..24c8a8e7 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerDeleteScreenerParams.kt @@ -0,0 +1,236 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Delete a saved screener configuration. + * + * Deletes the screener configuration for the authenticated user. + */ +class ScreenerDeleteScreenerParams +private constructor( + private val screenerId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, + private val additionalBodyProperties: Map, +) : Params { + + fun screenerId(): Optional = Optional.ofNullable(screenerId) + + /** Additional body properties to send with the request. */ + fun _additionalBodyProperties(): Map = additionalBodyProperties + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): ScreenerDeleteScreenerParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [ScreenerDeleteScreenerParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerDeleteScreenerParams]. */ + class Builder internal constructor() { + + private var screenerId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(screenerDeleteScreenerParams: ScreenerDeleteScreenerParams) = apply { + screenerId = screenerDeleteScreenerParams.screenerId + additionalHeaders = screenerDeleteScreenerParams.additionalHeaders.toBuilder() + additionalQueryParams = screenerDeleteScreenerParams.additionalQueryParams.toBuilder() + additionalBodyProperties = + screenerDeleteScreenerParams.additionalBodyProperties.toMutableMap() + } + + fun screenerId(screenerId: String?) = apply { this.screenerId = screenerId } + + /** Alias for calling [Builder.screenerId] with `screenerId.orElse(null)`. */ + fun screenerId(screenerId: Optional) = screenerId(screenerId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + putAllAdditionalBodyProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { + additionalBodyProperties.remove(key) + } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalBodyProperty) + } + + /** + * Returns an immutable instance of [ScreenerDeleteScreenerParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ScreenerDeleteScreenerParams = + ScreenerDeleteScreenerParams( + screenerId, + additionalHeaders.build(), + additionalQueryParams.build(), + additionalBodyProperties.toImmutable(), + ) + } + + fun _body(): Optional> = + Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) + + fun _pathParam(index: Int): String = + when (index) { + 0 -> screenerId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerDeleteScreenerParams && + screenerId == other.screenerId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams && + additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int = + Objects.hash(screenerId, additionalHeaders, additionalQueryParams, additionalBodyProperties) + + override fun toString() = + "ScreenerDeleteScreenerParams{screenerId=$screenerId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntry.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntry.kt new file mode 100644 index 00000000..1bf88945 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntry.kt @@ -0,0 +1,522 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A saved screener configuration entry */ +class ScreenerEntry +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val createdAt: JsonField, + private val filters: JsonField>, + private val name: JsonField, + private val updatedAt: JsonField, + private val columns: JsonField>, + private val fieldFilter: JsonField>, + private val sorts: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField> = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("updated_at") + @ExcludeMissing + updatedAt: JsonField = JsonMissing.of(), + @JsonProperty("columns") + @ExcludeMissing + columns: JsonField> = JsonMissing.of(), + @JsonProperty("field_filter") + @ExcludeMissing + fieldFilter: JsonField> = JsonMissing.of(), + @JsonProperty("sorts") @ExcludeMissing sorts: JsonField> = JsonMissing.of(), + ) : this(id, createdAt, filters, name, updatedAt, columns, fieldFilter, sorts, mutableMapOf()) + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun id(): String = id.getRequired("id") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun filters(): List = filters.getRequired("filters") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun updatedAt(): OffsetDateTime = updatedAt.getRequired("updated_at") + + /** + * Field references included when running this screener. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun columns(): Optional> = columns.getOptional("columns") + + /** + * Deprecated: use `columns` instead. Mirrors `columns`. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") + fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun sorts(): Optional> = sorts.getOptional("sorts") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField> = filters + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [updatedAt]. + * + * Unlike [updatedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("updated_at") + @ExcludeMissing + fun _updatedAt(): JsonField = updatedAt + + /** + * Returns the raw JSON value of [columns]. + * + * Unlike [columns], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns + + /** + * Returns the raw JSON value of [fieldFilter]. + * + * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") + @JsonProperty("field_filter") + @ExcludeMissing + fun _fieldFilter(): JsonField> = fieldFilter + + /** + * Returns the raw JSON value of [sorts]. + * + * Unlike [sorts], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("sorts") @ExcludeMissing fun _sorts(): JsonField> = sorts + + @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 [ScreenerEntry]. + * + * The following fields are required: + * ```java + * .id() + * .createdAt() + * .filters() + * .name() + * .updatedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerEntry]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var createdAt: JsonField? = null + private var filters: JsonField>? = null + private var name: JsonField? = null + private var updatedAt: JsonField? = null + private var columns: JsonField>? = null + private var fieldFilter: JsonField>? = null + private var sorts: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(screenerEntry: ScreenerEntry) = apply { + id = screenerEntry.id + createdAt = screenerEntry.createdAt + filters = screenerEntry.filters.map { it.toMutableList() } + name = screenerEntry.name + updatedAt = screenerEntry.updatedAt + columns = screenerEntry.columns.map { it.toMutableList() } + fieldFilter = screenerEntry.fieldFilter.map { it.toMutableList() } + sorts = screenerEntry.sorts.map { it.toMutableList() } + additionalProperties = screenerEntry.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + fun filters(filters: List) = filters(JsonField.of(filters)) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun filters(filters: JsonField>) = apply { + this.filters = filters.map { it.toMutableList() } + } + + /** + * Adds a single [SearchFilter] to [filters]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFilter(filter: SearchFilter) = apply { + filters = + (filters ?: JsonField.of(mutableListOf())).also { + checkKnown("filters", it).add(filter) + } + } + + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) + + /** + * Sets [Builder.updatedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt } + + /** Field references included when running this screener. */ + fun columns(columns: List?) = columns(JsonField.ofNullable(columns)) + + /** Alias for calling [Builder.columns] with `columns.orElse(null)`. */ + fun columns(columns: Optional>) = columns(columns.getOrNull()) + + /** + * Sets [Builder.columns] to an arbitrary JSON value. + * + * You should usually call [Builder.columns] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun columns(columns: JsonField>) = apply { + this.columns = columns.map { it.toMutableList() } + } + + /** + * Adds a single [FieldRef] to [columns]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addColumn(column: FieldRef) = apply { + columns = + (columns ?: JsonField.of(mutableListOf())).also { + checkKnown("columns", it).add(column) + } + } + + /** Deprecated: use `columns` instead. Mirrors `columns`. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: List?) = + fieldFilter(JsonField.ofNullable(fieldFilter)) + + /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: Optional>) = + fieldFilter(fieldFilter.getOrNull()) + + /** + * Sets [Builder.fieldFilter] to an arbitrary JSON value. + * + * You should usually call [Builder.fieldFilter] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: JsonField>) = apply { + this.fieldFilter = fieldFilter.map { it.toMutableList() } + } + + /** + * Adds a single [FieldRef] to [Builder.fieldFilter]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + @Deprecated("deprecated") + fun addFieldFilter(fieldFilter: FieldRef) = apply { + this.fieldFilter = + (this.fieldFilter ?: JsonField.of(mutableListOf())).also { + checkKnown("fieldFilter", it).add(fieldFilter) + } + } + + fun sorts(sorts: List?) = sorts(JsonField.ofNullable(sorts)) + + /** Alias for calling [Builder.sorts] with `sorts.orElse(null)`. */ + fun sorts(sorts: Optional>) = sorts(sorts.getOrNull()) + + /** + * Sets [Builder.sorts] to an arbitrary JSON value. + * + * You should usually call [Builder.sorts] with a well-typed `List` value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun sorts(sorts: JsonField>) = apply { + this.sorts = sorts.map { it.toMutableList() } + } + + /** + * Adds a single [SortSpec] to [sorts]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addSort(sort: SortSpec) = apply { + sorts = + (sorts ?: JsonField.of(mutableListOf())).also { checkKnown("sorts", it).add(sort) } + } + + 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 [ScreenerEntry]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .createdAt() + * .filters() + * .name() + * .updatedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ScreenerEntry = + ScreenerEntry( + checkRequired("id", id), + checkRequired("createdAt", createdAt), + checkRequired("filters", filters).map { it.toImmutable() }, + checkRequired("name", name), + checkRequired("updatedAt", updatedAt), + (columns ?: JsonMissing.of()).map { it.toImmutable() }, + (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, + (sorts ?: JsonMissing.of()).map { it.toImmutable() }, + 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(): ScreenerEntry = apply { + if (validated) { + return@apply + } + + id() + createdAt() + filters().forEach { it.validate() } + name() + updatedAt() + columns().ifPresent { it.forEach { it.validate() } } + fieldFilter().ifPresent { it.forEach { it.validate() } } + sorts().ifPresent { it.forEach { it.validate() } } + 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 = + (if (id.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (updatedAt.asKnown().isPresent) 1 else 0) + + (columns.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (fieldFilter.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (sorts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerEntry && + id == other.id && + createdAt == other.createdAt && + filters == other.filters && + name == other.name && + updatedAt == other.updatedAt && + columns == other.columns && + fieldFilter == other.fieldFilter && + sorts == other.sorts && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + createdAt, + filters, + name, + updatedAt, + columns, + fieldFilter, + sorts, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ScreenerEntry{id=$id, createdAt=$createdAt, filters=$filters, name=$name, updatedAt=$updatedAt, columns=$columns, fieldFilter=$fieldFilter, sorts=$sorts, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilter.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerFilter.kt similarity index 99% rename from clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilter.kt rename to clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerFilter.kt index 91b5a071..ae2ee887 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilter.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerFilter.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clearstreet.api.models.v1.omniai +package com.clearstreet.api.models.v1.screener import com.clearstreet.api.core.ExcludeMissing import com.clearstreet.api.core.JsonField diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdParams.kt new file mode 100644 index 00000000..4b940df1 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdParams.kt @@ -0,0 +1,201 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Get a saved screener configuration by ID. + * + * Returns a single screener configuration for the authenticated user. + */ +class ScreenerGetScreenerByIdParams +private constructor( + private val screenerId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun screenerId(): Optional = Optional.ofNullable(screenerId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): ScreenerGetScreenerByIdParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [ScreenerGetScreenerByIdParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerGetScreenerByIdParams]. */ + class Builder internal constructor() { + + private var screenerId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(screenerGetScreenerByIdParams: ScreenerGetScreenerByIdParams) = apply { + screenerId = screenerGetScreenerByIdParams.screenerId + additionalHeaders = screenerGetScreenerByIdParams.additionalHeaders.toBuilder() + additionalQueryParams = screenerGetScreenerByIdParams.additionalQueryParams.toBuilder() + } + + fun screenerId(screenerId: String?) = apply { this.screenerId = screenerId } + + /** Alias for calling [Builder.screenerId] with `screenerId.orElse(null)`. */ + fun screenerId(screenerId: Optional) = screenerId(screenerId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [ScreenerGetScreenerByIdParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ScreenerGetScreenerByIdParams = + ScreenerGetScreenerByIdParams( + screenerId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> screenerId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerGetScreenerByIdParams && + screenerId == other.screenerId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(screenerId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "ScreenerGetScreenerByIdParams{screenerId=$screenerId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponse.kt new file mode 100644 index 00000000..31d0b119 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponse.kt @@ -0,0 +1,273 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class ScreenerGetScreenerByIdResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val metadata: JsonField, + private val error: JsonField, + private val data: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing data: JsonField = JsonMissing.of(), + ) : this(metadata, error, data, mutableMapOf()) + + fun toBaseResponse(): BaseResponse = + BaseResponse.builder().metadata(metadata).error(error).build() + + /** + * Response metadata, including the request ID and optional pagination info. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): ResponseMetadata = metadata.getRequired("metadata") + + /** + * Structured error details when the request is unsuccessful. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun error(): Optional = error.getOptional("error") + + /** + * A saved screener configuration entry + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): ScreenerEntry = data.getRequired("data") + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [error]. + * + * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField = data + + @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 + * [ScreenerGetScreenerByIdResponse]. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerGetScreenerByIdResponse]. */ + class Builder internal constructor() { + + private var metadata: JsonField? = null + private var error: JsonField = JsonMissing.of() + private var data: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(screenerGetScreenerByIdResponse: ScreenerGetScreenerByIdResponse) = + apply { + metadata = screenerGetScreenerByIdResponse.metadata + error = screenerGetScreenerByIdResponse.error + data = screenerGetScreenerByIdResponse.data + additionalProperties = + screenerGetScreenerByIdResponse.additionalProperties.toMutableMap() + } + + /** Response metadata, including the request ID and optional pagination info. */ + fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [ResponseMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** Structured error details when the request is unsuccessful. */ + fun error(error: ApiError?) = error(JsonField.ofNullable(error)) + + /** Alias for calling [Builder.error] with `error.orElse(null)`. */ + fun error(error: Optional) = error(error.getOrNull()) + + /** + * Sets [Builder.error] to an arbitrary JSON value. + * + * You should usually call [Builder.error] with a well-typed [ApiError] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun error(error: JsonField) = apply { this.error = error } + + /** A saved screener configuration entry */ + fun data(data: ScreenerEntry) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed [ScreenerEntry] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun data(data: JsonField) = apply { this.data = data } + + 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 [ScreenerGetScreenerByIdResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ScreenerGetScreenerByIdResponse = + ScreenerGetScreenerByIdResponse( + checkRequired("metadata", metadata), + error, + checkRequired("data", data), + 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(): ScreenerGetScreenerByIdResponse = apply { + if (validated) { + return@apply + } + + metadata().validate() + error().ifPresent { it.validate() } + data().validate() + 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 = + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (error.asKnown().getOrNull()?.validity() ?: 0) + + (data.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerGetScreenerByIdResponse && + metadata == other.metadata && + error == other.error && + data == other.data && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(metadata, error, data, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ScreenerGetScreenerByIdResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersParams.kt new file mode 100644 index 00000000..f4334872 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersParams.kt @@ -0,0 +1,176 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import java.util.Objects + +/** + * List saved screener configurations. + * + * Returns all screener configurations for the authenticated user. + */ +class ScreenerGetScreenersParams +private constructor( + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): ScreenerGetScreenersParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [ScreenerGetScreenersParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerGetScreenersParams]. */ + class Builder internal constructor() { + + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(screenerGetScreenersParams: ScreenerGetScreenersParams) = apply { + additionalHeaders = screenerGetScreenersParams.additionalHeaders.toBuilder() + additionalQueryParams = screenerGetScreenersParams.additionalQueryParams.toBuilder() + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [ScreenerGetScreenersParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ScreenerGetScreenersParams = + ScreenerGetScreenersParams(additionalHeaders.build(), additionalQueryParams.build()) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerGetScreenersParams && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) + + override fun toString() = + "ScreenerGetScreenersParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponse.kt new file mode 100644 index 00000000..7eb26d62 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponse.kt @@ -0,0 +1,285 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class ScreenerGetScreenersResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val metadata: JsonField, + private val error: JsonField, + private val data: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + ) : this(metadata, error, data, mutableMapOf()) + + fun toBaseResponse(): BaseResponse = + BaseResponse.builder().metadata(metadata).error(error).build() + + /** + * Response metadata, including the request ID and optional pagination info. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): ResponseMetadata = metadata.getRequired("metadata") + + /** + * Structured error details when the request is unsuccessful. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun error(): Optional = error.getOptional("error") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [error]. + * + * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + @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 [ScreenerGetScreenersResponse]. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerGetScreenersResponse]. */ + class Builder internal constructor() { + + private var metadata: JsonField? = null + private var error: JsonField = JsonMissing.of() + private var data: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(screenerGetScreenersResponse: ScreenerGetScreenersResponse) = apply { + metadata = screenerGetScreenersResponse.metadata + error = screenerGetScreenersResponse.error + data = screenerGetScreenersResponse.data.map { it.toMutableList() } + additionalProperties = screenerGetScreenersResponse.additionalProperties.toMutableMap() + } + + /** Response metadata, including the request ID and optional pagination info. */ + fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [ResponseMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** Structured error details when the request is unsuccessful. */ + fun error(error: ApiError?) = error(JsonField.ofNullable(error)) + + /** Alias for calling [Builder.error] with `error.orElse(null)`. */ + fun error(error: Optional) = error(error.getOrNull()) + + /** + * Sets [Builder.error] to an arbitrary JSON value. + * + * You should usually call [Builder.error] with a well-typed [ApiError] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun error(error: JsonField) = apply { this.error = error } + + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [ScreenerEntry] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: ScreenerEntry) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + 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 [ScreenerGetScreenersResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ScreenerGetScreenersResponse = + ScreenerGetScreenersResponse( + checkRequired("metadata", metadata), + error, + checkRequired("data", data).map { it.toImmutable() }, + 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(): ScreenerGetScreenersResponse = apply { + if (validated) { + return@apply + } + + metadata().validate() + error().ifPresent { it.validate() } + data().forEach { it.validate() } + 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 = + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (error.asKnown().getOrNull()?.validity() ?: 0) + + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerGetScreenersResponse && + metadata == other.metadata && + error == other.error && + data == other.data && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(metadata, error, data, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ScreenerGetScreenersResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParams.kt new file mode 100644 index 00000000..f590d6b0 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParams.kt @@ -0,0 +1,830 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Update a saved screener configuration. + * + * Replaces the screener configuration for the authenticated user. If `name` is null, the existing + * name is preserved. + */ +class ScreenerReplaceScreenerParams +private constructor( + private val screenerId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun screenerId(): Optional = Optional.ofNullable(screenerId) + + /** + * Structured field references to include when running this screener + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun columns(): Optional> = body.columns() + + /** + * Deprecated: use `columns` instead. Ignored when `columns` is provided. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") fun fieldFilter(): Optional> = body.fieldFilter() + + /** + * Structured search filter criteria + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun filters(): Optional> = body.filters() + + /** + * The name for this screener configuration + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = body.name() + + /** + * Multi-field sort specifications + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun sorts(): Optional> = body.sorts() + + /** + * Returns the raw JSON value of [columns]. + * + * Unlike [columns], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _columns(): JsonField> = body._columns() + + /** + * Returns the raw JSON value of [fieldFilter]. + * + * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") fun _fieldFilter(): JsonField> = body._fieldFilter() + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _filters(): JsonField> = body._filters() + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _name(): JsonField = body._name() + + /** + * Returns the raw JSON value of [sorts]. + * + * Unlike [sorts], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _sorts(): JsonField> = body._sorts() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): ScreenerReplaceScreenerParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [ScreenerReplaceScreenerParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerReplaceScreenerParams]. */ + class Builder internal constructor() { + + private var screenerId: String? = null + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(screenerReplaceScreenerParams: ScreenerReplaceScreenerParams) = apply { + screenerId = screenerReplaceScreenerParams.screenerId + body = screenerReplaceScreenerParams.body.toBuilder() + additionalHeaders = screenerReplaceScreenerParams.additionalHeaders.toBuilder() + additionalQueryParams = screenerReplaceScreenerParams.additionalQueryParams.toBuilder() + } + + fun screenerId(screenerId: String?) = apply { this.screenerId = screenerId } + + /** Alias for calling [Builder.screenerId] with `screenerId.orElse(null)`. */ + fun screenerId(screenerId: Optional) = screenerId(screenerId.getOrNull()) + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [columns] + * - [fieldFilter] + * - [filters] + * - [name] + * - [sorts] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** Structured field references to include when running this screener */ + fun columns(columns: List?) = apply { body.columns(columns) } + + /** Alias for calling [Builder.columns] with `columns.orElse(null)`. */ + fun columns(columns: Optional>) = columns(columns.getOrNull()) + + /** + * Sets [Builder.columns] to an arbitrary JSON value. + * + * You should usually call [Builder.columns] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun columns(columns: JsonField>) = apply { body.columns(columns) } + + /** + * Adds a single [FieldRef] to [columns]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addColumn(column: FieldRef) = apply { body.addColumn(column) } + + /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: List?) = apply { body.fieldFilter(fieldFilter) } + + /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: Optional>) = + fieldFilter(fieldFilter.getOrNull()) + + /** + * Sets [Builder.fieldFilter] to an arbitrary JSON value. + * + * You should usually call [Builder.fieldFilter] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: JsonField>) = apply { + body.fieldFilter(fieldFilter) + } + + /** + * Adds a single [FieldRef] to [Builder.fieldFilter]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + @Deprecated("deprecated") + fun addFieldFilter(fieldFilter: FieldRef) = apply { body.addFieldFilter(fieldFilter) } + + /** Structured search filter criteria */ + fun filters(filters: List?) = apply { body.filters(filters) } + + /** Alias for calling [Builder.filters] with `filters.orElse(null)`. */ + fun filters(filters: Optional>) = filters(filters.getOrNull()) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun filters(filters: JsonField>) = apply { body.filters(filters) } + + /** + * Adds a single [SearchFilter] to [filters]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFilter(filter: SearchFilter) = apply { body.addFilter(filter) } + + /** The name for this screener configuration */ + fun name(name: String?) = apply { body.name(name) } + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { body.name(name) } + + /** Multi-field sort specifications */ + fun sorts(sorts: List?) = apply { body.sorts(sorts) } + + /** Alias for calling [Builder.sorts] with `sorts.orElse(null)`. */ + fun sorts(sorts: Optional>) = sorts(sorts.getOrNull()) + + /** + * Sets [Builder.sorts] to an arbitrary JSON value. + * + * You should usually call [Builder.sorts] with a well-typed `List` value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun sorts(sorts: JsonField>) = apply { body.sorts(sorts) } + + /** + * Adds a single [SortSpec] to [sorts]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addSort(sort: SortSpec) = apply { body.addSort(sort) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [ScreenerReplaceScreenerParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ScreenerReplaceScreenerParams = + ScreenerReplaceScreenerParams( + screenerId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> screenerId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + /** Request body for creating or updating a saved screener configuration */ + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val columns: JsonField>, + private val fieldFilter: JsonField>, + private val filters: JsonField>, + private val name: JsonField, + private val sorts: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("columns") + @ExcludeMissing + columns: JsonField> = JsonMissing.of(), + @JsonProperty("field_filter") + @ExcludeMissing + fieldFilter: JsonField> = JsonMissing.of(), + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField> = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("sorts") + @ExcludeMissing + sorts: JsonField> = JsonMissing.of(), + ) : this(columns, fieldFilter, filters, name, sorts, mutableMapOf()) + + /** + * Structured field references to include when running this screener + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun columns(): Optional> = columns.getOptional("columns") + + /** + * Deprecated: use `columns` instead. Ignored when `columns` is provided. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + @Deprecated("deprecated") + fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") + + /** + * Structured search filter criteria + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun filters(): Optional> = filters.getOptional("filters") + + /** + * The name for this screener configuration + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * Multi-field sort specifications + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun sorts(): Optional> = sorts.getOptional("sorts") + + /** + * Returns the raw JSON value of [columns]. + * + * Unlike [columns], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns + + /** + * Returns the raw JSON value of [fieldFilter]. + * + * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") + @JsonProperty("field_filter") + @ExcludeMissing + fun _fieldFilter(): JsonField> = fieldFilter + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") + @ExcludeMissing + fun _filters(): JsonField> = filters + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [sorts]. + * + * Unlike [sorts], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("sorts") @ExcludeMissing fun _sorts(): JsonField> = sorts + + @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 [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var columns: JsonField>? = null + private var fieldFilter: JsonField>? = null + private var filters: JsonField>? = null + private var name: JsonField = JsonMissing.of() + private var sorts: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + columns = body.columns.map { it.toMutableList() } + fieldFilter = body.fieldFilter.map { it.toMutableList() } + filters = body.filters.map { it.toMutableList() } + name = body.name + sorts = body.sorts.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** Structured field references to include when running this screener */ + fun columns(columns: List?) = columns(JsonField.ofNullable(columns)) + + /** Alias for calling [Builder.columns] with `columns.orElse(null)`. */ + fun columns(columns: Optional>) = columns(columns.getOrNull()) + + /** + * Sets [Builder.columns] to an arbitrary JSON value. + * + * You should usually call [Builder.columns] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun columns(columns: JsonField>) = apply { + this.columns = columns.map { it.toMutableList() } + } + + /** + * Adds a single [FieldRef] to [columns]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addColumn(column: FieldRef) = apply { + columns = + (columns ?: JsonField.of(mutableListOf())).also { + checkKnown("columns", it).add(column) + } + } + + /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: List?) = + fieldFilter(JsonField.ofNullable(fieldFilter)) + + /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: Optional>) = + fieldFilter(fieldFilter.getOrNull()) + + /** + * Sets [Builder.fieldFilter] to an arbitrary JSON value. + * + * You should usually call [Builder.fieldFilter] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: JsonField>) = apply { + this.fieldFilter = fieldFilter.map { it.toMutableList() } + } + + /** + * Adds a single [FieldRef] to [Builder.fieldFilter]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + @Deprecated("deprecated") + fun addFieldFilter(fieldFilter: FieldRef) = apply { + this.fieldFilter = + (this.fieldFilter ?: JsonField.of(mutableListOf())).also { + checkKnown("fieldFilter", it).add(fieldFilter) + } + } + + /** Structured search filter criteria */ + fun filters(filters: List?) = filters(JsonField.ofNullable(filters)) + + /** Alias for calling [Builder.filters] with `filters.orElse(null)`. */ + fun filters(filters: Optional>) = filters(filters.getOrNull()) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun filters(filters: JsonField>) = apply { + this.filters = filters.map { it.toMutableList() } + } + + /** + * Adds a single [SearchFilter] to [filters]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFilter(filter: SearchFilter) = apply { + filters = + (filters ?: JsonField.of(mutableListOf())).also { + checkKnown("filters", it).add(filter) + } + } + + /** The name for this screener configuration */ + fun name(name: String?) = name(JsonField.ofNullable(name)) + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Multi-field sort specifications */ + fun sorts(sorts: List?) = sorts(JsonField.ofNullable(sorts)) + + /** Alias for calling [Builder.sorts] with `sorts.orElse(null)`. */ + fun sorts(sorts: Optional>) = sorts(sorts.getOrNull()) + + /** + * Sets [Builder.sorts] to an arbitrary JSON value. + * + * You should usually call [Builder.sorts] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sorts(sorts: JsonField>) = apply { + this.sorts = sorts.map { it.toMutableList() } + } + + /** + * Adds a single [SortSpec] to [sorts]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addSort(sort: SortSpec) = apply { + sorts = + (sorts ?: JsonField.of(mutableListOf())).also { + checkKnown("sorts", it).add(sort) + } + } + + 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = + Body( + (columns ?: JsonMissing.of()).map { it.toImmutable() }, + (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, + (filters ?: JsonMissing.of()).map { it.toImmutable() }, + name, + (sorts ?: JsonMissing.of()).map { it.toImmutable() }, + 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(): Body = apply { + if (validated) { + return@apply + } + + columns().ifPresent { it.forEach { it.validate() } } + fieldFilter().ifPresent { it.forEach { it.validate() } } + filters().ifPresent { it.forEach { it.validate() } } + name() + sorts().ifPresent { it.forEach { it.validate() } } + 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 = + (columns.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (fieldFilter.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (sorts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + columns == other.columns && + fieldFilter == other.fieldFilter && + filters == other.filters && + name == other.name && + sorts == other.sorts && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(columns, fieldFilter, filters, name, sorts, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{columns=$columns, fieldFilter=$fieldFilter, filters=$filters, name=$name, sorts=$sorts, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerReplaceScreenerParams && + screenerId == other.screenerId && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(screenerId, body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "ScreenerReplaceScreenerParams{screenerId=$screenerId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponse.kt new file mode 100644 index 00000000..78815ead --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponse.kt @@ -0,0 +1,273 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class ScreenerReplaceScreenerResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val metadata: JsonField, + private val error: JsonField, + private val data: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), + @JsonProperty("data") @ExcludeMissing data: JsonField = JsonMissing.of(), + ) : this(metadata, error, data, mutableMapOf()) + + fun toBaseResponse(): BaseResponse = + BaseResponse.builder().metadata(metadata).error(error).build() + + /** + * Response metadata, including the request ID and optional pagination info. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): ResponseMetadata = metadata.getRequired("metadata") + + /** + * Structured error details when the request is unsuccessful. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun error(): Optional = error.getOptional("error") + + /** + * A saved screener configuration entry + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): ScreenerEntry = data.getRequired("data") + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [error]. + * + * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField = data + + @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 + * [ScreenerReplaceScreenerResponse]. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerReplaceScreenerResponse]. */ + class Builder internal constructor() { + + private var metadata: JsonField? = null + private var error: JsonField = JsonMissing.of() + private var data: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(screenerReplaceScreenerResponse: ScreenerReplaceScreenerResponse) = + apply { + metadata = screenerReplaceScreenerResponse.metadata + error = screenerReplaceScreenerResponse.error + data = screenerReplaceScreenerResponse.data + additionalProperties = + screenerReplaceScreenerResponse.additionalProperties.toMutableMap() + } + + /** Response metadata, including the request ID and optional pagination info. */ + fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [ResponseMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** Structured error details when the request is unsuccessful. */ + fun error(error: ApiError?) = error(JsonField.ofNullable(error)) + + /** Alias for calling [Builder.error] with `error.orElse(null)`. */ + fun error(error: Optional) = error(error.getOrNull()) + + /** + * Sets [Builder.error] to an arbitrary JSON value. + * + * You should usually call [Builder.error] with a well-typed [ApiError] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun error(error: JsonField) = apply { this.error = error } + + /** A saved screener configuration entry */ + fun data(data: ScreenerEntry) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed [ScreenerEntry] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun data(data: JsonField) = apply { this.data = data } + + 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 [ScreenerReplaceScreenerResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ScreenerReplaceScreenerResponse = + ScreenerReplaceScreenerResponse( + checkRequired("metadata", metadata), + error, + checkRequired("data", data), + 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(): ScreenerReplaceScreenerResponse = apply { + if (validated) { + return@apply + } + + metadata().validate() + error().ifPresent { it.validate() } + data().validate() + 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 = + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (error.asKnown().getOrNull()?.validity() ?: 0) + + (data.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerReplaceScreenerResponse && + metadata == other.metadata && + error == other.error && + data == other.data && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(metadata, error, data, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ScreenerReplaceScreenerResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParams.kt new file mode 100644 index 00000000..d2d0d668 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParams.kt @@ -0,0 +1,1028 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.Params +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.http.Headers +import com.clearstreet.api.core.http.QueryParams +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * Search instruments using structured filters. + * + * Returns a columnar response where each row is an array of column objects. Each column contains a + * human-readable name, a field reference, an optional type hint (e.g. `CURR_USD`, `PERCENT`), and + * the value. + * + * Use `columns` to select which columns appear in each row. When omitted, the default field set is + * returned. + */ +class ScreenerSearchScreenerParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * Subset of fields to include in the response. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun columns(): Optional> = body.columns() + + /** + * Deprecated: use `columns` instead. Ignored when `columns` is provided. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") fun fieldFilter(): Optional> = body.fieldFilter() + + /** + * Filter conditions to apply. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun filters(): Optional> = body.filters() + + /** + * The number of items to return per page (only used when page_token is not provided) + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun pageSize(): Optional = body.pageSize() + + /** + * Token for retrieving the next page of results. Contains encoded pagination state (limit + + * offset). When provided, page_size is ignored. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun pageToken(): Optional = body.pageToken() + + /** + * Whether string sorts should be case-sensitive (default: false). + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun sortCaseSensitive(): Optional = body.sortCaseSensitive() + + /** + * Multi-field sort specifications. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun sorts(): Optional> = body.sorts() + + /** + * Returns the raw JSON value of [columns]. + * + * Unlike [columns], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _columns(): JsonField> = body._columns() + + /** + * Returns the raw JSON value of [fieldFilter]. + * + * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") fun _fieldFilter(): JsonField> = body._fieldFilter() + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _filters(): JsonField> = body._filters() + + /** + * Returns the raw JSON value of [pageSize]. + * + * Unlike [pageSize], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _pageSize(): JsonField = body._pageSize() + + /** + * Returns the raw JSON value of [pageToken]. + * + * Unlike [pageToken], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _pageToken(): JsonField = body._pageToken() + + /** + * Returns the raw JSON value of [sortCaseSensitive]. + * + * Unlike [sortCaseSensitive], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _sortCaseSensitive(): JsonField = body._sortCaseSensitive() + + /** + * Returns the raw JSON value of [sorts]. + * + * Unlike [sorts], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _sorts(): JsonField> = body._sorts() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): ScreenerSearchScreenerParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [ScreenerSearchScreenerParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerSearchScreenerParams]. */ + class Builder internal constructor() { + + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(screenerSearchScreenerParams: ScreenerSearchScreenerParams) = apply { + body = screenerSearchScreenerParams.body.toBuilder() + additionalHeaders = screenerSearchScreenerParams.additionalHeaders.toBuilder() + additionalQueryParams = screenerSearchScreenerParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [columns] + * - [fieldFilter] + * - [filters] + * - [pageSize] + * - [pageToken] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** Subset of fields to include in the response. */ + fun columns(columns: List?) = apply { body.columns(columns) } + + /** Alias for calling [Builder.columns] with `columns.orElse(null)`. */ + fun columns(columns: Optional>) = columns(columns.getOrNull()) + + /** + * Sets [Builder.columns] to an arbitrary JSON value. + * + * You should usually call [Builder.columns] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun columns(columns: JsonField>) = apply { body.columns(columns) } + + /** + * Adds a single [FieldRef] to [columns]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addColumn(column: FieldRef) = apply { body.addColumn(column) } + + /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: List?) = apply { body.fieldFilter(fieldFilter) } + + /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: Optional>) = + fieldFilter(fieldFilter.getOrNull()) + + /** + * Sets [Builder.fieldFilter] to an arbitrary JSON value. + * + * You should usually call [Builder.fieldFilter] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: JsonField>) = apply { + body.fieldFilter(fieldFilter) + } + + /** + * Adds a single [FieldRef] to [Builder.fieldFilter]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + @Deprecated("deprecated") + fun addFieldFilter(fieldFilter: FieldRef) = apply { body.addFieldFilter(fieldFilter) } + + /** Filter conditions to apply. */ + fun filters(filters: List?) = apply { body.filters(filters) } + + /** Alias for calling [Builder.filters] with `filters.orElse(null)`. */ + fun filters(filters: Optional>) = filters(filters.getOrNull()) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun filters(filters: JsonField>) = apply { body.filters(filters) } + + /** + * Adds a single [SearchFilter] to [filters]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFilter(filter: SearchFilter) = apply { body.addFilter(filter) } + + /** The number of items to return per page (only used when page_token is not provided) */ + fun pageSize(pageSize: Long?) = apply { body.pageSize(pageSize) } + + /** + * Alias for [Builder.pageSize]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun pageSize(pageSize: Long) = pageSize(pageSize as Long?) + + /** Alias for calling [Builder.pageSize] with `pageSize.orElse(null)`. */ + fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) + + /** + * Sets [Builder.pageSize] to an arbitrary JSON value. + * + * You should usually call [Builder.pageSize] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun pageSize(pageSize: JsonField) = apply { body.pageSize(pageSize) } + + /** + * Token for retrieving the next page of results. Contains encoded pagination state (limit + + * offset). When provided, page_size is ignored. + */ + fun pageToken(pageToken: String?) = apply { body.pageToken(pageToken) } + + /** Alias for calling [Builder.pageToken] with `pageToken.orElse(null)`. */ + fun pageToken(pageToken: Optional) = pageToken(pageToken.getOrNull()) + + /** + * Sets [Builder.pageToken] to an arbitrary JSON value. + * + * You should usually call [Builder.pageToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun pageToken(pageToken: JsonField) = apply { body.pageToken(pageToken) } + + /** Whether string sorts should be case-sensitive (default: false). */ + fun sortCaseSensitive(sortCaseSensitive: Boolean?) = apply { + body.sortCaseSensitive(sortCaseSensitive) + } + + /** + * Alias for [Builder.sortCaseSensitive]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun sortCaseSensitive(sortCaseSensitive: Boolean) = + sortCaseSensitive(sortCaseSensitive as Boolean?) + + /** Alias for calling [Builder.sortCaseSensitive] with `sortCaseSensitive.orElse(null)`. */ + fun sortCaseSensitive(sortCaseSensitive: Optional) = + sortCaseSensitive(sortCaseSensitive.getOrNull()) + + /** + * Sets [Builder.sortCaseSensitive] to an arbitrary JSON value. + * + * You should usually call [Builder.sortCaseSensitive] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sortCaseSensitive(sortCaseSensitive: JsonField) = apply { + body.sortCaseSensitive(sortCaseSensitive) + } + + /** Multi-field sort specifications. */ + fun sorts(sorts: List?) = apply { body.sorts(sorts) } + + /** Alias for calling [Builder.sorts] with `sorts.orElse(null)`. */ + fun sorts(sorts: Optional>) = sorts(sorts.getOrNull()) + + /** + * Sets [Builder.sorts] to an arbitrary JSON value. + * + * You should usually call [Builder.sorts] with a well-typed `List` value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun sorts(sorts: JsonField>) = apply { body.sorts(sorts) } + + /** + * Adds a single [SortSpec] to [sorts]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addSort(sort: SortSpec) = apply { body.addSort(sort) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [ScreenerSearchScreenerParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ScreenerSearchScreenerParams = + ScreenerSearchScreenerParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + /** Request body for POST /screener. */ + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val columns: JsonField>, + private val fieldFilter: JsonField>, + private val filters: JsonField>, + private val pageSize: JsonField, + private val pageToken: JsonField, + private val sortCaseSensitive: JsonField, + private val sorts: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("columns") + @ExcludeMissing + columns: JsonField> = JsonMissing.of(), + @JsonProperty("field_filter") + @ExcludeMissing + fieldFilter: JsonField> = JsonMissing.of(), + @JsonProperty("filters") + @ExcludeMissing + filters: JsonField> = JsonMissing.of(), + @JsonProperty("page_size") @ExcludeMissing pageSize: JsonField = JsonMissing.of(), + @JsonProperty("page_token") + @ExcludeMissing + pageToken: JsonField = JsonMissing.of(), + @JsonProperty("sort_case_sensitive") + @ExcludeMissing + sortCaseSensitive: JsonField = JsonMissing.of(), + @JsonProperty("sorts") + @ExcludeMissing + sorts: JsonField> = JsonMissing.of(), + ) : this( + columns, + fieldFilter, + filters, + pageSize, + pageToken, + sortCaseSensitive, + sorts, + mutableMapOf(), + ) + + /** + * Subset of fields to include in the response. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun columns(): Optional> = columns.getOptional("columns") + + /** + * Deprecated: use `columns` instead. Ignored when `columns` is provided. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + @Deprecated("deprecated") + fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") + + /** + * Filter conditions to apply. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun filters(): Optional> = filters.getOptional("filters") + + /** + * The number of items to return per page (only used when page_token is not provided) + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun pageSize(): Optional = pageSize.getOptional("page_size") + + /** + * Token for retrieving the next page of results. Contains encoded pagination state (limit + + * offset). When provided, page_size is ignored. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun pageToken(): Optional = pageToken.getOptional("page_token") + + /** + * Whether string sorts should be case-sensitive (default: false). + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun sortCaseSensitive(): Optional = + sortCaseSensitive.getOptional("sort_case_sensitive") + + /** + * Multi-field sort specifications. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun sorts(): Optional> = sorts.getOptional("sorts") + + /** + * Returns the raw JSON value of [columns]. + * + * Unlike [columns], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns + + /** + * Returns the raw JSON value of [fieldFilter]. + * + * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. + */ + @Deprecated("deprecated") + @JsonProperty("field_filter") + @ExcludeMissing + fun _fieldFilter(): JsonField> = fieldFilter + + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") + @ExcludeMissing + fun _filters(): JsonField> = filters + + /** + * Returns the raw JSON value of [pageSize]. + * + * Unlike [pageSize], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("page_size") @ExcludeMissing fun _pageSize(): JsonField = pageSize + + /** + * Returns the raw JSON value of [pageToken]. + * + * Unlike [pageToken], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("page_token") @ExcludeMissing fun _pageToken(): JsonField = pageToken + + /** + * Returns the raw JSON value of [sortCaseSensitive]. + * + * Unlike [sortCaseSensitive], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("sort_case_sensitive") + @ExcludeMissing + fun _sortCaseSensitive(): JsonField = sortCaseSensitive + + /** + * Returns the raw JSON value of [sorts]. + * + * Unlike [sorts], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("sorts") @ExcludeMissing fun _sorts(): JsonField> = sorts + + @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 [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var columns: JsonField>? = null + private var fieldFilter: JsonField>? = null + private var filters: JsonField>? = null + private var pageSize: JsonField = JsonMissing.of() + private var pageToken: JsonField = JsonMissing.of() + private var sortCaseSensitive: JsonField = JsonMissing.of() + private var sorts: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + columns = body.columns.map { it.toMutableList() } + fieldFilter = body.fieldFilter.map { it.toMutableList() } + filters = body.filters.map { it.toMutableList() } + pageSize = body.pageSize + pageToken = body.pageToken + sortCaseSensitive = body.sortCaseSensitive + sorts = body.sorts.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** Subset of fields to include in the response. */ + fun columns(columns: List?) = columns(JsonField.ofNullable(columns)) + + /** Alias for calling [Builder.columns] with `columns.orElse(null)`. */ + fun columns(columns: Optional>) = columns(columns.getOrNull()) + + /** + * Sets [Builder.columns] to an arbitrary JSON value. + * + * You should usually call [Builder.columns] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun columns(columns: JsonField>) = apply { + this.columns = columns.map { it.toMutableList() } + } + + /** + * Adds a single [FieldRef] to [columns]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addColumn(column: FieldRef) = apply { + columns = + (columns ?: JsonField.of(mutableListOf())).also { + checkKnown("columns", it).add(column) + } + } + + /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: List?) = + fieldFilter(JsonField.ofNullable(fieldFilter)) + + /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: Optional>) = + fieldFilter(fieldFilter.getOrNull()) + + /** + * Sets [Builder.fieldFilter] to an arbitrary JSON value. + * + * You should usually call [Builder.fieldFilter] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + @Deprecated("deprecated") + fun fieldFilter(fieldFilter: JsonField>) = apply { + this.fieldFilter = fieldFilter.map { it.toMutableList() } + } + + /** + * Adds a single [FieldRef] to [Builder.fieldFilter]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + @Deprecated("deprecated") + fun addFieldFilter(fieldFilter: FieldRef) = apply { + this.fieldFilter = + (this.fieldFilter ?: JsonField.of(mutableListOf())).also { + checkKnown("fieldFilter", it).add(fieldFilter) + } + } + + /** Filter conditions to apply. */ + fun filters(filters: List?) = filters(JsonField.ofNullable(filters)) + + /** Alias for calling [Builder.filters] with `filters.orElse(null)`. */ + fun filters(filters: Optional>) = filters(filters.getOrNull()) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun filters(filters: JsonField>) = apply { + this.filters = filters.map { it.toMutableList() } + } + + /** + * Adds a single [SearchFilter] to [filters]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFilter(filter: SearchFilter) = apply { + filters = + (filters ?: JsonField.of(mutableListOf())).also { + checkKnown("filters", it).add(filter) + } + } + + /** + * The number of items to return per page (only used when page_token is not provided) + */ + fun pageSize(pageSize: Long?) = pageSize(JsonField.ofNullable(pageSize)) + + /** + * Alias for [Builder.pageSize]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun pageSize(pageSize: Long) = pageSize(pageSize as Long?) + + /** Alias for calling [Builder.pageSize] with `pageSize.orElse(null)`. */ + fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) + + /** + * Sets [Builder.pageSize] to an arbitrary JSON value. + * + * You should usually call [Builder.pageSize] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pageSize(pageSize: JsonField) = apply { this.pageSize = pageSize } + + /** + * Token for retrieving the next page of results. Contains encoded pagination state + * (limit + offset). When provided, page_size is ignored. + */ + fun pageToken(pageToken: String?) = pageToken(JsonField.ofNullable(pageToken)) + + /** Alias for calling [Builder.pageToken] with `pageToken.orElse(null)`. */ + fun pageToken(pageToken: Optional) = pageToken(pageToken.getOrNull()) + + /** + * Sets [Builder.pageToken] to an arbitrary JSON value. + * + * You should usually call [Builder.pageToken] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pageToken(pageToken: JsonField) = apply { this.pageToken = pageToken } + + /** Whether string sorts should be case-sensitive (default: false). */ + fun sortCaseSensitive(sortCaseSensitive: Boolean?) = + sortCaseSensitive(JsonField.ofNullable(sortCaseSensitive)) + + /** + * Alias for [Builder.sortCaseSensitive]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun sortCaseSensitive(sortCaseSensitive: Boolean) = + sortCaseSensitive(sortCaseSensitive as Boolean?) + + /** + * Alias for calling [Builder.sortCaseSensitive] with `sortCaseSensitive.orElse(null)`. + */ + fun sortCaseSensitive(sortCaseSensitive: Optional) = + sortCaseSensitive(sortCaseSensitive.getOrNull()) + + /** + * Sets [Builder.sortCaseSensitive] to an arbitrary JSON value. + * + * You should usually call [Builder.sortCaseSensitive] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sortCaseSensitive(sortCaseSensitive: JsonField) = apply { + this.sortCaseSensitive = sortCaseSensitive + } + + /** Multi-field sort specifications. */ + fun sorts(sorts: List?) = sorts(JsonField.ofNullable(sorts)) + + /** Alias for calling [Builder.sorts] with `sorts.orElse(null)`. */ + fun sorts(sorts: Optional>) = sorts(sorts.getOrNull()) + + /** + * Sets [Builder.sorts] to an arbitrary JSON value. + * + * You should usually call [Builder.sorts] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sorts(sorts: JsonField>) = apply { + this.sorts = sorts.map { it.toMutableList() } + } + + /** + * Adds a single [SortSpec] to [sorts]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addSort(sort: SortSpec) = apply { + sorts = + (sorts ?: JsonField.of(mutableListOf())).also { + checkKnown("sorts", it).add(sort) + } + } + + 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = + Body( + (columns ?: JsonMissing.of()).map { it.toImmutable() }, + (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, + (filters ?: JsonMissing.of()).map { it.toImmutable() }, + pageSize, + pageToken, + sortCaseSensitive, + (sorts ?: JsonMissing.of()).map { it.toImmutable() }, + 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(): Body = apply { + if (validated) { + return@apply + } + + columns().ifPresent { it.forEach { it.validate() } } + fieldFilter().ifPresent { it.forEach { it.validate() } } + filters().ifPresent { it.forEach { it.validate() } } + pageSize() + pageToken() + sortCaseSensitive() + sorts().ifPresent { it.forEach { it.validate() } } + 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 = + (columns.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (fieldFilter.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (pageSize.asKnown().isPresent) 1 else 0) + + (if (pageToken.asKnown().isPresent) 1 else 0) + + (if (sortCaseSensitive.asKnown().isPresent) 1 else 0) + + (sorts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + columns == other.columns && + fieldFilter == other.fieldFilter && + filters == other.filters && + pageSize == other.pageSize && + pageToken == other.pageToken && + sortCaseSensitive == other.sortCaseSensitive && + sorts == other.sorts && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + columns, + fieldFilter, + filters, + pageSize, + pageToken, + sortCaseSensitive, + sorts, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{columns=$columns, fieldFilter=$fieldFilter, filters=$filters, pageSize=$pageSize, pageToken=$pageToken, sortCaseSensitive=$sortCaseSensitive, sorts=$sorts, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerSearchScreenerParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "ScreenerSearchScreenerParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerResponse.kt new file mode 100644 index 00000000..6eb888a9 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerResponse.kt @@ -0,0 +1,287 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.BaseResponse +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class ScreenerSearchScreenerResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val metadata: JsonField, + private val error: JsonField, + private val data: JsonField>>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + metadata: JsonField = JsonMissing.of(), + @JsonProperty("error") @ExcludeMissing error: JsonField = JsonMissing.of(), + @JsonProperty("data") + @ExcludeMissing + data: JsonField>> = JsonMissing.of(), + ) : this(metadata, error, data, mutableMapOf()) + + fun toBaseResponse(): BaseResponse = + BaseResponse.builder().metadata(metadata).error(error).build() + + /** + * Response metadata, including the request ID and optional pagination info. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun metadata(): ResponseMetadata = metadata.getRequired("metadata") + + /** + * Structured error details when the request is unsuccessful. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun error(): Optional = error.getOptional("error") + + /** + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List> = data.getRequired("data") + + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + /** + * Returns the raw JSON value of [error]. + * + * Unlike [error], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("error") @ExcludeMissing fun _error(): JsonField = error + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField>> = data + + @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 + * [ScreenerSearchScreenerResponse]. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScreenerSearchScreenerResponse]. */ + class Builder internal constructor() { + + private var metadata: JsonField? = null + private var error: JsonField = JsonMissing.of() + private var data: JsonField>>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(screenerSearchScreenerResponse: ScreenerSearchScreenerResponse) = apply { + metadata = screenerSearchScreenerResponse.metadata + error = screenerSearchScreenerResponse.error + data = screenerSearchScreenerResponse.data.map { it.toMutableList() } + additionalProperties = + screenerSearchScreenerResponse.additionalProperties.toMutableMap() + } + + /** Response metadata, including the request ID and optional pagination info. */ + fun metadata(metadata: ResponseMetadata) = metadata(JsonField.of(metadata)) + + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [ResponseMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } + + /** Structured error details when the request is unsuccessful. */ + fun error(error: ApiError?) = error(JsonField.ofNullable(error)) + + /** Alias for calling [Builder.error] with `error.orElse(null)`. */ + fun error(error: Optional) = error(error.getOrNull()) + + /** + * Sets [Builder.error] to an arbitrary JSON value. + * + * You should usually call [Builder.error] with a well-typed [ApiError] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun error(error: JsonField) = apply { this.error = error } + + fun data(data: List>) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List>` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun data(data: JsonField>>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [List] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: List) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + 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 [ScreenerSearchScreenerResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .metadata() + * .data() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ScreenerSearchScreenerResponse = + ScreenerSearchScreenerResponse( + checkRequired("metadata", metadata), + error, + checkRequired("data", data).map { it.toImmutable() }, + 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(): ScreenerSearchScreenerResponse = apply { + if (validated) { + return@apply + } + + metadata().validate() + error().ifPresent { it.validate() } + data().forEach { it.forEach { it.validate() } } + 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 = + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (error.asKnown().getOrNull()?.validity() ?: 0) + + (data.asKnown().getOrNull()?.sumOf { it.sumOf { it.validity().toInt() }.toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ScreenerSearchScreenerResponse && + metadata == other.metadata && + error == other.error && + data == other.data && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(metadata, error, data, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ScreenerSearchScreenerResponse{metadata=$metadata, error=$error, data=$data, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/SearchFilter.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/SearchFilter.kt new file mode 100644 index 00000000..cc5fad56 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/SearchFilter.kt @@ -0,0 +1,287 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkKnown +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.toImmutable +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * A single filter condition. + * + * When `op` and `right` are both absent, the filter is "unenabled": it persists a `left` field + * reference without applying any predicate. Unenabled filters are skipped during search execution + * but still round-trip through save/load so callers can preserve draft state. + */ +class SearchFilter +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val left: JsonField, + private val op: JsonField, + private val right: JsonField>, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("left") @ExcludeMissing left: JsonField = JsonMissing.of(), + @JsonProperty("op") @ExcludeMissing op: JsonField = JsonMissing.of(), + @JsonProperty("right") + @ExcludeMissing + right: JsonField> = JsonMissing.of(), + ) : this(left, op, right, mutableMapOf()) + + /** + * The field to filter on. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun left(): FieldRef = left.getRequired("left") + + /** + * The operator and optional arguments. Omit together with `right` for an unenabled filter. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun op(): Optional = op.getOptional("op") + + /** + * The value(s) to compare against. Omit together with `op` for an unenabled filter. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun right(): Optional> = right.getOptional("right") + + /** + * Returns the raw JSON value of [left]. + * + * Unlike [left], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("left") @ExcludeMissing fun _left(): JsonField = left + + /** + * Returns the raw JSON value of [op]. + * + * Unlike [op], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("op") @ExcludeMissing fun _op(): JsonField = op + + /** + * Returns the raw JSON value of [right]. + * + * Unlike [right], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("right") @ExcludeMissing fun _right(): JsonField> = right + + @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 [SearchFilter]. + * + * The following fields are required: + * ```java + * .left() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [SearchFilter]. */ + class Builder internal constructor() { + + private var left: JsonField? = null + private var op: JsonField = JsonMissing.of() + private var right: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(searchFilter: SearchFilter) = apply { + left = searchFilter.left + op = searchFilter.op + right = searchFilter.right.map { it.toMutableList() } + additionalProperties = searchFilter.additionalProperties.toMutableMap() + } + + /** The field to filter on. */ + fun left(left: FieldRef) = left(JsonField.of(left)) + + /** + * Sets [Builder.left] to an arbitrary JSON value. + * + * You should usually call [Builder.left] with a well-typed [FieldRef] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun left(left: JsonField) = apply { this.left = left } + + /** + * The operator and optional arguments. Omit together with `right` for an unenabled filter. + */ + fun op(op: FilterOpSpec?) = op(JsonField.ofNullable(op)) + + /** Alias for calling [Builder.op] with `op.orElse(null)`. */ + fun op(op: Optional) = op(op.getOrNull()) + + /** + * Sets [Builder.op] to an arbitrary JSON value. + * + * You should usually call [Builder.op] with a well-typed [FilterOpSpec] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun op(op: JsonField) = apply { this.op = op } + + /** The value(s) to compare against. Omit together with `op` for an unenabled filter. */ + fun right(right: List?) = right(JsonField.ofNullable(right)) + + /** Alias for calling [Builder.right] with `right.orElse(null)`. */ + fun right(right: Optional>) = right(right.getOrNull()) + + /** + * Sets [Builder.right] to an arbitrary JSON value. + * + * You should usually call [Builder.right] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun right(right: JsonField>) = apply { + this.right = right.map { it.toMutableList() } + } + + /** + * Adds a single [FilterValue] to [Builder.right]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRight(right: FilterValue) = apply { + this.right = + (this.right ?: JsonField.of(mutableListOf())).also { + checkKnown("right", it).add(right) + } + } + + 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 [SearchFilter]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .left() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): SearchFilter = + SearchFilter( + checkRequired("left", left), + op, + (right ?: JsonMissing.of()).map { it.toImmutable() }, + 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(): SearchFilter = apply { + if (validated) { + return@apply + } + + left().validate() + op().ifPresent { it.validate() } + right().ifPresent { it.forEach { it.validate() } } + 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 = + (left.asKnown().getOrNull()?.validity() ?: 0) + + (op.asKnown().getOrNull()?.validity() ?: 0) + + (right.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is SearchFilter && + left == other.left && + op == other.op && + right == other.right && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(left, op, right, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "SearchFilter{left=$left, op=$op, right=$right, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/SortSpec.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/SortSpec.kt new file mode 100644 index 00000000..e1ebaecb --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/SortSpec.kt @@ -0,0 +1,222 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.clearstreet.api.models.v1.SortDirection +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A sort specification pairing a field with a direction. */ +class SortSpec +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val field: JsonField, + private val direction: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("field") @ExcludeMissing field: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + direction: JsonField = JsonMissing.of(), + ) : this(field, direction, mutableMapOf()) + + /** + * The field to sort by. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun field(): FieldRef = field.getRequired("field") + + /** + * Sort direction (defaults to DESC). + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun direction(): Optional = direction.getOptional("direction") + + /** + * Returns the raw JSON value of [field]. + * + * Unlike [field], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("field") @ExcludeMissing fun _field(): JsonField = field + + /** + * Returns the raw JSON value of [direction]. + * + * Unlike [direction], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("direction") + @ExcludeMissing + fun _direction(): JsonField = direction + + @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 [SortSpec]. + * + * The following fields are required: + * ```java + * .field() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [SortSpec]. */ + class Builder internal constructor() { + + private var field: JsonField? = null + private var direction: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(sortSpec: SortSpec) = apply { + field = sortSpec.field + direction = sortSpec.direction + additionalProperties = sortSpec.additionalProperties.toMutableMap() + } + + /** The field to sort by. */ + fun field(field: FieldRef) = field(JsonField.of(field)) + + /** + * Sets [Builder.field] to an arbitrary JSON value. + * + * You should usually call [Builder.field] with a well-typed [FieldRef] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun field(field: JsonField) = apply { this.field = field } + + /** Sort direction (defaults to DESC). */ + fun direction(direction: SortDirection) = direction(JsonField.of(direction)) + + /** + * Sets [Builder.direction] to an arbitrary JSON value. + * + * You should usually call [Builder.direction] with a well-typed [SortDirection] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun direction(direction: JsonField) = apply { this.direction = direction } + + 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 [SortSpec]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .field() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): SortSpec = + SortSpec(checkRequired("field", field), direction, 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(): SortSpec = apply { + if (validated) { + return@apply + } + + field().validate() + direction().ifPresent { it.validate() } + 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 = + (field.asKnown().getOrNull()?.validity() ?: 0) + + (direction.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is SortSpec && + field == other.field && + direction == other.direction && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(field, direction, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "SortSpec{field=$field, direction=$direction, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/Variable.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/Variable.kt new file mode 100644 index 00000000..51019300 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/Variable.kt @@ -0,0 +1,304 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.ExcludeMissing +import com.clearstreet.api.core.JsonField +import com.clearstreet.api.core.JsonMissing +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.errors.ClearStreetInvalidDataException +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A variable reference (field or built-in like `today`). */ +class Variable +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val name: JsonField, + private val lookback: JsonField, + private val modifier: JsonField, + private val period: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("lookback") + @ExcludeMissing + lookback: JsonField = JsonMissing.of(), + @JsonProperty("modifier") @ExcludeMissing modifier: JsonField = JsonMissing.of(), + @JsonProperty("period") @ExcludeMissing period: JsonField = JsonMissing.of(), + ) : this(name, lookback, modifier, period, mutableMapOf()) + + /** + * The variable name. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * Optional historical lookback window. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun lookback(): Optional = lookback.getOptional("lookback") + + /** + * Optional arithmetic modifier. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modifier(): Optional = modifier.getOptional("modifier") + + /** + * Optional reporting period. + * + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun period(): Optional = period.getOptional("period") + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [lookback]. + * + * Unlike [lookback], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("lookback") @ExcludeMissing fun _lookback(): JsonField = lookback + + /** + * Returns the raw JSON value of [modifier]. + * + * Unlike [modifier], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modifier") @ExcludeMissing fun _modifier(): JsonField = modifier + + /** + * Returns the raw JSON value of [period]. + * + * Unlike [period], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("period") @ExcludeMissing fun _period(): JsonField = period + + @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 [Variable]. + * + * The following fields are required: + * ```java + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Variable]. */ + class Builder internal constructor() { + + private var name: JsonField? = null + private var lookback: JsonField = JsonMissing.of() + private var modifier: JsonField = JsonMissing.of() + private var period: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(variable: Variable) = apply { + name = variable.name + lookback = variable.lookback + modifier = variable.modifier + period = variable.period + additionalProperties = variable.additionalProperties.toMutableMap() + } + + /** The variable name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Optional historical lookback window. */ + fun lookback(lookback: FieldLookback?) = lookback(JsonField.ofNullable(lookback)) + + /** Alias for calling [Builder.lookback] with `lookback.orElse(null)`. */ + fun lookback(lookback: Optional) = lookback(lookback.getOrNull()) + + /** + * Sets [Builder.lookback] to an arbitrary JSON value. + * + * You should usually call [Builder.lookback] with a well-typed [FieldLookback] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun lookback(lookback: JsonField) = apply { this.lookback = lookback } + + /** Optional arithmetic modifier. */ + fun modifier(modifier: Modifier?) = modifier(JsonField.ofNullable(modifier)) + + /** Alias for calling [Builder.modifier] with `modifier.orElse(null)`. */ + fun modifier(modifier: Optional) = modifier(modifier.getOrNull()) + + /** + * Sets [Builder.modifier] to an arbitrary JSON value. + * + * You should usually call [Builder.modifier] with a well-typed [Modifier] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun modifier(modifier: JsonField) = apply { this.modifier = modifier } + + /** Optional reporting period. */ + fun period(period: FieldPeriod?) = period(JsonField.ofNullable(period)) + + /** Alias for calling [Builder.period] with `period.orElse(null)`. */ + fun period(period: Optional) = period(period.getOrNull()) + + /** + * Sets [Builder.period] to an arbitrary JSON value. + * + * You should usually call [Builder.period] with a well-typed [FieldPeriod] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun period(period: JsonField) = apply { this.period = period } + + 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 [Variable]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Variable = + Variable( + checkRequired("name", name), + lookback, + modifier, + period, + 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(): Variable = apply { + if (validated) { + return@apply + } + + name() + lookback().ifPresent { it.validate() } + modifier().ifPresent { it.validate() } + period().ifPresent { it.validate() } + 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 = + (if (name.asKnown().isPresent) 1 else 0) + + (lookback.asKnown().getOrNull()?.validity() ?: 0) + + (modifier.asKnown().getOrNull()?.validity() ?: 0) + + (period.asKnown().getOrNull()?.validity() ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Variable && + name == other.name && + lookback == other.lookback && + modifier == other.modifier && + period == other.period && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(name, lookback, modifier, period, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Variable{name=$name, lookback=$lookback, modifier=$modifier, period=$period, additionalProperties=$additionalProperties}" +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt index 4bb88953..1a1bd507 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsync.kt @@ -11,6 +11,7 @@ import com.clearstreet.api.services.async.v1.InstrumentServiceAsync import com.clearstreet.api.services.async.v1.OmniAiServiceAsync import com.clearstreet.api.services.async.v1.OrderServiceAsync import com.clearstreet.api.services.async.v1.PositionServiceAsync +import com.clearstreet.api.services.async.v1.ScreenerServiceAsync import com.clearstreet.api.services.async.v1.WatchlistServiceAsync import java.util.function.Consumer @@ -51,6 +52,9 @@ interface V1ServiceAsync { /** View positions and manage position instructions. */ fun positions(): PositionServiceAsync + /** Search instruments and manage saved screeners. */ + fun screener(): ScreenerServiceAsync + /** Create and manage watchlists. */ fun watchlist(): WatchlistServiceAsync @@ -87,6 +91,9 @@ interface V1ServiceAsync { /** View positions and manage position instructions. */ fun positions(): PositionServiceAsync.WithRawResponse + /** Search instruments and manage saved screeners. */ + fun screener(): ScreenerServiceAsync.WithRawResponse + /** Create and manage watchlists. */ fun watchlist(): WatchlistServiceAsync.WithRawResponse } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt index d8d5936c..be4ff98b 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/V1ServiceAsyncImpl.kt @@ -19,6 +19,8 @@ import com.clearstreet.api.services.async.v1.OrderServiceAsync import com.clearstreet.api.services.async.v1.OrderServiceAsyncImpl import com.clearstreet.api.services.async.v1.PositionServiceAsync import com.clearstreet.api.services.async.v1.PositionServiceAsyncImpl +import com.clearstreet.api.services.async.v1.ScreenerServiceAsync +import com.clearstreet.api.services.async.v1.ScreenerServiceAsyncImpl import com.clearstreet.api.services.async.v1.WatchlistServiceAsync import com.clearstreet.api.services.async.v1.WatchlistServiceAsyncImpl import java.util.function.Consumer @@ -52,6 +54,8 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO private val positions: PositionServiceAsync by lazy { PositionServiceAsyncImpl(clientOptions) } + private val screener: ScreenerServiceAsync by lazy { ScreenerServiceAsyncImpl(clientOptions) } + private val watchlist: WatchlistServiceAsync by lazy { WatchlistServiceAsyncImpl(clientOptions) } @@ -84,6 +88,9 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** View positions and manage position instructions. */ override fun positions(): PositionServiceAsync = positions + /** Search instruments and manage saved screeners. */ + override fun screener(): ScreenerServiceAsync = screener + /** Create and manage watchlists. */ override fun watchlist(): WatchlistServiceAsync = watchlist @@ -122,6 +129,10 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO PositionServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val screener: ScreenerServiceAsync.WithRawResponse by lazy { + ScreenerServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + private val watchlist: WatchlistServiceAsync.WithRawResponse by lazy { WatchlistServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -156,6 +167,9 @@ class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientO /** View positions and manage position instructions. */ override fun positions(): PositionServiceAsync.WithRawResponse = positions + /** Search instruments and manage saved screeners. */ + override fun screener(): ScreenerServiceAsync.WithRawResponse = screener + /** Create and manage watchlists. */ override fun watchlist(): WatchlistServiceAsync.WithRawResponse = watchlist } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsync.kt new file mode 100644 index 00000000..358d316b --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsync.kt @@ -0,0 +1,458 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerResponse +import com.clearstreet.api.models.v1.screener.ScreenerDeleteScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenerByIdParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenerByIdResponse +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenersParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenersResponse +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerResponse +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +/** Search instruments and manage saved screeners. */ +interface ScreenerServiceAsync { + + /** + * 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): ScreenerServiceAsync + + /** + * Create a saved screener configuration. + * + * Persists a screener configuration for the authenticated user. + */ + fun createScreener(): CompletableFuture = + createScreener(ScreenerCreateScreenerParams.none()) + + /** @see createScreener */ + fun createScreener( + params: ScreenerCreateScreenerParams = ScreenerCreateScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see createScreener */ + fun createScreener( + params: ScreenerCreateScreenerParams = ScreenerCreateScreenerParams.none() + ): CompletableFuture = + createScreener(params, RequestOptions.none()) + + /** @see createScreener */ + fun createScreener( + requestOptions: RequestOptions + ): CompletableFuture = + createScreener(ScreenerCreateScreenerParams.none(), requestOptions) + + /** + * Delete a saved screener configuration. + * + * Deletes the screener configuration for the authenticated user. + */ + fun deleteScreener(screenerId: String): CompletableFuture = + deleteScreener(screenerId, ScreenerDeleteScreenerParams.none()) + + /** @see deleteScreener */ + fun deleteScreener( + screenerId: String, + params: ScreenerDeleteScreenerParams = ScreenerDeleteScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + deleteScreener(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see deleteScreener */ + fun deleteScreener( + screenerId: String, + params: ScreenerDeleteScreenerParams = ScreenerDeleteScreenerParams.none(), + ): CompletableFuture = deleteScreener(screenerId, params, RequestOptions.none()) + + /** @see deleteScreener */ + fun deleteScreener( + params: ScreenerDeleteScreenerParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see deleteScreener */ + fun deleteScreener(params: ScreenerDeleteScreenerParams): CompletableFuture = + deleteScreener(params, RequestOptions.none()) + + /** @see deleteScreener */ + fun deleteScreener( + screenerId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + deleteScreener(screenerId, ScreenerDeleteScreenerParams.none(), requestOptions) + + /** + * Get a saved screener configuration by ID. + * + * Returns a single screener configuration for the authenticated user. + */ + fun getScreenerById(screenerId: String): CompletableFuture = + getScreenerById(screenerId, ScreenerGetScreenerByIdParams.none()) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + params: ScreenerGetScreenerByIdParams = ScreenerGetScreenerByIdParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + getScreenerById(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + params: ScreenerGetScreenerByIdParams = ScreenerGetScreenerByIdParams.none(), + ): CompletableFuture = + getScreenerById(screenerId, params, RequestOptions.none()) + + /** @see getScreenerById */ + fun getScreenerById( + params: ScreenerGetScreenerByIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getScreenerById */ + fun getScreenerById( + params: ScreenerGetScreenerByIdParams + ): CompletableFuture = + getScreenerById(params, RequestOptions.none()) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + getScreenerById(screenerId, ScreenerGetScreenerByIdParams.none(), requestOptions) + + /** + * List saved screener configurations. + * + * Returns all screener configurations for the authenticated user. + */ + fun getScreeners(): CompletableFuture = + getScreeners(ScreenerGetScreenersParams.none()) + + /** @see getScreeners */ + fun getScreeners( + params: ScreenerGetScreenersParams = ScreenerGetScreenersParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see getScreeners */ + fun getScreeners( + params: ScreenerGetScreenersParams = ScreenerGetScreenersParams.none() + ): CompletableFuture = getScreeners(params, RequestOptions.none()) + + /** @see getScreeners */ + fun getScreeners( + requestOptions: RequestOptions + ): CompletableFuture = + getScreeners(ScreenerGetScreenersParams.none(), requestOptions) + + /** + * Update a saved screener configuration. + * + * Replaces the screener configuration for the authenticated user. If `name` is null, the + * existing name is preserved. + */ + fun replaceScreener(screenerId: String): CompletableFuture = + replaceScreener(screenerId, ScreenerReplaceScreenerParams.none()) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + params: ScreenerReplaceScreenerParams = ScreenerReplaceScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + replaceScreener(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + params: ScreenerReplaceScreenerParams = ScreenerReplaceScreenerParams.none(), + ): CompletableFuture = + replaceScreener(screenerId, params, RequestOptions.none()) + + /** @see replaceScreener */ + fun replaceScreener( + params: ScreenerReplaceScreenerParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see replaceScreener */ + fun replaceScreener( + params: ScreenerReplaceScreenerParams + ): CompletableFuture = + replaceScreener(params, RequestOptions.none()) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + replaceScreener(screenerId, ScreenerReplaceScreenerParams.none(), requestOptions) + + /** + * Search instruments using structured filters. + * + * Returns a columnar response where each row is an array of column objects. Each column + * contains a human-readable name, a field reference, an optional type hint (e.g. `CURR_USD`, + * `PERCENT`), and the value. + * + * Use `columns` to select which columns appear in each row. When omitted, the default field set + * is returned. + */ + fun searchScreener(): CompletableFuture = + searchScreener(ScreenerSearchScreenerParams.none()) + + /** @see searchScreener */ + fun searchScreener( + params: ScreenerSearchScreenerParams = ScreenerSearchScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see searchScreener */ + fun searchScreener( + params: ScreenerSearchScreenerParams = ScreenerSearchScreenerParams.none() + ): CompletableFuture = + searchScreener(params, RequestOptions.none()) + + /** @see searchScreener */ + fun searchScreener( + requestOptions: RequestOptions + ): CompletableFuture = + searchScreener(ScreenerSearchScreenerParams.none(), requestOptions) + + /** + * A view of [ScreenerServiceAsync] 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 + ): ScreenerServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /v1/saved-screeners`, but is otherwise the same as + * [ScreenerServiceAsync.createScreener]. + */ + fun createScreener(): CompletableFuture> = + createScreener(ScreenerCreateScreenerParams.none()) + + /** @see createScreener */ + fun createScreener( + params: ScreenerCreateScreenerParams = ScreenerCreateScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see createScreener */ + fun createScreener( + params: ScreenerCreateScreenerParams = ScreenerCreateScreenerParams.none() + ): CompletableFuture> = + createScreener(params, RequestOptions.none()) + + /** @see createScreener */ + fun createScreener( + requestOptions: RequestOptions + ): CompletableFuture> = + createScreener(ScreenerCreateScreenerParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `delete /v1/saved-screeners/{screener_id}`, but is + * otherwise the same as [ScreenerServiceAsync.deleteScreener]. + */ + fun deleteScreener(screenerId: String): CompletableFuture = + deleteScreener(screenerId, ScreenerDeleteScreenerParams.none()) + + /** @see deleteScreener */ + fun deleteScreener( + screenerId: String, + params: ScreenerDeleteScreenerParams = ScreenerDeleteScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + deleteScreener(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see deleteScreener */ + fun deleteScreener( + screenerId: String, + params: ScreenerDeleteScreenerParams = ScreenerDeleteScreenerParams.none(), + ): CompletableFuture = + deleteScreener(screenerId, params, RequestOptions.none()) + + /** @see deleteScreener */ + fun deleteScreener( + params: ScreenerDeleteScreenerParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see deleteScreener */ + fun deleteScreener(params: ScreenerDeleteScreenerParams): CompletableFuture = + deleteScreener(params, RequestOptions.none()) + + /** @see deleteScreener */ + fun deleteScreener( + screenerId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + deleteScreener(screenerId, ScreenerDeleteScreenerParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /v1/saved-screeners/{screener_id}`, but is otherwise + * the same as [ScreenerServiceAsync.getScreenerById]. + */ + fun getScreenerById( + screenerId: String + ): CompletableFuture> = + getScreenerById(screenerId, ScreenerGetScreenerByIdParams.none()) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + params: ScreenerGetScreenerByIdParams = ScreenerGetScreenerByIdParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + getScreenerById(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + params: ScreenerGetScreenerByIdParams = ScreenerGetScreenerByIdParams.none(), + ): CompletableFuture> = + getScreenerById(screenerId, params, RequestOptions.none()) + + /** @see getScreenerById */ + fun getScreenerById( + params: ScreenerGetScreenerByIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getScreenerById */ + fun getScreenerById( + params: ScreenerGetScreenerByIdParams + ): CompletableFuture> = + getScreenerById(params, RequestOptions.none()) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + getScreenerById(screenerId, ScreenerGetScreenerByIdParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /v1/saved-screeners`, but is otherwise the same as + * [ScreenerServiceAsync.getScreeners]. + */ + fun getScreeners(): CompletableFuture> = + getScreeners(ScreenerGetScreenersParams.none()) + + /** @see getScreeners */ + fun getScreeners( + params: ScreenerGetScreenersParams = ScreenerGetScreenersParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see getScreeners */ + fun getScreeners( + params: ScreenerGetScreenersParams = ScreenerGetScreenersParams.none() + ): CompletableFuture> = + getScreeners(params, RequestOptions.none()) + + /** @see getScreeners */ + fun getScreeners( + requestOptions: RequestOptions + ): CompletableFuture> = + getScreeners(ScreenerGetScreenersParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `put /v1/saved-screeners/{screener_id}`, but is otherwise + * the same as [ScreenerServiceAsync.replaceScreener]. + */ + fun replaceScreener( + screenerId: String + ): CompletableFuture> = + replaceScreener(screenerId, ScreenerReplaceScreenerParams.none()) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + params: ScreenerReplaceScreenerParams = ScreenerReplaceScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + replaceScreener(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + params: ScreenerReplaceScreenerParams = ScreenerReplaceScreenerParams.none(), + ): CompletableFuture> = + replaceScreener(screenerId, params, RequestOptions.none()) + + /** @see replaceScreener */ + fun replaceScreener( + params: ScreenerReplaceScreenerParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see replaceScreener */ + fun replaceScreener( + params: ScreenerReplaceScreenerParams + ): CompletableFuture> = + replaceScreener(params, RequestOptions.none()) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + replaceScreener(screenerId, ScreenerReplaceScreenerParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /v1/screener`, but is otherwise the same as + * [ScreenerServiceAsync.searchScreener]. + */ + fun searchScreener(): CompletableFuture> = + searchScreener(ScreenerSearchScreenerParams.none()) + + /** @see searchScreener */ + fun searchScreener( + params: ScreenerSearchScreenerParams = ScreenerSearchScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see searchScreener */ + fun searchScreener( + params: ScreenerSearchScreenerParams = ScreenerSearchScreenerParams.none() + ): CompletableFuture> = + searchScreener(params, RequestOptions.none()) + + /** @see searchScreener */ + fun searchScreener( + requestOptions: RequestOptions + ): CompletableFuture> = + searchScreener(ScreenerSearchScreenerParams.none(), requestOptions) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncImpl.kt new file mode 100644 index 00000000..82ac79b6 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncImpl.kt @@ -0,0 +1,289 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.emptyHandler +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepareAsync +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerResponse +import com.clearstreet.api.models.v1.screener.ScreenerDeleteScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenerByIdParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenerByIdResponse +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenersParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenersResponse +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerResponse +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerResponse +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +/** Search instruments and manage saved screeners. */ +class ScreenerServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ScreenerServiceAsync { + + private val withRawResponse: ScreenerServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): ScreenerServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): ScreenerServiceAsync = + ScreenerServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun createScreener( + params: ScreenerCreateScreenerParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /v1/saved-screeners + withRawResponse().createScreener(params, requestOptions).thenApply { it.parse() } + + override fun deleteScreener( + params: ScreenerDeleteScreenerParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // delete /v1/saved-screeners/{screener_id} + withRawResponse().deleteScreener(params, requestOptions).thenAccept {} + + override fun getScreenerById( + params: ScreenerGetScreenerByIdParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/saved-screeners/{screener_id} + withRawResponse().getScreenerById(params, requestOptions).thenApply { it.parse() } + + override fun getScreeners( + params: ScreenerGetScreenersParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /v1/saved-screeners + withRawResponse().getScreeners(params, requestOptions).thenApply { it.parse() } + + override fun replaceScreener( + params: ScreenerReplaceScreenerParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // put /v1/saved-screeners/{screener_id} + withRawResponse().replaceScreener(params, requestOptions).thenApply { it.parse() } + + override fun searchScreener( + params: ScreenerSearchScreenerParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /v1/screener + withRawResponse().searchScreener(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + ScreenerServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): ScreenerServiceAsync.WithRawResponse = + ScreenerServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createScreenerHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun createScreener( + params: ScreenerCreateScreenerParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners") + .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 { createScreenerHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val deleteScreenerHandler: Handler = emptyHandler() + + override fun deleteScreener( + params: ScreenerDeleteScreenerParams, + requestOptions: RequestOptions, + ): CompletableFuture { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("screenerId", params.screenerId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.DELETE) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners", params._pathParam(0)) + .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 { deleteScreenerHandler.handle(it) } + } + } + } + + private val getScreenerByIdHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getScreenerById( + params: ScreenerGetScreenerByIdParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("screenerId", params.screenerId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners", params._pathParam(0)) + .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 { getScreenerByIdHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val getScreenersHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getScreeners( + params: ScreenerGetScreenersParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners") + .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 { getScreenersHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val replaceScreenerHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun replaceScreener( + params: ScreenerReplaceScreenerParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("screenerId", params.screenerId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PUT) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners", params._pathParam(0)) + .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 { replaceScreenerHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val searchScreenerHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun searchScreener( + params: ScreenerSearchScreenerParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "screener") + .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 { searchScreenerHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt index 626dfe0b..d04159e3 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1Service.kt @@ -11,6 +11,7 @@ import com.clearstreet.api.services.blocking.v1.InstrumentService import com.clearstreet.api.services.blocking.v1.OmniAiService import com.clearstreet.api.services.blocking.v1.OrderService import com.clearstreet.api.services.blocking.v1.PositionService +import com.clearstreet.api.services.blocking.v1.ScreenerService import com.clearstreet.api.services.blocking.v1.WatchlistService import java.util.function.Consumer @@ -51,6 +52,9 @@ interface V1Service { /** View positions and manage position instructions. */ fun positions(): PositionService + /** Search instruments and manage saved screeners. */ + fun screener(): ScreenerService + /** Create and manage watchlists. */ fun watchlist(): WatchlistService @@ -87,6 +91,9 @@ interface V1Service { /** View positions and manage position instructions. */ fun positions(): PositionService.WithRawResponse + /** Search instruments and manage saved screeners. */ + fun screener(): ScreenerService.WithRawResponse + /** Create and manage watchlists. */ fun watchlist(): WatchlistService.WithRawResponse } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt index 479c98f2..6e0d67ed 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/V1ServiceImpl.kt @@ -19,6 +19,8 @@ import com.clearstreet.api.services.blocking.v1.OrderService import com.clearstreet.api.services.blocking.v1.OrderServiceImpl import com.clearstreet.api.services.blocking.v1.PositionService import com.clearstreet.api.services.blocking.v1.PositionServiceImpl +import com.clearstreet.api.services.blocking.v1.ScreenerService +import com.clearstreet.api.services.blocking.v1.ScreenerServiceImpl import com.clearstreet.api.services.blocking.v1.WatchlistService import com.clearstreet.api.services.blocking.v1.WatchlistServiceImpl import java.util.function.Consumer @@ -47,6 +49,8 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption private val positions: PositionService by lazy { PositionServiceImpl(clientOptions) } + private val screener: ScreenerService by lazy { ScreenerServiceImpl(clientOptions) } + private val watchlist: WatchlistService by lazy { WatchlistServiceImpl(clientOptions) } override fun withRawResponse(): V1Service.WithRawResponse = withRawResponse @@ -77,6 +81,9 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** View positions and manage position instructions. */ override fun positions(): PositionService = positions + /** Search instruments and manage saved screeners. */ + override fun screener(): ScreenerService = screener + /** Create and manage watchlists. */ override fun watchlist(): WatchlistService = watchlist @@ -115,6 +122,10 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption PositionServiceImpl.WithRawResponseImpl(clientOptions) } + private val screener: ScreenerService.WithRawResponse by lazy { + ScreenerServiceImpl.WithRawResponseImpl(clientOptions) + } + private val watchlist: WatchlistService.WithRawResponse by lazy { WatchlistServiceImpl.WithRawResponseImpl(clientOptions) } @@ -149,6 +160,9 @@ class V1ServiceImpl internal constructor(private val clientOptions: ClientOption /** View positions and manage position instructions. */ override fun positions(): PositionService.WithRawResponse = positions + /** Search instruments and manage saved screeners. */ + override fun screener(): ScreenerService.WithRawResponse = screener + /** Create and manage watchlists. */ override fun watchlist(): WatchlistService.WithRawResponse = watchlist } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerService.kt new file mode 100644 index 00000000..ad78e8c5 --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerService.kt @@ -0,0 +1,458 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerResponse +import com.clearstreet.api.models.v1.screener.ScreenerDeleteScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenerByIdParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenerByIdResponse +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenersParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenersResponse +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerResponse +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerResponse +import com.google.errorprone.annotations.MustBeClosed +import java.util.function.Consumer + +/** Search instruments and manage saved screeners. */ +interface ScreenerService { + + /** + * 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): ScreenerService + + /** + * Create a saved screener configuration. + * + * Persists a screener configuration for the authenticated user. + */ + fun createScreener(): ScreenerCreateScreenerResponse = + createScreener(ScreenerCreateScreenerParams.none()) + + /** @see createScreener */ + fun createScreener( + params: ScreenerCreateScreenerParams = ScreenerCreateScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): ScreenerCreateScreenerResponse + + /** @see createScreener */ + fun createScreener( + params: ScreenerCreateScreenerParams = ScreenerCreateScreenerParams.none() + ): ScreenerCreateScreenerResponse = createScreener(params, RequestOptions.none()) + + /** @see createScreener */ + fun createScreener(requestOptions: RequestOptions): ScreenerCreateScreenerResponse = + createScreener(ScreenerCreateScreenerParams.none(), requestOptions) + + /** + * Delete a saved screener configuration. + * + * Deletes the screener configuration for the authenticated user. + */ + fun deleteScreener(screenerId: String) = + deleteScreener(screenerId, ScreenerDeleteScreenerParams.none()) + + /** @see deleteScreener */ + fun deleteScreener( + screenerId: String, + params: ScreenerDeleteScreenerParams = ScreenerDeleteScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ) = deleteScreener(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see deleteScreener */ + fun deleteScreener( + screenerId: String, + params: ScreenerDeleteScreenerParams = ScreenerDeleteScreenerParams.none(), + ) = deleteScreener(screenerId, params, RequestOptions.none()) + + /** @see deleteScreener */ + fun deleteScreener( + params: ScreenerDeleteScreenerParams, + requestOptions: RequestOptions = RequestOptions.none(), + ) + + /** @see deleteScreener */ + fun deleteScreener(params: ScreenerDeleteScreenerParams) = + deleteScreener(params, RequestOptions.none()) + + /** @see deleteScreener */ + fun deleteScreener(screenerId: String, requestOptions: RequestOptions) = + deleteScreener(screenerId, ScreenerDeleteScreenerParams.none(), requestOptions) + + /** + * Get a saved screener configuration by ID. + * + * Returns a single screener configuration for the authenticated user. + */ + fun getScreenerById(screenerId: String): ScreenerGetScreenerByIdResponse = + getScreenerById(screenerId, ScreenerGetScreenerByIdParams.none()) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + params: ScreenerGetScreenerByIdParams = ScreenerGetScreenerByIdParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): ScreenerGetScreenerByIdResponse = + getScreenerById(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + params: ScreenerGetScreenerByIdParams = ScreenerGetScreenerByIdParams.none(), + ): ScreenerGetScreenerByIdResponse = getScreenerById(screenerId, params, RequestOptions.none()) + + /** @see getScreenerById */ + fun getScreenerById( + params: ScreenerGetScreenerByIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ScreenerGetScreenerByIdResponse + + /** @see getScreenerById */ + fun getScreenerById(params: ScreenerGetScreenerByIdParams): ScreenerGetScreenerByIdResponse = + getScreenerById(params, RequestOptions.none()) + + /** @see getScreenerById */ + fun getScreenerById( + screenerId: String, + requestOptions: RequestOptions, + ): ScreenerGetScreenerByIdResponse = + getScreenerById(screenerId, ScreenerGetScreenerByIdParams.none(), requestOptions) + + /** + * List saved screener configurations. + * + * Returns all screener configurations for the authenticated user. + */ + fun getScreeners(): ScreenerGetScreenersResponse = + getScreeners(ScreenerGetScreenersParams.none()) + + /** @see getScreeners */ + fun getScreeners( + params: ScreenerGetScreenersParams = ScreenerGetScreenersParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): ScreenerGetScreenersResponse + + /** @see getScreeners */ + fun getScreeners( + params: ScreenerGetScreenersParams = ScreenerGetScreenersParams.none() + ): ScreenerGetScreenersResponse = getScreeners(params, RequestOptions.none()) + + /** @see getScreeners */ + fun getScreeners(requestOptions: RequestOptions): ScreenerGetScreenersResponse = + getScreeners(ScreenerGetScreenersParams.none(), requestOptions) + + /** + * Update a saved screener configuration. + * + * Replaces the screener configuration for the authenticated user. If `name` is null, the + * existing name is preserved. + */ + fun replaceScreener(screenerId: String): ScreenerReplaceScreenerResponse = + replaceScreener(screenerId, ScreenerReplaceScreenerParams.none()) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + params: ScreenerReplaceScreenerParams = ScreenerReplaceScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): ScreenerReplaceScreenerResponse = + replaceScreener(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + params: ScreenerReplaceScreenerParams = ScreenerReplaceScreenerParams.none(), + ): ScreenerReplaceScreenerResponse = replaceScreener(screenerId, params, RequestOptions.none()) + + /** @see replaceScreener */ + fun replaceScreener( + params: ScreenerReplaceScreenerParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ScreenerReplaceScreenerResponse + + /** @see replaceScreener */ + fun replaceScreener(params: ScreenerReplaceScreenerParams): ScreenerReplaceScreenerResponse = + replaceScreener(params, RequestOptions.none()) + + /** @see replaceScreener */ + fun replaceScreener( + screenerId: String, + requestOptions: RequestOptions, + ): ScreenerReplaceScreenerResponse = + replaceScreener(screenerId, ScreenerReplaceScreenerParams.none(), requestOptions) + + /** + * Search instruments using structured filters. + * + * Returns a columnar response where each row is an array of column objects. Each column + * contains a human-readable name, a field reference, an optional type hint (e.g. `CURR_USD`, + * `PERCENT`), and the value. + * + * Use `columns` to select which columns appear in each row. When omitted, the default field set + * is returned. + */ + fun searchScreener(): ScreenerSearchScreenerResponse = + searchScreener(ScreenerSearchScreenerParams.none()) + + /** @see searchScreener */ + fun searchScreener( + params: ScreenerSearchScreenerParams = ScreenerSearchScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): ScreenerSearchScreenerResponse + + /** @see searchScreener */ + fun searchScreener( + params: ScreenerSearchScreenerParams = ScreenerSearchScreenerParams.none() + ): ScreenerSearchScreenerResponse = searchScreener(params, RequestOptions.none()) + + /** @see searchScreener */ + fun searchScreener(requestOptions: RequestOptions): ScreenerSearchScreenerResponse = + searchScreener(ScreenerSearchScreenerParams.none(), requestOptions) + + /** A view of [ScreenerService] 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): ScreenerService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /v1/saved-screeners`, but is otherwise the same as + * [ScreenerService.createScreener]. + */ + @MustBeClosed + fun createScreener(): HttpResponseFor = + createScreener(ScreenerCreateScreenerParams.none()) + + /** @see createScreener */ + @MustBeClosed + fun createScreener( + params: ScreenerCreateScreenerParams = ScreenerCreateScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see createScreener */ + @MustBeClosed + fun createScreener( + params: ScreenerCreateScreenerParams = ScreenerCreateScreenerParams.none() + ): HttpResponseFor = + createScreener(params, RequestOptions.none()) + + /** @see createScreener */ + @MustBeClosed + fun createScreener( + requestOptions: RequestOptions + ): HttpResponseFor = + createScreener(ScreenerCreateScreenerParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `delete /v1/saved-screeners/{screener_id}`, but is + * otherwise the same as [ScreenerService.deleteScreener]. + */ + @MustBeClosed + fun deleteScreener(screenerId: String): HttpResponse = + deleteScreener(screenerId, ScreenerDeleteScreenerParams.none()) + + /** @see deleteScreener */ + @MustBeClosed + fun deleteScreener( + screenerId: String, + params: ScreenerDeleteScreenerParams = ScreenerDeleteScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponse = + deleteScreener(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see deleteScreener */ + @MustBeClosed + fun deleteScreener( + screenerId: String, + params: ScreenerDeleteScreenerParams = ScreenerDeleteScreenerParams.none(), + ): HttpResponse = deleteScreener(screenerId, params, RequestOptions.none()) + + /** @see deleteScreener */ + @MustBeClosed + fun deleteScreener( + params: ScreenerDeleteScreenerParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponse + + /** @see deleteScreener */ + @MustBeClosed + fun deleteScreener(params: ScreenerDeleteScreenerParams): HttpResponse = + deleteScreener(params, RequestOptions.none()) + + /** @see deleteScreener */ + @MustBeClosed + fun deleteScreener(screenerId: String, requestOptions: RequestOptions): HttpResponse = + deleteScreener(screenerId, ScreenerDeleteScreenerParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /v1/saved-screeners/{screener_id}`, but is otherwise + * the same as [ScreenerService.getScreenerById]. + */ + @MustBeClosed + fun getScreenerById(screenerId: String): HttpResponseFor = + getScreenerById(screenerId, ScreenerGetScreenerByIdParams.none()) + + /** @see getScreenerById */ + @MustBeClosed + fun getScreenerById( + screenerId: String, + params: ScreenerGetScreenerByIdParams = ScreenerGetScreenerByIdParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + getScreenerById(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see getScreenerById */ + @MustBeClosed + fun getScreenerById( + screenerId: String, + params: ScreenerGetScreenerByIdParams = ScreenerGetScreenerByIdParams.none(), + ): HttpResponseFor = + getScreenerById(screenerId, params, RequestOptions.none()) + + /** @see getScreenerById */ + @MustBeClosed + fun getScreenerById( + params: ScreenerGetScreenerByIdParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getScreenerById */ + @MustBeClosed + fun getScreenerById( + params: ScreenerGetScreenerByIdParams + ): HttpResponseFor = + getScreenerById(params, RequestOptions.none()) + + /** @see getScreenerById */ + @MustBeClosed + fun getScreenerById( + screenerId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + getScreenerById(screenerId, ScreenerGetScreenerByIdParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /v1/saved-screeners`, but is otherwise the same as + * [ScreenerService.getScreeners]. + */ + @MustBeClosed + fun getScreeners(): HttpResponseFor = + getScreeners(ScreenerGetScreenersParams.none()) + + /** @see getScreeners */ + @MustBeClosed + fun getScreeners( + params: ScreenerGetScreenersParams = ScreenerGetScreenersParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see getScreeners */ + @MustBeClosed + fun getScreeners( + params: ScreenerGetScreenersParams = ScreenerGetScreenersParams.none() + ): HttpResponseFor = + getScreeners(params, RequestOptions.none()) + + /** @see getScreeners */ + @MustBeClosed + fun getScreeners( + requestOptions: RequestOptions + ): HttpResponseFor = + getScreeners(ScreenerGetScreenersParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `put /v1/saved-screeners/{screener_id}`, but is otherwise + * the same as [ScreenerService.replaceScreener]. + */ + @MustBeClosed + fun replaceScreener(screenerId: String): HttpResponseFor = + replaceScreener(screenerId, ScreenerReplaceScreenerParams.none()) + + /** @see replaceScreener */ + @MustBeClosed + fun replaceScreener( + screenerId: String, + params: ScreenerReplaceScreenerParams = ScreenerReplaceScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + replaceScreener(params.toBuilder().screenerId(screenerId).build(), requestOptions) + + /** @see replaceScreener */ + @MustBeClosed + fun replaceScreener( + screenerId: String, + params: ScreenerReplaceScreenerParams = ScreenerReplaceScreenerParams.none(), + ): HttpResponseFor = + replaceScreener(screenerId, params, RequestOptions.none()) + + /** @see replaceScreener */ + @MustBeClosed + fun replaceScreener( + params: ScreenerReplaceScreenerParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see replaceScreener */ + @MustBeClosed + fun replaceScreener( + params: ScreenerReplaceScreenerParams + ): HttpResponseFor = + replaceScreener(params, RequestOptions.none()) + + /** @see replaceScreener */ + @MustBeClosed + fun replaceScreener( + screenerId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + replaceScreener(screenerId, ScreenerReplaceScreenerParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /v1/screener`, but is otherwise the same as + * [ScreenerService.searchScreener]. + */ + @MustBeClosed + fun searchScreener(): HttpResponseFor = + searchScreener(ScreenerSearchScreenerParams.none()) + + /** @see searchScreener */ + @MustBeClosed + fun searchScreener( + params: ScreenerSearchScreenerParams = ScreenerSearchScreenerParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see searchScreener */ + @MustBeClosed + fun searchScreener( + params: ScreenerSearchScreenerParams = ScreenerSearchScreenerParams.none() + ): HttpResponseFor = + searchScreener(params, RequestOptions.none()) + + /** @see searchScreener */ + @MustBeClosed + fun searchScreener( + requestOptions: RequestOptions + ): HttpResponseFor = + searchScreener(ScreenerSearchScreenerParams.none(), requestOptions) + } +} diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceImpl.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceImpl.kt new file mode 100644 index 00000000..8bb36c8e --- /dev/null +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceImpl.kt @@ -0,0 +1,271 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.core.ClientOptions +import com.clearstreet.api.core.RequestOptions +import com.clearstreet.api.core.checkRequired +import com.clearstreet.api.core.handlers.emptyHandler +import com.clearstreet.api.core.handlers.errorBodyHandler +import com.clearstreet.api.core.handlers.errorHandler +import com.clearstreet.api.core.handlers.jsonHandler +import com.clearstreet.api.core.http.HttpMethod +import com.clearstreet.api.core.http.HttpRequest +import com.clearstreet.api.core.http.HttpResponse +import com.clearstreet.api.core.http.HttpResponse.Handler +import com.clearstreet.api.core.http.HttpResponseFor +import com.clearstreet.api.core.http.json +import com.clearstreet.api.core.http.parseable +import com.clearstreet.api.core.prepare +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerResponse +import com.clearstreet.api.models.v1.screener.ScreenerDeleteScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenerByIdParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenerByIdResponse +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenersParams +import com.clearstreet.api.models.v1.screener.ScreenerGetScreenersResponse +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerResponse +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerResponse +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +/** Search instruments and manage saved screeners. */ +class ScreenerServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ScreenerService { + + private val withRawResponse: ScreenerService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): ScreenerService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): ScreenerService = + ScreenerServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun createScreener( + params: ScreenerCreateScreenerParams, + requestOptions: RequestOptions, + ): ScreenerCreateScreenerResponse = + // post /v1/saved-screeners + withRawResponse().createScreener(params, requestOptions).parse() + + override fun deleteScreener( + params: ScreenerDeleteScreenerParams, + requestOptions: RequestOptions, + ) { + // delete /v1/saved-screeners/{screener_id} + withRawResponse().deleteScreener(params, requestOptions) + } + + override fun getScreenerById( + params: ScreenerGetScreenerByIdParams, + requestOptions: RequestOptions, + ): ScreenerGetScreenerByIdResponse = + // get /v1/saved-screeners/{screener_id} + withRawResponse().getScreenerById(params, requestOptions).parse() + + override fun getScreeners( + params: ScreenerGetScreenersParams, + requestOptions: RequestOptions, + ): ScreenerGetScreenersResponse = + // get /v1/saved-screeners + withRawResponse().getScreeners(params, requestOptions).parse() + + override fun replaceScreener( + params: ScreenerReplaceScreenerParams, + requestOptions: RequestOptions, + ): ScreenerReplaceScreenerResponse = + // put /v1/saved-screeners/{screener_id} + withRawResponse().replaceScreener(params, requestOptions).parse() + + override fun searchScreener( + params: ScreenerSearchScreenerParams, + requestOptions: RequestOptions, + ): ScreenerSearchScreenerResponse = + // post /v1/screener + withRawResponse().searchScreener(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + ScreenerService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): ScreenerService.WithRawResponse = + ScreenerServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createScreenerHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun createScreener( + params: ScreenerCreateScreenerParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createScreenerHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val deleteScreenerHandler: Handler = emptyHandler() + + override fun deleteScreener( + params: ScreenerDeleteScreenerParams, + requestOptions: RequestOptions, + ): HttpResponse { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("screenerId", params.screenerId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.DELETE) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners", params._pathParam(0)) + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response.use { deleteScreenerHandler.handle(it) } + } + } + + private val getScreenerByIdHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getScreenerById( + params: ScreenerGetScreenerByIdParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("screenerId", params.screenerId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getScreenerByIdHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val getScreenersHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun getScreeners( + params: ScreenerGetScreenersParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { getScreenersHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val replaceScreenerHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun replaceScreener( + params: ScreenerReplaceScreenerParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("screenerId", params.screenerId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PUT) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "saved-screeners", params._pathParam(0)) + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { replaceScreenerHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val searchScreenerHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun searchScreener( + params: ScreenerSearchScreenerParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("v1", "screener") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { searchScreenerHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt index 32fc986a..cbdc2446 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt @@ -4,6 +4,7 @@ package com.clearstreet.api.models.v1.omniai import com.clearstreet.api.core.JsonValue import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.screener.ScreenerFilter import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat @@ -29,6 +30,7 @@ internal class OpenScreenerActionTest { .value(JsonValue.from(10000000000)) .build() ) + .addColumn("string") .addFieldFilter("string") .pageSize(0) .sortBy("sort_by") @@ -48,6 +50,7 @@ internal class OpenScreenerActionTest { .value(JsonValue.from(10000000000)) .build(), ) + assertThat(openScreenerAction.columns().getOrNull()).containsExactly("string") assertThat(openScreenerAction.fieldFilter().getOrNull()).containsExactly("string") assertThat(openScreenerAction.pageSize()).contains(0) assertThat(openScreenerAction.sortBy()).contains("sort_by") @@ -73,6 +76,7 @@ internal class OpenScreenerActionTest { .value(JsonValue.from(10000000000)) .build() ) + .addColumn("string") .addFieldFilter("string") .pageSize(0) .sortBy("sort_by") diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt index 0ae2d9be..8af99302 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt @@ -11,6 +11,7 @@ import com.clearstreet.api.models.v1.orders.RequestOrderType import com.clearstreet.api.models.v1.orders.RequestTimeInForce import com.clearstreet.api.models.v1.orders.Side import com.clearstreet.api.models.v1.orders.TrailingOffsetType +import com.clearstreet.api.models.v1.screener.ScreenerFilter import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -169,6 +170,7 @@ internal class StructuredActionTest { .value(JsonValue.from(10000000000)) .build() ) + .addColumn("string") .addFieldFilter("string") .pageSize(0) .sortBy("sort_by") @@ -207,6 +209,7 @@ internal class StructuredActionTest { .value(JsonValue.from(10000000000)) .build() ) + .addColumn("string") .addFieldFilter("string") .pageSize(0) .sortBy("sort_by") diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FieldRefTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FieldRefTest.kt new file mode 100644 index 00000000..0eb68997 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FieldRefTest.kt @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FieldRefTest { + + @Test + fun create() { + val fieldRef = + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + + assertThat(fieldRef.name()).isEqualTo("market_cap") + assertThat(fieldRef.lookback()).contains(FieldLookback.ONE_DAY) + assertThat(fieldRef.period()).contains(FieldPeriod.QUARTER) + assertThat(fieldRef.valueType()).contains(FieldType.DECIMAL) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val fieldRef = + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + + val roundtrippedFieldRef = + jsonMapper.readValue( + jsonMapper.writeValueAsString(fieldRef), + jacksonTypeRef(), + ) + + assertThat(roundtrippedFieldRef).isEqualTo(fieldRef) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpecTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpecTest.kt new file mode 100644 index 00000000..0138cb6e --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpecTest.kt @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FilterOpSpecTest { + + @Test + fun create() { + val filterOpSpec = + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + + assertThat(filterOpSpec.name()).isEqualTo(FilterOperator.LESS_THAN) + assertThat(filterOpSpec.args().getOrNull()).containsExactly(OperatorArg.LEFT_INCLUSIVE) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val filterOpSpec = + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + + val roundtrippedFilterOpSpec = + jsonMapper.readValue( + jsonMapper.writeValueAsString(filterOpSpec), + jacksonTypeRef(), + ) + + assertThat(roundtrippedFilterOpSpec).isEqualTo(filterOpSpec) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterValueTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterValueTest.kt new file mode 100644 index 00000000..a5c80019 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterValueTest.kt @@ -0,0 +1,81 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FilterValueTest { + + @Test + fun create() { + val filterValue = + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + + assertThat(filterValue.value()).contains(FilterValue.Value.ofNumber(1000000000.0)) + assertThat(filterValue.variable()) + .contains( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val filterValue = + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + + val roundtrippedFilterValue = + jsonMapper.readValue( + jsonMapper.writeValueAsString(filterValue), + jacksonTypeRef(), + ) + + assertThat(roundtrippedFilterValue).isEqualTo(filterValue) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ModifierTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ModifierTest.kt new file mode 100644 index 00000000..e69aa6d8 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ModifierTest.kt @@ -0,0 +1,36 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ModifierTest { + + @Test + fun create() { + val modifier = + Modifier.builder().addArg(30.0).addArg("DAY").name(ModifierOp.SUBTRACT).build() + + assertThat(modifier.args()) + .containsExactly(Modifier.Arg.ofNumber(30.0), Modifier.Arg.ofString("DAY")) + assertThat(modifier.name()).isEqualTo(ModifierOp.SUBTRACT) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val modifier = + Modifier.builder().addArg(30.0).addArg("DAY").name(ModifierOp.SUBTRACT).build() + + val roundtrippedModifier = + jsonMapper.readValue( + jsonMapper.writeValueAsString(modifier), + jacksonTypeRef(), + ) + + assertThat(roundtrippedModifier).isEqualTo(modifier) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerColumnTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerColumnTest.kt new file mode 100644 index 00000000..52e1e197 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerColumnTest.kt @@ -0,0 +1,69 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerColumnTest { + + @Test + fun create() { + val screenerColumn = + ScreenerColumn.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .name("Market Cap") + .value(2890000000000.0) + .type("CURR_USD") + .build() + + assertThat(screenerColumn.field()) + .isEqualTo( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(screenerColumn.name()).isEqualTo("Market Cap") + assertThat(screenerColumn.value()).contains(ScreenerColumn.Value.ofNumber(2890000000000.0)) + assertThat(screenerColumn.type()).contains("CURR_USD") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val screenerColumn = + ScreenerColumn.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .name("Market Cap") + .value(2890000000000.0) + .type("CURR_USD") + .build() + + val roundtrippedScreenerColumn = + jsonMapper.readValue( + jsonMapper.writeValueAsString(screenerColumn), + jacksonTypeRef(), + ) + + assertThat(roundtrippedScreenerColumn).isEqualTo(screenerColumn) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt new file mode 100644 index 00000000..13c3d1a1 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt @@ -0,0 +1,239 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.models.v1.SortDirection +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerCreateScreenerParamsTest { + + @Test + fun create() { + ScreenerCreateScreenerParams.builder() + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + } + + @Test + fun body() { + val params = + ScreenerCreateScreenerParams.builder() + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + + val body = params._body() + + assertThat(body.columns().getOrNull()) + .containsExactly( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(body.fieldFilter().getOrNull()) + .containsExactly( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(body.filters().getOrNull()) + .containsExactly( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + assertThat(body.name()).contains("name") + assertThat(body.sorts().getOrNull()) + .containsExactly( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = ScreenerCreateScreenerParams.builder().build() + + val body = params._body() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt new file mode 100644 index 00000000..d8f67f20 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt @@ -0,0 +1,329 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SortDirection +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerCreateScreenerResponseTest { + + @Test + fun create() { + val screenerCreateScreenerResponse = + ScreenerCreateScreenerResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .data( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + .build() + + assertThat(screenerCreateScreenerResponse.metadata()) + .isEqualTo( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + assertThat(screenerCreateScreenerResponse.error()) + .contains( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + assertThat(screenerCreateScreenerResponse.data()) + .isEqualTo( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val screenerCreateScreenerResponse = + ScreenerCreateScreenerResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .data( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + .build() + + val roundtrippedScreenerCreateScreenerResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(screenerCreateScreenerResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedScreenerCreateScreenerResponse) + .isEqualTo(screenerCreateScreenerResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerDeleteScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerDeleteScreenerParamsTest.kt new file mode 100644 index 00000000..157ee21f --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerDeleteScreenerParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerDeleteScreenerParamsTest { + + @Test + fun create() { + ScreenerDeleteScreenerParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .build() + } + + @Test + fun pathParams() { + val params = + ScreenerDeleteScreenerParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .build() + + assertThat(params._pathParam(0)).isEqualTo("550e8400-e29b-41d4-a716-446655440000") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt new file mode 100644 index 00000000..b4ae43e3 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt @@ -0,0 +1,254 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.SortDirection +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerEntryTest { + + @Test + fun create() { + val screenerEntry = + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + + assertThat(screenerEntry.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(screenerEntry.createdAt()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(screenerEntry.filters()) + .containsExactly( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + assertThat(screenerEntry.name()).isEqualTo("name") + assertThat(screenerEntry.updatedAt()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(screenerEntry.columns().getOrNull()) + .containsExactly( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(screenerEntry.fieldFilter().getOrNull()) + .containsExactly( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(screenerEntry.sorts().getOrNull()) + .containsExactly( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val screenerEntry = + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + + val roundtrippedScreenerEntry = + jsonMapper.readValue( + jsonMapper.writeValueAsString(screenerEntry), + jacksonTypeRef(), + ) + + assertThat(roundtrippedScreenerEntry).isEqualTo(screenerEntry) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilterTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerFilterTest.kt similarity index 96% rename from clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilterTest.kt rename to clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerFilterTest.kt index e555a7dc..de3c5b4f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ScreenerFilterTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerFilterTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.clearstreet.api.models.v1.omniai +package com.clearstreet.api.models.v1.screener import com.clearstreet.api.core.JsonValue import com.clearstreet.api.core.jsonMapper diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdParamsTest.kt new file mode 100644 index 00000000..88656ede --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerGetScreenerByIdParamsTest { + + @Test + fun create() { + ScreenerGetScreenerByIdParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .build() + } + + @Test + fun pathParams() { + val params = + ScreenerGetScreenerByIdParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .build() + + assertThat(params._pathParam(0)).isEqualTo("550e8400-e29b-41d4-a716-446655440000") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt new file mode 100644 index 00000000..35bd4c64 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt @@ -0,0 +1,329 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SortDirection +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerGetScreenerByIdResponseTest { + + @Test + fun create() { + val screenerGetScreenerByIdResponse = + ScreenerGetScreenerByIdResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .data( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + .build() + + assertThat(screenerGetScreenerByIdResponse.metadata()) + .isEqualTo( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + assertThat(screenerGetScreenerByIdResponse.error()) + .contains( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + assertThat(screenerGetScreenerByIdResponse.data()) + .isEqualTo( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val screenerGetScreenerByIdResponse = + ScreenerGetScreenerByIdResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .data( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + .build() + + val roundtrippedScreenerGetScreenerByIdResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(screenerGetScreenerByIdResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedScreenerGetScreenerByIdResponse) + .isEqualTo(screenerGetScreenerByIdResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersParamsTest.kt new file mode 100644 index 00000000..8fa5a6d6 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersParamsTest.kt @@ -0,0 +1,13 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import org.junit.jupiter.api.Test + +internal class ScreenerGetScreenersParamsTest { + + @Test + fun create() { + ScreenerGetScreenersParams.builder().build() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt new file mode 100644 index 00000000..27f5cfa3 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt @@ -0,0 +1,328 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SortDirection +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerGetScreenersResponseTest { + + @Test + fun create() { + val screenerGetScreenersResponse = + ScreenerGetScreenersResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .addData( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + .build() + + assertThat(screenerGetScreenersResponse.metadata()) + .isEqualTo( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + assertThat(screenerGetScreenersResponse.error()) + .contains( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + assertThat(screenerGetScreenersResponse.data()) + .containsExactly( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val screenerGetScreenersResponse = + ScreenerGetScreenersResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .addData( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + .build() + + val roundtrippedScreenerGetScreenersResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(screenerGetScreenersResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedScreenerGetScreenersResponse).isEqualTo(screenerGetScreenersResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt new file mode 100644 index 00000000..74da7d34 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt @@ -0,0 +1,256 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.models.v1.SortDirection +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerReplaceScreenerParamsTest { + + @Test + fun create() { + ScreenerReplaceScreenerParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + } + + @Test + fun pathParams() { + val params = + ScreenerReplaceScreenerParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .build() + + assertThat(params._pathParam(0)).isEqualTo("550e8400-e29b-41d4-a716-446655440000") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + ScreenerReplaceScreenerParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + + val body = params._body() + + assertThat(body.columns().getOrNull()) + .containsExactly( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(body.fieldFilter().getOrNull()) + .containsExactly( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(body.filters().getOrNull()) + .containsExactly( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + assertThat(body.name()).contains("name") + assertThat(body.sorts().getOrNull()) + .containsExactly( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + ScreenerReplaceScreenerParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .build() + + val body = params._body() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt new file mode 100644 index 00000000..47c747cc --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt @@ -0,0 +1,329 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.clearstreet.api.models.v1.SortDirection +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerReplaceScreenerResponseTest { + + @Test + fun create() { + val screenerReplaceScreenerResponse = + ScreenerReplaceScreenerResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .data( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + .build() + + assertThat(screenerReplaceScreenerResponse.metadata()) + .isEqualTo( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + assertThat(screenerReplaceScreenerResponse.error()) + .contains( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + assertThat(screenerReplaceScreenerResponse.data()) + .isEqualTo( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val screenerReplaceScreenerResponse = + ScreenerReplaceScreenerResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .data( + ScreenerEntry.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + .build() + + val roundtrippedScreenerReplaceScreenerResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(screenerReplaceScreenerResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedScreenerReplaceScreenerResponse) + .isEqualTo(screenerReplaceScreenerResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt new file mode 100644 index 00000000..e4e0df25 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt @@ -0,0 +1,285 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.models.v1.SortDirection +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerSearchScreenerParamsTest { + + @Test + fun create() { + ScreenerSearchScreenerParams.builder() + .columns( + listOf( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("price") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("volume") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + ) + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .pageSize(25L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .sortCaseSensitive(true) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + } + + @Test + fun body() { + val params = + ScreenerSearchScreenerParams.builder() + .columns( + listOf( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("price") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("volume") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + ) + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .pageSize(25L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .sortCaseSensitive(true) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + + val body = params._body() + + assertThat(body.columns().getOrNull()) + .containsExactly( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("price") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("volume") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + ) + assertThat(body.fieldFilter().getOrNull()) + .containsExactly( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(body.filters().getOrNull()) + .containsExactly( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + assertThat(body.pageSize()).contains(25L) + assertThat(body.pageToken()).contains("U3RhaW5sZXNzIHJvY2tz") + assertThat(body.sortCaseSensitive()).contains(true) + assertThat(body.sorts().getOrNull()) + .containsExactly( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = ScreenerSearchScreenerParams.builder().build() + + val body = params._body() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerResponseTest.kt new file mode 100644 index 00000000..d7231e30 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerResponseTest.kt @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.JsonValue +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.ApiError +import com.clearstreet.api.models.ResponseMetadata +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ScreenerSearchScreenerResponseTest { + + @Test + fun create() { + val screenerSearchScreenerResponse = + ScreenerSearchScreenerResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .addData( + listOf( + ScreenerColumn.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .name("Market Cap") + .value(2890000000000.0) + .type("CURR_USD") + .build() + ) + ) + .build() + + assertThat(screenerSearchScreenerResponse.metadata()) + .isEqualTo( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + assertThat(screenerSearchScreenerResponse.error()) + .contains( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + assertThat(screenerSearchScreenerResponse.data()) + .containsExactly( + listOf( + ScreenerColumn.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .name("Market Cap") + .value(2890000000000.0) + .type("CURR_USD") + .build() + ) + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val screenerSearchScreenerResponse = + ScreenerSearchScreenerResponse.builder() + .metadata( + ResponseMetadata.builder() + .requestId("request_id") + .nextPageToken("U3RhaW5sZXNzIHJvY2tz") + .pageNumber(0) + .previousPageToken("U3RhaW5sZXNzIHJvY2tz") + .totalItems(0L) + .totalPages(0) + .build() + ) + .error( + ApiError.builder() + .code(400) + .message("Order quantity must be greater than zero") + .addDetail( + ApiError.Detail.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .addData( + listOf( + ScreenerColumn.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .name("Market Cap") + .value(2890000000000.0) + .type("CURR_USD") + .build() + ) + ) + .build() + + val roundtrippedScreenerSearchScreenerResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(screenerSearchScreenerResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedScreenerSearchScreenerResponse) + .isEqualTo(screenerSearchScreenerResponse) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SearchFilterTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SearchFilterTest.kt new file mode 100644 index 00000000..74ecedd8 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SearchFilterTest.kt @@ -0,0 +1,138 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class SearchFilterTest { + + @Test + fun create() { + val searchFilter = + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + + assertThat(searchFilter.left()) + .isEqualTo( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(searchFilter.op()) + .contains( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + assertThat(searchFilter.right().getOrNull()) + .containsExactly( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val searchFilter = + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + + val roundtrippedSearchFilter = + jsonMapper.readValue( + jsonMapper.writeValueAsString(searchFilter), + jacksonTypeRef(), + ) + + assertThat(roundtrippedSearchFilter).isEqualTo(searchFilter) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SortSpecTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SortSpecTest.kt new file mode 100644 index 00000000..b262e735 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SortSpecTest.kt @@ -0,0 +1,64 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.clearstreet.api.models.v1.SortDirection +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class SortSpecTest { + + @Test + fun create() { + val sortSpec = + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + + assertThat(sortSpec.field()) + .isEqualTo( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + assertThat(sortSpec.direction()).contains(SortDirection.DESC) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val sortSpec = + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + + val roundtrippedSortSpec = + jsonMapper.readValue( + jsonMapper.writeValueAsString(sortSpec), + jacksonTypeRef(), + ) + + assertThat(roundtrippedSortSpec).isEqualTo(sortSpec) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/VariableTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/VariableTest.kt new file mode 100644 index 00000000..d5fac880 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/VariableTest.kt @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.models.v1.screener + +import com.clearstreet.api.core.jsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class VariableTest { + + @Test + fun create() { + val variable = + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder().addArg(30.0).addArg("DAY").name(ModifierOp.SUBTRACT).build() + ) + .period(FieldPeriod.QUARTER) + .build() + + assertThat(variable.name()).isEqualTo("today") + assertThat(variable.lookback()).contains(FieldLookback.ONE_DAY) + assertThat(variable.modifier()) + .contains( + Modifier.builder().addArg(30.0).addArg("DAY").name(ModifierOp.SUBTRACT).build() + ) + assertThat(variable.period()).contains(FieldPeriod.QUARTER) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val variable = + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder().addArg(30.0).addArg("DAY").name(ModifierOp.SUBTRACT).build() + ) + .period(FieldPeriod.QUARTER) + .build() + + val roundtrippedVariable = + jsonMapper.readValue( + jsonMapper.writeValueAsString(variable), + jacksonTypeRef(), + ) + + assertThat(roundtrippedVariable).isEqualTo(variable) + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt new file mode 100644 index 00000000..388df061 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt @@ -0,0 +1,349 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.services.async.v1 + +import com.clearstreet.api.TestServerExtension +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.SortDirection +import com.clearstreet.api.models.v1.screener.FieldLookback +import com.clearstreet.api.models.v1.screener.FieldPeriod +import com.clearstreet.api.models.v1.screener.FieldRef +import com.clearstreet.api.models.v1.screener.FieldType +import com.clearstreet.api.models.v1.screener.FilterOpSpec +import com.clearstreet.api.models.v1.screener.FilterOperator +import com.clearstreet.api.models.v1.screener.FilterValue +import com.clearstreet.api.models.v1.screener.Modifier +import com.clearstreet.api.models.v1.screener.ModifierOp +import com.clearstreet.api.models.v1.screener.OperatorArg +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerParams +import com.clearstreet.api.models.v1.screener.SearchFilter +import com.clearstreet.api.models.v1.screener.SortSpec +import com.clearstreet.api.models.v1.screener.Variable +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class ScreenerServiceAsyncTest { + + @Test + fun createScreener() { + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerServiceAsync = client.v1().screener() + + val responseFuture = + screenerServiceAsync.createScreener( + ScreenerCreateScreenerParams.builder() + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Test + fun deleteScreener() { + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerServiceAsync = client.v1().screener() + + val future = screenerServiceAsync.deleteScreener("550e8400-e29b-41d4-a716-446655440000") + + val response = future.get() + } + + @Test + fun getScreenerById() { + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerServiceAsync = client.v1().screener() + + val responseFuture = + screenerServiceAsync.getScreenerById("550e8400-e29b-41d4-a716-446655440000") + + val response = responseFuture.get() + response.validate() + } + + @Test + fun getScreeners() { + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerServiceAsync = client.v1().screener() + + val responseFuture = screenerServiceAsync.getScreeners() + + val response = responseFuture.get() + response.validate() + } + + @Test + fun replaceScreener() { + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerServiceAsync = client.v1().screener() + + val responseFuture = + screenerServiceAsync.replaceScreener( + ScreenerReplaceScreenerParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + + val response = responseFuture.get() + response.validate() + } + + @Test + fun searchScreener() { + val client = + ClearStreetOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerServiceAsync = client.v1().screener() + + val responseFuture = + screenerServiceAsync.searchScreener( + ScreenerSearchScreenerParams.builder() + .columns( + listOf( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("price") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("volume") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + ) + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .pageSize(25L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .sortCaseSensitive(true) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + + val response = responseFuture.get() + response.validate() + } +} diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt new file mode 100644 index 00000000..633e7223 --- /dev/null +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt @@ -0,0 +1,341 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.clearstreet.api.services.blocking.v1 + +import com.clearstreet.api.TestServerExtension +import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.SortDirection +import com.clearstreet.api.models.v1.screener.FieldLookback +import com.clearstreet.api.models.v1.screener.FieldPeriod +import com.clearstreet.api.models.v1.screener.FieldRef +import com.clearstreet.api.models.v1.screener.FieldType +import com.clearstreet.api.models.v1.screener.FilterOpSpec +import com.clearstreet.api.models.v1.screener.FilterOperator +import com.clearstreet.api.models.v1.screener.FilterValue +import com.clearstreet.api.models.v1.screener.Modifier +import com.clearstreet.api.models.v1.screener.ModifierOp +import com.clearstreet.api.models.v1.screener.OperatorArg +import com.clearstreet.api.models.v1.screener.ScreenerCreateScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerReplaceScreenerParams +import com.clearstreet.api.models.v1.screener.ScreenerSearchScreenerParams +import com.clearstreet.api.models.v1.screener.SearchFilter +import com.clearstreet.api.models.v1.screener.SortSpec +import com.clearstreet.api.models.v1.screener.Variable +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class ScreenerServiceTest { + + @Test + fun createScreener() { + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerService = client.v1().screener() + + val response = + screenerService.createScreener( + ScreenerCreateScreenerParams.builder() + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + + response.validate() + } + + @Test + fun deleteScreener() { + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerService = client.v1().screener() + + screenerService.deleteScreener("550e8400-e29b-41d4-a716-446655440000") + } + + @Test + fun getScreenerById() { + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerService = client.v1().screener() + + val response = screenerService.getScreenerById("550e8400-e29b-41d4-a716-446655440000") + + response.validate() + } + + @Test + fun getScreeners() { + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerService = client.v1().screener() + + val response = screenerService.getScreeners() + + response.validate() + } + + @Test + fun replaceScreener() { + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerService = client.v1().screener() + + val response = + screenerService.replaceScreener( + ScreenerReplaceScreenerParams.builder() + .screenerId("550e8400-e29b-41d4-a716-446655440000") + .addColumn( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .name("name") + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + + response.validate() + } + + @Test + fun searchScreener() { + val client = + ClearStreetOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val screenerService = client.v1().screener() + + val response = + screenerService.searchScreener( + ScreenerSearchScreenerParams.builder() + .columns( + listOf( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("price") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + FieldRef.builder() + .name("volume") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build(), + ) + ) + .addFieldFilter( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .addFilter( + SearchFilter.builder() + .left( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .op( + FilterOpSpec.builder() + .name(FilterOperator.LESS_THAN) + .addArg(OperatorArg.LEFT_INCLUSIVE) + .build() + ) + .addRight( + FilterValue.builder() + .value(1000000000.0) + .variable( + Variable.builder() + .name("today") + .lookback(FieldLookback.ONE_DAY) + .modifier( + Modifier.builder() + .addArg(30.0) + .addArg("DAY") + .name(ModifierOp.SUBTRACT) + .build() + ) + .period(FieldPeriod.QUARTER) + .build() + ) + .build() + ) + .build() + ) + .pageSize(25L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .sortCaseSensitive(true) + .addSort( + SortSpec.builder() + .field( + FieldRef.builder() + .name("market_cap") + .lookback(FieldLookback.ONE_DAY) + .period(FieldPeriod.QUARTER) + .valueType(FieldType.DECIMAL) + .build() + ) + .direction(SortDirection.DESC) + .build() + ) + .build() + ) + + response.validate() + } +} From 2f63393f8320709d8805c31ba73e8ee5d5419601 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Jun 2026 13:05:21 +0000 Subject: [PATCH 43/51] feat(api): api update --- .stats.yml | 4 +-- .../api/models/v1/instruments/Instrument.kt | 31 +++++++++++++------ .../models/v1/instruments/InstrumentCore.kt | 31 +++++++++++++------ .../InstrumentGetInstrumentsParams.kt | 10 ++++-- .../v1/instruments/InstrumentCoreTest.kt | 12 +++---- ...InstrumentGetInstrumentByIdResponseTest.kt | 12 +++---- .../InstrumentGetInstrumentsResponseTest.kt | 12 +++---- ...InstrumentSearchInstrumentsResponseTest.kt | 12 +++---- .../models/v1/instruments/InstrumentTest.kt | 12 +++---- .../v1/watchlist/WatchlistDetailTest.kt | 12 +++---- .../WatchlistGetWatchlistByIdResponseTest.kt | 12 +++---- .../v1/watchlist/WatchlistItemEntryTest.kt | 12 +++---- 12 files changed, 100 insertions(+), 72 deletions(-) diff --git a/.stats.yml b/.stats.yml index ee1a5879..a1b20f3b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-2b0b1f4a89c24a376aed1482e7494a2abf4965e01886cc96451bcc3e1579e4d0.yml -openapi_spec_hash: 0e4e96791d68f8fd7c895b4d14665bef +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-fa3d3be289a6dcaa8d5723c7df840d4c5bf4f07853a28ded52c256c7381871d2.yml +openapi_spec_hash: 5d4560795d986d5755cc0af05a02d88b config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt index 5d0416da..deaf16f5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/Instrument.kt @@ -248,13 +248,13 @@ private constructor( fun adv(): Optional = adv.getOptional("adv") /** - * The expiration date for options instruments When a null/undefined value is observed, it - * indicates it does not apply. + * Deprecated. Always null. When a null/undefined value is observed, it indicates it does not + * apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun expiry(): Optional = expiry.getOptional("expiry") + @Deprecated("deprecated") fun expiry(): Optional = expiry.getOptional("expiry") /** * The type of security (e.g., Common Stock, ETF) When a null/undefined value is observed, it @@ -322,12 +322,13 @@ private constructor( fun shortMarginRate(): Optional = shortMarginRate.getOptional("short_margin_rate") /** - * The strike price for options instruments When a null/undefined value is observed, it - * indicates it does not apply. + * Deprecated. Always null. When a null/undefined value is observed, it indicates it does not + * apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ + @Deprecated("deprecated") fun strikePrice(): Optional = strikePrice.getOptional("strike_price") /** @@ -450,7 +451,10 @@ private constructor( * * Unlike [expiry], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("expiry") @ExcludeMissing fun _expiry(): JsonField = expiry + @Deprecated("deprecated") + @JsonProperty("expiry") + @ExcludeMissing + fun _expiry(): JsonField = expiry /** * Returns the raw JSON value of [instrumentType]. @@ -519,6 +523,7 @@ private constructor( * * Unlike [strikePrice], this method doesn't throw if the JSON field has an unexpected type. */ + @Deprecated("deprecated") @JsonProperty("strike_price") @ExcludeMissing fun _strikePrice(): JsonField = strikePrice @@ -805,12 +810,14 @@ private constructor( fun adv(adv: JsonField) = apply { this.adv = adv } /** - * The expiration date for options instruments When a null/undefined value is observed, it - * indicates it does not apply. + * Deprecated. Always null. When a null/undefined value is observed, it indicates it does + * not apply. */ + @Deprecated("deprecated") fun expiry(expiry: LocalDate?) = expiry(JsonField.ofNullable(expiry)) /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ + @Deprecated("deprecated") fun expiry(expiry: Optional) = expiry(expiry.getOrNull()) /** @@ -820,6 +827,7 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet supported * value. */ + @Deprecated("deprecated") fun expiry(expiry: JsonField) = apply { this.expiry = expiry } /** @@ -983,12 +991,14 @@ private constructor( } /** - * The strike price for options instruments When a null/undefined value is observed, it - * indicates it does not apply. + * Deprecated. Always null. When a null/undefined value is observed, it indicates it does + * not apply. */ + @Deprecated("deprecated") fun strikePrice(strikePrice: String?) = strikePrice(JsonField.ofNullable(strikePrice)) /** Alias for calling [Builder.strikePrice] with `strikePrice.orElse(null)`. */ + @Deprecated("deprecated") fun strikePrice(strikePrice: Optional) = strikePrice(strikePrice.getOrNull()) /** @@ -998,6 +1008,7 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet supported * value. */ + @Deprecated("deprecated") fun strikePrice(strikePrice: JsonField) = apply { this.strikePrice = strikePrice } fun additionalProperties(additionalProperties: Map) = apply { diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt index 7c31f5ea..c2e61067 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCore.kt @@ -240,13 +240,13 @@ private constructor( fun adv(): Optional = adv.getOptional("adv") /** - * The expiration date for options instruments When a null/undefined value is observed, it - * indicates it does not apply. + * Deprecated. Always null. When a null/undefined value is observed, it indicates it does not + * apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun expiry(): Optional = expiry.getOptional("expiry") + @Deprecated("deprecated") fun expiry(): Optional = expiry.getOptional("expiry") /** * The type of security (e.g., Common Stock, ETF) When a null/undefined value is observed, it @@ -303,12 +303,13 @@ private constructor( fun shortMarginRate(): Optional = shortMarginRate.getOptional("short_margin_rate") /** - * The strike price for options instruments When a null/undefined value is observed, it - * indicates it does not apply. + * Deprecated. Always null. When a null/undefined value is observed, it indicates it does not + * apply. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ + @Deprecated("deprecated") fun strikePrice(): Optional = strikePrice.getOptional("strike_price") /** @@ -431,7 +432,10 @@ private constructor( * * Unlike [expiry], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("expiry") @ExcludeMissing fun _expiry(): JsonField = expiry + @Deprecated("deprecated") + @JsonProperty("expiry") + @ExcludeMissing + fun _expiry(): JsonField = expiry /** * Returns the raw JSON value of [instrumentType]. @@ -490,6 +494,7 @@ private constructor( * * Unlike [strikePrice], this method doesn't throw if the JSON field has an unexpected type. */ + @Deprecated("deprecated") @JsonProperty("strike_price") @ExcludeMissing fun _strikePrice(): JsonField = strikePrice @@ -774,12 +779,14 @@ private constructor( fun adv(adv: JsonField) = apply { this.adv = adv } /** - * The expiration date for options instruments When a null/undefined value is observed, it - * indicates it does not apply. + * Deprecated. Always null. When a null/undefined value is observed, it indicates it does + * not apply. */ + @Deprecated("deprecated") fun expiry(expiry: LocalDate?) = expiry(JsonField.ofNullable(expiry)) /** Alias for calling [Builder.expiry] with `expiry.orElse(null)`. */ + @Deprecated("deprecated") fun expiry(expiry: Optional) = expiry(expiry.getOrNull()) /** @@ -789,6 +796,7 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet supported * value. */ + @Deprecated("deprecated") fun expiry(expiry: JsonField) = apply { this.expiry = expiry } /** @@ -915,12 +923,14 @@ private constructor( } /** - * The strike price for options instruments When a null/undefined value is observed, it - * indicates it does not apply. + * Deprecated. Always null. When a null/undefined value is observed, it indicates it does + * not apply. */ + @Deprecated("deprecated") fun strikePrice(strikePrice: String?) = strikePrice(JsonField.ofNullable(strikePrice)) /** Alias for calling [Builder.strikePrice] with `strikePrice.orElse(null)`. */ + @Deprecated("deprecated") fun strikePrice(strikePrice: Optional) = strikePrice(strikePrice.getOrNull()) /** @@ -930,6 +940,7 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet supported * value. */ + @Deprecated("deprecated") fun strikePrice(strikePrice: JsonField) = apply { this.strikePrice = strikePrice } fun additionalProperties(additionalProperties: Map) = apply { diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt index 14f9b0be..76b8ebb6 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsParams.kt @@ -34,7 +34,10 @@ private constructor( /** Filter by easy to borrow status */ fun easyToBorrow(): Optional = Optional.ofNullable(easyToBorrow) - /** Comma-separated instrument identifiers */ + /** + * Comma-separated instrument identifiers: unique identifiers or symbols (symbol for equities, + * OSI for options) + */ fun instrumentIds(): Optional> = Optional.ofNullable(instrumentIds) /** Filter by instrument type (e.g. COMMON_STOCK, OPTION) */ @@ -128,7 +131,10 @@ private constructor( /** Alias for calling [Builder.easyToBorrow] with `easyToBorrow.orElse(null)`. */ fun easyToBorrow(easyToBorrow: Optional) = easyToBorrow(easyToBorrow.getOrNull()) - /** Comma-separated instrument identifiers */ + /** + * Comma-separated instrument identifiers: unique identifiers or symbols (symbol for + * equities, OSI for options) + */ fun instrumentIds(instrumentIds: List?) = apply { this.instrumentIds = instrumentIds?.toMutableList() } diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCoreTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCoreTest.kt index 0769cb05..55fe4c8a 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCoreTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentCoreTest.kt @@ -29,14 +29,14 @@ internal class InstrumentCoreTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() assertThat(instrumentCore.id()).isEqualTo("0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b") @@ -53,14 +53,14 @@ internal class InstrumentCoreTest { assertThat(instrumentCore.symbol()).isEqualTo("AAPL") assertThat(instrumentCore.venue()).isEqualTo("XNMS") assertThat(instrumentCore.adv()).contains("75000000") - assertThat(instrumentCore.expiry()).contains(LocalDate.parse("2024-12-20")) + assertThat(instrumentCore.expiry()).contains(LocalDate.parse("2019-12-27")) assertThat(instrumentCore.instrumentType()).contains(SecurityType.COMMON_STOCK) assertThat(instrumentCore.longMarginRate()).contains("0.25") assertThat(instrumentCore.name()).contains("Apple Inc.") assertThat(instrumentCore.notionalAdv()).contains("15815250000") assertThat(instrumentCore.previousClose()).contains("210.87") assertThat(instrumentCore.shortMarginRate()).contains("0.25") - assertThat(instrumentCore.strikePrice()).contains("150.00") + assertThat(instrumentCore.strikePrice()).contains("strike_price") } @Test @@ -82,14 +82,14 @@ internal class InstrumentCoreTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() val roundtrippedInstrumentCore = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt index 23b2eeaa..2ff93181 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentByIdResponseTest.kt @@ -55,7 +55,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -63,7 +63,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() @@ -108,7 +108,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -116,7 +116,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) } @@ -163,7 +163,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -171,7 +171,7 @@ internal class InstrumentGetInstrumentByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt index c7a4f7e1..490375ee 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentGetInstrumentsResponseTest.kt @@ -55,14 +55,14 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() @@ -107,14 +107,14 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) } @@ -161,14 +161,14 @@ internal class InstrumentGetInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt index 7261e5ae..417daa44 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentSearchInstrumentsResponseTest.kt @@ -55,14 +55,14 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() @@ -107,14 +107,14 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) } @@ -161,14 +161,14 @@ internal class InstrumentSearchInstrumentsResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") .notionalAdv("15815250000") .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentTest.kt index e36a40fd..b8769f60 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instruments/InstrumentTest.kt @@ -30,7 +30,7 @@ internal class InstrumentTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -38,7 +38,7 @@ internal class InstrumentTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() assertThat(instrument.id()).isEqualTo("0f5a1a4e-5b3e-4d8f-9b7a-2b1d0e3f4a5b") @@ -55,7 +55,7 @@ internal class InstrumentTest { assertThat(instrument.symbol()).isEqualTo("AAPL") assertThat(instrument.venue()).isEqualTo("XNMS") assertThat(instrument.adv()).contains("75000000") - assertThat(instrument.expiry()).contains(LocalDate.parse("2024-12-20")) + assertThat(instrument.expiry()).contains(LocalDate.parse("2019-12-27")) assertThat(instrument.instrumentType()).contains(SecurityType.COMMON_STOCK) assertThat(instrument.longMarginRate()).contains("0.25") assertThat(instrument.name()).contains("Apple Inc.") @@ -64,7 +64,7 @@ internal class InstrumentTest { .containsExactly(LocalDate.parse("2019-12-27")) assertThat(instrument.previousClose()).contains("210.87") assertThat(instrument.shortMarginRate()).contains("0.25") - assertThat(instrument.strikePrice()).contains("150.00") + assertThat(instrument.strikePrice()).contains("strike_price") } @Test @@ -86,7 +86,7 @@ internal class InstrumentTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -94,7 +94,7 @@ internal class InstrumentTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() val roundtrippedInstrument = diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetailTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetailTest.kt index 57f77dfa..69999f7f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetailTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistDetailTest.kt @@ -40,7 +40,7 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -48,7 +48,7 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() @@ -81,7 +81,7 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -89,7 +89,7 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() @@ -125,7 +125,7 @@ internal class WatchlistDetailTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -133,7 +133,7 @@ internal class WatchlistDetailTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt index 4e9c9dc4..306eb0a9 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistGetWatchlistByIdResponseTest.kt @@ -66,7 +66,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -74,7 +74,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() @@ -133,7 +133,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -141,7 +141,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() @@ -202,7 +202,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -210,7 +210,7 @@ internal class WatchlistGetWatchlistByIdResponseTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntryTest.kt index 8741bcdc..73cde680 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/watchlist/WatchlistItemEntryTest.kt @@ -36,7 +36,7 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -44,7 +44,7 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() @@ -70,7 +70,7 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -78,7 +78,7 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) } @@ -107,7 +107,7 @@ internal class WatchlistItemEntryTest { .symbol("AAPL") .venue("XNMS") .adv("75000000") - .expiry(LocalDate.parse("2024-12-20")) + .expiry(LocalDate.parse("2019-12-27")) .instrumentType(SecurityType.COMMON_STOCK) .longMarginRate("0.25") .name("Apple Inc.") @@ -115,7 +115,7 @@ internal class WatchlistItemEntryTest { .addOptionsExpiryDate(LocalDate.parse("2019-12-27")) .previousClose("210.87") .shortMarginRate("0.25") - .strikePrice("150.00") + .strikePrice("strike_price") .build() ) .build() From 63564214348bcbb950f6427d52cb11d1dc5736fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:32:44 +0000 Subject: [PATCH 44/51] feat(api): api update --- .stats.yml | 4 +-- .../models/v1/orders/OrderGetOrdersParams.kt | 33 ++++++++++++++++++- .../v1/orders/OrderGetOrdersParamsTest.kt | 3 ++ .../async/v1/OrderServiceAsyncTest.kt | 1 + .../services/blocking/v1/OrderServiceTest.kt | 1 + 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index a1b20f3b..f4cef465 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-fa3d3be289a6dcaa8d5723c7df840d4c5bf4f07853a28ded52c256c7381871d2.yml -openapi_spec_hash: 5d4560795d986d5755cc0af05a02d88b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-ca06a1cd4f4f600d8b58487d52561832b4c9ea5c7be85ea709e6b9cf5ee93de0.yml +openapi_spec_hash: d551b79cd98f734b8429177be29f2ee8 config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt index 86e65ac3..f727fc17 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParams.kt @@ -23,6 +23,7 @@ private constructor( private val from: OffsetDateTime?, private val instrumentIds: List?, private val instrumentType: InstrumentType?, + private val orderIds: List?, private val pageSize: Long?, private val pageToken: String?, private val status: List?, @@ -44,6 +45,12 @@ private constructor( /** Instrument type filter (e.g., COMMON_STOCK, OPTION) */ fun instrumentType(): Optional = Optional.ofNullable(instrumentType) + /** + * Comma-separated order IDs to filter by. When provided, only orders whose order ID is in this + * set are returned. + */ + fun orderIds(): Optional> = Optional.ofNullable(orderIds) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) @@ -92,6 +99,7 @@ private constructor( private var from: OffsetDateTime? = null private var instrumentIds: MutableList? = null private var instrumentType: InstrumentType? = null + private var orderIds: MutableList? = null private var pageSize: Long? = null private var pageToken: String? = null private var status: MutableList? = null @@ -107,6 +115,7 @@ private constructor( from = orderGetOrdersParams.from instrumentIds = orderGetOrdersParams.instrumentIds?.toMutableList() instrumentType = orderGetOrdersParams.instrumentType + orderIds = orderGetOrdersParams.orderIds?.toMutableList() pageSize = orderGetOrdersParams.pageSize pageToken = orderGetOrdersParams.pageToken status = orderGetOrdersParams.status?.toMutableList() @@ -162,6 +171,24 @@ private constructor( fun instrumentType(instrumentType: Optional) = instrumentType(instrumentType.getOrNull()) + /** + * Comma-separated order IDs to filter by. When provided, only orders whose order ID is in + * this set are returned. + */ + fun orderIds(orderIds: List?) = apply { this.orderIds = orderIds?.toMutableList() } + + /** Alias for calling [Builder.orderIds] with `orderIds.orElse(null)`. */ + fun orderIds(orderIds: Optional>) = orderIds(orderIds.getOrNull()) + + /** + * Adds a single [String] to [orderIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addOrderId(orderId: String) = apply { + orderIds = (orderIds ?: mutableListOf()).apply { add(orderId) } + } + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } @@ -345,6 +372,7 @@ private constructor( from, instrumentIds?.toImmutable(), instrumentType, + orderIds?.toImmutable(), pageSize, pageToken, status?.toImmutable(), @@ -370,6 +398,7 @@ private constructor( from?.let { put("from", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) } instrumentIds?.let { put("instrument_ids", it.joinToString(",")) } instrumentType?.let { put("instrument_type", it.toString()) } + orderIds?.let { put("order_ids", it.joinToString(",")) } pageSize?.let { put("page_size", it.toString()) } pageToken?.let { put("page_token", it) } status?.let { put("status", it.joinToString(",") { it.toString() }) } @@ -754,6 +783,7 @@ private constructor( from == other.from && instrumentIds == other.instrumentIds && instrumentType == other.instrumentType && + orderIds == other.orderIds && pageSize == other.pageSize && pageToken == other.pageToken && status == other.status && @@ -770,6 +800,7 @@ private constructor( from, instrumentIds, instrumentType, + orderIds, pageSize, pageToken, status, @@ -781,5 +812,5 @@ private constructor( ) override fun toString() = - "OrderGetOrdersParams{accountId=$accountId, from=$from, instrumentIds=$instrumentIds, instrumentType=$instrumentType, pageSize=$pageSize, pageToken=$pageToken, status=$status, symbol=$symbol, to=$to, underlyingInstrumentIds=$underlyingInstrumentIds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "OrderGetOrdersParams{accountId=$accountId, from=$from, instrumentIds=$instrumentIds, instrumentType=$instrumentType, orderIds=$orderIds, pageSize=$pageSize, pageToken=$pageToken, status=$status, symbol=$symbol, to=$to, underlyingInstrumentIds=$underlyingInstrumentIds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParamsTest.kt index dc269f3f..7052d765 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersParamsTest.kt @@ -16,6 +16,7 @@ internal class OrderGetOrdersParamsTest { .from(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .instrumentType(OrderGetOrdersParams.InstrumentType.COMMON_STOCK) + .addOrderId("string") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .addStatus(OrderGetOrdersParams.Status.PENDING_NEW) @@ -42,6 +43,7 @@ internal class OrderGetOrdersParamsTest { .from(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .instrumentType(OrderGetOrdersParams.InstrumentType.COMMON_STOCK) + .addOrderId("string") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .addStatus(OrderGetOrdersParams.Status.PENDING_NEW) @@ -61,6 +63,7 @@ internal class OrderGetOrdersParamsTest { listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").joinToString(","), ) .put("instrument_type", "COMMON_STOCK") + .put("order_ids", listOf("string").joinToString(",")) .put("page_size", "1") .put("page_token", "U3RhaW5sZXNzIHJvY2tz") .put("status", listOf("PENDING_NEW").joinToString(",")) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt index 895b7b96..12e10737 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt @@ -123,6 +123,7 @@ internal class OrderServiceAsyncTest { .from(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .instrumentType(OrderGetOrdersParams.InstrumentType.COMMON_STOCK) + .addOrderId("string") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .addStatus(OrderGetOrdersParams.Status.PENDING_NEW) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt index 66ab2907..1780108c 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt @@ -119,6 +119,7 @@ internal class OrderServiceTest { .from(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addInstrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .instrumentType(OrderGetOrdersParams.InstrumentType.COMMON_STOCK) + .addOrderId("string") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .addStatus(OrderGetOrdersParams.Status.PENDING_NEW) From 929c0f84068d006f9b3ad816cc1e5590db6f8db9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:33:05 +0000 Subject: [PATCH 45/51] feat(api): api update --- .stats.yml | 4 +- .../api/models/v1/orders/NewOrderRequest.kt | 8 +- .../PositionGetPositionInstructionsParams.kt | 10 +- .../ContentPartStructuredActionPayloadTest.kt | 24 +-- .../v1/omniai/PrefillNewOrderActionTest.kt | 24 +-- .../v1/omniai/PrefillOrderActionTest.kt | 16 +- .../models/v1/omniai/StructuredActionTest.kt | 16 +- .../responses/ResponseContentPartTest.kt | 16 +- .../omniai/threads/MessageContentPartTest.kt | 16 +- .../models/v1/orders/NewOrderRequestTest.kt | 48 ++--- .../OrderCancelAllOpenOrdersResponseTest.kt | 90 ++++---- .../OrderCancelOpenOrderResponseTest.kt | 90 ++++---- .../orders/OrderGetOrderByIdResponseTest.kt | 90 ++++---- .../v1/orders/OrderGetOrdersResponseTest.kt | 90 ++++---- .../v1/orders/OrderReplaceOrderParamsTest.kt | 18 +- .../orders/OrderReplaceOrderResponseTest.kt | 90 ++++---- .../v1/orders/OrderSubmitOrdersParamsTest.kt | 203 +++++------------- .../orders/OrderSubmitOrdersResponseTest.kt | 90 ++++---- .../api/models/v1/orders/OrderTest.kt | 90 ++++---- .../PositionClosePositionResponseTest.kt | 90 ++++---- .../PositionClosePositionsResponseTest.kt | 90 ++++---- .../models/v1/screener/FilterOpSpecTest.kt | 6 +- .../ScreenerCreateScreenerParamsTest.kt | 6 +- .../ScreenerCreateScreenerResponseTest.kt | 6 +- .../models/v1/screener/ScreenerEntryTest.kt | 6 +- .../ScreenerGetScreenerByIdResponseTest.kt | 6 +- .../ScreenerGetScreenersResponseTest.kt | 6 +- .../ScreenerReplaceScreenerParamsTest.kt | 6 +- .../ScreenerReplaceScreenerResponseTest.kt | 6 +- .../ScreenerSearchScreenerParamsTest.kt | 6 +- .../models/v1/screener/SearchFilterTest.kt | 6 +- .../async/v1/OrderServiceAsyncTest.kt | 54 ++--- .../async/v1/ScreenerServiceAsyncTest.kt | 6 +- .../services/blocking/v1/OrderServiceTest.kt | 54 ++--- .../blocking/v1/ScreenerServiceTest.kt | 6 +- .../api/proguard/ProGuardCompatibilityTest.kt | 8 +- 36 files changed, 640 insertions(+), 761 deletions(-) diff --git a/.stats.yml b/.stats.yml index f4cef465..369d11a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-ca06a1cd4f4f600d8b58487d52561832b4c9ea5c7be85ea709e6b9cf5ee93de0.yml -openapi_spec_hash: d551b79cd98f734b8429177be29f2ee8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-b238a80e1eacaf493dbb0c67c88175a38e1b4b43fcfdca1acb6de64e358aad02.yml +openapi_spec_hash: 6a83458a60852309dc8afe445e555651 config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt index d7721ff0..09c9b412 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequest.kt @@ -195,8 +195,8 @@ private constructor( fun stopPrice(): Optional = stopPrice.getOptional("stop_price") /** - * Trading symbol. For equities, use the ticker symbol (e.g., "AAPL"). For options, use the OSI - * symbol (e.g., "AAPL 250117C00190000"). Either `symbol` or `instrument_id` must be provided. + * Trading symbol. For equities, use the ticker symbol (e.g., "TSLA"). For options, use the OSI + * symbol (e.g., "TSLA 250117C00190000"). Either `symbol` or `instrument_id` must be provided. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -601,8 +601,8 @@ private constructor( fun stopPrice(stopPrice: JsonField) = apply { this.stopPrice = stopPrice } /** - * Trading symbol. For equities, use the ticker symbol (e.g., "AAPL"). For options, use the - * OSI symbol (e.g., "AAPL 250117C00190000"). Either `symbol` or `instrument_id` must be + * Trading symbol. For equities, use the ticker symbol (e.g., "TSLA"). For options, use the + * OSI symbol (e.g., "TSLA 250117C00190000"). Either `symbol` or `instrument_id` must be * provided. */ fun symbol(symbol: String?) = symbol(JsonField.ofNullable(symbol)) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt index 32e10cf3..3e955343 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionGetPositionInstructionsParams.kt @@ -28,7 +28,10 @@ private constructor( fun accountId(): Optional = Optional.ofNullable(accountId) - /** Limit results to a single contract. Accepts the instrument id or the OSI symbol. */ + /** + * Limit results to a single contract. Instrument ID (UUID) or symbol (equity ticker or OSI + * option symbol). + */ fun instrumentId(): Optional = Optional.ofNullable(instrumentId) /** Additional headers to send with the request. */ @@ -81,7 +84,10 @@ private constructor( /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) - /** Limit results to a single contract. Accepts the instrument id or the OSI symbol. */ + /** + * Limit results to a single contract. Instrument ID (UUID) or symbol (equity ticker or OSI + * option symbol). + */ fun instrumentId(instrumentId: String?) = apply { this.instrumentId = instrumentId } /** Alias for calling [Builder.instrumentId] with `instrumentId.orElse(null)`. */ diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt index c75d43bb..8ffee415 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/ContentPartStructuredActionPayloadTest.kt @@ -35,13 +35,13 @@ internal class ContentPartStructuredActionPayloadTest { OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z") ) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) @@ -70,13 +70,13 @@ internal class ContentPartStructuredActionPayloadTest { OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z") ) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) @@ -110,13 +110,13 @@ internal class ContentPartStructuredActionPayloadTest { OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z") ) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderActionTest.kt index ea2db95c..76c8ed26 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillNewOrderActionTest.kt @@ -29,13 +29,13 @@ internal class PrefillNewOrderActionTest { .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) @@ -51,13 +51,13 @@ internal class PrefillNewOrderActionTest { .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) @@ -77,13 +77,13 @@ internal class PrefillNewOrderActionTest { .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderActionTest.kt index d2dd45a0..87ee52d0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/PrefillOrderActionTest.kt @@ -35,13 +35,13 @@ internal class PrefillOrderActionTest { .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) @@ -69,13 +69,13 @@ internal class PrefillOrderActionTest { .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt index 8af99302..80643c77 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt @@ -37,13 +37,13 @@ internal class StructuredActionTest { .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) @@ -79,13 +79,13 @@ internal class StructuredActionTest { OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z") ) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPartTest.kt index 35971c45..e7b0cd64 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/responses/ResponseContentPartTest.kt @@ -126,13 +126,13 @@ internal class ResponseContentPartTest { OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z") ) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) @@ -180,13 +180,13 @@ internal class ResponseContentPartTest { ) ) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPartTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPartTest.kt index 2ab61e57..1b41a8cd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPartTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/MessageContentPartTest.kt @@ -87,13 +87,13 @@ internal class MessageContentPartTest { OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z") ) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) @@ -140,13 +140,13 @@ internal class MessageContentPartTest { ) ) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequestTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequestTest.kt index 1bcc6e1f..1398ae53 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequestTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/NewOrderRequestTest.kt @@ -14,38 +14,38 @@ internal class NewOrderRequestTest { fun create() { val newOrderRequest = NewOrderRequest.builder() - .orderType(RequestOrderType.LIMIT) - .quantity("25") + .orderType(RequestOrderType.MARKET) + .quantity("1") .side(Side.BUY) .timeInForce(RequestTimeInForce.DAY) .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") - .limitPrice("140.50") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") + .limitPrice("48.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") - .symbol("AAPL") - .trailingOffset("1.25") + .stopPrice("52.00") + .symbol("TSLA") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() - assertThat(newOrderRequest.orderType()).isEqualTo(RequestOrderType.LIMIT) - assertThat(newOrderRequest.quantity()).isEqualTo("25") + assertThat(newOrderRequest.orderType()).isEqualTo(RequestOrderType.MARKET) + assertThat(newOrderRequest.quantity()).isEqualTo("1") assertThat(newOrderRequest.side()).isEqualTo(Side.BUY) assertThat(newOrderRequest.timeInForce()).isEqualTo(RequestTimeInForce.DAY) assertThat(newOrderRequest.id()).contains("my-ref-id-20251001-002") assertThat(newOrderRequest.expiresAt()) .contains(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) assertThat(newOrderRequest.extendedHours()).contains(true) - assertThat(newOrderRequest.instrumentId()).contains("f47ac10b-58cc-4372-a567-0e02b2c3d479") - assertThat(newOrderRequest.limitOffset()).contains("0.10") - assertThat(newOrderRequest.limitPrice()).contains("140.50") + assertThat(newOrderRequest.instrumentId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(newOrderRequest.limitOffset()).contains("0.50") + assertThat(newOrderRequest.limitPrice()).contains("48.00") assertThat(newOrderRequest.positionEffect()).contains(PositionEffect.OPEN) - assertThat(newOrderRequest.stopPrice()).contains("135.00") - assertThat(newOrderRequest.symbol()).contains("AAPL") - assertThat(newOrderRequest.trailingOffset()).contains("1.25") + assertThat(newOrderRequest.stopPrice()).contains("52.00") + assertThat(newOrderRequest.symbol()).contains("TSLA") + assertThat(newOrderRequest.trailingOffset()).contains("2.00") assertThat(newOrderRequest.trailingOffsetType()).contains(TrailingOffsetType.PRICE) } @@ -54,20 +54,20 @@ internal class NewOrderRequestTest { val jsonMapper = jsonMapper() val newOrderRequest = NewOrderRequest.builder() - .orderType(RequestOrderType.LIMIT) - .quantity("25") + .orderType(RequestOrderType.MARKET) + .quantity("1") .side(Side.BUY) .timeInForce(RequestTimeInForce.DAY) .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") - .limitPrice("140.50") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") + .limitPrice("48.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") - .symbol("AAPL") - .trailingOffset("1.25") + .stopPrice("52.00") + .symbol("TSLA") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt index 9ce4a577..39ad0781 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelAllOpenOrdersResponseTest.kt @@ -45,32 +45,32 @@ internal class OrderCancelAllOpenOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -107,32 +107,32 @@ internal class OrderCancelAllOpenOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -171,32 +171,32 @@ internal class OrderCancelAllOpenOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt index e76baff7..c4612683 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderCancelOpenOrderResponseTest.kt @@ -45,32 +45,32 @@ internal class OrderCancelOpenOrderResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -107,32 +107,32 @@ internal class OrderCancelOpenOrderResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -171,32 +171,32 @@ internal class OrderCancelOpenOrderResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt index 5cf43b6a..c6f35ea0 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrderByIdResponseTest.kt @@ -45,32 +45,32 @@ internal class OrderGetOrderByIdResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -107,32 +107,32 @@ internal class OrderGetOrderByIdResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -171,32 +171,32 @@ internal class OrderGetOrderByIdResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponseTest.kt index c651a89f..73a7fddf 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderGetOrdersResponseTest.kt @@ -45,32 +45,32 @@ internal class OrderGetOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -107,32 +107,32 @@ internal class OrderGetOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -171,32 +171,32 @@ internal class OrderGetOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParamsTest.kt index 5df33c3d..8028403e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderParamsTest.kt @@ -12,9 +12,9 @@ internal class OrderReplaceOrderParamsTest { OrderReplaceOrderParams.builder() .accountId(0L) .orderId("order_id") - .limitPrice("150.50") - .quantity("125") - .stopPrice("148.00") + .limitPrice("49.00") + .quantity("1") + .stopPrice("52.00") .timeInForce(RequestTimeInForce.DAY) .build() } @@ -35,17 +35,17 @@ internal class OrderReplaceOrderParamsTest { OrderReplaceOrderParams.builder() .accountId(0L) .orderId("order_id") - .limitPrice("150.50") - .quantity("125") - .stopPrice("148.00") + .limitPrice("49.00") + .quantity("1") + .stopPrice("52.00") .timeInForce(RequestTimeInForce.DAY) .build() val body = params._body() - assertThat(body.limitPrice()).contains("150.50") - assertThat(body.quantity()).contains("125") - assertThat(body.stopPrice()).contains("148.00") + assertThat(body.limitPrice()).contains("49.00") + assertThat(body.quantity()).contains("1") + assertThat(body.stopPrice()).contains("52.00") assertThat(body.timeInForce()).contains(RequestTimeInForce.DAY) } diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponseTest.kt index 87fcc7ca..35fc0fe8 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderReplaceOrderResponseTest.kt @@ -45,32 +45,32 @@ internal class OrderReplaceOrderResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -107,32 +107,32 @@ internal class OrderReplaceOrderResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -171,32 +171,32 @@ internal class OrderReplaceOrderResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt index 7c64b87a..48b3e557 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersParamsTest.kt @@ -2,6 +2,7 @@ package com.clearstreet.api.models.v1.orders +import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,37 +13,22 @@ internal class OrderSubmitOrdersParamsTest { OrderSubmitOrdersParams.builder() .accountId(0L) .addOrder( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.builder() - .legs( - listOf( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-447a-706f-996f-097254663f02") - .side(Side.BUY) - .id("1") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") - .side(Side.SELL) - .id("2") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") - .side(Side.BUY) - .id("3") - .positionEffect(PositionEffect.OPEN) - .build(), - ) - ) + NewOrderRequest.builder() .orderType(RequestOrderType.LIMIT) - .timeInForce(RequestTimeInForce.DAY) - .id("my-mleg-ref-20251001-001") - .limitPrice("0.50") .quantity("1") + .side(Side.BUY) + .timeInForce(RequestTimeInForce.DAY) + .id("my-ref-id-20251001-002") + .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) + .extendedHours(true) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") + .limitPrice("48.00") + .positionEffect(PositionEffect.OPEN) + .stopPrice("52.00") + .symbol("TSLA") + .trailingOffset("2.00") + .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) .build() @@ -54,27 +40,10 @@ internal class OrderSubmitOrdersParamsTest { OrderSubmitOrdersParams.builder() .accountId(0L) .addOrder( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.builder() - .legs( - listOf( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-447a-706f-996f-097254663f02") - .side(Side.BUY) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") - .side(Side.SELL) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") - .side(Side.BUY) - .build(), - ) - ) + NewOrderRequest.builder() .orderType(RequestOrderType.LIMIT) + .quantity("1") + .side(Side.BUY) .timeInForce(RequestTimeInForce.DAY) .build() ) @@ -91,37 +60,22 @@ internal class OrderSubmitOrdersParamsTest { OrderSubmitOrdersParams.builder() .accountId(0L) .addOrder( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.builder() - .legs( - listOf( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-447a-706f-996f-097254663f02") - .side(Side.BUY) - .id("1") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") - .side(Side.SELL) - .id("2") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") - .side(Side.BUY) - .id("3") - .positionEffect(PositionEffect.OPEN) - .build(), - ) - ) + NewOrderRequest.builder() .orderType(RequestOrderType.LIMIT) - .timeInForce(RequestTimeInForce.DAY) - .id("my-mleg-ref-20251001-001") - .limitPrice("0.50") .quantity("1") + .side(Side.BUY) + .timeInForce(RequestTimeInForce.DAY) + .id("my-ref-id-20251001-002") + .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) + .extendedHours(true) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") + .limitPrice("48.00") + .positionEffect(PositionEffect.OPEN) + .stopPrice("52.00") + .symbol("TSLA") + .trailingOffset("2.00") + .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) .build() @@ -130,38 +84,23 @@ internal class OrderSubmitOrdersParamsTest { assertThat(body) .containsExactly( - OrderSubmitOrdersParams.Order.ofNewOrderMultilegRequest( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.builder() - .legs( - listOf( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-447a-706f-996f-097254663f02") - .side(Side.BUY) - .id("1") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") - .side(Side.SELL) - .id("2") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") - .side(Side.BUY) - .id("3") - .positionEffect(PositionEffect.OPEN) - .build(), - ) - ) + OrderSubmitOrdersParams.Order.ofNewOrderRequest( + NewOrderRequest.builder() .orderType(RequestOrderType.LIMIT) - .timeInForce(RequestTimeInForce.DAY) - .id("my-mleg-ref-20251001-001") - .limitPrice("0.50") .quantity("1") + .side(Side.BUY) + .timeInForce(RequestTimeInForce.DAY) + .id("my-ref-id-20251001-002") + .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) + .extendedHours(true) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") + .limitPrice("48.00") + .positionEffect(PositionEffect.OPEN) + .stopPrice("52.00") + .symbol("TSLA") + .trailingOffset("2.00") + .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) ) @@ -173,27 +112,10 @@ internal class OrderSubmitOrdersParamsTest { OrderSubmitOrdersParams.builder() .accountId(0L) .addOrder( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.builder() - .legs( - listOf( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-447a-706f-996f-097254663f02") - .side(Side.BUY) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") - .side(Side.SELL) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") - .side(Side.BUY) - .build(), - ) - ) + NewOrderRequest.builder() .orderType(RequestOrderType.LIMIT) + .quantity("1") + .side(Side.BUY) .timeInForce(RequestTimeInForce.DAY) .build() ) @@ -203,28 +125,11 @@ internal class OrderSubmitOrdersParamsTest { assertThat(body) .containsExactly( - OrderSubmitOrdersParams.Order.ofNewOrderMultilegRequest( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.builder() - .legs( - listOf( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-447a-706f-996f-097254663f02") - .side(Side.BUY) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") - .side(Side.SELL) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg.builder() - .ratio("ratio") - .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") - .side(Side.BUY) - .build(), - ) - ) + OrderSubmitOrdersParams.Order.ofNewOrderRequest( + NewOrderRequest.builder() .orderType(RequestOrderType.LIMIT) + .quantity("1") + .side(Side.BUY) .timeInForce(RequestTimeInForce.DAY) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt index 70d6dd1f..e3fcd017 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderSubmitOrdersResponseTest.kt @@ -45,32 +45,32 @@ internal class OrderSubmitOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -107,32 +107,32 @@ internal class OrderSubmitOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -171,32 +171,32 @@ internal class OrderSubmitOrdersResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderTest.kt index 5e53327d..7e20a2cb 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/orders/OrderTest.kt @@ -20,32 +20,32 @@ internal class OrderTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -55,35 +55,35 @@ internal class OrderTest { assertThat(order.clientOrderId()).isEqualTo("my-ref-id-20251001-001") assertThat(order.createdAt()) .isEqualTo(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - assertThat(order.filledQuantity()).isEqualTo("50") - assertThat(order.instrumentId()).isEqualTo("f47ac10b-58cc-4372-a567-0e02b2c3d479") + assertThat(order.filledQuantity()).isEqualTo("0") + assertThat(order.instrumentId()).isEqualTo("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") assertThat(order.instrumentType()).isEqualTo(SecurityType.COMMON_STOCK) - assertThat(order.leavesQuantity()).isEqualTo("50") + assertThat(order.leavesQuantity()).isEqualTo("1") assertThat(order.orderType()).isEqualTo(OrderType.LIMIT) - assertThat(order.quantity()).isEqualTo("100") + assertThat(order.quantity()).isEqualTo("1") assertThat(order.side()).isEqualTo(Side.BUY) - assertThat(order.status()).isEqualTo(OrderStatus.PARTIALLY_FILLED) - assertThat(order.symbol()).isEqualTo("AAPL") + assertThat(order.status()).isEqualTo(OrderStatus.PENDING_NEW) + assertThat(order.symbol()).isEqualTo("TSLA") assertThat(order.timeInForce()).isEqualTo(TimeInForce.DAY) assertThat(order.updatedAt()) - .isEqualTo(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - assertThat(order.venue()).isEqualTo("XNMS") - assertThat(order.averageFillPrice()).contains("149.95") + .isEqualTo(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + assertThat(order.venue()).isEqualTo("XNAS") + assertThat(order.averageFillPrice()).contains("47.95") assertThat(order.details().getOrNull()).containsExactly("string") assertThat(order.expiresAt()) .contains(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) assertThat(order.extendedHours()).contains(false) - assertThat(order.limitOffset()).contains("0.10") - assertThat(order.limitPrice()).contains("150.00") + assertThat(order.limitOffset()).contains("0.50") + assertThat(order.limitPrice()).contains("48.00") assertThat(order.queueState()).contains(QueueState.AWAITING_RELEASE) assertThat(order.releasesAt()) .contains(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) assertThat(order.stopPrice()).isEmpty - assertThat(order.trailingLimitPx()).contains("148.65") - assertThat(order.trailingOffset()).contains("1.25") + assertThat(order.trailingLimitPx()).contains("47.50") + assertThat(order.trailingOffset()).contains("2.00") assertThat(order.trailingOffsetType()).contains(TrailingOffsetType.PRICE) - assertThat(order.trailingStopPx()).contains("148.75") - assertThat(order.trailingWatermarkPx()).contains("150.00") + assertThat(order.trailingStopPx()).contains("48.00") + assertThat(order.trailingWatermarkPx()).contains("50.00") assertThat(order.trailingWatermarkTs()) .contains(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) assertThat(order.underlyingInstrumentId()).contains("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") @@ -98,32 +98,32 @@ internal class OrderTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponseTest.kt index 5a05d6b7..abd463fa 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionResponseTest.kt @@ -52,32 +52,32 @@ internal class PositionClosePositionResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -114,32 +114,32 @@ internal class PositionClosePositionResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -178,32 +178,32 @@ internal class PositionClosePositionResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponseTest.kt index ac4a2706..37afdf60 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/positions/PositionClosePositionsResponseTest.kt @@ -52,32 +52,32 @@ internal class PositionClosePositionsResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -114,32 +114,32 @@ internal class PositionClosePositionsResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() @@ -178,32 +178,32 @@ internal class PositionClosePositionsResponseTest { .accountId(19816L) .clientOrderId("my-ref-id-20251001-001") .createdAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) - .filledQuantity("50") - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") + .filledQuantity("0") + .instrumentId("d4d5d6d7-e4e5-f4f5-a4a5-a6a7a8a9aaab") .instrumentType(SecurityType.COMMON_STOCK) - .leavesQuantity("50") + .leavesQuantity("1") .orderType(OrderType.LIMIT) - .quantity("100") + .quantity("1") .side(Side.BUY) - .status(OrderStatus.PARTIALLY_FILLED) - .symbol("AAPL") + .status(OrderStatus.PENDING_NEW) + .symbol("TSLA") .timeInForce(TimeInForce.DAY) - .updatedAt(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) - .venue("XNMS") - .averageFillPrice("149.95") + .updatedAt(OffsetDateTime.parse("2025-10-31T13:30:00.000000000Z")) + .venue("XNAS") + .averageFillPrice("47.95") .addDetail("string") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(false) - .limitOffset("0.10") - .limitPrice("150.00") + .limitOffset("0.50") + .limitPrice("48.00") .queueState(QueueState.AWAITING_RELEASE) .releasesAt(OffsetDateTime.parse("2025-10-31T14:30:00.000000000Z")) .stopPrice(null) - .trailingLimitPx("148.65") - .trailingOffset("1.25") + .trailingLimitPx("47.50") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) - .trailingStopPx("148.75") - .trailingWatermarkPx("150.00") + .trailingStopPx("48.00") + .trailingWatermarkPx("50.00") .trailingWatermarkTs(OffsetDateTime.parse("2025-10-31T13:35:10.000000000Z")) .underlyingInstrumentId("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpecTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpecTest.kt index 0138cb6e..eef1a2ef 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpecTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/FilterOpSpecTest.kt @@ -14,11 +14,11 @@ internal class FilterOpSpecTest { fun create() { val filterOpSpec = FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() - assertThat(filterOpSpec.name()).isEqualTo(FilterOperator.LESS_THAN) + assertThat(filterOpSpec.name()).isEqualTo(FilterOperator.GREATER_OR_EQUAL) assertThat(filterOpSpec.args().getOrNull()).containsExactly(OperatorArg.LEFT_INCLUSIVE) } @@ -27,7 +27,7 @@ internal class FilterOpSpecTest { val jsonMapper = jsonMapper() val filterOpSpec = FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt index 13c3d1a1..f7150b89 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt @@ -40,7 +40,7 @@ internal class ScreenerCreateScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -114,7 +114,7 @@ internal class ScreenerCreateScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -188,7 +188,7 @@ internal class ScreenerCreateScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt index d8f67f20..145439c1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt @@ -55,7 +55,7 @@ internal class ScreenerCreateScreenerResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -155,7 +155,7 @@ internal class ScreenerCreateScreenerResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -257,7 +257,7 @@ internal class ScreenerCreateScreenerResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt index b4ae43e3..fc366812 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt @@ -30,7 +30,7 @@ internal class ScreenerEntryTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -104,7 +104,7 @@ internal class ScreenerEntryTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -185,7 +185,7 @@ internal class ScreenerEntryTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt index 35bd4c64..017b4c16 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt @@ -55,7 +55,7 @@ internal class ScreenerGetScreenerByIdResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -155,7 +155,7 @@ internal class ScreenerGetScreenerByIdResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -257,7 +257,7 @@ internal class ScreenerGetScreenerByIdResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt index 27f5cfa3..0c296fe7 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt @@ -55,7 +55,7 @@ internal class ScreenerGetScreenersResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -155,7 +155,7 @@ internal class ScreenerGetScreenersResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -257,7 +257,7 @@ internal class ScreenerGetScreenersResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt index 74da7d34..73c314a4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt @@ -41,7 +41,7 @@ internal class ScreenerReplaceScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -128,7 +128,7 @@ internal class ScreenerReplaceScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -202,7 +202,7 @@ internal class ScreenerReplaceScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt index 47c747cc..729f8ae2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt @@ -55,7 +55,7 @@ internal class ScreenerReplaceScreenerResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -155,7 +155,7 @@ internal class ScreenerReplaceScreenerResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -257,7 +257,7 @@ internal class ScreenerReplaceScreenerResponseTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt index e4e0df25..6dea32d5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt @@ -54,7 +54,7 @@ internal class ScreenerSearchScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -144,7 +144,7 @@ internal class ScreenerSearchScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -232,7 +232,7 @@ internal class ScreenerSearchScreenerParamsTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SearchFilterTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SearchFilterTest.kt index 74ecedd8..1c84c8b3 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SearchFilterTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/SearchFilterTest.kt @@ -24,7 +24,7 @@ internal class SearchFilterTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -61,7 +61,7 @@ internal class SearchFilterTest { assertThat(searchFilter.op()) .contains( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -102,7 +102,7 @@ internal class SearchFilterTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt index 12e10737..de2db48e 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/OrderServiceAsyncTest.kt @@ -4,6 +4,7 @@ package com.clearstreet.api.services.async.v1 import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync +import com.clearstreet.api.models.v1.orders.NewOrderRequest import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams import com.clearstreet.api.models.v1.orders.OrderGetExecutionsParams @@ -15,6 +16,7 @@ import com.clearstreet.api.models.v1.orders.PositionEffect import com.clearstreet.api.models.v1.orders.RequestOrderType import com.clearstreet.api.models.v1.orders.RequestTimeInForce import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -151,9 +153,9 @@ internal class OrderServiceAsyncTest { OrderReplaceOrderParams.builder() .accountId(0L) .orderId("order_id") - .limitPrice("150.50") - .quantity("125") - .stopPrice("148.00") + .limitPrice("49.00") + .quantity("1") + .stopPrice("52.00") .timeInForce(RequestTimeInForce.DAY) .build() ) @@ -176,40 +178,22 @@ internal class OrderServiceAsyncTest { OrderSubmitOrdersParams.builder() .accountId(0L) .addOrder( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.builder() - .legs( - listOf( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg - .builder() - .ratio("ratio") - .security("0193bb84-447a-706f-996f-097254663f02") - .side(Side.BUY) - .id("1") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg - .builder() - .ratio("ratio") - .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") - .side(Side.SELL) - .id("2") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg - .builder() - .ratio("ratio") - .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") - .side(Side.BUY) - .id("3") - .positionEffect(PositionEffect.OPEN) - .build(), - ) - ) + NewOrderRequest.builder() .orderType(RequestOrderType.LIMIT) - .timeInForce(RequestTimeInForce.DAY) - .id("my-mleg-ref-20251001-001") - .limitPrice("0.50") .quantity("1") + .side(Side.BUY) + .timeInForce(RequestTimeInForce.DAY) + .id("my-ref-id-20251001-002") + .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) + .extendedHours(true) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") + .limitPrice("48.00") + .positionEffect(PositionEffect.OPEN) + .stopPrice("52.00") + .symbol("TSLA") + .trailingOffset("2.00") + .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt index 388df061..3b1d562b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt @@ -67,7 +67,7 @@ internal class ScreenerServiceAsyncTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -199,7 +199,7 @@ internal class ScreenerServiceAsyncTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -299,7 +299,7 @@ internal class ScreenerServiceAsyncTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt index 1780108c..d5bd1077 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/OrderServiceTest.kt @@ -4,6 +4,7 @@ package com.clearstreet.api.services.blocking.v1 import com.clearstreet.api.TestServerExtension import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient +import com.clearstreet.api.models.v1.orders.NewOrderRequest import com.clearstreet.api.models.v1.orders.OrderCancelAllOpenOrdersParams import com.clearstreet.api.models.v1.orders.OrderCancelOpenOrderParams import com.clearstreet.api.models.v1.orders.OrderGetExecutionsParams @@ -15,6 +16,7 @@ import com.clearstreet.api.models.v1.orders.PositionEffect import com.clearstreet.api.models.v1.orders.RequestOrderType import com.clearstreet.api.models.v1.orders.RequestTimeInForce import com.clearstreet.api.models.v1.orders.Side +import com.clearstreet.api.models.v1.orders.TrailingOffsetType import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -146,9 +148,9 @@ internal class OrderServiceTest { OrderReplaceOrderParams.builder() .accountId(0L) .orderId("order_id") - .limitPrice("150.50") - .quantity("125") - .stopPrice("148.00") + .limitPrice("49.00") + .quantity("1") + .stopPrice("52.00") .timeInForce(RequestTimeInForce.DAY) .build() ) @@ -170,40 +172,22 @@ internal class OrderServiceTest { OrderSubmitOrdersParams.builder() .accountId(0L) .addOrder( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.builder() - .legs( - listOf( - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg - .builder() - .ratio("ratio") - .security("0193bb84-447a-706f-996f-097254663f02") - .side(Side.BUY) - .id("1") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg - .builder() - .ratio("ratio") - .security("0193bb84-4db4-78ec-b4fd-cba8be61cf8a") - .side(Side.SELL) - .id("2") - .positionEffect(PositionEffect.OPEN) - .build(), - OrderSubmitOrdersParams.Order.NewOrderMultilegRequest.Leg - .builder() - .ratio("ratio") - .security("0193bb84-5264-7f20-8fd3-35df82cd6ef0") - .side(Side.BUY) - .id("3") - .positionEffect(PositionEffect.OPEN) - .build(), - ) - ) + NewOrderRequest.builder() .orderType(RequestOrderType.LIMIT) - .timeInForce(RequestTimeInForce.DAY) - .id("my-mleg-ref-20251001-001") - .limitPrice("0.50") .quantity("1") + .side(Side.BUY) + .timeInForce(RequestTimeInForce.DAY) + .id("my-ref-id-20251001-002") + .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) + .extendedHours(true) + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") + .limitPrice("48.00") + .positionEffect(PositionEffect.OPEN) + .stopPrice("52.00") + .symbol("TSLA") + .trailingOffset("2.00") + .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt index 633e7223..83cacbc6 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt @@ -67,7 +67,7 @@ internal class ScreenerServiceTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -193,7 +193,7 @@ internal class ScreenerServiceTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) @@ -292,7 +292,7 @@ internal class ScreenerServiceTest { ) .op( FilterOpSpec.builder() - .name(FilterOperator.LESS_THAN) + .name(FilterOperator.GREATER_OR_EQUAL) .addArg(OperatorArg.LEFT_INCLUSIVE) .build() ) diff --git a/clear-street-java-proguard-test/src/test/kotlin/com/clearstreet/api/proguard/ProGuardCompatibilityTest.kt b/clear-street-java-proguard-test/src/test/kotlin/com/clearstreet/api/proguard/ProGuardCompatibilityTest.kt index 41e425d2..c9cd8315 100644 --- a/clear-street-java-proguard-test/src/test/kotlin/com/clearstreet/api/proguard/ProGuardCompatibilityTest.kt +++ b/clear-street-java-proguard-test/src/test/kotlin/com/clearstreet/api/proguard/ProGuardCompatibilityTest.kt @@ -102,13 +102,13 @@ internal class ProGuardCompatibilityTest { .id("my-ref-id-20251001-002") .expiresAt(OffsetDateTime.parse("2025-10-15T16:00:00.000000000Z")) .extendedHours(true) - .instrumentId("f47ac10b-58cc-4372-a567-0e02b2c3d479") - .limitOffset("0.10") + .instrumentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limitOffset("0.50") .limitPrice("150.00") .positionEffect(PositionEffect.OPEN) - .stopPrice("135.00") + .stopPrice("52.00") .symbol("AAPL") - .trailingOffset("1.25") + .trailingOffset("2.00") .trailingOffsetType(TrailingOffsetType.PRICE) .build() ) From 457c1d74df20eca53640d45d68d02cf26be92ddd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 16:10:52 +0000 Subject: [PATCH 46/51] feat(api): api update --- .stats.yml | 4 +- .../v1/accounts/AccountGetAccountsParams.kt | 62 ++++++++++++++++++- .../services/async/v1/AccountServiceAsync.kt | 10 ++- .../services/blocking/v1/AccountService.kt | 10 ++- .../accounts/AccountGetAccountsParamsTest.kt | 11 +++- .../api/services/ErrorHandlingTest.kt | 34 ++++++++++ .../api/services/ServiceParamsTest.kt | 2 + .../async/v1/AccountServiceAsyncTest.kt | 2 + .../blocking/v1/AccountServiceTest.kt | 2 + 9 files changed, 129 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 369d11a9..5e3285e3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-b238a80e1eacaf493dbb0c67c88175a38e1b4b43fcfdca1acb6de64e358aad02.yml -openapi_spec_hash: 6a83458a60852309dc8afe445e555651 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-b11bb07d5cdd5ab0640cd26f2ebe581379c27b890a3a67d9aab7d4c0155dc404.yml +openapi_spec_hash: 3a6595fefc6049da384ec7a1ad422f4f config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParams.kt index 9eab27ea..6ca4d9da 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParams.kt @@ -9,15 +9,36 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** List accounts the authenticated user has permission to access */ +/** + * List accounts the authenticated user has permission to access. + * + * Results can be narrowed with the optional `account_id` and `account_name` filters. `account_id` + * is a lexicographic prefix match on the decimal account id (e.g. `100` matches `100345` and + * `100567`); `account_name` is a case-insensitive substring match on the account's full name. When + * both are supplied an account must match both. When neither is supplied every accessible account + * is returned. + */ class AccountGetAccountsParams private constructor( + private val accountId: String?, + private val accountName: String?, private val pageSize: Long?, private val pageToken: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { + /** + * Filter to accounts whose id starts with this value (lexicographic prefix match on the decimal + * id, e.g. `100` matches `100345`). + */ + fun accountId(): Optional = Optional.ofNullable(accountId) + + /** + * Filter to accounts whose full name contains this value (case-insensitive substring match). + */ + fun accountName(): Optional = Optional.ofNullable(accountName) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(): Optional = Optional.ofNullable(pageSize) @@ -46,6 +67,8 @@ private constructor( /** A builder for [AccountGetAccountsParams]. */ class Builder internal constructor() { + private var accountId: String? = null + private var accountName: String? = null private var pageSize: Long? = null private var pageToken: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -53,12 +76,32 @@ private constructor( @JvmSynthetic internal fun from(accountGetAccountsParams: AccountGetAccountsParams) = apply { + accountId = accountGetAccountsParams.accountId + accountName = accountGetAccountsParams.accountName pageSize = accountGetAccountsParams.pageSize pageToken = accountGetAccountsParams.pageToken additionalHeaders = accountGetAccountsParams.additionalHeaders.toBuilder() additionalQueryParams = accountGetAccountsParams.additionalQueryParams.toBuilder() } + /** + * Filter to accounts whose id starts with this value (lexicographic prefix match on the + * decimal id, e.g. `100` matches `100345`). + */ + fun accountId(accountId: String?) = apply { this.accountId = accountId } + + /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ + fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) + + /** + * Filter to accounts whose full name contains this value (case-insensitive substring + * match). + */ + fun accountName(accountName: String?) = apply { this.accountName = accountName } + + /** Alias for calling [Builder.accountName] with `accountName.orElse(null)`. */ + fun accountName(accountName: Optional) = accountName(accountName.getOrNull()) + /** The number of items to return per page. Only used when page_token is not provided. */ fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } @@ -186,6 +229,8 @@ private constructor( */ fun build(): AccountGetAccountsParams = AccountGetAccountsParams( + accountId, + accountName, pageSize, pageToken, additionalHeaders.build(), @@ -198,6 +243,8 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { + accountId?.let { put("account_id", it) } + accountName?.let { put("account_name", it) } pageSize?.let { put("page_size", it.toString()) } pageToken?.let { put("page_token", it) } putAll(additionalQueryParams) @@ -210,6 +257,8 @@ private constructor( } return other is AccountGetAccountsParams && + accountId == other.accountId && + accountName == other.accountName && pageSize == other.pageSize && pageToken == other.pageToken && additionalHeaders == other.additionalHeaders && @@ -217,8 +266,15 @@ private constructor( } override fun hashCode(): Int = - Objects.hash(pageSize, pageToken, additionalHeaders, additionalQueryParams) + Objects.hash( + accountId, + accountName, + pageSize, + pageToken, + additionalHeaders, + additionalQueryParams, + ) override fun toString() = - "AccountGetAccountsParams{pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "AccountGetAccountsParams{accountId=$accountId, accountName=$accountName, pageSize=$pageSize, pageToken=$pageToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsync.kt index 0eef04a6..88627634 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsync.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsync.kt @@ -109,7 +109,15 @@ interface AccountServiceAsync { ): CompletableFuture = getAccountById(accountId, AccountGetAccountByIdParams.none(), requestOptions) - /** List accounts the authenticated user has permission to access */ + /** + * List accounts the authenticated user has permission to access. + * + * Results can be narrowed with the optional `account_id` and `account_name` filters. + * `account_id` is a lexicographic prefix match on the decimal account id (e.g. `100` matches + * `100345` and `100567`); `account_name` is a case-insensitive substring match on the account's + * full name. When both are supplied an account must match both. When neither is supplied every + * accessible account is returned. + */ fun getAccounts(): CompletableFuture = getAccounts(AccountGetAccountsParams.none()) diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountService.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountService.kt index d9f5d52b..5930ec4e 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountService.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/services/blocking/v1/AccountService.kt @@ -105,7 +105,15 @@ interface AccountService { ): AccountGetAccountByIdResponse = getAccountById(accountId, AccountGetAccountByIdParams.none(), requestOptions) - /** List accounts the authenticated user has permission to access */ + /** + * List accounts the authenticated user has permission to access. + * + * Results can be narrowed with the optional `account_id` and `account_name` filters. + * `account_id` is a lexicographic prefix match on the decimal account id (e.g. `100` matches + * `100345` and `100567`); `account_name` is a case-insensitive substring match on the account's + * full name. When both are supplied an account must match both. When neither is supplied every + * accessible account is returned. + */ fun getAccounts(): AccountGetAccountsResponse = getAccounts(AccountGetAccountsParams.none()) /** @see getAccounts */ diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParamsTest.kt index cebf3a9f..31166463 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/accounts/AccountGetAccountsParamsTest.kt @@ -10,13 +10,20 @@ internal class AccountGetAccountsParamsTest { @Test fun create() { - AccountGetAccountsParams.builder().pageSize(1L).pageToken("U3RhaW5sZXNzIHJvY2tz").build() + AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") + .pageSize(1L) + .pageToken("U3RhaW5sZXNzIHJvY2tz") + .build() } @Test fun queryParams() { val params = AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -26,6 +33,8 @@ internal class AccountGetAccountsParamsTest { assertThat(queryParams) .isEqualTo( QueryParams.builder() + .put("account_id", "account_id") + .put("account_name", "account_name") .put("page_size", "1") .put("page_token", "U3RhaW5sZXNzIHJvY2tz") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ErrorHandlingTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ErrorHandlingTest.kt index 7c31c0bd..9dc7acaf 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ErrorHandlingTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ErrorHandlingTest.kt @@ -72,6 +72,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -97,6 +99,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -122,6 +126,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -147,6 +153,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -172,6 +180,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -197,6 +207,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -222,6 +234,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -247,6 +261,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -272,6 +288,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -297,6 +315,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -322,6 +342,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -347,6 +369,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -372,6 +396,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -397,6 +423,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -422,6 +450,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -447,6 +477,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() @@ -470,6 +502,8 @@ internal class ErrorHandlingTest { assertThrows { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt index d8bd5ed7..7449b8c4 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/ServiceParamsTest.kt @@ -40,6 +40,8 @@ internal class ServiceParamsTest { accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .putAdditionalHeader("Secret-Header", "42") diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt index 1dbc1504..7aad6893 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/AccountServiceAsyncTest.kt @@ -64,6 +64,8 @@ internal class AccountServiceAsyncTest { val responseFuture = accountServiceAsync.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt index 77b48ecc..2adbb69b 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/AccountServiceTest.kt @@ -62,6 +62,8 @@ internal class AccountServiceTest { val response = accountService.getAccounts( AccountGetAccountsParams.builder() + .accountId("account_id") + .accountName("account_name") .pageSize(1L) .pageToken("U3RhaW5sZXNzIHJvY2tz") .build() From 0a6aff1439838a09031f758b2b39afaea2df7e47 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2026 14:06:26 +0000 Subject: [PATCH 47/51] feat(api): api update --- .stats.yml | 4 ++-- .../threads/ThreadGetThreadResponseResponse.kt | 13 ++++++++----- .../threads/ThreadGetThreadResponseResponseTest.kt | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5e3285e3..8149e35c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-b11bb07d5cdd5ab0640cd26f2ebe581379c27b890a3a67d9aab7d4c0155dc404.yml -openapi_spec_hash: 3a6595fefc6049da384ec7a1ad422f4f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-e23f6967e9c32e2f9ea309ad3987052c2cd495a2b8aedd67d77e69170f7a6b84.yml +openapi_spec_hash: 0cb41ef4616f2fdd45d4218582f19b8a config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt index 1bb861f4..5e1f87d0 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponse.kt @@ -61,10 +61,10 @@ private constructor( /** * Dynamic pollable response. * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun data(): Response = data.getRequired("data") + fun data(): Optional = data.getOptional("data") /** * Returns the raw JSON value of [metadata]. @@ -161,7 +161,10 @@ private constructor( fun error(error: JsonField) = apply { this.error = error } /** Dynamic pollable response. */ - fun data(data: Response) = data(JsonField.of(data)) + fun data(data: Response?) = data(JsonField.ofNullable(data)) + + /** Alias for calling [Builder.data] with `data.orElse(null)`. */ + fun data(data: Optional) = data(data.getOrNull()) /** * Sets [Builder.data] to an arbitrary JSON value. @@ -229,7 +232,7 @@ private constructor( metadata().validate() error().ifPresent { it.validate() } - data().validate() + data().ifPresent { it.validate() } validated = true } diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt index d55e6064..42913646 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/threads/ThreadGetThreadResponseResponseTest.kt @@ -94,7 +94,7 @@ internal class ThreadGetThreadResponseResponseTest { .build() ) assertThat(threadGetThreadResponseResponse.data()) - .isEqualTo( + .contains( Response.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .status(ResponseStatus.QUEUED) From ba66042f673d15e539d21dcec8ca59cd55f981e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 19:59:46 +0000 Subject: [PATCH 48/51] feat(api): api update --- .stats.yml | 4 +- .../marketdata/SnapshotQuote.kt | 195 +++++++++--------- .../MarketDataGetSnapshotsResponseTest.kt | 12 +- .../marketdata/MarketDataSnapshotTest.kt | 12 +- .../marketdata/SnapshotQuoteTest.kt | 14 +- 5 files changed, 116 insertions(+), 121 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8149e35c..71c409a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-e23f6967e9c32e2f9ea309ad3987052c2cd495a2b8aedd67d77e69170f7a6b84.yml -openapi_spec_hash: 0cb41ef4616f2fdd45d4218582f19b8a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-025ef74c2458dd52cb1cfd12d0650875975dcd6d3e2317c5d45f5384122c4e97.yml +openapi_spec_hash: fde280681b37f41d799f8af9fab976de config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt index 6d6a2562..ce835a66 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuote.kt @@ -6,7 +6,6 @@ import com.clearstreet.api.core.ExcludeMissing import com.clearstreet.api.core.JsonField import com.clearstreet.api.core.JsonMissing import com.clearstreet.api.core.JsonValue -import com.clearstreet.api.core.checkRequired import com.clearstreet.api.errors.ClearStreetInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter @@ -22,63 +21,66 @@ class SnapshotQuote @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val ask: JsonField, - private val bid: JsonField, - private val midpoint: JsonField, private val askSize: JsonField, + private val bid: JsonField, private val bidSize: JsonField, + private val midpoint: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( @JsonProperty("ask") @ExcludeMissing ask: JsonField = JsonMissing.of(), - @JsonProperty("bid") @ExcludeMissing bid: JsonField = JsonMissing.of(), - @JsonProperty("midpoint") @ExcludeMissing midpoint: JsonField = JsonMissing.of(), @JsonProperty("ask_size") @ExcludeMissing askSize: JsonField = JsonMissing.of(), + @JsonProperty("bid") @ExcludeMissing bid: JsonField = JsonMissing.of(), @JsonProperty("bid_size") @ExcludeMissing bidSize: JsonField = JsonMissing.of(), - ) : this(ask, bid, midpoint, askSize, bidSize, mutableMapOf()) + @JsonProperty("midpoint") @ExcludeMissing midpoint: JsonField = JsonMissing.of(), + ) : this(ask, askSize, bid, bidSize, midpoint, mutableMapOf()) /** - * Current best ask. + * Current best ask. Absent when no ask is available (one-sided quote). When a null/undefined + * value is observed, it indicates that there is no available data. * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun ask(): String = ask.getRequired("ask") + fun ask(): Optional = ask.getOptional("ask") /** - * Current best bid. + * Size at the best ask, in shares. When a null/undefined value is observed, it indicates that + * there is no available data. * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun bid(): String = bid.getRequired("bid") + fun askSize(): Optional = askSize.getOptional("ask_size") /** - * Midpoint of bid and ask. + * Current best bid. Absent when no bid is available (one-sided quote). When a null/undefined + * value is observed, it indicates that there is no available data. * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun midpoint(): String = midpoint.getRequired("midpoint") + fun bid(): Optional = bid.getOptional("bid") /** - * Size at the best ask, in shares. When a null/undefined value is observed, it indicates that + * Size at the best bid, in shares. When a null/undefined value is observed, it indicates that * there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun askSize(): Optional = askSize.getOptional("ask_size") + fun bidSize(): Optional = bidSize.getOptional("bid_size") /** - * Size at the best bid, in shares. When a null/undefined value is observed, it indicates that - * there is no available data. + * Midpoint of bid and ask. Absent when either side is missing. When a null/undefined value is + * observed, it indicates that there is no available data. * * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun bidSize(): Optional = bidSize.getOptional("bid_size") + fun midpoint(): Optional = midpoint.getOptional("midpoint") /** * Returns the raw JSON value of [ask]. @@ -88,32 +90,32 @@ private constructor( @JsonProperty("ask") @ExcludeMissing fun _ask(): JsonField = ask /** - * Returns the raw JSON value of [bid]. + * Returns the raw JSON value of [askSize]. * - * Unlike [bid], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [askSize], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("bid") @ExcludeMissing fun _bid(): JsonField = bid + @JsonProperty("ask_size") @ExcludeMissing fun _askSize(): JsonField = askSize /** - * Returns the raw JSON value of [midpoint]. + * Returns the raw JSON value of [bid]. * - * Unlike [midpoint], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [bid], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("midpoint") @ExcludeMissing fun _midpoint(): JsonField = midpoint + @JsonProperty("bid") @ExcludeMissing fun _bid(): JsonField = bid /** - * Returns the raw JSON value of [askSize]. + * Returns the raw JSON value of [bidSize]. * - * Unlike [askSize], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [bidSize], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("ask_size") @ExcludeMissing fun _askSize(): JsonField = askSize + @JsonProperty("bid_size") @ExcludeMissing fun _bidSize(): JsonField = bidSize /** - * Returns the raw JSON value of [bidSize]. + * Returns the raw JSON value of [midpoint]. * - * Unlike [bidSize], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [midpoint], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("bid_size") @ExcludeMissing fun _bidSize(): JsonField = bidSize + @JsonProperty("midpoint") @ExcludeMissing fun _midpoint(): JsonField = midpoint @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -129,71 +131,46 @@ private constructor( companion object { - /** - * Returns a mutable builder for constructing an instance of [SnapshotQuote]. - * - * The following fields are required: - * ```java - * .ask() - * .bid() - * .midpoint() - * ``` - */ + /** Returns a mutable builder for constructing an instance of [SnapshotQuote]. */ @JvmStatic fun builder() = Builder() } /** A builder for [SnapshotQuote]. */ class Builder internal constructor() { - private var ask: JsonField? = null - private var bid: JsonField? = null - private var midpoint: JsonField? = null + private var ask: JsonField = JsonMissing.of() private var askSize: JsonField = JsonMissing.of() + private var bid: JsonField = JsonMissing.of() private var bidSize: JsonField = JsonMissing.of() + private var midpoint: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(snapshotQuote: SnapshotQuote) = apply { ask = snapshotQuote.ask - bid = snapshotQuote.bid - midpoint = snapshotQuote.midpoint askSize = snapshotQuote.askSize + bid = snapshotQuote.bid bidSize = snapshotQuote.bidSize + midpoint = snapshotQuote.midpoint additionalProperties = snapshotQuote.additionalProperties.toMutableMap() } - /** Current best ask. */ - fun ask(ask: String) = ask(JsonField.of(ask)) - /** - * Sets [Builder.ask] to an arbitrary JSON value. - * - * You should usually call [Builder.ask] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun ask(ask: JsonField) = apply { this.ask = ask } - - /** Current best bid. */ - fun bid(bid: String) = bid(JsonField.of(bid)) - - /** - * Sets [Builder.bid] to an arbitrary JSON value. - * - * You should usually call [Builder.bid] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. + * Current best ask. Absent when no ask is available (one-sided quote). When a + * null/undefined value is observed, it indicates that there is no available data. */ - fun bid(bid: JsonField) = apply { this.bid = bid } + fun ask(ask: String?) = ask(JsonField.ofNullable(ask)) - /** Midpoint of bid and ask. */ - fun midpoint(midpoint: String) = midpoint(JsonField.of(midpoint)) + /** Alias for calling [Builder.ask] with `ask.orElse(null)`. */ + fun ask(ask: Optional) = ask(ask.getOrNull()) /** - * Sets [Builder.midpoint] to an arbitrary JSON value. + * Sets [Builder.ask] to an arbitrary JSON value. * - * You should usually call [Builder.midpoint] with a well-typed [String] value instead. This + * You should usually call [Builder.ask] with a well-typed [String] value instead. This * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun midpoint(midpoint: JsonField) = apply { this.midpoint = midpoint } + fun ask(ask: JsonField) = apply { this.ask = ask } /** * Size at the best ask, in shares. When a null/undefined value is observed, it indicates @@ -219,6 +196,23 @@ private constructor( */ fun askSize(askSize: JsonField) = apply { this.askSize = askSize } + /** + * Current best bid. Absent when no bid is available (one-sided quote). When a + * null/undefined value is observed, it indicates that there is no available data. + */ + fun bid(bid: String?) = bid(JsonField.ofNullable(bid)) + + /** Alias for calling [Builder.bid] with `bid.orElse(null)`. */ + fun bid(bid: Optional) = bid(bid.getOrNull()) + + /** + * Sets [Builder.bid] to an arbitrary JSON value. + * + * You should usually call [Builder.bid] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun bid(bid: JsonField) = apply { this.bid = bid } + /** * Size at the best bid, in shares. When a null/undefined value is observed, it indicates * that there is no available data. @@ -243,6 +237,23 @@ private constructor( */ fun bidSize(bidSize: JsonField) = apply { this.bidSize = bidSize } + /** + * Midpoint of bid and ask. Absent when either side is missing. When a null/undefined value + * is observed, it indicates that there is no available data. + */ + fun midpoint(midpoint: String?) = midpoint(JsonField.ofNullable(midpoint)) + + /** Alias for calling [Builder.midpoint] with `midpoint.orElse(null)`. */ + fun midpoint(midpoint: Optional) = midpoint(midpoint.getOrNull()) + + /** + * Sets [Builder.midpoint] to an arbitrary JSON value. + * + * You should usually call [Builder.midpoint] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun midpoint(midpoint: JsonField) = apply { this.midpoint = midpoint } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -266,25 +277,9 @@ private constructor( * Returns an immutable instance of [SnapshotQuote]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .ask() - * .bid() - * .midpoint() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ fun build(): SnapshotQuote = - SnapshotQuote( - checkRequired("ask", ask), - checkRequired("bid", bid), - checkRequired("midpoint", midpoint), - askSize, - bidSize, - additionalProperties.toMutableMap(), - ) + SnapshotQuote(ask, askSize, bid, bidSize, midpoint, additionalProperties.toMutableMap()) } private var validated: Boolean = false @@ -303,10 +298,10 @@ private constructor( } ask() - bid() - midpoint() askSize() + bid() bidSize() + midpoint() validated = true } @@ -326,10 +321,10 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (ask.asKnown().isPresent) 1 else 0) + - (if (bid.asKnown().isPresent) 1 else 0) + - (if (midpoint.asKnown().isPresent) 1 else 0) + (if (askSize.asKnown().isPresent) 1 else 0) + - (if (bidSize.asKnown().isPresent) 1 else 0) + (if (bid.asKnown().isPresent) 1 else 0) + + (if (bidSize.asKnown().isPresent) 1 else 0) + + (if (midpoint.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -338,19 +333,19 @@ private constructor( return other is SnapshotQuote && ask == other.ask && - bid == other.bid && - midpoint == other.midpoint && askSize == other.askSize && + bid == other.bid && bidSize == other.bidSize && + midpoint == other.midpoint && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(ask, bid, midpoint, askSize, bidSize, additionalProperties) + Objects.hash(ask, askSize, bid, bidSize, midpoint, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "SnapshotQuote{ask=$ask, bid=$bid, midpoint=$midpoint, askSize=$askSize, bidSize=$bidSize, additionalProperties=$additionalProperties}" + "SnapshotQuote{ask=$ask, askSize=$askSize, bid=$bid, bidSize=$bidSize, midpoint=$midpoint, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt index 0555c4a2..946514ec 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataGetSnapshotsResponseTest.kt @@ -58,10 +58,10 @@ internal class MarketDataGetSnapshotsResponseTest { .lastQuote( SnapshotQuote.builder() .ask("210.14") - .bid("210.10") - .midpoint("210.12") .askSize(200) + .bid("210.10") .bidSize(300) + .midpoint("210.12") .build() ) .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) @@ -121,10 +121,10 @@ internal class MarketDataGetSnapshotsResponseTest { .lastQuote( SnapshotQuote.builder() .ask("210.14") - .bid("210.10") - .midpoint("210.12") .askSize(200) + .bid("210.10") .bidSize(300) + .midpoint("210.12") .build() ) .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) @@ -186,10 +186,10 @@ internal class MarketDataGetSnapshotsResponseTest { .lastQuote( SnapshotQuote.builder() .ask("210.14") - .bid("210.10") - .midpoint("210.12") .askSize(200) + .bid("210.10") .bidSize(300) + .midpoint("210.12") .build() ) .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt index 8e1e04c9..0f0d6648 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/MarketDataSnapshotTest.kt @@ -32,10 +32,10 @@ internal class MarketDataSnapshotTest { .lastQuote( SnapshotQuote.builder() .ask("210.14") - .bid("210.10") - .midpoint("210.12") .askSize(200) + .bid("210.10") .bidSize(300) + .midpoint("210.12") .build() ) .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) @@ -70,10 +70,10 @@ internal class MarketDataSnapshotTest { .contains( SnapshotQuote.builder() .ask("210.14") - .bid("210.10") - .midpoint("210.12") .askSize(200) + .bid("210.10") .bidSize(300) + .midpoint("210.12") .build() ) assertThat(marketDataSnapshot.lastTrade()) @@ -112,10 +112,10 @@ internal class MarketDataSnapshotTest { .lastQuote( SnapshotQuote.builder() .ask("210.14") - .bid("210.10") - .midpoint("210.12") .askSize(200) + .bid("210.10") .bidSize(300) + .midpoint("210.12") .build() ) .lastTrade(SnapshotLastTrade.builder().price("210.12").size(100).build()) diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt index 0ed4ae7e..88018ffd 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/instrumentdata/marketdata/SnapshotQuoteTest.kt @@ -14,17 +14,17 @@ internal class SnapshotQuoteTest { val snapshotQuote = SnapshotQuote.builder() .ask("ask") - .bid("bid") - .midpoint("midpoint") .askSize(0) + .bid("bid") .bidSize(0) + .midpoint("midpoint") .build() - assertThat(snapshotQuote.ask()).isEqualTo("ask") - assertThat(snapshotQuote.bid()).isEqualTo("bid") - assertThat(snapshotQuote.midpoint()).isEqualTo("midpoint") + assertThat(snapshotQuote.ask()).contains("ask") assertThat(snapshotQuote.askSize()).contains(0) + assertThat(snapshotQuote.bid()).contains("bid") assertThat(snapshotQuote.bidSize()).contains(0) + assertThat(snapshotQuote.midpoint()).contains("midpoint") } @Test @@ -33,10 +33,10 @@ internal class SnapshotQuoteTest { val snapshotQuote = SnapshotQuote.builder() .ask("ask") - .bid("bid") - .midpoint("midpoint") .askSize(0) + .bid("bid") .bidSize(0) + .midpoint("midpoint") .build() val roundtrippedSnapshotQuote = From 245f095fbc541a0f12a75b75bf410f79ac0430e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:11:53 +0000 Subject: [PATCH 49/51] feat(api): api update --- .stats.yml | 4 ++-- .../api/models/v1/positions/PositionType.kt | 24 ------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/.stats.yml b/.stats.yml index 71c409a7..12d56bb6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-025ef74c2458dd52cb1cfd12d0650875975dcd6d3e2317c5d45f5384122c4e97.yml -openapi_spec_hash: fde280681b37f41d799f8af9fab976de +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-0cdfefe11fcd3a2e2d6ec32cbc71b8c563e1bb04e77d51533031620b534e83d0.yml +openapi_spec_hash: ed673e29a03f7c640f59c1fc3855ab56 config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionType.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionType.kt index 55f76ced..1b545b84 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionType.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/positions/PositionType.kt @@ -25,14 +25,6 @@ class PositionType @JsonCreator private constructor(private val value: JsonField @JvmField val SHORT = of("SHORT") - @JvmField val LONG_CALL = of("LONG_CALL") - - @JvmField val SHORT_CALL = of("SHORT_CALL") - - @JvmField val LONG_PUT = of("LONG_PUT") - - @JvmField val SHORT_PUT = of("SHORT_PUT") - @JvmStatic fun of(value: String) = PositionType(JsonField.of(value)) } @@ -40,10 +32,6 @@ class PositionType @JsonCreator private constructor(private val value: JsonField enum class Known { LONG, SHORT, - LONG_CALL, - SHORT_CALL, - LONG_PUT, - SHORT_PUT, } /** @@ -58,10 +46,6 @@ class PositionType @JsonCreator private constructor(private val value: JsonField enum class Value { LONG, SHORT, - LONG_CALL, - SHORT_CALL, - LONG_PUT, - SHORT_PUT, /** An enum member indicating that [PositionType] was instantiated with an unknown value. */ _UNKNOWN, } @@ -77,10 +61,6 @@ class PositionType @JsonCreator private constructor(private val value: JsonField when (this) { LONG -> Value.LONG SHORT -> Value.SHORT - LONG_CALL -> Value.LONG_CALL - SHORT_CALL -> Value.SHORT_CALL - LONG_PUT -> Value.LONG_PUT - SHORT_PUT -> Value.SHORT_PUT else -> Value._UNKNOWN } @@ -97,10 +77,6 @@ class PositionType @JsonCreator private constructor(private val value: JsonField when (this) { LONG -> Known.LONG SHORT -> Known.SHORT - LONG_CALL -> Known.LONG_CALL - SHORT_CALL -> Known.SHORT_CALL - LONG_PUT -> Known.LONG_PUT - SHORT_PUT -> Known.SHORT_PUT else -> throw ClearStreetInvalidDataException("Unknown PositionType: $value") } From 692735bf797743480bae0e8e8e8ffbd9a97d1919 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:37:44 +0000 Subject: [PATCH 50/51] feat(api): api update --- .stats.yml | 4 +- .../models/v1/omniai/OpenScreenerAction.kt | 76 +---------- .../screener/ScreenerCreateScreenerParams.kt | 116 +--------------- .../api/models/v1/screener/ScreenerEntry.kt | 80 +---------- .../screener/ScreenerReplaceScreenerParams.kt | 116 +--------------- .../screener/ScreenerSearchScreenerParams.kt | 124 +----------------- .../v1/omniai/OpenScreenerActionTest.kt | 3 - .../models/v1/omniai/StructuredActionTest.kt | 2 - .../ScreenerCreateScreenerParamsTest.kt | 25 ---- .../ScreenerCreateScreenerResponseTest.kt | 24 ---- .../models/v1/screener/ScreenerEntryTest.kt | 25 ---- .../ScreenerGetScreenerByIdResponseTest.kt | 24 ---- .../ScreenerGetScreenersResponseTest.kt | 24 ---- .../ScreenerReplaceScreenerParamsTest.kt | 25 ---- .../ScreenerReplaceScreenerResponseTest.kt | 24 ---- .../ScreenerSearchScreenerParamsTest.kt | 25 ---- .../async/v1/ScreenerServiceAsyncTest.kt | 24 ---- .../blocking/v1/ScreenerServiceTest.kt | 24 ---- 18 files changed, 17 insertions(+), 748 deletions(-) diff --git a/.stats.yml b/.stats.yml index 12d56bb6..0fe2bc6d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-0cdfefe11fcd3a2e2d6ec32cbc71b8c563e1bb04e77d51533031620b534e83d0.yml -openapi_spec_hash: ed673e29a03f7c640f59c1fc3855ab56 +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/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt index e0c0762b..d46a57e5 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerAction.kt @@ -26,7 +26,6 @@ class OpenScreenerAction private constructor( private val filters: JsonField>, private val columns: JsonField>, - private val fieldFilter: JsonField>, private val pageSize: JsonField, private val sortBy: JsonField, private val sortDirection: JsonField, @@ -41,15 +40,12 @@ private constructor( @JsonProperty("columns") @ExcludeMissing columns: JsonField> = JsonMissing.of(), - @JsonProperty("field_filter") - @ExcludeMissing - fieldFilter: JsonField> = JsonMissing.of(), @JsonProperty("page_size") @ExcludeMissing pageSize: JsonField = JsonMissing.of(), @JsonProperty("sort_by") @ExcludeMissing sortBy: JsonField = JsonMissing.of(), @JsonProperty("sort_direction") @ExcludeMissing sortDirection: JsonField = JsonMissing.of(), - ) : this(filters, columns, fieldFilter, pageSize, sortBy, sortDirection, mutableMapOf()) + ) : this(filters, columns, pageSize, sortBy, sortDirection, mutableMapOf()) /** * Filter criteria for the screener @@ -68,15 +64,6 @@ private constructor( */ fun columns(): Optional> = columns.getOptional("columns") - /** - * Deprecated: use `columns` instead. Mirrors `columns`. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - @Deprecated("deprecated") - fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") - /** * Optional page size. When a null/undefined value is observed, it indicates it does not apply. * @@ -119,16 +106,6 @@ private constructor( */ @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns - /** - * Returns the raw JSON value of [fieldFilter]. - * - * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") - @JsonProperty("field_filter") - @ExcludeMissing - fun _fieldFilter(): JsonField> = fieldFilter - /** * Returns the raw JSON value of [pageSize]. * @@ -182,7 +159,6 @@ private constructor( private var filters: JsonField>? = null private var columns: JsonField>? = null - private var fieldFilter: JsonField>? = null private var pageSize: JsonField = JsonMissing.of() private var sortBy: JsonField = JsonMissing.of() private var sortDirection: JsonField = JsonMissing.of() @@ -192,7 +168,6 @@ private constructor( internal fun from(openScreenerAction: OpenScreenerAction) = apply { filters = openScreenerAction.filters.map { it.toMutableList() } columns = openScreenerAction.columns.map { it.toMutableList() } - fieldFilter = openScreenerAction.fieldFilter.map { it.toMutableList() } pageSize = openScreenerAction.pageSize sortBy = openScreenerAction.sortBy sortDirection = openScreenerAction.sortDirection @@ -257,39 +232,6 @@ private constructor( } } - /** Deprecated: use `columns` instead. Mirrors `columns`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: List?) = fieldFilter(JsonField.ofNullable(fieldFilter)) - - /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: Optional>) = fieldFilter(fieldFilter.getOrNull()) - - /** - * Sets [Builder.fieldFilter] to an arbitrary JSON value. - * - * You should usually call [Builder.fieldFilter] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: JsonField>) = apply { - this.fieldFilter = fieldFilter.map { it.toMutableList() } - } - - /** - * Adds a single [String] to [Builder.fieldFilter]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - @Deprecated("deprecated") - fun addFieldFilter(fieldFilter: String) = apply { - this.fieldFilter = - (this.fieldFilter ?: JsonField.of(mutableListOf())).also { - checkKnown("fieldFilter", it).add(fieldFilter) - } - } - /** * Optional page size. When a null/undefined value is observed, it indicates it does not * apply. @@ -388,7 +330,6 @@ private constructor( OpenScreenerAction( checkRequired("filters", filters).map { it.toImmutable() }, (columns ?: JsonMissing.of()).map { it.toImmutable() }, - (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, pageSize, sortBy, sortDirection, @@ -413,7 +354,6 @@ private constructor( filters().forEach { it.validate() } columns() - fieldFilter() pageSize() sortBy() sortDirection() @@ -437,7 +377,6 @@ private constructor( internal fun validity(): Int = (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (columns.asKnown().getOrNull()?.size ?: 0) + - (fieldFilter.asKnown().getOrNull()?.size ?: 0) + (if (pageSize.asKnown().isPresent) 1 else 0) + (if (sortBy.asKnown().isPresent) 1 else 0) + (if (sortDirection.asKnown().isPresent) 1 else 0) @@ -450,7 +389,6 @@ private constructor( return other is OpenScreenerAction && filters == other.filters && columns == other.columns && - fieldFilter == other.fieldFilter && pageSize == other.pageSize && sortBy == other.sortBy && sortDirection == other.sortDirection && @@ -458,19 +396,11 @@ private constructor( } private val hashCode: Int by lazy { - Objects.hash( - filters, - columns, - fieldFilter, - pageSize, - sortBy, - sortDirection, - additionalProperties, - ) + Objects.hash(filters, columns, pageSize, sortBy, sortDirection, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "OpenScreenerAction{filters=$filters, columns=$columns, fieldFilter=$fieldFilter, pageSize=$pageSize, sortBy=$sortBy, sortDirection=$sortDirection, additionalProperties=$additionalProperties}" + "OpenScreenerAction{filters=$filters, columns=$columns, pageSize=$pageSize, sortBy=$sortBy, sortDirection=$sortDirection, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParams.kt index 801f999c..b178a312 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParams.kt @@ -41,14 +41,6 @@ private constructor( */ fun columns(): Optional> = body.columns() - /** - * Deprecated: use `columns` instead. Ignored when `columns` is provided. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - @Deprecated("deprecated") fun fieldFilter(): Optional> = body.fieldFilter() - /** * Structured search filter criteria * @@ -80,13 +72,6 @@ private constructor( */ fun _columns(): JsonField> = body._columns() - /** - * Returns the raw JSON value of [fieldFilter]. - * - * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") fun _fieldFilter(): JsonField> = body._fieldFilter() - /** * Returns the raw JSON value of [filters]. * @@ -148,11 +133,9 @@ private constructor( * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: * - [columns] - * - [fieldFilter] * - [filters] * - [name] * - [sorts] - * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -178,35 +161,6 @@ private constructor( */ fun addColumn(column: FieldRef) = apply { body.addColumn(column) } - /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: List?) = apply { body.fieldFilter(fieldFilter) } - - /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: Optional>) = - fieldFilter(fieldFilter.getOrNull()) - - /** - * Sets [Builder.fieldFilter] to an arbitrary JSON value. - * - * You should usually call [Builder.fieldFilter] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: JsonField>) = apply { - body.fieldFilter(fieldFilter) - } - - /** - * Adds a single [FieldRef] to [Builder.fieldFilter]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - @Deprecated("deprecated") - fun addFieldFilter(fieldFilter: FieldRef) = apply { body.addFieldFilter(fieldFilter) } - /** Structured search filter criteria */ fun filters(filters: List?) = apply { body.filters(filters) } @@ -406,7 +360,6 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val columns: JsonField>, - private val fieldFilter: JsonField>, private val filters: JsonField>, private val name: JsonField, private val sorts: JsonField>, @@ -418,9 +371,6 @@ private constructor( @JsonProperty("columns") @ExcludeMissing columns: JsonField> = JsonMissing.of(), - @JsonProperty("field_filter") - @ExcludeMissing - fieldFilter: JsonField> = JsonMissing.of(), @JsonProperty("filters") @ExcludeMissing filters: JsonField> = JsonMissing.of(), @@ -428,7 +378,7 @@ private constructor( @JsonProperty("sorts") @ExcludeMissing sorts: JsonField> = JsonMissing.of(), - ) : this(columns, fieldFilter, filters, name, sorts, mutableMapOf()) + ) : this(columns, filters, name, sorts, mutableMapOf()) /** * Structured field references to include when running this screener @@ -438,15 +388,6 @@ private constructor( */ fun columns(): Optional> = columns.getOptional("columns") - /** - * Deprecated: use `columns` instead. Ignored when `columns` is provided. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - @Deprecated("deprecated") - fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") - /** * Structured search filter criteria * @@ -478,16 +419,6 @@ private constructor( */ @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns - /** - * Returns the raw JSON value of [fieldFilter]. - * - * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") - @JsonProperty("field_filter") - @ExcludeMissing - fun _fieldFilter(): JsonField> = fieldFilter - /** * Returns the raw JSON value of [filters]. * @@ -533,7 +464,6 @@ private constructor( class Builder internal constructor() { private var columns: JsonField>? = null - private var fieldFilter: JsonField>? = null private var filters: JsonField>? = null private var name: JsonField = JsonMissing.of() private var sorts: JsonField>? = null @@ -542,7 +472,6 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { columns = body.columns.map { it.toMutableList() } - fieldFilter = body.fieldFilter.map { it.toMutableList() } filters = body.filters.map { it.toMutableList() } name = body.name sorts = body.sorts.map { it.toMutableList() } @@ -578,41 +507,6 @@ private constructor( } } - /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: List?) = - fieldFilter(JsonField.ofNullable(fieldFilter)) - - /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: Optional>) = - fieldFilter(fieldFilter.getOrNull()) - - /** - * Sets [Builder.fieldFilter] to an arbitrary JSON value. - * - * You should usually call [Builder.fieldFilter] with a well-typed `List` - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: JsonField>) = apply { - this.fieldFilter = fieldFilter.map { it.toMutableList() } - } - - /** - * Adds a single [FieldRef] to [Builder.fieldFilter]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - @Deprecated("deprecated") - fun addFieldFilter(fieldFilter: FieldRef) = apply { - this.fieldFilter = - (this.fieldFilter ?: JsonField.of(mutableListOf())).also { - checkKnown("fieldFilter", it).add(fieldFilter) - } - } - /** Structured search filter criteria */ fun filters(filters: List?) = filters(JsonField.ofNullable(filters)) @@ -713,7 +607,6 @@ private constructor( fun build(): Body = Body( (columns ?: JsonMissing.of()).map { it.toImmutable() }, - (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, (filters ?: JsonMissing.of()).map { it.toImmutable() }, name, (sorts ?: JsonMissing.of()).map { it.toImmutable() }, @@ -738,7 +631,6 @@ private constructor( } columns().ifPresent { it.forEach { it.validate() } } - fieldFilter().ifPresent { it.forEach { it.validate() } } filters().ifPresent { it.forEach { it.validate() } } name() sorts().ifPresent { it.forEach { it.validate() } } @@ -762,7 +654,6 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (columns.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (fieldFilter.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + (sorts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) @@ -774,7 +665,6 @@ private constructor( return other is Body && columns == other.columns && - fieldFilter == other.fieldFilter && filters == other.filters && name == other.name && sorts == other.sorts && @@ -782,13 +672,13 @@ private constructor( } private val hashCode: Int by lazy { - Objects.hash(columns, fieldFilter, filters, name, sorts, additionalProperties) + Objects.hash(columns, filters, name, sorts, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{columns=$columns, fieldFilter=$fieldFilter, filters=$filters, name=$name, sorts=$sorts, additionalProperties=$additionalProperties}" + "Body{columns=$columns, filters=$filters, name=$name, sorts=$sorts, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntry.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntry.kt index 1bf88945..e92c4b84 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntry.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntry.kt @@ -30,7 +30,6 @@ private constructor( private val name: JsonField, private val updatedAt: JsonField, private val columns: JsonField>, - private val fieldFilter: JsonField>, private val sorts: JsonField>, private val additionalProperties: MutableMap, ) { @@ -51,11 +50,8 @@ private constructor( @JsonProperty("columns") @ExcludeMissing columns: JsonField> = JsonMissing.of(), - @JsonProperty("field_filter") - @ExcludeMissing - fieldFilter: JsonField> = JsonMissing.of(), @JsonProperty("sorts") @ExcludeMissing sorts: JsonField> = JsonMissing.of(), - ) : this(id, createdAt, filters, name, updatedAt, columns, fieldFilter, sorts, mutableMapOf()) + ) : this(id, createdAt, filters, name, updatedAt, columns, sorts, mutableMapOf()) /** * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type or is @@ -95,15 +91,6 @@ private constructor( */ fun columns(): Optional> = columns.getOptional("columns") - /** - * Deprecated: use `columns` instead. Mirrors `columns`. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - @Deprecated("deprecated") - fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") - /** * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -156,16 +143,6 @@ private constructor( */ @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns - /** - * Returns the raw JSON value of [fieldFilter]. - * - * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") - @JsonProperty("field_filter") - @ExcludeMissing - fun _fieldFilter(): JsonField> = fieldFilter - /** * Returns the raw JSON value of [sorts]. * @@ -211,7 +188,6 @@ private constructor( private var name: JsonField? = null private var updatedAt: JsonField? = null private var columns: JsonField>? = null - private var fieldFilter: JsonField>? = null private var sorts: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -223,7 +199,6 @@ private constructor( name = screenerEntry.name updatedAt = screenerEntry.updatedAt columns = screenerEntry.columns.map { it.toMutableList() } - fieldFilter = screenerEntry.fieldFilter.map { it.toMutableList() } sorts = screenerEntry.sorts.map { it.toMutableList() } additionalProperties = screenerEntry.additionalProperties.toMutableMap() } @@ -324,41 +299,6 @@ private constructor( } } - /** Deprecated: use `columns` instead. Mirrors `columns`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: List?) = - fieldFilter(JsonField.ofNullable(fieldFilter)) - - /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: Optional>) = - fieldFilter(fieldFilter.getOrNull()) - - /** - * Sets [Builder.fieldFilter] to an arbitrary JSON value. - * - * You should usually call [Builder.fieldFilter] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: JsonField>) = apply { - this.fieldFilter = fieldFilter.map { it.toMutableList() } - } - - /** - * Adds a single [FieldRef] to [Builder.fieldFilter]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - @Deprecated("deprecated") - fun addFieldFilter(fieldFilter: FieldRef) = apply { - this.fieldFilter = - (this.fieldFilter ?: JsonField.of(mutableListOf())).also { - checkKnown("fieldFilter", it).add(fieldFilter) - } - } - fun sorts(sorts: List?) = sorts(JsonField.ofNullable(sorts)) /** Alias for calling [Builder.sorts] with `sorts.orElse(null)`. */ @@ -428,7 +368,6 @@ private constructor( checkRequired("name", name), checkRequired("updatedAt", updatedAt), (columns ?: JsonMissing.of()).map { it.toImmutable() }, - (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, (sorts ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) @@ -455,7 +394,6 @@ private constructor( name() updatedAt() columns().ifPresent { it.forEach { it.validate() } } - fieldFilter().ifPresent { it.forEach { it.validate() } } sorts().ifPresent { it.forEach { it.validate() } } validated = true } @@ -481,7 +419,6 @@ private constructor( (if (name.asKnown().isPresent) 1 else 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + (columns.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (fieldFilter.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (sorts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) override fun equals(other: Any?): Boolean { @@ -496,27 +433,16 @@ private constructor( name == other.name && updatedAt == other.updatedAt && columns == other.columns && - fieldFilter == other.fieldFilter && sorts == other.sorts && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash( - id, - createdAt, - filters, - name, - updatedAt, - columns, - fieldFilter, - sorts, - additionalProperties, - ) + Objects.hash(id, createdAt, filters, name, updatedAt, columns, sorts, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "ScreenerEntry{id=$id, createdAt=$createdAt, filters=$filters, name=$name, updatedAt=$updatedAt, columns=$columns, fieldFilter=$fieldFilter, sorts=$sorts, additionalProperties=$additionalProperties}" + "ScreenerEntry{id=$id, createdAt=$createdAt, filters=$filters, name=$name, updatedAt=$updatedAt, columns=$columns, sorts=$sorts, additionalProperties=$additionalProperties}" } diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParams.kt index f590d6b0..b42db24a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParams.kt @@ -45,14 +45,6 @@ private constructor( */ fun columns(): Optional> = body.columns() - /** - * Deprecated: use `columns` instead. Ignored when `columns` is provided. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - @Deprecated("deprecated") fun fieldFilter(): Optional> = body.fieldFilter() - /** * Structured search filter criteria * @@ -84,13 +76,6 @@ private constructor( */ fun _columns(): JsonField> = body._columns() - /** - * Returns the raw JSON value of [fieldFilter]. - * - * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") fun _fieldFilter(): JsonField> = body._fieldFilter() - /** * Returns the raw JSON value of [filters]. * @@ -160,11 +145,9 @@ private constructor( * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: * - [columns] - * - [fieldFilter] * - [filters] * - [name] * - [sorts] - * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -190,35 +173,6 @@ private constructor( */ fun addColumn(column: FieldRef) = apply { body.addColumn(column) } - /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: List?) = apply { body.fieldFilter(fieldFilter) } - - /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: Optional>) = - fieldFilter(fieldFilter.getOrNull()) - - /** - * Sets [Builder.fieldFilter] to an arbitrary JSON value. - * - * You should usually call [Builder.fieldFilter] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: JsonField>) = apply { - body.fieldFilter(fieldFilter) - } - - /** - * Adds a single [FieldRef] to [Builder.fieldFilter]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - @Deprecated("deprecated") - fun addFieldFilter(fieldFilter: FieldRef) = apply { body.addFieldFilter(fieldFilter) } - /** Structured search filter criteria */ fun filters(filters: List?) = apply { body.filters(filters) } @@ -425,7 +379,6 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val columns: JsonField>, - private val fieldFilter: JsonField>, private val filters: JsonField>, private val name: JsonField, private val sorts: JsonField>, @@ -437,9 +390,6 @@ private constructor( @JsonProperty("columns") @ExcludeMissing columns: JsonField> = JsonMissing.of(), - @JsonProperty("field_filter") - @ExcludeMissing - fieldFilter: JsonField> = JsonMissing.of(), @JsonProperty("filters") @ExcludeMissing filters: JsonField> = JsonMissing.of(), @@ -447,7 +397,7 @@ private constructor( @JsonProperty("sorts") @ExcludeMissing sorts: JsonField> = JsonMissing.of(), - ) : this(columns, fieldFilter, filters, name, sorts, mutableMapOf()) + ) : this(columns, filters, name, sorts, mutableMapOf()) /** * Structured field references to include when running this screener @@ -457,15 +407,6 @@ private constructor( */ fun columns(): Optional> = columns.getOptional("columns") - /** - * Deprecated: use `columns` instead. Ignored when `columns` is provided. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - @Deprecated("deprecated") - fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") - /** * Structured search filter criteria * @@ -497,16 +438,6 @@ private constructor( */ @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns - /** - * Returns the raw JSON value of [fieldFilter]. - * - * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") - @JsonProperty("field_filter") - @ExcludeMissing - fun _fieldFilter(): JsonField> = fieldFilter - /** * Returns the raw JSON value of [filters]. * @@ -552,7 +483,6 @@ private constructor( class Builder internal constructor() { private var columns: JsonField>? = null - private var fieldFilter: JsonField>? = null private var filters: JsonField>? = null private var name: JsonField = JsonMissing.of() private var sorts: JsonField>? = null @@ -561,7 +491,6 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { columns = body.columns.map { it.toMutableList() } - fieldFilter = body.fieldFilter.map { it.toMutableList() } filters = body.filters.map { it.toMutableList() } name = body.name sorts = body.sorts.map { it.toMutableList() } @@ -597,41 +526,6 @@ private constructor( } } - /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: List?) = - fieldFilter(JsonField.ofNullable(fieldFilter)) - - /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: Optional>) = - fieldFilter(fieldFilter.getOrNull()) - - /** - * Sets [Builder.fieldFilter] to an arbitrary JSON value. - * - * You should usually call [Builder.fieldFilter] with a well-typed `List` - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: JsonField>) = apply { - this.fieldFilter = fieldFilter.map { it.toMutableList() } - } - - /** - * Adds a single [FieldRef] to [Builder.fieldFilter]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - @Deprecated("deprecated") - fun addFieldFilter(fieldFilter: FieldRef) = apply { - this.fieldFilter = - (this.fieldFilter ?: JsonField.of(mutableListOf())).also { - checkKnown("fieldFilter", it).add(fieldFilter) - } - } - /** Structured search filter criteria */ fun filters(filters: List?) = filters(JsonField.ofNullable(filters)) @@ -732,7 +626,6 @@ private constructor( fun build(): Body = Body( (columns ?: JsonMissing.of()).map { it.toImmutable() }, - (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, (filters ?: JsonMissing.of()).map { it.toImmutable() }, name, (sorts ?: JsonMissing.of()).map { it.toImmutable() }, @@ -757,7 +650,6 @@ private constructor( } columns().ifPresent { it.forEach { it.validate() } } - fieldFilter().ifPresent { it.forEach { it.validate() } } filters().ifPresent { it.forEach { it.validate() } } name() sorts().ifPresent { it.forEach { it.validate() } } @@ -781,7 +673,6 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (columns.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (fieldFilter.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + (sorts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) @@ -793,7 +684,6 @@ private constructor( return other is Body && columns == other.columns && - fieldFilter == other.fieldFilter && filters == other.filters && name == other.name && sorts == other.sorts && @@ -801,13 +691,13 @@ private constructor( } private val hashCode: Int by lazy { - Objects.hash(columns, fieldFilter, filters, name, sorts, additionalProperties) + Objects.hash(columns, filters, name, sorts, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{columns=$columns, fieldFilter=$fieldFilter, filters=$filters, name=$name, sorts=$sorts, additionalProperties=$additionalProperties}" + "Body{columns=$columns, filters=$filters, name=$name, sorts=$sorts, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParams.kt b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParams.kt index d2d0d668..e6619b8a 100644 --- a/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParams.kt +++ b/clear-street-java-core/src/main/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParams.kt @@ -46,14 +46,6 @@ private constructor( */ fun columns(): Optional> = body.columns() - /** - * Deprecated: use `columns` instead. Ignored when `columns` is provided. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - @Deprecated("deprecated") fun fieldFilter(): Optional> = body.fieldFilter() - /** * Filter conditions to apply. * @@ -102,13 +94,6 @@ private constructor( */ fun _columns(): JsonField> = body._columns() - /** - * Returns the raw JSON value of [fieldFilter]. - * - * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") fun _fieldFilter(): JsonField> = body._fieldFilter() - /** * Returns the raw JSON value of [filters]. * @@ -185,10 +170,10 @@ private constructor( * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: * - [columns] - * - [fieldFilter] * - [filters] * - [pageSize] * - [pageToken] + * - [sortCaseSensitive] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -215,35 +200,6 @@ private constructor( */ fun addColumn(column: FieldRef) = apply { body.addColumn(column) } - /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: List?) = apply { body.fieldFilter(fieldFilter) } - - /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: Optional>) = - fieldFilter(fieldFilter.getOrNull()) - - /** - * Sets [Builder.fieldFilter] to an arbitrary JSON value. - * - * You should usually call [Builder.fieldFilter] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: JsonField>) = apply { - body.fieldFilter(fieldFilter) - } - - /** - * Adds a single [FieldRef] to [Builder.fieldFilter]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - @Deprecated("deprecated") - fun addFieldFilter(fieldFilter: FieldRef) = apply { body.addFieldFilter(fieldFilter) } - /** Filter conditions to apply. */ fun filters(filters: List?) = apply { body.filters(filters) } @@ -496,7 +452,6 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val columns: JsonField>, - private val fieldFilter: JsonField>, private val filters: JsonField>, private val pageSize: JsonField, private val pageToken: JsonField, @@ -510,9 +465,6 @@ private constructor( @JsonProperty("columns") @ExcludeMissing columns: JsonField> = JsonMissing.of(), - @JsonProperty("field_filter") - @ExcludeMissing - fieldFilter: JsonField> = JsonMissing.of(), @JsonProperty("filters") @ExcludeMissing filters: JsonField> = JsonMissing.of(), @@ -526,16 +478,7 @@ private constructor( @JsonProperty("sorts") @ExcludeMissing sorts: JsonField> = JsonMissing.of(), - ) : this( - columns, - fieldFilter, - filters, - pageSize, - pageToken, - sortCaseSensitive, - sorts, - mutableMapOf(), - ) + ) : this(columns, filters, pageSize, pageToken, sortCaseSensitive, sorts, mutableMapOf()) /** * Subset of fields to include in the response. @@ -545,15 +488,6 @@ private constructor( */ fun columns(): Optional> = columns.getOptional("columns") - /** - * Deprecated: use `columns` instead. Ignored when `columns` is provided. - * - * @throws ClearStreetInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - @Deprecated("deprecated") - fun fieldFilter(): Optional> = fieldFilter.getOptional("field_filter") - /** * Filter conditions to apply. * @@ -603,16 +537,6 @@ private constructor( */ @JsonProperty("columns") @ExcludeMissing fun _columns(): JsonField> = columns - /** - * Returns the raw JSON value of [fieldFilter]. - * - * Unlike [fieldFilter], this method doesn't throw if the JSON field has an unexpected type. - */ - @Deprecated("deprecated") - @JsonProperty("field_filter") - @ExcludeMissing - fun _fieldFilter(): JsonField> = fieldFilter - /** * Returns the raw JSON value of [filters]. * @@ -675,7 +599,6 @@ private constructor( class Builder internal constructor() { private var columns: JsonField>? = null - private var fieldFilter: JsonField>? = null private var filters: JsonField>? = null private var pageSize: JsonField = JsonMissing.of() private var pageToken: JsonField = JsonMissing.of() @@ -686,7 +609,6 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { columns = body.columns.map { it.toMutableList() } - fieldFilter = body.fieldFilter.map { it.toMutableList() } filters = body.filters.map { it.toMutableList() } pageSize = body.pageSize pageToken = body.pageToken @@ -724,41 +646,6 @@ private constructor( } } - /** Deprecated: use `columns` instead. Ignored when `columns` is provided. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: List?) = - fieldFilter(JsonField.ofNullable(fieldFilter)) - - /** Alias for calling [Builder.fieldFilter] with `fieldFilter.orElse(null)`. */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: Optional>) = - fieldFilter(fieldFilter.getOrNull()) - - /** - * Sets [Builder.fieldFilter] to an arbitrary JSON value. - * - * You should usually call [Builder.fieldFilter] with a well-typed `List` - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - @Deprecated("deprecated") - fun fieldFilter(fieldFilter: JsonField>) = apply { - this.fieldFilter = fieldFilter.map { it.toMutableList() } - } - - /** - * Adds a single [FieldRef] to [Builder.fieldFilter]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - @Deprecated("deprecated") - fun addFieldFilter(fieldFilter: FieldRef) = apply { - this.fieldFilter = - (this.fieldFilter ?: JsonField.of(mutableListOf())).also { - checkKnown("fieldFilter", it).add(fieldFilter) - } - } - /** Filter conditions to apply. */ fun filters(filters: List?) = filters(JsonField.ofNullable(filters)) @@ -915,7 +802,6 @@ private constructor( fun build(): Body = Body( (columns ?: JsonMissing.of()).map { it.toImmutable() }, - (fieldFilter ?: JsonMissing.of()).map { it.toImmutable() }, (filters ?: JsonMissing.of()).map { it.toImmutable() }, pageSize, pageToken, @@ -942,7 +828,6 @@ private constructor( } columns().ifPresent { it.forEach { it.validate() } } - fieldFilter().ifPresent { it.forEach { it.validate() } } filters().ifPresent { it.forEach { it.validate() } } pageSize() pageToken() @@ -968,7 +853,6 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (columns.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (fieldFilter.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (pageSize.asKnown().isPresent) 1 else 0) + (if (pageToken.asKnown().isPresent) 1 else 0) + @@ -982,7 +866,6 @@ private constructor( return other is Body && columns == other.columns && - fieldFilter == other.fieldFilter && filters == other.filters && pageSize == other.pageSize && pageToken == other.pageToken && @@ -994,7 +877,6 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( columns, - fieldFilter, filters, pageSize, pageToken, @@ -1007,7 +889,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{columns=$columns, fieldFilter=$fieldFilter, filters=$filters, pageSize=$pageSize, pageToken=$pageToken, sortCaseSensitive=$sortCaseSensitive, sorts=$sorts, additionalProperties=$additionalProperties}" + "Body{columns=$columns, filters=$filters, pageSize=$pageSize, pageToken=$pageToken, sortCaseSensitive=$sortCaseSensitive, sorts=$sorts, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt index cbdc2446..be0f5da1 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/OpenScreenerActionTest.kt @@ -31,7 +31,6 @@ internal class OpenScreenerActionTest { .build() ) .addColumn("string") - .addFieldFilter("string") .pageSize(0) .sortBy("sort_by") .sortDirection("sort_direction") @@ -51,7 +50,6 @@ internal class OpenScreenerActionTest { .build(), ) assertThat(openScreenerAction.columns().getOrNull()).containsExactly("string") - assertThat(openScreenerAction.fieldFilter().getOrNull()).containsExactly("string") assertThat(openScreenerAction.pageSize()).contains(0) assertThat(openScreenerAction.sortBy()).contains("sort_by") assertThat(openScreenerAction.sortDirection()).contains("sort_direction") @@ -77,7 +75,6 @@ internal class OpenScreenerActionTest { .build() ) .addColumn("string") - .addFieldFilter("string") .pageSize(0) .sortBy("sort_by") .sortDirection("sort_direction") diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt index 80643c77..9462e21f 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/omniai/StructuredActionTest.kt @@ -171,7 +171,6 @@ internal class StructuredActionTest { .build() ) .addColumn("string") - .addFieldFilter("string") .pageSize(0) .sortBy("sort_by") .sortDirection("sort_direction") @@ -210,7 +209,6 @@ internal class StructuredActionTest { .build() ) .addColumn("string") - .addFieldFilter("string") .pageSize(0) .sortBy("sort_by") .sortDirection("sort_direction") diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt index f7150b89..40592eca 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerParamsTest.kt @@ -20,14 +20,6 @@ internal class ScreenerCreateScreenerParamsTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -94,14 +86,6 @@ internal class ScreenerCreateScreenerParamsTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -166,15 +150,6 @@ internal class ScreenerCreateScreenerParamsTest { .valueType(FieldType.DECIMAL) .build() ) - assertThat(body.fieldFilter().getOrNull()) - .containsExactly( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) assertThat(body.filters().getOrNull()) .containsExactly( SearchFilter.builder() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt index 145439c1..f20825a2 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerCreateScreenerResponseTest.kt @@ -90,14 +90,6 @@ internal class ScreenerCreateScreenerResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -190,14 +182,6 @@ internal class ScreenerCreateScreenerResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -292,14 +276,6 @@ internal class ScreenerCreateScreenerResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt index fc366812..c7a02dad 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerEntryTest.kt @@ -65,14 +65,6 @@ internal class ScreenerEntryTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -141,15 +133,6 @@ internal class ScreenerEntryTest { .valueType(FieldType.DECIMAL) .build() ) - assertThat(screenerEntry.fieldFilter().getOrNull()) - .containsExactly( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) assertThat(screenerEntry.sorts().getOrNull()) .containsExactly( SortSpec.builder() @@ -220,14 +203,6 @@ internal class ScreenerEntryTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt index 017b4c16..6c8f69ed 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenerByIdResponseTest.kt @@ -90,14 +90,6 @@ internal class ScreenerGetScreenerByIdResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -190,14 +182,6 @@ internal class ScreenerGetScreenerByIdResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -292,14 +276,6 @@ internal class ScreenerGetScreenerByIdResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt index 0c296fe7..cb7fa473 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerGetScreenersResponseTest.kt @@ -90,14 +90,6 @@ internal class ScreenerGetScreenersResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -190,14 +182,6 @@ internal class ScreenerGetScreenersResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -292,14 +276,6 @@ internal class ScreenerGetScreenersResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt index 73c314a4..44efef07 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerParamsTest.kt @@ -21,14 +21,6 @@ internal class ScreenerReplaceScreenerParamsTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -108,14 +100,6 @@ internal class ScreenerReplaceScreenerParamsTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -180,15 +164,6 @@ internal class ScreenerReplaceScreenerParamsTest { .valueType(FieldType.DECIMAL) .build() ) - assertThat(body.fieldFilter().getOrNull()) - .containsExactly( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) assertThat(body.filters().getOrNull()) .containsExactly( SearchFilter.builder() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt index 729f8ae2..5146c2ff 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerReplaceScreenerResponseTest.kt @@ -90,14 +90,6 @@ internal class ScreenerReplaceScreenerResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -190,14 +182,6 @@ internal class ScreenerReplaceScreenerResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( @@ -292,14 +276,6 @@ internal class ScreenerReplaceScreenerResponseTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addSort( SortSpec.builder() .field( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt index 6dea32d5..8f48fa47 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/models/v1/screener/ScreenerSearchScreenerParamsTest.kt @@ -34,14 +34,6 @@ internal class ScreenerSearchScreenerParamsTest { .build(), ) ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -124,14 +116,6 @@ internal class ScreenerSearchScreenerParamsTest { .build(), ) ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -210,15 +194,6 @@ internal class ScreenerSearchScreenerParamsTest { .valueType(FieldType.DECIMAL) .build(), ) - assertThat(body.fieldFilter().getOrNull()) - .containsExactly( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) assertThat(body.filters().getOrNull()) .containsExactly( SearchFilter.builder() diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt index 3b1d562b..ffe993da 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/async/v1/ScreenerServiceAsyncTest.kt @@ -47,14 +47,6 @@ internal class ScreenerServiceAsyncTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -179,14 +171,6 @@ internal class ScreenerServiceAsyncTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -279,14 +263,6 @@ internal class ScreenerServiceAsyncTest { .build(), ) ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( diff --git a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt index 83cacbc6..7e0ed4c5 100644 --- a/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt +++ b/clear-street-java-core/src/test/kotlin/com/clearstreet/api/services/blocking/v1/ScreenerServiceTest.kt @@ -47,14 +47,6 @@ internal class ScreenerServiceTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -173,14 +165,6 @@ internal class ScreenerServiceTest { .valueType(FieldType.DECIMAL) .build() ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( @@ -272,14 +256,6 @@ internal class ScreenerServiceTest { .build(), ) ) - .addFieldFilter( - FieldRef.builder() - .name("market_cap") - .lookback(FieldLookback.ONE_DAY) - .period(FieldPeriod.QUARTER) - .valueType(FieldType.DECIMAL) - .build() - ) .addFilter( SearchFilter.builder() .left( From 19268d58c62718b6b9fd3612c5128edd54b78ab8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:38:33 +0000 Subject: [PATCH 51/51] release: 0.3.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 53 +++++++++++++++++++++++++++++++++++ README.md | 10 +++---- build.gradle.kts | 2 +- 4 files changed, 60 insertions(+), 7 deletions(-) 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/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 bb0f30ef..8d2fe49d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.clearstreet.api/clear-street-java)](https://central.sonatype.com/artifact/com.clearstreet.api/clear-street-java/0.2.0) -[![javadoc](https://javadoc.io/badge2/com.clearstreet.api/clear-street-java/0.2.0/javadoc.svg)](https://javadoc.io/doc/com.clearstreet.api/clear-street-java/0.2.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.clearstreet.api/clear-street-java)](https://central.sonatype.com/artifact/com.clearstreet.api/clear-street-java/0.3.0) +[![javadoc](https://javadoc.io/badge2/com.clearstreet.api/clear-street-java/0.3.0/javadoc.svg)](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.clearstreet.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,7 +24,7 @@ Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.clearstreet.ap ### Gradle ```kotlin -implementation("com.clearstreet.api:clear-street-java:0.2.0") +implementation("com.clearstreet.api:clear-street-java:0.3.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.clearstreet.api:clear-street-java:0.2.0") com.clearstreet.api clear-street-java - 0.2.0 + 0.3.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index e1fd0363..ca6270b1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.clearstreet.api" - version = "0.2.0" // x-release-please-version + version = "0.3.0" // x-release-please-version } subprojects {