Skip to content

Commit

Permalink
feat(api): update via SDK Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Jul 15, 2024
1 parent b9c7f83 commit b903f1e
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 66 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/).

## Documentation

The REST API documentation can be found [on docs.clearstreet.io](https://docs.clearstreet.io/studio).
The REST API documentation can be found on [docs.clearstreet.io](https://docs.clearstreet.io/studio).

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AccountBulkOrderCreateResponseTest {
AccountBulkOrderCreateResponse.Data.builder()
.submitted(true)
.orderId("x")
.reason("string")
.reason("reason")
.build()
)
)
Expand All @@ -29,7 +29,7 @@ class AccountBulkOrderCreateResponseTest {
AccountBulkOrderCreateResponse.Data.builder()
.submitted(true)
.orderId("x")
.reason("string")
.reason("reason")
.build()
)
assertThat(accountBulkOrderCreateResponse.rejected()).isEqualTo(123L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AccountLocateOrderCreateParamsTest {
.quantity("x")
.referenceId("my-order-id-123")
.symbol("AAPL")
.comments("string")
.comments("comments")
.build()
}

Expand All @@ -29,15 +29,15 @@ class AccountLocateOrderCreateParamsTest {
.quantity("x")
.referenceId("my-order-id-123")
.symbol("AAPL")
.comments("string")
.comments("comments")
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.mpid()).isEqualTo("x")
assertThat(body.quantity()).isEqualTo("x")
assertThat(body.referenceId()).isEqualTo("my-order-id-123")
assertThat(body.symbol()).isEqualTo("AAPL")
assertThat(body.comments()).isEqualTo("string")
assertThat(body.comments()).isEqualTo("comments")
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ class AccountLocateOrderListResponseTest {
.symbol("AAPL")
.updatedAt(1710613560668L)
.borrowRate("x")
.deskComment("string")
.deskComment("desk_comment")
.expiresAt(1710613560668L)
.locateId("x")
.locatedAt(1710613560668L)
.locatedQuantity("x")
.referenceId("my-order-id-123")
.totalCost("x")
.traderComment("string")
.traderComment("trader_comment")
.build()
)
)
Expand All @@ -48,14 +48,14 @@ class AccountLocateOrderListResponseTest {
.symbol("AAPL")
.updatedAt(1710613560668L)
.borrowRate("x")
.deskComment("string")
.deskComment("desk_comment")
.expiresAt(1710613560668L)
.locateId("x")
.locatedAt(1710613560668L)
.locatedQuantity("x")
.referenceId("my-order-id-123")
.totalCost("x")
.traderComment("string")
.traderComment("trader_comment")
.build()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AccountOrderListParamsTest {
.accountId("x")
.from(1710613560668L)
.pageSize(123L)
.pageToken("string")
.pageToken("page_token")
.to(1710613560668L)
.build()
}
Expand All @@ -26,13 +26,13 @@ class AccountOrderListParamsTest {
.accountId("x")
.from(1710613560668L)
.pageSize(123L)
.pageToken("string")
.pageToken("page_token")
.to(1710613560668L)
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put("from", listOf("1710613560668"))
expected.put("page_size", listOf("123"))
expected.put("page_token", listOf("string"))
expected.put("page_token", listOf("page_token"))
expected.put("to", listOf("1710613560668"))
assertThat(params.getQueryParams()).isEqualTo(expected)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class AccountOrderListResponseTest {
.orderUpdateReason(Order.OrderUpdateReason.PLACE)
.price("x")
.referenceId("my-order-id-123")
.text("string")
.text("text")
.build()
)
)
.nextPageToken("string")
.nextPageToken("next_page_token")
.build()
assertThat(accountOrderListResponse).isNotNull
assertThat(accountOrderListResponse.data())
Expand All @@ -60,9 +60,9 @@ class AccountOrderListResponseTest {
.orderUpdateReason(Order.OrderUpdateReason.PLACE)
.price("x")
.referenceId("my-order-id-123")
.text("string")
.text("text")
.build()
)
assertThat(accountOrderListResponse.nextPageToken()).contains("string")
assertThat(accountOrderListResponse.nextPageToken()).contains("next_page_token")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AccountOrderRetrieveResponseTest {
.orderUpdateReason(Order.OrderUpdateReason.PLACE)
.price("x")
.referenceId("my-order-id-123")
.text("string")
.text("text")
.build()
)
.build()
Expand All @@ -57,7 +57,7 @@ class AccountOrderRetrieveResponseTest {
.orderUpdateReason(Order.OrderUpdateReason.PLACE)
.price("x")
.referenceId("my-order-id-123")
.text("string")
.text("text")
.build()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AccountPnlDetailListResponseTest {
.sodQuantity("x")
.soldQuantity("x")
.symbol("AAPL")
.symbolDescription("string")
.symbolDescription("symbol_description")
.timestamp(1710613560668L)
.totalFees(42.23)
.totalPnl(42.23)
Expand Down Expand Up @@ -64,7 +64,7 @@ class AccountPnlDetailListResponseTest {
.sodQuantity("x")
.soldQuantity("x")
.symbol("AAPL")
.symbolDescription("string")
.symbolDescription("symbol_description")
.timestamp(1710613560668L)
.totalFees(42.23)
.totalPnl(42.23)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AccountPositionListParamsTest {
AccountPositionListParams.builder()
.accountId("x")
.pageSize(123L)
.pageToken("string")
.pageToken("page_token")
.build()
}

Expand All @@ -23,11 +23,11 @@ class AccountPositionListParamsTest {
AccountPositionListParams.builder()
.accountId("x")
.pageSize(123L)
.pageToken("string")
.pageToken("page_token")
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put("page_size", listOf("123"))
expected.put("page_token", listOf("string"))
expected.put("page_token", listOf("page_token"))
assertThat(params.getQueryParams()).isEqualTo(expected)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class AccountPositionListResponseTest {
.data(
listOf(Position.builder().accountId("x").quantity("x").symbol("AAPL").build())
)
.nextPageToken("string")
.nextPageToken("next_page_token")
.build()
assertThat(accountPositionListResponse).isNotNull
assertThat(accountPositionListResponse.data())
.containsExactly(Position.builder().accountId("x").quantity("x").symbol("AAPL").build())
assertThat(accountPositionListResponse.nextPageToken()).contains("string")
assertThat(accountPositionListResponse.nextPageToken()).contains("next_page_token")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ class AccountTradeListParamsTest {

@Test
fun createAccountTradeListParams() {
AccountTradeListParams.builder().accountId("x").pageSize(123L).pageToken("string").build()
AccountTradeListParams.builder()
.accountId("x")
.pageSize(123L)
.pageToken("page_token")
.build()
}

@Test
Expand All @@ -19,11 +23,11 @@ class AccountTradeListParamsTest {
AccountTradeListParams.builder()
.accountId("x")
.pageSize(123L)
.pageToken("string")
.pageToken("page_token")
.build()
val expected = mutableMapOf<String, List<String>>()
expected.put("page_size", listOf("123"))
expected.put("page_token", listOf("string"))
expected.put("page_token", listOf("page_token"))
assertThat(params.getQueryParams()).isEqualTo(expected)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AccountTradeListResponseTest {
.build()
)
)
.nextPageToken("string")
.nextPageToken("next_page_token")
.build()
assertThat(accountTradeListResponse).isNotNull
assertThat(accountTradeListResponse.data())
Expand All @@ -41,6 +41,6 @@ class AccountTradeListResponseTest {
.symbol("AAPL")
.build()
)
assertThat(accountTradeListResponse.nextPageToken()).contains("string")
assertThat(accountTradeListResponse.nextPageToken()).contains("next_page_token")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class EntityRegtMarginSimulationCreateParamsTest {
fun createEntityRegtMarginSimulationCreateParams() {
EntityRegtMarginSimulationCreateParams.builder()
.entityId("x")
.name("string")
.name("name")
.ignoreExisting(true)
.prices(
listOf(
Expand Down Expand Up @@ -42,7 +42,7 @@ class EntityRegtMarginSimulationCreateParamsTest {
val params =
EntityRegtMarginSimulationCreateParams.builder()
.entityId("x")
.name("string")
.name("name")
.ignoreExisting(true)
.prices(
listOf(
Expand Down Expand Up @@ -71,7 +71,7 @@ class EntityRegtMarginSimulationCreateParamsTest {
.build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.name()).isEqualTo("string")
assertThat(body.name()).isEqualTo("name")
assertThat(body.ignoreExisting()).isEqualTo(true)
assertThat(body.prices())
.isEqualTo(
Expand Down Expand Up @@ -100,16 +100,16 @@ class EntityRegtMarginSimulationCreateParamsTest {
@Test
fun getBodyWithoutOptionalFields() {
val params =
EntityRegtMarginSimulationCreateParams.builder().entityId("x").name("string").build()
EntityRegtMarginSimulationCreateParams.builder().entityId("x").name("name").build()
val body = params.getBody()
assertThat(body).isNotNull
assertThat(body.name()).isEqualTo("string")
assertThat(body.name()).isEqualTo("name")
}

@Test
fun getPathParam() {
val params =
EntityRegtMarginSimulationCreateParams.builder().entityId("x").name("string").build()
EntityRegtMarginSimulationCreateParams.builder().entityId("x").name("name").build()
assertThat(params).isNotNull
// path param "entityId"
assertThat(params.getPathParam(0)).isEqualTo("x")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class LocateOrderTest {
.symbol("AAPL")
.updatedAt(1710613560668L)
.borrowRate("x")
.deskComment("string")
.deskComment("desk_comment")
.expiresAt(1710613560668L)
.locateId("x")
.locatedAt(1710613560668L)
.locatedQuantity("x")
.referenceId("my-order-id-123")
.totalCost("x")
.traderComment("string")
.traderComment("trader_comment")
.build()
assertThat(locateOrder).isNotNull
assertThat(locateOrder.accountId()).isEqualTo("x")
Expand All @@ -39,13 +39,13 @@ class LocateOrderTest {
assertThat(locateOrder.symbol()).isEqualTo("AAPL")
assertThat(locateOrder.updatedAt()).isEqualTo(1710613560668L)
assertThat(locateOrder.borrowRate()).contains("x")
assertThat(locateOrder.deskComment()).contains("string")
assertThat(locateOrder.deskComment()).contains("desk_comment")
assertThat(locateOrder.expiresAt()).contains(1710613560668L)
assertThat(locateOrder.locateId()).contains("x")
assertThat(locateOrder.locatedAt()).contains(1710613560668L)
assertThat(locateOrder.locatedQuantity()).contains("x")
assertThat(locateOrder.referenceId()).contains("my-order-id-123")
assertThat(locateOrder.totalCost()).contains("x")
assertThat(locateOrder.traderComment()).contains("string")
assertThat(locateOrder.traderComment()).contains("trader_comment")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class OrderTest {
.orderUpdateReason(Order.OrderUpdateReason.PLACE)
.price("x")
.referenceId("my-order-id-123")
.text("string")
.text("text")
.build()
assertThat(order).isNotNull
assertThat(order.accountId()).isEqualTo("x")
Expand All @@ -50,6 +50,6 @@ class OrderTest {
assertThat(order.orderUpdateReason()).contains(Order.OrderUpdateReason.PLACE)
assertThat(order.price()).contains("x")
assertThat(order.referenceId()).contains("my-order-id-123")
assertThat(order.text()).contains("string")
assertThat(order.text()).contains("text")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PortfolioMarginTest {
.build()
)
)
.name("string")
.name("name")
.concentrationRequirement(42.23)
.discretionaryRequirement(42.23)
.liquidityRequirement(42.23)
Expand All @@ -64,7 +64,7 @@ class PortfolioMarginTest {
.riskBasedRequirementPercent(42.23)
.timestamp(1710613560668L)
.vegaRequirement(42.23)
.version("string")
.version("version")
.build()
assertThat(portfolioMargin).isNotNull
assertThat(portfolioMargin.addOnRequirement()).contains(42.23)
Expand Down Expand Up @@ -95,7 +95,7 @@ class PortfolioMarginTest {
.build()
)
)
.name("string")
.name("name")
.concentrationRequirement(42.23)
.discretionaryRequirement(42.23)
.liquidityRequirement(42.23)
Expand All @@ -117,6 +117,6 @@ class PortfolioMarginTest {
assertThat(portfolioMargin.riskBasedRequirementPercent()).contains(42.23)
assertThat(portfolioMargin.timestamp()).contains(1710613560668L)
assertThat(portfolioMargin.vegaRequirement()).contains(42.23)
assertThat(portfolioMargin.version()).contains("string")
assertThat(portfolioMargin.version()).contains("version")
}
}
Loading

0 comments on commit b903f1e

Please sign in to comment.