diff --git a/.release-please-manifest.json b/.release-please-manifest.json index da59f99..2aca35a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0" + ".": "0.5.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 8c1ce73..0fe2bc6 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 -config_hash: 66e3fd0a8171a922070c46769ac48c06 +configured_endpoints: 61 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-778aab5bcb35ad542557833d9198158fff69771421393843317778f90be2c9f6.yml +openapi_spec_hash: b5584a424c4072680789ee9f9b09d531 +config_hash: 3823311a3577c4e3cd71a1ea4ace533d diff --git a/CHANGELOG.md b/CHANGELOG.md index 190a7a1..9a9b589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## 0.5.0 (2026-06-29) + +Full Changelog: [v0.4.0...v0.5.0](https://github.com/clear-street/clear-street-python/compare/v0.4.0...v0.5.0) + +### Features + +* **api:** api update ([4e9e0d6](https://github.com/clear-street/clear-street-python/commit/4e9e0d6bfa18839d6e00e058aa5bde5fda712ef4)) +* **api:** api update ([7fec209](https://github.com/clear-street/clear-street-python/commit/7fec2098683e7a75b88ac22516ad9f02f1235876)) +* **api:** api update ([d7fe7bd](https://github.com/clear-street/clear-street-python/commit/d7fe7bd078725b52a5d487f108d166c2e094d857)) +* **api:** api update ([fd825b3](https://github.com/clear-street/clear-street-python/commit/fd825b3695251ab7cef1b2c707627d1af5f413de)) +* **api:** api update ([881f865](https://github.com/clear-street/clear-street-python/commit/881f8659babbbd7edb28314c063f092852dcdcbe)) +* **api:** api update ([a7117ea](https://github.com/clear-street/clear-street-python/commit/a7117ead2ee04ffea823132513c9743d0625b2ac)) +* **api:** api update ([ab1fa34](https://github.com/clear-street/clear-street-python/commit/ab1fa346992ca1272d61daff8ec6c7cd5bd0e3d3)) +* **api:** api update ([89aa53d](https://github.com/clear-street/clear-street-python/commit/89aa53da64d0beb64000d934f06c76359960680f)) +* **api:** api update ([c028e36](https://github.com/clear-street/clear-street-python/commit/c028e3648bad482c76f1c7b99d9e489d2bb3f3a4)) +* **api:** api update ([b6be99d](https://github.com/clear-street/clear-street-python/commit/b6be99d2969f71762f16778ed010138b8a3e5575)) +* **api:** api update ([e0defc0](https://github.com/clear-street/clear-street-python/commit/e0defc0df81917094232686332fde1a3104ddd70)) +* **api:** api update ([41d649c](https://github.com/clear-street/clear-street-python/commit/41d649c2743ac28ddc718ba93166368f5aff1511)) +* **api:** api update ([9471e67](https://github.com/clear-street/clear-street-python/commit/9471e675875066bf04ae7cfa9cb8b079e8effda7)) +* **api:** api update ([bc03dfb](https://github.com/clear-street/clear-street-python/commit/bc03dfbfc16e87f25f7a65b684e2ccbd1c9d5a5a)) +* **api:** api update ([8bf96af](https://github.com/clear-street/clear-street-python/commit/8bf96af2ca6af690ae3a1c636b13b5cd3f919128)) +* **api:** api update ([f7a2d31](https://github.com/clear-street/clear-street-python/commit/f7a2d313bf82857fd86c0a9a46b52fe36d3452a7)) +* **api:** api update ([044a398](https://github.com/clear-street/clear-street-python/commit/044a3988e0d20af44e74100b56f9c037d4399932)) +* **api:** api update ([2c07783](https://github.com/clear-street/clear-street-python/commit/2c0778360f628ec7f8adf6ebe7359e8de81928d5)) +* **api:** api update ([8a4d9e0](https://github.com/clear-street/clear-street-python/commit/8a4d9e0ac7ac8e3862516c0476b269897e64cfe2)) + + +### Chores + +* update SDK settings ([179c874](https://github.com/clear-street/clear-street-python/commit/179c874ede8056c6bace730f80232744d3ba1bc8)) + ## 0.4.0 (2026-06-03) Full Changelog: [v0.3.0...v0.4.0](https://github.com/clear-street/clear-street-python/compare/v0.3.0...v0.4.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70fb066..c3034ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,6 +85,12 @@ $ pip install ./path-to-wheel-file.whl ## Running tests +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. + +```sh +$ ./scripts/mock +``` + ```sh $ ./scripts/test ``` diff --git a/api.md b/api.md index c41f66f..848e95f 100644 --- a/api.md +++ b/api.md @@ -9,7 +9,7 @@ from clearstreet.types import APIError, BaseResponse, ResponseMetadata Types: ```python -from clearstreet.types import SecurityType +from clearstreet.types import SecurityType, SortDirection ``` ## Accounts @@ -28,6 +28,7 @@ from clearstreet.types.v1 import ( AccountType, MarginDetails, MarginDetailsUsage, + MarginSessionDetails, MarginTopContributor, MarginType, PortfolioHistoryResponse, @@ -229,7 +230,6 @@ from clearstreet.types.v1 import ( PrefillNewOrderAction, PrefillOrderAction, PromptButtonAction, - ScreenerFilter, StructuredAction, StructuredActionButtonAction, SuggestedActionsPayload, @@ -407,6 +407,48 @@ Methods: - client.v1.positions.get_positions(account_id, \*\*params) -> PositionGetPositionsResponse - client.v1.positions.submit_position_instructions(account_id, \*\*params) -> PositionSubmitPositionInstructionsResponse +## Screener + +Types: + +```python +from clearstreet.types.v1 import ( + FieldLookback, + FieldPeriod, + FieldRef, + FieldType, + FilterOpSpec, + FilterOperator, + FilterValue, + Modifier, + ModifierOp, + OperatorArg, + ScreenerColumn, + ScreenerEntry, + ScreenerEntryList, + ScreenerFilter, + ScreenerRow, + ScreenerRowList, + SearchFilter, + SortSpec, + Variable, + ScreenerCreateScreenerResponse, + ScreenerGetScreenerByIDResponse, + ScreenerGetScreenersResponse, + ScreenerReplaceScreenerResponse, + ScreenerSearchScreenerResponse, +) +``` + +Methods: + +- client.v1.screener.create_screener(\*\*params) -> ScreenerCreateScreenerResponse +- client.v1.screener.delete_screener(screener_id) -> None +- client.v1.screener.get_screener_by_id(screener_id) -> ScreenerGetScreenerByIDResponse +- client.v1.screener.get_screeners() -> ScreenerGetScreenersResponse +- client.v1.screener.replace_screener(screener_id, \*\*params) -> ScreenerReplaceScreenerResponse +- client.v1.screener.search_screener(\*\*params) -> ScreenerSearchScreenerResponse + ## Watchlist Types: @@ -435,9 +477,3 @@ Methods: - client.v1.watchlist.delete_watchlist_item(item_id, \*, watchlist_id) -> WatchlistDeleteWatchlistItemResponse - client.v1.watchlist.get_watchlist_by_id(watchlist_id) -> WatchlistGetWatchlistByIDResponse - client.v1.watchlist.get_watchlists(\*\*params) -> WatchlistGetWatchlistsResponse - -## Websocket - -Methods: - -- client.v1.websocket.websocket_handler() -> None diff --git a/pyproject.toml b/pyproject.toml index 532b316..81880d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "clearstreet" -version = "0.4.0" +version = "0.5.0" description = "The official Python library for the clear-street API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 0000000..feebe5e --- /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 fe50ebb..a47c5b4 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 export DEFER_PYDANTIC_BUILD=false diff --git a/src/clearstreet/_version.py b/src/clearstreet/_version.py index dcae711..cbf3ca4 100644 --- a/src/clearstreet/_version.py +++ b/src/clearstreet/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "clearstreet" -__version__ = "0.4.0" # x-release-please-version +__version__ = "0.5.0" # x-release-please-version diff --git a/src/clearstreet/resources/v1/__init__.py b/src/clearstreet/resources/v1/__init__.py index a579a8f..dafc75c 100644 --- a/src/clearstreet/resources/v1/__init__.py +++ b/src/clearstreet/resources/v1/__init__.py @@ -40,6 +40,14 @@ CalendarResourceWithStreamingResponse, AsyncCalendarResourceWithStreamingResponse, ) +from .screener import ( + ScreenerResource, + AsyncScreenerResource, + ScreenerResourceWithRawResponse, + AsyncScreenerResourceWithRawResponse, + ScreenerResourceWithStreamingResponse, + AsyncScreenerResourceWithStreamingResponse, +) from .positions import ( PositionsResource, AsyncPositionsResource, @@ -56,14 +64,6 @@ WatchlistResourceWithStreamingResponse, AsyncWatchlistResourceWithStreamingResponse, ) -from .websocket import ( - WebsocketResource, - AsyncWebsocketResource, - WebsocketResourceWithRawResponse, - AsyncWebsocketResourceWithRawResponse, - WebsocketResourceWithStreamingResponse, - AsyncWebsocketResourceWithStreamingResponse, -) from .api_version import ( APIVersionResource, AsyncAPIVersionResource, @@ -138,18 +138,18 @@ "AsyncPositionsResourceWithRawResponse", "PositionsResourceWithStreamingResponse", "AsyncPositionsResourceWithStreamingResponse", + "ScreenerResource", + "AsyncScreenerResource", + "ScreenerResourceWithRawResponse", + "AsyncScreenerResourceWithRawResponse", + "ScreenerResourceWithStreamingResponse", + "AsyncScreenerResourceWithStreamingResponse", "WatchlistResource", "AsyncWatchlistResource", "WatchlistResourceWithRawResponse", "AsyncWatchlistResourceWithRawResponse", "WatchlistResourceWithStreamingResponse", "AsyncWatchlistResourceWithStreamingResponse", - "WebsocketResource", - "AsyncWebsocketResource", - "WebsocketResourceWithRawResponse", - "AsyncWebsocketResourceWithRawResponse", - "WebsocketResourceWithStreamingResponse", - "AsyncWebsocketResourceWithStreamingResponse", "V1Resource", "AsyncV1Resource", "V1ResourceWithRawResponse", diff --git a/src/clearstreet/resources/v1/accounts.py b/src/clearstreet/resources/v1/accounts.py index 118a4cd..ce2f446 100644 --- a/src/clearstreet/resources/v1/accounts.py +++ b/src/clearstreet/resources/v1/accounts.py @@ -72,7 +72,7 @@ def get_account_balances( Fetch account balance information Args: - top_margin_contributors_limit: Limit the number of top margin contributors returned by the engine. + top_margin_contributors_limit: Limit the number of top margin contributors returned. extra_headers: Send extra headers @@ -131,6 +131,8 @@ def get_account_by_id( def get_accounts( self, *, + account_id: str | Omit = omit, + account_name: str | Omit = omit, page_size: int | Omit = omit, page_token: Union[str, Base64FileInput] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -141,9 +143,21 @@ def get_accounts( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountGetAccountsResponse: """ - 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. Args: + account_id: Filter to accounts whose id starts with this value (lexicographic prefix match + on the decimal id, e.g. `100` matches `100345`). + + account_name: Filter to accounts whose full name contains this value (case-insensitive + substring match). + page_size: The number of items to return per page. Only used when page_token is not provided. @@ -167,6 +181,8 @@ def get_accounts( timeout=timeout, query=maybe_transform( { + "account_id": account_id, + "account_name": account_name, "page_size": page_size, "page_token": page_token, }, @@ -297,7 +313,7 @@ async def get_account_balances( Fetch account balance information Args: - top_margin_contributors_limit: Limit the number of top margin contributors returned by the engine. + top_margin_contributors_limit: Limit the number of top margin contributors returned. extra_headers: Send extra headers @@ -356,6 +372,8 @@ async def get_account_by_id( async def get_accounts( self, *, + account_id: str | Omit = omit, + account_name: str | Omit = omit, page_size: int | Omit = omit, page_token: Union[str, Base64FileInput] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -366,9 +384,21 @@ async def get_accounts( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountGetAccountsResponse: """ - 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. Args: + account_id: Filter to accounts whose id starts with this value (lexicographic prefix match + on the decimal id, e.g. `100` matches `100345`). + + account_name: Filter to accounts whose full name contains this value (case-insensitive + substring match). + page_size: The number of items to return per page. Only used when page_token is not provided. @@ -392,6 +422,8 @@ async def get_accounts( timeout=timeout, query=await async_maybe_transform( { + "account_id": account_id, + "account_name": account_name, "page_size": page_size, "page_token": page_token, }, diff --git a/src/clearstreet/resources/v1/instrument_data/instrument_data.py b/src/clearstreet/resources/v1/instrument_data/instrument_data.py index c473a19..417d42a 100644 --- a/src/clearstreet/resources/v1/instrument_data/instrument_data.py +++ b/src/clearstreet/resources/v1/instrument_data/instrument_data.py @@ -135,7 +135,7 @@ def get_all_instrument_events( from_date: The start date for the query range, inclusive (YYYY-MM-DD). instrument_ids: - 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`. to_date: The end date for the query range, inclusive (YYYY-MM-DD). @@ -185,7 +185,7 @@ def get_instrument_analyst_consensus( Retrieves analyst ratings and price targets for an instrument. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_: The start date for the query range, inclusive (YYYY-MM-DD) @@ -246,7 +246,7 @@ def get_instrument_balance_sheet_statements( - `to_date`: None (no upper bound) Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_date: The start date for the query range, inclusive (YYYY-MM-DD). @@ -311,7 +311,7 @@ def get_instrument_cash_flow_statements( financing activities. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_date: The start date for the query range, inclusive (YYYY-MM-DD). @@ -376,7 +376,7 @@ def get_instrument_events( - `to_date`: today + 60 days Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_date: The start date for the query range, inclusive (YYYY-MM-DD). @@ -425,7 +425,7 @@ def get_instrument_fundamentals( Retrieves supplemental fundamentals and company profile data for an instrument. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier extra_headers: Send extra headers @@ -470,7 +470,7 @@ def get_instrument_income_statements( - `to_date`: None (no upper bound) Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_date: The start date for the query range, inclusive (YYYY-MM-DD). @@ -572,7 +572,7 @@ async def get_all_instrument_events( from_date: The start date for the query range, inclusive (YYYY-MM-DD). instrument_ids: - 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`. to_date: The end date for the query range, inclusive (YYYY-MM-DD). @@ -622,7 +622,7 @@ async def get_instrument_analyst_consensus( Retrieves analyst ratings and price targets for an instrument. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_: The start date for the query range, inclusive (YYYY-MM-DD) @@ -683,7 +683,7 @@ async def get_instrument_balance_sheet_statements( - `to_date`: None (no upper bound) Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_date: The start date for the query range, inclusive (YYYY-MM-DD). @@ -748,7 +748,7 @@ async def get_instrument_cash_flow_statements( financing activities. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_date: The start date for the query range, inclusive (YYYY-MM-DD). @@ -813,7 +813,7 @@ async def get_instrument_events( - `to_date`: today + 60 days Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_date: The start date for the query range, inclusive (YYYY-MM-DD). @@ -862,7 +862,7 @@ async def get_instrument_fundamentals( Retrieves supplemental fundamentals and company profile data for an instrument. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier extra_headers: Send extra headers @@ -907,7 +907,7 @@ async def get_instrument_income_statements( - `to_date`: None (no upper bound) Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier from_date: The start date for the query range, inclusive (YYYY-MM-DD). diff --git a/src/clearstreet/resources/v1/instrument_data/market_data.py b/src/clearstreet/resources/v1/instrument_data/market_data.py index 5a67eee..d6acff2 100644 --- a/src/clearstreet/resources/v1/instrument_data/market_data.py +++ b/src/clearstreet/resources/v1/instrument_data/market_data.py @@ -56,21 +56,16 @@ def get_daily_summaries( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MarketDataGetDailySummariesResponse: """ - 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 + every 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. - Args: - instrument_ids: Comma-separated OEMS instrument UUIDs (required, 1..=100) + instrument_ids: Comma-separated instrument identifiers (required, 1..=100) extra_headers: Send extra headers @@ -110,7 +105,7 @@ def get_snapshots( Get market data snapshots for one or more securities. Args: - instrument_ids: Comma-separated OEMS instrument UUIDs. + instrument_ids: Comma-separated instrument identifiers. extra_headers: Send extra headers @@ -169,21 +164,16 @@ async def get_daily_summaries( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MarketDataGetDailySummariesResponse: """ - 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 + every 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. - Args: - instrument_ids: Comma-separated OEMS instrument UUIDs (required, 1..=100) + instrument_ids: Comma-separated instrument identifiers (required, 1..=100) extra_headers: Send extra headers @@ -223,7 +213,7 @@ async def get_snapshots( Get market data snapshots for one or more securities. Args: - instrument_ids: Comma-separated OEMS instrument UUIDs. + instrument_ids: Comma-separated instrument identifiers. extra_headers: Send extra headers diff --git a/src/clearstreet/resources/v1/instrument_data/news.py b/src/clearstreet/resources/v1/instrument_data/news.py index 233ff6f..08482bb 100644 --- a/src/clearstreet/resources/v1/instrument_data/news.py +++ b/src/clearstreet/resources/v1/instrument_data/news.py @@ -104,7 +104,7 @@ def get_news( include_publishers: Comma-separated list of publishers to include (mutually exclusive with exclude_publishers). - instrument_ids: Comma-delimited OEMS instrument UUIDs to filter by. + instrument_ids: Comma-delimited instrument identifiers to filter by. news_type: Filter by news type. @@ -225,7 +225,7 @@ async def get_news( include_publishers: Comma-separated list of publishers to include (mutually exclusive with exclude_publishers). - instrument_ids: Comma-delimited OEMS instrument UUIDs to filter by. + instrument_ids: Comma-delimited instrument identifiers to filter by. news_type: Filter by news type. diff --git a/src/clearstreet/resources/v1/instruments.py b/src/clearstreet/resources/v1/instruments.py index 5f8b011..ea22342 100644 --- a/src/clearstreet/resources/v1/instruments.py +++ b/src/clearstreet/resources/v1/instruments.py @@ -85,7 +85,7 @@ def get_instrument_by_id( Retrieves detailed information for a specific instrument. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier include_options_expiry_dates: When true, include unique options expiry dates for this instrument @@ -140,7 +140,8 @@ def get_instruments( Args: easy_to_borrow: Filter by easy to borrow status - instrument_ids: Comma-separated OEMS instrument UUIDs + instrument_ids: Comma-separated instrument identifiers: unique identifiers or symbols (symbol + for equities, OSI for options) instrument_type: Filter by instrument type (e.g. COMMON_STOCK, OPTION) @@ -229,7 +230,7 @@ def get_option_contracts( underlier: Underlier symbol (e.g., AAPL, SPX) - underlying_instrument_id: OEMS instrument UUID or symbol of the underlying equity/index + underlying_instrument_id: Instrument identifier or symbol of the underlying equity/index extra_headers: Send extra headers @@ -283,18 +284,18 @@ def search_instruments( 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 + identifiers such 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 symbol or alternate identifier. + 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`. Args: q: 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. + (CUSIP, ISIN, OPRA root), and company names for non-option instruments. Option + searches match symbols and alternate identifiers. asset_class: Comma-separated asset classes (EQUITY|OPTION|WARRANT|BOND|FX|OTHER). Defaults to EQUITY. @@ -385,7 +386,7 @@ async def get_instrument_by_id( Retrieves detailed information for a specific instrument. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier include_options_expiry_dates: When true, include unique options expiry dates for this instrument @@ -440,7 +441,8 @@ async def get_instruments( Args: easy_to_borrow: Filter by easy to borrow status - instrument_ids: Comma-separated OEMS instrument UUIDs + instrument_ids: Comma-separated instrument identifiers: unique identifiers or symbols (symbol + for equities, OSI for options) instrument_type: Filter by instrument type (e.g. COMMON_STOCK, OPTION) @@ -529,7 +531,7 @@ async def get_option_contracts( underlier: Underlier symbol (e.g., AAPL, SPX) - underlying_instrument_id: OEMS instrument UUID or symbol of the underlying equity/index + underlying_instrument_id: Instrument identifier or symbol of the underlying equity/index extra_headers: Send extra headers @@ -583,18 +585,18 @@ async def search_instruments( 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 + identifiers such 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 symbol or alternate identifier. + 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`. Args: q: 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. + (CUSIP, ISIN, OPRA root), and company names for non-option instruments. Option + searches match symbols and alternate identifiers. asset_class: Comma-separated asset classes (EQUITY|OPTION|WARRANT|BOND|FX|OTHER). Defaults to EQUITY. diff --git a/src/clearstreet/resources/v1/orders.py b/src/clearstreet/resources/v1/orders.py index 05e2d4c..87f5b9c 100644 --- a/src/clearstreet/resources/v1/orders.py +++ b/src/clearstreet/resources/v1/orders.py @@ -93,7 +93,7 @@ def cancel_all_open_orders( Cancel all orders for an account Args: - instrument_ids: Comma-separated OEMS instrument UUIDs + instrument_ids: Comma-separated instrument identifiers instrument_type: Filter by instrument type (e.g., COMMON_STOCK, OPTION) @@ -187,7 +187,7 @@ def get_executions( from_: The start date and time for the query range, inclusive (ISO 8601 format) instrument_id: Optional instrument to filter by. Accepts either a symbol (e.g. `AAPL`) or an - OEMS instrument UUID. + instrument identifier. page_size: The number of items to return per page. Only used when page_token is not provided. @@ -267,6 +267,7 @@ def get_orders( from_: Union[str, datetime] | Omit = omit, instrument_ids: SequenceNotStr[str] | Omit = omit, instrument_type: Literal["COMMON_STOCK", "OPTION", "CASH"] | Omit = omit, + order_ids: SequenceNotStr[str] | Omit = omit, page_size: int | Omit = omit, page_token: Union[str, Base64FileInput] | Omit = omit, status: List[ @@ -305,10 +306,13 @@ def get_orders( Args: from_: The start date and time for the query range, inclusive (ISO 8601 format) - instrument_ids: Comma-separated OEMS instrument UUIDs + instrument_ids: Comma-separated instrument identifiers instrument_type: Instrument type filter (e.g., COMMON_STOCK, OPTION) + order_ids: Comma-separated order IDs to filter by. When provided, only orders whose order + ID is in this set are returned. + page_size: The number of items to return per page. Only used when page_token is not provided. @@ -321,7 +325,7 @@ def get_orders( to: The end date and time for the query range, inclusive (ISO 8601 format) - underlying_instrument_ids: Comma-separated OEMS instrument UUIDs. Matches options orders whose resolved + underlying_instrument_ids: Comma-separated instrument identifiers. Matches options orders whose resolved underlier is any of the given IDs. extra_headers: Send extra headers @@ -344,6 +348,7 @@ def get_orders( "from_": from_, "instrument_ids": instrument_ids, "instrument_type": instrument_type, + "order_ids": order_ids, "page_size": page_size, "page_token": page_token, "status": status, @@ -488,7 +493,7 @@ async def cancel_all_open_orders( Cancel all orders for an account Args: - instrument_ids: Comma-separated OEMS instrument UUIDs + instrument_ids: Comma-separated instrument identifiers instrument_type: Filter by instrument type (e.g., COMMON_STOCK, OPTION) @@ -582,7 +587,7 @@ async def get_executions( from_: The start date and time for the query range, inclusive (ISO 8601 format) instrument_id: Optional instrument to filter by. Accepts either a symbol (e.g. `AAPL`) or an - OEMS instrument UUID. + instrument identifier. page_size: The number of items to return per page. Only used when page_token is not provided. @@ -662,6 +667,7 @@ async def get_orders( from_: Union[str, datetime] | Omit = omit, instrument_ids: SequenceNotStr[str] | Omit = omit, instrument_type: Literal["COMMON_STOCK", "OPTION", "CASH"] | Omit = omit, + order_ids: SequenceNotStr[str] | Omit = omit, page_size: int | Omit = omit, page_token: Union[str, Base64FileInput] | Omit = omit, status: List[ @@ -700,10 +706,13 @@ async def get_orders( Args: from_: The start date and time for the query range, inclusive (ISO 8601 format) - instrument_ids: Comma-separated OEMS instrument UUIDs + instrument_ids: Comma-separated instrument identifiers instrument_type: Instrument type filter (e.g., COMMON_STOCK, OPTION) + order_ids: Comma-separated order IDs to filter by. When provided, only orders whose order + ID is in this set are returned. + page_size: The number of items to return per page. Only used when page_token is not provided. @@ -716,7 +725,7 @@ async def get_orders( to: The end date and time for the query range, inclusive (ISO 8601 format) - underlying_instrument_ids: Comma-separated OEMS instrument UUIDs. Matches options orders whose resolved + underlying_instrument_ids: Comma-separated instrument identifiers. Matches options orders whose resolved underlier is any of the given IDs. extra_headers: Send extra headers @@ -739,6 +748,7 @@ async def get_orders( "from_": from_, "instrument_ids": instrument_ids, "instrument_type": instrument_type, + "order_ids": order_ids, "page_size": page_size, "page_token": page_token, "status": status, diff --git a/src/clearstreet/resources/v1/positions.py b/src/clearstreet/resources/v1/positions.py index d09ca0a..113691b 100644 --- a/src/clearstreet/resources/v1/positions.py +++ b/src/clearstreet/resources/v1/positions.py @@ -130,7 +130,7 @@ def close_position( Retrieves orders generated to close the position. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier cancel_orders: Whether to cancel existing open orders for the position before submitting closing orders. @@ -216,8 +216,15 @@ def get_position_instructions( 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. + Args: - instrument_id: Limit results to a single contract. Accepts the instrument id or the OSI symbol. + instrument_id: Limit results to a single contract. Instrument ID (UUID) or symbol (equity + ticker or OSI option symbol). extra_headers: Send extra headers @@ -257,6 +264,7 @@ def get_positions( "POSITION_TYPE", "UNREALIZED_PNL", "DAILY_UNREALIZED_PNL", + "DAILY_REALIZED_PNL", ] | Omit = omit, sort_direction: Literal["ASC", "DESC"] | Omit = omit, @@ -271,7 +279,7 @@ def get_positions( Retrieves all positions for the specified trading account. Args: - instrument_ids: Comma-separated OEMS instrument UUIDs + instrument_ids: Comma-separated instrument identifiers page_size: The number of items to return per page. Only used when page_token is not provided. @@ -332,12 +340,14 @@ def submit_position_instructions( - **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. + rows carry `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 = REJECTED` and + `rejection_reason` so callers can attribute failures by `instruction_id`; the + top-level `error` summarizes the batch. Args: extra_headers: Send extra headers @@ -441,7 +451,7 @@ async def close_position( Retrieves orders generated to close the position. Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier cancel_orders: Whether to cancel existing open orders for the position before submitting closing orders. @@ -527,8 +537,15 @@ async def get_position_instructions( 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. + Args: - instrument_id: Limit results to a single contract. Accepts the instrument id or the OSI symbol. + instrument_id: Limit results to a single contract. Instrument ID (UUID) or symbol (equity + ticker or OSI option symbol). extra_headers: Send extra headers @@ -568,6 +585,7 @@ async def get_positions( "POSITION_TYPE", "UNREALIZED_PNL", "DAILY_UNREALIZED_PNL", + "DAILY_REALIZED_PNL", ] | Omit = omit, sort_direction: Literal["ASC", "DESC"] | Omit = omit, @@ -582,7 +600,7 @@ async def get_positions( Retrieves all positions for the specified trading account. Args: - instrument_ids: Comma-separated OEMS instrument UUIDs + instrument_ids: Comma-separated instrument identifiers page_size: The number of items to return per page. Only used when page_token is not provided. @@ -643,12 +661,14 @@ async def submit_position_instructions( - **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. + rows carry `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 = REJECTED` and + `rejection_reason` so callers can attribute failures by `instruction_id`; the + top-level `error` summarizes the batch. Args: extra_headers: Send extra headers diff --git a/src/clearstreet/resources/v1/screener.py b/src/clearstreet/resources/v1/screener.py new file mode 100644 index 0000000..fc12452 --- /dev/null +++ b/src/clearstreet/resources/v1/screener.py @@ -0,0 +1,720 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional + +import httpx + +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, Base64FileInput, omit, not_given +from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ...types.v1 import ( + screener_create_screener_params, + screener_search_screener_params, + screener_replace_screener_params, +) +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.v1.field_ref_param import FieldRefParam +from ...types.v1.sort_spec_param import SortSpecParam +from ...types.v1.search_filter_param import SearchFilterParam +from ...types.v1.screener_get_screeners_response import ScreenerGetScreenersResponse +from ...types.v1.screener_create_screener_response import ScreenerCreateScreenerResponse +from ...types.v1.screener_search_screener_response import ScreenerSearchScreenerResponse +from ...types.v1.screener_replace_screener_response import ScreenerReplaceScreenerResponse +from ...types.v1.screener_get_screener_by_id_response import ScreenerGetScreenerByIDResponse + +__all__ = ["ScreenerResource", "AsyncScreenerResource"] + + +class ScreenerResource(SyncAPIResource): + """Search instruments and manage saved screeners.""" + + @cached_property + def with_raw_response(self) -> ScreenerResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/clear-street/clear-street-python#accessing-raw-response-data-eg-headers + """ + return ScreenerResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ScreenerResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/clear-street/clear-street-python#with_streaming_response + """ + return ScreenerResourceWithStreamingResponse(self) + + def create_screener( + self, + *, + columns: Optional[Iterable[FieldRefParam]] | Omit = omit, + filters: Optional[Iterable[SearchFilterParam]] | Omit = omit, + name: Optional[str] | Omit = omit, + sorts: Optional[Iterable[SortSpecParam]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerCreateScreenerResponse: + """ + Create a saved screener configuration. + + Persists a screener configuration for the authenticated user. + + Args: + columns: Structured field references to include when running this screener + + filters: Structured search filter criteria + + name: The name for this screener configuration + + sorts: Multi-field sort specifications + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v1/saved-screeners", + body=maybe_transform( + { + "columns": columns, + "filters": filters, + "name": name, + "sorts": sorts, + }, + screener_create_screener_params.ScreenerCreateScreenerParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerCreateScreenerResponse, + ) + + def delete_screener( + self, + screener_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: + """ + Delete a saved screener configuration. + + Deletes the screener configuration for the authenticated user. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not screener_id: + raise ValueError(f"Expected a non-empty value for `screener_id` but received {screener_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + path_template("/v1/saved-screeners/{screener_id}", screener_id=screener_id), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + def get_screener_by_id( + self, + screener_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerGetScreenerByIDResponse: + """ + Get a saved screener configuration by ID. + + Returns a single screener configuration for the authenticated user. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not screener_id: + raise ValueError(f"Expected a non-empty value for `screener_id` but received {screener_id!r}") + return self._get( + path_template("/v1/saved-screeners/{screener_id}", screener_id=screener_id), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerGetScreenerByIDResponse, + ) + + def get_screeners( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerGetScreenersResponse: + """ + List saved screener configurations. + + Returns all screener configurations for the authenticated user. + """ + return self._get( + "/v1/saved-screeners", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerGetScreenersResponse, + ) + + def replace_screener( + self, + screener_id: str, + *, + columns: Optional[Iterable[FieldRefParam]] | Omit = omit, + filters: Optional[Iterable[SearchFilterParam]] | Omit = omit, + name: Optional[str] | Omit = omit, + sorts: Optional[Iterable[SortSpecParam]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerReplaceScreenerResponse: + """ + Update a saved screener configuration. + + Replaces the screener configuration for the authenticated user. If `name` is + null, the existing name is preserved. + + Args: + columns: Structured field references to include when running this screener + + filters: Structured search filter criteria + + name: The name for this screener configuration + + sorts: Multi-field sort specifications + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not screener_id: + raise ValueError(f"Expected a non-empty value for `screener_id` but received {screener_id!r}") + return self._put( + path_template("/v1/saved-screeners/{screener_id}", screener_id=screener_id), + body=maybe_transform( + { + "columns": columns, + "filters": filters, + "name": name, + "sorts": sorts, + }, + screener_replace_screener_params.ScreenerReplaceScreenerParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerReplaceScreenerResponse, + ) + + def search_screener( + self, + *, + columns: Optional[Iterable[FieldRefParam]] | Omit = omit, + filters: Optional[Iterable[SearchFilterParam]] | Omit = omit, + page_size: Optional[int] | Omit = omit, + page_token: Union[str, Base64FileInput, None] | Omit = omit, + sort_case_sensitive: Optional[bool] | Omit = omit, + sorts: Optional[Iterable[SortSpecParam]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerSearchScreenerResponse: + """ + 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. + + Args: + columns: Subset of fields to include in the response. + + filters: Filter conditions to apply. + + page_size: The number of items to return per page (only used when page_token is not + provided) + + page_token: Token for retrieving the next page of results. Contains encoded pagination state + (limit + offset). When provided, page_size is ignored. + + sort_case_sensitive: Whether string sorts should be case-sensitive (default: false). + + sorts: Multi-field sort specifications. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v1/screener", + body=maybe_transform( + { + "columns": columns, + "filters": filters, + "page_size": page_size, + "page_token": page_token, + "sort_case_sensitive": sort_case_sensitive, + "sorts": sorts, + }, + screener_search_screener_params.ScreenerSearchScreenerParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerSearchScreenerResponse, + ) + + +class AsyncScreenerResource(AsyncAPIResource): + """Search instruments and manage saved screeners.""" + + @cached_property + def with_raw_response(self) -> AsyncScreenerResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/clear-street/clear-street-python#accessing-raw-response-data-eg-headers + """ + return AsyncScreenerResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncScreenerResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/clear-street/clear-street-python#with_streaming_response + """ + return AsyncScreenerResourceWithStreamingResponse(self) + + async def create_screener( + self, + *, + columns: Optional[Iterable[FieldRefParam]] | Omit = omit, + filters: Optional[Iterable[SearchFilterParam]] | Omit = omit, + name: Optional[str] | Omit = omit, + sorts: Optional[Iterable[SortSpecParam]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerCreateScreenerResponse: + """ + Create a saved screener configuration. + + Persists a screener configuration for the authenticated user. + + Args: + columns: Structured field references to include when running this screener + + filters: Structured search filter criteria + + name: The name for this screener configuration + + sorts: Multi-field sort specifications + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v1/saved-screeners", + body=await async_maybe_transform( + { + "columns": columns, + "filters": filters, + "name": name, + "sorts": sorts, + }, + screener_create_screener_params.ScreenerCreateScreenerParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerCreateScreenerResponse, + ) + + async def delete_screener( + self, + screener_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: + """ + Delete a saved screener configuration. + + Deletes the screener configuration for the authenticated user. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not screener_id: + raise ValueError(f"Expected a non-empty value for `screener_id` but received {screener_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + path_template("/v1/saved-screeners/{screener_id}", screener_id=screener_id), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + async def get_screener_by_id( + self, + screener_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerGetScreenerByIDResponse: + """ + Get a saved screener configuration by ID. + + Returns a single screener configuration for the authenticated user. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not screener_id: + raise ValueError(f"Expected a non-empty value for `screener_id` but received {screener_id!r}") + return await self._get( + path_template("/v1/saved-screeners/{screener_id}", screener_id=screener_id), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerGetScreenerByIDResponse, + ) + + async def get_screeners( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerGetScreenersResponse: + """ + List saved screener configurations. + + Returns all screener configurations for the authenticated user. + """ + return await self._get( + "/v1/saved-screeners", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerGetScreenersResponse, + ) + + async def replace_screener( + self, + screener_id: str, + *, + columns: Optional[Iterable[FieldRefParam]] | Omit = omit, + filters: Optional[Iterable[SearchFilterParam]] | Omit = omit, + name: Optional[str] | Omit = omit, + sorts: Optional[Iterable[SortSpecParam]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerReplaceScreenerResponse: + """ + Update a saved screener configuration. + + Replaces the screener configuration for the authenticated user. If `name` is + null, the existing name is preserved. + + Args: + columns: Structured field references to include when running this screener + + filters: Structured search filter criteria + + name: The name for this screener configuration + + sorts: Multi-field sort specifications + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not screener_id: + raise ValueError(f"Expected a non-empty value for `screener_id` but received {screener_id!r}") + return await self._put( + path_template("/v1/saved-screeners/{screener_id}", screener_id=screener_id), + body=await async_maybe_transform( + { + "columns": columns, + "filters": filters, + "name": name, + "sorts": sorts, + }, + screener_replace_screener_params.ScreenerReplaceScreenerParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerReplaceScreenerResponse, + ) + + async def search_screener( + self, + *, + columns: Optional[Iterable[FieldRefParam]] | Omit = omit, + filters: Optional[Iterable[SearchFilterParam]] | Omit = omit, + page_size: Optional[int] | Omit = omit, + page_token: Union[str, Base64FileInput, None] | Omit = omit, + sort_case_sensitive: Optional[bool] | Omit = omit, + sorts: Optional[Iterable[SortSpecParam]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScreenerSearchScreenerResponse: + """ + 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. + + Args: + columns: Subset of fields to include in the response. + + filters: Filter conditions to apply. + + page_size: The number of items to return per page (only used when page_token is not + provided) + + page_token: Token for retrieving the next page of results. Contains encoded pagination state + (limit + offset). When provided, page_size is ignored. + + sort_case_sensitive: Whether string sorts should be case-sensitive (default: false). + + sorts: Multi-field sort specifications. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v1/screener", + body=await async_maybe_transform( + { + "columns": columns, + "filters": filters, + "page_size": page_size, + "page_token": page_token, + "sort_case_sensitive": sort_case_sensitive, + "sorts": sorts, + }, + screener_search_screener_params.ScreenerSearchScreenerParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScreenerSearchScreenerResponse, + ) + + +class ScreenerResourceWithRawResponse: + def __init__(self, screener: ScreenerResource) -> None: + self._screener = screener + + self.create_screener = to_raw_response_wrapper( + screener.create_screener, + ) + self.delete_screener = to_raw_response_wrapper( + screener.delete_screener, + ) + self.get_screener_by_id = to_raw_response_wrapper( + screener.get_screener_by_id, + ) + self.get_screeners = to_raw_response_wrapper( + screener.get_screeners, + ) + self.replace_screener = to_raw_response_wrapper( + screener.replace_screener, + ) + self.search_screener = to_raw_response_wrapper( + screener.search_screener, + ) + + +class AsyncScreenerResourceWithRawResponse: + def __init__(self, screener: AsyncScreenerResource) -> None: + self._screener = screener + + self.create_screener = async_to_raw_response_wrapper( + screener.create_screener, + ) + self.delete_screener = async_to_raw_response_wrapper( + screener.delete_screener, + ) + self.get_screener_by_id = async_to_raw_response_wrapper( + screener.get_screener_by_id, + ) + self.get_screeners = async_to_raw_response_wrapper( + screener.get_screeners, + ) + self.replace_screener = async_to_raw_response_wrapper( + screener.replace_screener, + ) + self.search_screener = async_to_raw_response_wrapper( + screener.search_screener, + ) + + +class ScreenerResourceWithStreamingResponse: + def __init__(self, screener: ScreenerResource) -> None: + self._screener = screener + + self.create_screener = to_streamed_response_wrapper( + screener.create_screener, + ) + self.delete_screener = to_streamed_response_wrapper( + screener.delete_screener, + ) + self.get_screener_by_id = to_streamed_response_wrapper( + screener.get_screener_by_id, + ) + self.get_screeners = to_streamed_response_wrapper( + screener.get_screeners, + ) + self.replace_screener = to_streamed_response_wrapper( + screener.replace_screener, + ) + self.search_screener = to_streamed_response_wrapper( + screener.search_screener, + ) + + +class AsyncScreenerResourceWithStreamingResponse: + def __init__(self, screener: AsyncScreenerResource) -> None: + self._screener = screener + + self.create_screener = async_to_streamed_response_wrapper( + screener.create_screener, + ) + self.delete_screener = async_to_streamed_response_wrapper( + screener.delete_screener, + ) + self.get_screener_by_id = async_to_streamed_response_wrapper( + screener.get_screener_by_id, + ) + self.get_screeners = async_to_streamed_response_wrapper( + screener.get_screeners, + ) + self.replace_screener = async_to_streamed_response_wrapper( + screener.replace_screener, + ) + self.search_screener = async_to_streamed_response_wrapper( + screener.search_screener, + ) diff --git a/src/clearstreet/resources/v1/v1.py b/src/clearstreet/resources/v1/v1.py index f90b960..0d76db9 100644 --- a/src/clearstreet/resources/v1/v1.py +++ b/src/clearstreet/resources/v1/v1.py @@ -26,6 +26,14 @@ CalendarResourceWithStreamingResponse, AsyncCalendarResourceWithStreamingResponse, ) +from .screener import ( + ScreenerResource, + AsyncScreenerResource, + ScreenerResourceWithRawResponse, + AsyncScreenerResourceWithRawResponse, + ScreenerResourceWithStreamingResponse, + AsyncScreenerResourceWithStreamingResponse, +) from ..._compat import cached_property from .positions import ( PositionsResource, @@ -43,14 +51,6 @@ WatchlistResourceWithStreamingResponse, AsyncWatchlistResourceWithStreamingResponse, ) -from .websocket import ( - WebsocketResource, - AsyncWebsocketResource, - WebsocketResourceWithRawResponse, - AsyncWebsocketResourceWithRawResponse, - WebsocketResourceWithStreamingResponse, - AsyncWebsocketResourceWithStreamingResponse, -) from ..._resource import SyncAPIResource, AsyncAPIResource from .api_version import ( APIVersionResource, @@ -128,16 +128,16 @@ def positions(self) -> PositionsResource: """View positions and manage position instructions.""" return PositionsResource(self._client) + @cached_property + def screener(self) -> ScreenerResource: + """Search instruments and manage saved screeners.""" + return ScreenerResource(self._client) + @cached_property def watchlist(self) -> WatchlistResource: """Create and manage watchlists.""" return WatchlistResource(self._client) - @cached_property - def websocket(self) -> WebsocketResource: - """Active Websocket.""" - return WebsocketResource(self._client) - @cached_property def with_raw_response(self) -> V1ResourceWithRawResponse: """ @@ -198,16 +198,16 @@ def positions(self) -> AsyncPositionsResource: """View positions and manage position instructions.""" return AsyncPositionsResource(self._client) + @cached_property + def screener(self) -> AsyncScreenerResource: + """Search instruments and manage saved screeners.""" + return AsyncScreenerResource(self._client) + @cached_property def watchlist(self) -> AsyncWatchlistResource: """Create and manage watchlists.""" return AsyncWatchlistResource(self._client) - @cached_property - def websocket(self) -> AsyncWebsocketResource: - """Active Websocket.""" - return AsyncWebsocketResource(self._client) - @cached_property def with_raw_response(self) -> AsyncV1ResourceWithRawResponse: """ @@ -271,16 +271,16 @@ def positions(self) -> PositionsResourceWithRawResponse: """View positions and manage position instructions.""" return PositionsResourceWithRawResponse(self._v1.positions) + @cached_property + def screener(self) -> ScreenerResourceWithRawResponse: + """Search instruments and manage saved screeners.""" + return ScreenerResourceWithRawResponse(self._v1.screener) + @cached_property def watchlist(self) -> WatchlistResourceWithRawResponse: """Create and manage watchlists.""" return WatchlistResourceWithRawResponse(self._v1.watchlist) - @cached_property - def websocket(self) -> WebsocketResourceWithRawResponse: - """Active Websocket.""" - return WebsocketResourceWithRawResponse(self._v1.websocket) - class AsyncV1ResourceWithRawResponse: def __init__(self, v1: AsyncV1Resource) -> None: @@ -325,16 +325,16 @@ def positions(self) -> AsyncPositionsResourceWithRawResponse: """View positions and manage position instructions.""" return AsyncPositionsResourceWithRawResponse(self._v1.positions) + @cached_property + def screener(self) -> AsyncScreenerResourceWithRawResponse: + """Search instruments and manage saved screeners.""" + return AsyncScreenerResourceWithRawResponse(self._v1.screener) + @cached_property def watchlist(self) -> AsyncWatchlistResourceWithRawResponse: """Create and manage watchlists.""" return AsyncWatchlistResourceWithRawResponse(self._v1.watchlist) - @cached_property - def websocket(self) -> AsyncWebsocketResourceWithRawResponse: - """Active Websocket.""" - return AsyncWebsocketResourceWithRawResponse(self._v1.websocket) - class V1ResourceWithStreamingResponse: def __init__(self, v1: V1Resource) -> None: @@ -379,16 +379,16 @@ def positions(self) -> PositionsResourceWithStreamingResponse: """View positions and manage position instructions.""" return PositionsResourceWithStreamingResponse(self._v1.positions) + @cached_property + def screener(self) -> ScreenerResourceWithStreamingResponse: + """Search instruments and manage saved screeners.""" + return ScreenerResourceWithStreamingResponse(self._v1.screener) + @cached_property def watchlist(self) -> WatchlistResourceWithStreamingResponse: """Create and manage watchlists.""" return WatchlistResourceWithStreamingResponse(self._v1.watchlist) - @cached_property - def websocket(self) -> WebsocketResourceWithStreamingResponse: - """Active Websocket.""" - return WebsocketResourceWithStreamingResponse(self._v1.websocket) - class AsyncV1ResourceWithStreamingResponse: def __init__(self, v1: AsyncV1Resource) -> None: @@ -433,12 +433,12 @@ def positions(self) -> AsyncPositionsResourceWithStreamingResponse: """View positions and manage position instructions.""" return AsyncPositionsResourceWithStreamingResponse(self._v1.positions) + @cached_property + def screener(self) -> AsyncScreenerResourceWithStreamingResponse: + """Search instruments and manage saved screeners.""" + return AsyncScreenerResourceWithStreamingResponse(self._v1.screener) + @cached_property def watchlist(self) -> AsyncWatchlistResourceWithStreamingResponse: """Create and manage watchlists.""" return AsyncWatchlistResourceWithStreamingResponse(self._v1.watchlist) - - @cached_property - def websocket(self) -> AsyncWebsocketResourceWithStreamingResponse: - """Active Websocket.""" - return AsyncWebsocketResourceWithStreamingResponse(self._v1.websocket) diff --git a/src/clearstreet/resources/v1/watchlist.py b/src/clearstreet/resources/v1/watchlist.py index 233b1a0..ae11d3b 100644 --- a/src/clearstreet/resources/v1/watchlist.py +++ b/src/clearstreet/resources/v1/watchlist.py @@ -72,7 +72,7 @@ def add_watchlist_item( Add an instrument to a watchlist Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier extra_headers: Send extra headers @@ -318,7 +318,7 @@ async def add_watchlist_item( Add an instrument to a watchlist Args: - instrument_id: OEMS instrument UUID + instrument_id: Instrument identifier extra_headers: Send extra headers diff --git a/src/clearstreet/resources/v1/websocket.py b/src/clearstreet/resources/v1/websocket.py deleted file mode 100644 index ef58ca7..0000000 --- a/src/clearstreet/resources/v1/websocket.py +++ /dev/null @@ -1,140 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import Body, Query, Headers, NoneType, NotGiven, not_given -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options - -__all__ = ["WebsocketResource", "AsyncWebsocketResource"] - - -class WebsocketResource(SyncAPIResource): - """Active Websocket.""" - - @cached_property - def with_raw_response(self) -> WebsocketResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/clear-street/clear-street-python#accessing-raw-response-data-eg-headers - """ - return WebsocketResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> WebsocketResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/clear-street/clear-street-python#with_streaming_response - """ - return WebsocketResourceWithStreamingResponse(self) - - def websocket_handler( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: - """Upgrade the HTTP connection to a WebSocket and echo incoming messages.""" - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return self._get( - "/v1/ws", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - - -class AsyncWebsocketResource(AsyncAPIResource): - """Active Websocket.""" - - @cached_property - def with_raw_response(self) -> AsyncWebsocketResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/clear-street/clear-street-python#accessing-raw-response-data-eg-headers - """ - return AsyncWebsocketResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncWebsocketResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/clear-street/clear-street-python#with_streaming_response - """ - return AsyncWebsocketResourceWithStreamingResponse(self) - - async def websocket_handler( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: - """Upgrade the HTTP connection to a WebSocket and echo incoming messages.""" - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return await self._get( - "/v1/ws", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - - -class WebsocketResourceWithRawResponse: - def __init__(self, websocket: WebsocketResource) -> None: - self._websocket = websocket - - self.websocket_handler = to_raw_response_wrapper( - websocket.websocket_handler, - ) - - -class AsyncWebsocketResourceWithRawResponse: - def __init__(self, websocket: AsyncWebsocketResource) -> None: - self._websocket = websocket - - self.websocket_handler = async_to_raw_response_wrapper( - websocket.websocket_handler, - ) - - -class WebsocketResourceWithStreamingResponse: - def __init__(self, websocket: WebsocketResource) -> None: - self._websocket = websocket - - self.websocket_handler = to_streamed_response_wrapper( - websocket.websocket_handler, - ) - - -class AsyncWebsocketResourceWithStreamingResponse: - def __init__(self, websocket: AsyncWebsocketResource) -> None: - self._websocket = websocket - - self.websocket_handler = async_to_streamed_response_wrapper( - websocket.websocket_handler, - ) diff --git a/src/clearstreet/types/__init__.py b/src/clearstreet/types/__init__.py index 12d75c7..69b1ba4 100644 --- a/src/clearstreet/types/__init__.py +++ b/src/clearstreet/types/__init__.py @@ -4,3 +4,4 @@ from .shared import APIError as APIError, BaseResponse as BaseResponse, ResponseMetadata as ResponseMetadata from .security_type import SecurityType as SecurityType +from .sort_direction import SortDirection as SortDirection diff --git a/src/clearstreet/types/sort_direction.py b/src/clearstreet/types/sort_direction.py new file mode 100644 index 0000000..5f8b906 --- /dev/null +++ b/src/clearstreet/types/sort_direction.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SortDirection"] + +SortDirection: TypeAlias = Literal["ASC", "DESC"] diff --git a/src/clearstreet/types/v1/__init__.py b/src/clearstreet/types/v1/__init__.py index 2ffd69b..51297be 100644 --- a/src/clearstreet/types/v1/__init__.py +++ b/src/clearstreet/types/v1/__init__.py @@ -7,23 +7,33 @@ from .account import Account as Account from .version import Version as Version from .day_type import DayType as DayType +from .modifier import Modifier as Modifier from .position import Position as Position +from .variable import Variable as Variable from .execution import Execution as Execution +from .field_ref import FieldRef as FieldRef +from .sort_spec import SortSpec as SortSpec from .data_chart import DataChart as DataChart +from .field_type import FieldType as FieldType from .instrument import Instrument as Instrument from .order_list import OrderList as OrderList from .order_type import OrderType as OrderType from .chart_point import ChartPoint as ChartPoint from .margin_type import MarginType as MarginType from .market_type import MarketType as MarketType +from .modifier_op import ModifierOp as ModifierOp from .queue_state import QueueState as QueueState from .account_list import AccountList as AccountList from .account_type import AccountType as AccountType from .chart_series import ChartSeries as ChartSeries from .clock_detail import ClockDetail as ClockDetail +from .field_period import FieldPeriod as FieldPeriod +from .filter_value import FilterValue as FilterValue from .listing_type import ListingType as ListingType +from .operator_arg import OperatorArg as OperatorArg from .order_status import OrderStatus as OrderStatus from .price_target import PriceTarget as PriceTarget +from .screener_row import ScreenerRow as ScreenerRow from .action_button import ActionButton as ActionButton from .chart_payload import ChartPayload as ChartPayload from .contract_type import ContractType as ContractType @@ -31,16 +41,26 @@ from .position_list import PositionList as PositionList from .position_type import PositionType as PositionType from .risk_settings import RiskSettings as RiskSettings +from .search_filter import SearchFilter as SearchFilter from .time_in_force import TimeInForce as TimeInForce from .account_status import AccountStatus as AccountStatus from .analyst_rating import AnalystRating as AnalystRating from .execution_list import ExecutionList as ExecutionList from .exercise_style import ExerciseStyle as ExerciseStyle +from .field_lookback import FieldLookback as FieldLookback +from .filter_op_spec import FilterOpSpec as FilterOpSpec from .margin_details import MarginDetails as MarginDetails +from .modifier_param import ModifierParam as ModifierParam +from .screener_entry import ScreenerEntry as ScreenerEntry +from .variable_param import VariableParam as VariableParam from .account_subtype import AccountSubtype as AccountSubtype +from .field_ref_param import FieldRefParam as FieldRefParam +from .filter_operator import FilterOperator as FilterOperator from .instrument_core import InstrumentCore as InstrumentCore from .position_effect import PositionEffect as PositionEffect +from .screener_column import ScreenerColumn as ScreenerColumn from .screener_filter import ScreenerFilter as ScreenerFilter +from .sort_spec_param import SortSpecParam as SortSpecParam from .watchlist_entry import WatchlistEntry as WatchlistEntry from .account_balances import AccountBalances as AccountBalances from .account_settings import AccountSettings as AccountSettings @@ -51,16 +71,21 @@ from .watchlist_detail import WatchlistDetail as WatchlistDetail from .new_order_request import NewOrderRequest as NewOrderRequest from .open_chart_action import OpenChartAction as OpenChartAction +from .screener_row_list import ScreenerRowList as ScreenerRowList from .structured_action import StructuredAction as StructuredAction +from .filter_value_param import FilterValueParam as FilterValueParam from .fiscal_period_type import FiscalPeriodType as FiscalPeriodType from .request_order_type import RequestOrderType as RequestOrderType from .instrument_earnings import InstrumentEarnings as InstrumentEarnings from .market_hours_detail import MarketHoursDetail as MarketHoursDetail from .market_session_type import MarketSessionType as MarketSessionType from .risk_settings_param import RiskSettingsParam as RiskSettingsParam +from .screener_entry_list import ScreenerEntryList as ScreenerEntryList +from .search_filter_param import SearchFilterParam as SearchFilterParam from .account_balances_sod import AccountBalancesSod as AccountBalancesSod from .analyst_distribution import AnalystDistribution as AnalystDistribution from .cancel_order_request import CancelOrderRequest as CancelOrderRequest +from .filter_op_spec_param import FilterOpSpecParam as FilterOpSpecParam from .instrument_core_list import InstrumentCoreList as InstrumentCoreList from .margin_details_usage import MarginDetailsUsage as MarginDetailsUsage from .open_screener_action import OpenScreenerAction as OpenScreenerAction @@ -75,6 +100,7 @@ from .request_time_in_force import RequestTimeInForce as RequestTimeInForce from .instrument_events_data import InstrumentEventsData as InstrumentEventsData from .instrument_split_event import InstrumentSplitEvent as InstrumentSplitEvent +from .margin_session_details import MarginSessionDetails as MarginSessionDetails from .margin_top_contributor import MarginTopContributor as MarginTopContributor from .add_watchlist_item_data import AddWatchlistItemData as AddWatchlistItemData from .instrument_fundamentals import InstrumentFundamentals as InstrumentFundamentals @@ -119,19 +145,26 @@ from .open_entitlement_consent_action import OpenEntitlementConsentAction as OpenEntitlementConsentAction from .position_close_positions_params import PositionClosePositionsParams as PositionClosePositionsParams from .position_get_positions_response import PositionGetPositionsResponse as PositionGetPositionsResponse +from .screener_create_screener_params import ScreenerCreateScreenerParams as ScreenerCreateScreenerParams +from .screener_get_screeners_response import ScreenerGetScreenersResponse as ScreenerGetScreenersResponse +from .screener_search_screener_params import ScreenerSearchScreenerParams as ScreenerSearchScreenerParams from .structured_action_button_action import StructuredActionButtonAction as StructuredActionButtonAction from .watchlist_get_watchlists_params import WatchlistGetWatchlistsParams as WatchlistGetWatchlistsParams from .api_version_get_version_response import APIVersionGetVersionResponse as APIVersionGetVersionResponse from .instrument_income_statement_list import InstrumentIncomeStatementList as InstrumentIncomeStatementList from .order_cancel_open_order_response import OrderCancelOpenOrderResponse as OrderCancelOpenOrderResponse from .position_close_position_response import PositionClosePositionResponse as PositionClosePositionResponse +from .screener_replace_screener_params import ScreenerReplaceScreenerParams as ScreenerReplaceScreenerParams from .instrument_get_instruments_params import InstrumentGetInstrumentsParams as InstrumentGetInstrumentsParams from .position_close_positions_response import PositionClosePositionsResponse as PositionClosePositionsResponse +from .screener_create_screener_response import ScreenerCreateScreenerResponse as ScreenerCreateScreenerResponse +from .screener_search_screener_response import ScreenerSearchScreenerResponse as ScreenerSearchScreenerResponse from .watchlist_create_watchlist_params import WatchlistCreateWatchlistParams as WatchlistCreateWatchlistParams from .watchlist_get_watchlists_response import WatchlistGetWatchlistsResponse as WatchlistGetWatchlistsResponse from .account_get_account_by_id_response import AccountGetAccountByIDResponse as AccountGetAccountByIDResponse from .account_patch_account_by_id_params import AccountPatchAccountByIDParams as AccountPatchAccountByIDParams from .instrument_balance_sheet_statement import InstrumentBalanceSheetStatement as InstrumentBalanceSheetStatement +from .screener_replace_screener_response import ScreenerReplaceScreenerResponse as ScreenerReplaceScreenerResponse from .account_get_account_balances_params import AccountGetAccountBalancesParams as AccountGetAccountBalancesParams from .instrument_cash_flow_statement_list import InstrumentCashFlowStatementList as InstrumentCashFlowStatementList from .instrument_get_instruments_response import InstrumentGetInstrumentsResponse as InstrumentGetInstrumentsResponse @@ -142,6 +175,7 @@ from .account_get_portfolio_history_params import AccountGetPortfolioHistoryParams as AccountGetPortfolioHistoryParams from .account_patch_account_by_id_response import AccountPatchAccountByIDResponse as AccountPatchAccountByIDResponse from .instrument_search_instruments_params import InstrumentSearchInstrumentsParams as InstrumentSearchInstrumentsParams +from .screener_get_screener_by_id_response import ScreenerGetScreenerByIDResponse as ScreenerGetScreenerByIDResponse from .account_get_account_balances_response import ( AccountGetAccountBalancesResponse as AccountGetAccountBalancesResponse, ) diff --git a/src/clearstreet/types/v1/account.py b/src/clearstreet/types/v1/account.py index f590da2..142366d 100644 --- a/src/clearstreet/types/v1/account.py +++ b/src/clearstreet/types/v1/account.py @@ -42,4 +42,7 @@ class Account(BaseModel): """The type of account""" close_date: Optional[date] = None - """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. + """ diff --git a/src/clearstreet/types/v1/account_balances.py b/src/clearstreet/types/v1/account_balances.py index 89b01b3..630ff05 100644 --- a/src/clearstreet/types/v1/account_balances.py +++ b/src/clearstreet/types/v1/account_balances.py @@ -22,6 +22,12 @@ class AccountBalances(BaseModel): currency: str """Currency identifier for all monetary values.""" + daily_change: str + """Difference between current equity and start-of-day equity.""" + + daily_pnl: str + """Total profit or loss since start of day.""" + daily_realized_pnl: str """Realized profit or loss since start of day.""" @@ -52,6 +58,9 @@ class AccountBalances(BaseModel): trade_cash: str """Trade-date effective cash.""" + unrealized_pnl: str + """Total unrealized profit or loss across all open positions.""" + unsettled_credits: str """Trade-date unsettled cash credits.""" @@ -62,10 +71,19 @@ class AccountBalances(BaseModel): """The amount of cash currently available to withdraw.""" margin_details: Optional[MarginDetails] = None - """Margin-account-only details.""" + """ + Margin-account-only details. When a null/undefined value is observed, it + indicates it does not apply. + """ multiplier: Optional[str] = None - """Applied multiplier for margin calculations.""" + """ + Applied multiplier for margin calculations. When a null/undefined value is + observed, it indicates it does not apply. + """ short_market_value: Optional[str] = None - """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. + """ diff --git a/src/clearstreet/types/v1/account_balances_sod.py b/src/clearstreet/types/v1/account_balances_sod.py index 1c364fd..1401870 100644 --- a/src/clearstreet/types/v1/account_balances_sod.py +++ b/src/clearstreet/types/v1/account_balances_sod.py @@ -22,16 +22,31 @@ class AccountBalancesSod(BaseModel): """Start-of-day short market value.""" asof: Optional[date] = None - """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. + """ day_trade_buying_power: Optional[str] = None - """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. + """ maintenance_margin_excess: Optional[str] = None - """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. + """ maintenance_margin_requirement: Optional[str] = None - """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. + """ trade_cash: Optional[str] = None - """Start-of-day trade cash.""" + """ + Start-of-day trade cash. When a null/undefined value is observed, it indicates + it does not apply. + """ diff --git a/src/clearstreet/types/v1/account_get_account_balances_params.py b/src/clearstreet/types/v1/account_get_account_balances_params.py index 829fd1b..e6d1c92 100644 --- a/src/clearstreet/types/v1/account_get_account_balances_params.py +++ b/src/clearstreet/types/v1/account_get_account_balances_params.py @@ -9,4 +9,4 @@ class AccountGetAccountBalancesParams(TypedDict, total=False): top_margin_contributors_limit: int - """Limit the number of top margin contributors returned by the engine.""" + """Limit the number of top margin contributors returned.""" diff --git a/src/clearstreet/types/v1/account_get_accounts_params.py b/src/clearstreet/types/v1/account_get_accounts_params.py index 2c4a6b5..e316bf6 100644 --- a/src/clearstreet/types/v1/account_get_accounts_params.py +++ b/src/clearstreet/types/v1/account_get_accounts_params.py @@ -12,6 +12,18 @@ class AccountGetAccountsParams(TypedDict, total=False): + account_id: str + """ + Filter to accounts whose id starts with this value (lexicographic prefix match + on the decimal id, e.g. `100` matches `100345`). + """ + + account_name: str + """ + Filter to accounts whose full name contains this value (case-insensitive + substring match). + """ + page_size: int """The number of items to return per page. diff --git a/src/clearstreet/types/v1/account_settings.py b/src/clearstreet/types/v1/account_settings.py index 4913bae..3a57141 100644 --- a/src/clearstreet/types/v1/account_settings.py +++ b/src/clearstreet/types/v1/account_settings.py @@ -10,4 +10,7 @@ class AccountSettings(BaseModel): risk: Optional[RiskSettings] = None - """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. + """ diff --git a/src/clearstreet/types/v1/action_button.py b/src/clearstreet/types/v1/action_button.py index 2210066..9a637c7 100644 --- a/src/clearstreet/types/v1/action_button.py +++ b/src/clearstreet/types/v1/action_button.py @@ -21,7 +21,13 @@ class ActionButton(BaseModel): """User-visible label.""" prompt: Optional[PromptButtonAction] = None - """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. + """ structured_action: Optional[StructuredActionButtonAction] = FieldInfo(alias="structuredAction", default=None) - """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. + """ diff --git a/src/clearstreet/types/v1/chart_payload.py b/src/clearstreet/types/v1/chart_payload.py index 11a8804..00013de 100644 --- a/src/clearstreet/types/v1/chart_payload.py +++ b/src/clearstreet/types/v1/chart_payload.py @@ -21,4 +21,7 @@ class ChartPayload(BaseModel): """Buttons associated with this chart.""" data_chart: Optional[DataChart] = FieldInfo(alias="dataChart", default=None) - """Explicit series-driven chart definition.""" + """ + Explicit series-driven chart definition. When a null/undefined value is + observed, it indicates it does not apply. + """ diff --git a/src/clearstreet/types/v1/execution.py b/src/clearstreet/types/v1/execution.py index 900f608..0f0b509 100644 --- a/src/clearstreet/types/v1/execution.py +++ b/src/clearstreet/types/v1/execution.py @@ -15,7 +15,7 @@ class Execution(BaseModel): """Unique identifier for this execution report.""" instrument_id: str - """OEMS instrument identifier.""" + """Unique instrument identifier.""" order_id: str """Identifier of the order this execution belongs to.""" diff --git a/src/clearstreet/types/v1/field_lookback.py b/src/clearstreet/types/v1/field_lookback.py new file mode 100644 index 0000000..819c819 --- /dev/null +++ b/src/clearstreet/types/v1/field_lookback.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["FieldLookback"] + +FieldLookback: TypeAlias = Literal[ + "ONE_DAY", "ONE_WEEK", "ONE_MONTH", "THREE_MONTHS", "SIX_MONTHS", "YEAR_TO_DATE", "ONE_YEAR" +] diff --git a/src/clearstreet/types/v1/field_period.py b/src/clearstreet/types/v1/field_period.py new file mode 100644 index 0000000..a6f8294 --- /dev/null +++ b/src/clearstreet/types/v1/field_period.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["FieldPeriod"] + +FieldPeriod: TypeAlias = Literal["QUARTER", "TRAILING_TWELVE_MONTHS"] diff --git a/src/clearstreet/types/v1/field_ref.py b/src/clearstreet/types/v1/field_ref.py new file mode 100644 index 0000000..8abe649 --- /dev/null +++ b/src/clearstreet/types/v1/field_ref.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .field_type import FieldType +from .field_period import FieldPeriod +from .field_lookback import FieldLookback + +__all__ = ["FieldRef"] + + +class FieldRef(BaseModel): + """A reference to a screener field.""" + + name: str + """The field name.""" + + lookback: Optional[FieldLookback] = None + """Optional historical lookback window.""" + + period: Optional[FieldPeriod] = None + """Optional reporting period (e.g. quarter or TTM).""" + + value_type: Optional[FieldType] = None + """The data type of the field value. Present only in responses.""" diff --git a/src/clearstreet/types/v1/field_ref_param.py b/src/clearstreet/types/v1/field_ref_param.py new file mode 100644 index 0000000..2499f39 --- /dev/null +++ b/src/clearstreet/types/v1/field_ref_param.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from .field_type import FieldType +from .field_period import FieldPeriod +from .field_lookback import FieldLookback + +__all__ = ["FieldRefParam"] + + +class FieldRefParam(TypedDict, total=False): + """A reference to a screener field.""" + + name: Required[str] + """The field name.""" + + lookback: Optional[FieldLookback] + """Optional historical lookback window.""" + + period: Optional[FieldPeriod] + """Optional reporting period (e.g. quarter or TTM).""" + + value_type: Optional[FieldType] + """The data type of the field value. Present only in responses.""" diff --git a/src/clearstreet/types/v1/field_type.py b/src/clearstreet/types/v1/field_type.py new file mode 100644 index 0000000..f063016 --- /dev/null +++ b/src/clearstreet/types/v1/field_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["FieldType"] + +FieldType: TypeAlias = Literal["DECIMAL", "INTEGER", "STRING", "ANALYST_RATING", "DATE"] diff --git a/src/clearstreet/types/v1/filter_op_spec.py b/src/clearstreet/types/v1/filter_op_spec.py new file mode 100644 index 0000000..3f9ae27 --- /dev/null +++ b/src/clearstreet/types/v1/filter_op_spec.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .operator_arg import OperatorArg +from .filter_operator import FilterOperator + +__all__ = ["FilterOpSpec"] + + +class FilterOpSpec(BaseModel): + """Operator specification with optional behavioral arguments.""" + + name: FilterOperator + """The operator to apply.""" + + args: Optional[List[OperatorArg]] = None + """Optional arguments that modify operator behavior.""" diff --git a/src/clearstreet/types/v1/filter_op_spec_param.py b/src/clearstreet/types/v1/filter_op_spec_param.py new file mode 100644 index 0000000..e4cecc6 --- /dev/null +++ b/src/clearstreet/types/v1/filter_op_spec_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +from .operator_arg import OperatorArg +from .filter_operator import FilterOperator + +__all__ = ["FilterOpSpecParam"] + + +class FilterOpSpecParam(TypedDict, total=False): + """Operator specification with optional behavioral arguments.""" + + name: Required[FilterOperator] + """The operator to apply.""" + + args: List[OperatorArg] + """Optional arguments that modify operator behavior.""" diff --git a/src/clearstreet/types/v1/filter_operator.py b/src/clearstreet/types/v1/filter_operator.py new file mode 100644 index 0000000..c1c755c --- /dev/null +++ b/src/clearstreet/types/v1/filter_operator.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["FilterOperator"] + +FilterOperator: TypeAlias = Literal[ + "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", +] diff --git a/src/clearstreet/types/v1/filter_value.py b/src/clearstreet/types/v1/filter_value.py new file mode 100644 index 0000000..ebd5c90 --- /dev/null +++ b/src/clearstreet/types/v1/filter_value.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from .variable import Variable +from ..._models import BaseModel + +__all__ = ["FilterValue"] + + +class FilterValue(BaseModel): + """A filter value: either a literal or a variable reference.""" + + value: Union[float, str, None] = None + + variable: Optional[Variable] = None + """A variable reference.""" diff --git a/src/clearstreet/types/v1/filter_value_param.py b/src/clearstreet/types/v1/filter_value_param.py new file mode 100644 index 0000000..3d683fd --- /dev/null +++ b/src/clearstreet/types/v1/filter_value_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from typing_extensions import TypedDict + +from .variable_param import VariableParam + +__all__ = ["FilterValueParam"] + + +class FilterValueParam(TypedDict, total=False): + """A filter value: either a literal or a variable reference.""" + + value: Union[float, str, None] + + variable: Optional[VariableParam] + """A variable reference.""" diff --git a/src/clearstreet/types/v1/instrument.py b/src/clearstreet/types/v1/instrument.py index 48715be..de92229 100644 --- a/src/clearstreet/types/v1/instrument.py +++ b/src/clearstreet/types/v1/instrument.py @@ -13,7 +13,7 @@ class Instrument(BaseModel): """Represents a tradable financial instrument.""" id: str - """Unique OEMS instrument identifier (UUID)""" + """Unique instrument identifier (UUID)""" country_of_issue: str """The ISO country code of the instrument's issue""" @@ -55,39 +55,64 @@ class Instrument(BaseModel): """The MIC code of the primary listing venue""" adv: Optional[str] = None - """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. + """ expiry: Optional[date] = None - """The expiration date for options instruments""" + """Deprecated. + + Always null. When a null/undefined value is observed, it indicates it does not + apply. + """ instrument_type: Optional[SecurityType] = None - """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. + """ long_margin_rate: Optional[str] = None - """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. + """ name: Optional[str] = None - """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. + """ notional_adv: Optional[str] = None - """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). When a + null/undefined value is observed, it indicates that there is no available data. """ options_expiry_dates: Optional[List[date]] = None """ 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. """ previous_close: Optional[str] = None - """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. + """ short_margin_rate: Optional[str] = None - """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. + """ strike_price: Optional[str] = None - """The strike price for options instruments""" + """Deprecated. + + Always null. When a null/undefined value is observed, it indicates it does not + apply. + """ diff --git a/src/clearstreet/types/v1/instrument_analyst_consensus.py b/src/clearstreet/types/v1/instrument_analyst_consensus.py index 5bccefb..79825e9 100644 --- a/src/clearstreet/types/v1/instrument_analyst_consensus.py +++ b/src/clearstreet/types/v1/instrument_analyst_consensus.py @@ -18,10 +18,19 @@ class InstrumentAnalystConsensus(BaseModel): """The date the consensus snapshot was generated""" distribution: Optional[AnalystDistribution] = None - """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. + """ price_target: Optional[PriceTarget] = None - """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. + """ rating: Optional[AnalystRating] = None - """Consensus analyst rating""" + """ + Consensus analyst rating When a null/undefined value is observed, it indicates + that there is no available data. + """ diff --git a/src/clearstreet/types/v1/instrument_core.py b/src/clearstreet/types/v1/instrument_core.py index b9e608a..f1cc357 100644 --- a/src/clearstreet/types/v1/instrument_core.py +++ b/src/clearstreet/types/v1/instrument_core.py @@ -11,7 +11,7 @@ class InstrumentCore(BaseModel): id: str - """Unique OEMS instrument identifier (UUID)""" + """Unique instrument identifier (UUID)""" country_of_issue: str """The ISO country code of the instrument's issue""" @@ -53,33 +53,57 @@ class InstrumentCore(BaseModel): """The MIC code of the primary listing venue""" adv: Optional[str] = None - """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. + """ expiry: Optional[date] = None - """The expiration date for options instruments""" + """Deprecated. + + Always null. When a null/undefined value is observed, it indicates it does not + apply. + """ instrument_type: Optional[SecurityType] = None - """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. + """ long_margin_rate: Optional[str] = None - """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. + """ name: Optional[str] = None - """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. + """ notional_adv: Optional[str] = None - """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). When a + null/undefined value is observed, it indicates that there is no available data. """ previous_close: Optional[str] = None - """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. + """ short_margin_rate: Optional[str] = None - """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. + """ strike_price: Optional[str] = None - """The strike price for options instruments""" + """Deprecated. + + Always null. When a null/undefined value is observed, it indicates it does not + apply. + """ diff --git a/src/clearstreet/types/v1/instrument_data/daily_summary.py b/src/clearstreet/types/v1/instrument_data/daily_summary.py index c5d65e6..de95e50 100644 --- a/src/clearstreet/types/v1/instrument_data/daily_summary.py +++ b/src/clearstreet/types/v1/instrument_data/daily_summary.py @@ -21,22 +21,41 @@ class DailySummary(BaseModel): """ instrument_id: str - """OEMS instrument identifier. Always populated; echoes the request ID.""" + """Unique instrument identifier. Always populated; echoes the request ID.""" high: Optional[str] = None - """Session high.""" + """ + Session high. When a null/undefined value is observed, it indicates that there + is no available data. + """ low: Optional[str] = None - """Session low.""" + """ + Session low. When a null/undefined value is observed, it indicates that there is + no available data. + """ open: Optional[str] = None - """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. + """ symbol: Optional[str] = None - """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. + """ trade_date: Optional[date] = None - """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. + """ volume: Optional[int] = None - """Session cumulative trading volume.""" + """ + Session cumulative trading volume. When a null/undefined value is observed, it + indicates that there is no available data. + """ diff --git a/src/clearstreet/types/v1/instrument_data/market_data_get_daily_summaries_params.py b/src/clearstreet/types/v1/instrument_data/market_data_get_daily_summaries_params.py index a467283..e0a655e 100644 --- a/src/clearstreet/types/v1/instrument_data/market_data_get_daily_summaries_params.py +++ b/src/clearstreet/types/v1/instrument_data/market_data_get_daily_summaries_params.py @@ -9,4 +9,4 @@ class MarketDataGetDailySummariesParams(TypedDict, total=False): instrument_ids: Required[str] - """Comma-separated OEMS instrument UUIDs (required, 1..=100)""" + """Comma-separated instrument identifiers (required, 1..=100)""" diff --git a/src/clearstreet/types/v1/instrument_data/market_data_get_snapshots_params.py b/src/clearstreet/types/v1/instrument_data/market_data_get_snapshots_params.py index c4498ff..747a2cb 100644 --- a/src/clearstreet/types/v1/instrument_data/market_data_get_snapshots_params.py +++ b/src/clearstreet/types/v1/instrument_data/market_data_get_snapshots_params.py @@ -11,4 +11,4 @@ class MarketDataGetSnapshotsParams(TypedDict, total=False): instrument_ids: SequenceNotStr[str] - """Comma-separated OEMS instrument UUIDs.""" + """Comma-separated instrument identifiers.""" diff --git a/src/clearstreet/types/v1/instrument_data/market_data_snapshot.py b/src/clearstreet/types/v1/instrument_data/market_data_snapshot.py index 0ee4729..85d2c21 100644 --- a/src/clearstreet/types/v1/instrument_data/market_data_snapshot.py +++ b/src/clearstreet/types/v1/instrument_data/market_data_snapshot.py @@ -15,7 +15,7 @@ class MarketDataSnapshot(BaseModel): """Market data snapshot for a single security.""" instrument_id: str - """OEMS instrument identifier.""" + """Unique instrument identifier.""" symbol: str """Display symbol for the security.""" @@ -23,23 +23,39 @@ class MarketDataSnapshot(BaseModel): cumulative_volume: Optional[int] = None """ Cumulative traded volume reported on the most recent trade, in shares for - equities or contracts for options. Absent when no trade is available. + equities or contracts for options. Absent when no trade is available. When a + null/undefined value is observed, it indicates that there is no available data. """ greeks: Optional[SnapshotGreeks] = None """Theoretical price and Greeks for option instruments. `None` for equities, and for options whose Greeks have not yet been observed + When a null/undefined value is observed, it indicates that there is no available + data. """ last_quote: Optional[SnapshotQuote] = None - """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. + """ last_trade: Optional[SnapshotLastTrade] = None - """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. + """ name: Optional[str] = None - """Security name if available.""" + """ + Security name if available. When a null/undefined value is observed, it + indicates that there is no available data. + """ session: Optional[SnapshotSession] = None - """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. + """ diff --git a/src/clearstreet/types/v1/instrument_data/news_get_news_params.py b/src/clearstreet/types/v1/instrument_data/news_get_news_params.py index 1e901f3..350ccf1 100644 --- a/src/clearstreet/types/v1/instrument_data/news_get_news_params.py +++ b/src/clearstreet/types/v1/instrument_data/news_get_news_params.py @@ -28,7 +28,7 @@ class NewsGetNewsParams(TypedDict, total=False): """ instrument_ids: SequenceNotStr[str] - """Comma-delimited OEMS instrument UUIDs to filter by.""" + """Comma-delimited instrument identifiers to filter by.""" news_type: Literal["NEWS", "PRESS_RELEASE"] """Filter by news type.""" diff --git a/src/clearstreet/types/v1/instrument_data/news_instrument.py b/src/clearstreet/types/v1/instrument_data/news_instrument.py index 6727835..7332862 100644 --- a/src/clearstreet/types/v1/instrument_data/news_instrument.py +++ b/src/clearstreet/types/v1/instrument_data/news_instrument.py @@ -11,10 +11,16 @@ class NewsInstrument(BaseModel): """Instrument associated with a news item.""" instrument_id: str - """OEMS instrument UUID.""" + """Instrument identifier.""" name: Optional[str] = None - """Instrument name/description, if available from instrument cache enrichment.""" + """ + Instrument name/description, if available. When a null/undefined value is + observed, it indicates that there is no available data. + """ symbol: Optional[str] = None - """Trading symbol, if available from instrument cache enrichment.""" + """ + Trading symbol, if available. When a null/undefined value is observed, it + indicates that there is no available data. + """ diff --git a/src/clearstreet/types/v1/instrument_data/news_item.py b/src/clearstreet/types/v1/instrument_data/news_item.py index 75052da..b4d342f 100644 --- a/src/clearstreet/types/v1/instrument_data/news_item.py +++ b/src/clearstreet/types/v1/instrument_data/news_item.py @@ -32,10 +32,19 @@ class NewsItem(BaseModel): """Canonical URL to the full article.""" image_url: Optional[str] = None - """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. + """ site: Optional[str] = None - """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. + """ text: Optional[str] = None - """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. + """ diff --git a/src/clearstreet/types/v1/instrument_data/snapshot_greeks.py b/src/clearstreet/types/v1/instrument_data/snapshot_greeks.py index a04f5d7..705e396 100644 --- a/src/clearstreet/types/v1/instrument_data/snapshot_greeks.py +++ b/src/clearstreet/types/v1/instrument_data/snapshot_greeks.py @@ -11,7 +11,7 @@ class SnapshotGreeks(BaseModel): """Theoretical price and Greeks for an options snapshot. All values are - **per share** as published by RENG; no contract multiplier is applied. + **per share**; no contract multiplier is applied. """ delta: str @@ -33,7 +33,7 @@ class SnapshotGreeks(BaseModel): """Theta per trading day.""" timestamp: datetime - """Event timestamp published by RENG.""" + """Timestamp when the Greeks were calculated.""" vega: str """Vega per 1.0 vol point.""" diff --git a/src/clearstreet/types/v1/instrument_data/snapshot_quote.py b/src/clearstreet/types/v1/instrument_data/snapshot_quote.py index 7245782..2743c63 100644 --- a/src/clearstreet/types/v1/instrument_data/snapshot_quote.py +++ b/src/clearstreet/types/v1/instrument_data/snapshot_quote.py @@ -10,17 +10,35 @@ class SnapshotQuote(BaseModel): """L1 quote fields for a market data snapshot.""" - ask: str - """Current best ask.""" + ask: Optional[str] = None + """Current best ask. - bid: str - """Current best bid.""" - - midpoint: str - """Midpoint of bid and 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. + """ ask_size: Optional[int] = None - """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. + """ + + bid: Optional[str] = None + """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. + """ bid_size: Optional[int] = None - """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. + """ + + midpoint: Optional[str] = None + """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. + """ diff --git a/src/clearstreet/types/v1/instrument_data_get_all_instrument_events_params.py b/src/clearstreet/types/v1/instrument_data_get_all_instrument_events_params.py index 5efe3ce..4b34b76 100644 --- a/src/clearstreet/types/v1/instrument_data_get_all_instrument_events_params.py +++ b/src/clearstreet/types/v1/instrument_data_get_all_instrument_events_params.py @@ -22,7 +22,7 @@ class InstrumentDataGetAllInstrumentEventsParams(TypedDict, total=False): """The start date for the query range, inclusive (YYYY-MM-DD).""" instrument_ids: SequenceNotStr[str] - """Filter by OEMS instrument ID(s). + """Filter by instrument ID(s). Comma-delimited list of UUIDs. Example: `instrument_ids=550e8400-e29b-41d4-a716-446655440000`. diff --git a/src/clearstreet/types/v1/instrument_dividend_event.py b/src/clearstreet/types/v1/instrument_dividend_event.py index a56e2f2..a42e720 100644 --- a/src/clearstreet/types/v1/instrument_dividend_event.py +++ b/src/clearstreet/types/v1/instrument_dividend_event.py @@ -18,26 +18,40 @@ class InstrumentDividendEvent(BaseModel): """The day the stock starts trading without the right to receive that dividend.""" declaration_date: Optional[date] = None - """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. + """ dividend_amount: Optional[str] = None - """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. + """ dividend_yield: Optional[str] = None - """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. + """ frequency: Optional[str] = None - """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. + """ payment_date: Optional[date] = None """ The payment date is the date on which a declared stock dividend is scheduled to - be paid. + be paid. When a null/undefined value is observed, it indicates that there is no + available data. """ record_date: Optional[date] = None """ 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. + dividend. When a null/undefined value is observed, it indicates that there is no + available data. """ diff --git a/src/clearstreet/types/v1/instrument_earnings.py b/src/clearstreet/types/v1/instrument_earnings.py index dfc73e8..4162e34 100644 --- a/src/clearstreet/types/v1/instrument_earnings.py +++ b/src/clearstreet/types/v1/instrument_earnings.py @@ -15,19 +15,37 @@ class InstrumentEarnings(BaseModel): """The date when the earnings report was published""" eps_actual: Optional[str] = None - """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. + """ eps_estimate: Optional[str] = None - """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. + """ eps_surprise_percent: Optional[str] = None - """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. + """ revenue_actual: Optional[str] = None - """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. + """ revenue_estimate: Optional[str] = None - """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. + """ revenue_surprise_percent: Optional[str] = None - """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. + """ diff --git a/src/clearstreet/types/v1/instrument_event_envelope.py b/src/clearstreet/types/v1/instrument_event_envelope.py index f92661a..2031d45 100644 --- a/src/clearstreet/types/v1/instrument_event_envelope.py +++ b/src/clearstreet/types/v1/instrument_event_envelope.py @@ -22,25 +22,43 @@ class InstrumentEventEnvelope(BaseModel): """Event type discriminator.""" dividend_event_data: Optional[InstrumentDividendEvent] = None - """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. + """ earnings_event_data: Optional[InstrumentEarnings] = None - """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. + """ instrument_id: Optional[str] = None """ - OEMS instrument identifier, when the instrument is found in the instrument - cache. + Instrument identifier, when available. When a null/undefined value is observed, + it indicates that there is no available data. """ ipo_event_data: Optional[InstrumentEventIpoItem] = None - """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. + """ name: Optional[str] = None - """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. + """ reporting_currency: Optional[str] = None - """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. + """ stock_split_event_data: Optional[InstrumentSplitEvent] = None - """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. + """ diff --git a/src/clearstreet/types/v1/instrument_event_ipo_item.py b/src/clearstreet/types/v1/instrument_event_ipo_item.py index 730d46a..433df6c 100644 --- a/src/clearstreet/types/v1/instrument_event_ipo_item.py +++ b/src/clearstreet/types/v1/instrument_event_ipo_item.py @@ -12,22 +12,43 @@ class InstrumentEventIpoItem(BaseModel): """IPO event in the all-events date grouping response.""" actions: Optional[str] = None - """IPO action.""" + """ + IPO action. When a null/undefined value is observed, it indicates that there is + no available data. + """ announced_at: Optional[datetime] = None - """IPO announced timestamp.""" + """ + IPO announced timestamp. When a null/undefined value is observed, it indicates + that there is no available data. + """ company: Optional[str] = None - """IPO company name.""" + """ + IPO company name. When a null/undefined value is observed, it indicates that + there is no available data. + """ exchange: Optional[str] = None - """IPO exchange.""" + """ + IPO exchange. When a null/undefined value is observed, it indicates that there + is no available data. + """ market_cap: Optional[str] = None - """IPO market cap.""" + """ + IPO market cap. When a null/undefined value is observed, it indicates that there + is no available data. + """ price_range: Optional[str] = None - """IPO price range.""" + """ + IPO price range. When a null/undefined value is observed, it indicates that + there is no available data. + """ shares: Optional[str] = None - """IPO shares offered.""" + """ + IPO shares offered. When a null/undefined value is observed, it indicates that + there is no available data. + """ diff --git a/src/clearstreet/types/v1/instrument_events_data.py b/src/clearstreet/types/v1/instrument_events_data.py index 881234d..351239e 100644 --- a/src/clearstreet/types/v1/instrument_events_data.py +++ b/src/clearstreet/types/v1/instrument_events_data.py @@ -20,10 +20,13 @@ class InstrumentEventsData(BaseModel): """Earnings announcement events""" instrument_id: str - """OEMS instrument UUID from the request""" + """Instrument identifier""" splits: List[InstrumentSplitEvent] """Stock split events""" reporting_currency: Optional[str] = None - """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. + """ diff --git a/src/clearstreet/types/v1/instrument_fundamentals.py b/src/clearstreet/types/v1/instrument_fundamentals.py index f4ef9a6..0d3cc79 100644 --- a/src/clearstreet/types/v1/instrument_fundamentals.py +++ b/src/clearstreet/types/v1/instrument_fundamentals.py @@ -12,49 +12,92 @@ class InstrumentFundamentals(BaseModel): """Supplemental fundamentals and company profile data for an instrument.""" average_volume: Optional[int] = None - """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. + """ beta: Optional[str] = None """ The beta value, measuring the instrument's volatility relative to the overall - market + market When a null/undefined value is observed, it indicates that there is no + available data. """ description: Optional[str] = None - """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. + """ dividend_yield: Optional[str] = None - """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. + """ earnings_per_share: Optional[str] = None - """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. + """ fifty_two_week_high: Optional[str] = None - """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. + """ fifty_two_week_low: Optional[str] = None - """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. + """ industry: Optional[str] = None - """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. + """ list_date: Optional[date] = None - """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. + """ logo_url: Optional[str] = None - """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. + """ market_cap: Optional[str] = None - """The total market capitalization""" + """ + The total market capitalization When a null/undefined value is observed, it + indicates that there is no available data. + """ previous_close: Optional[str] = None - """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. + """ price_to_earnings: Optional[str] = None - """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. + """ reporting_currency: Optional[str] = None - """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. + """ sector: Optional[str] = None - """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. + """ diff --git a/src/clearstreet/types/v1/instrument_get_instruments_params.py b/src/clearstreet/types/v1/instrument_get_instruments_params.py index 0a70627..e99b651 100644 --- a/src/clearstreet/types/v1/instrument_get_instruments_params.py +++ b/src/clearstreet/types/v1/instrument_get_instruments_params.py @@ -16,7 +16,10 @@ class InstrumentGetInstrumentsParams(TypedDict, total=False): """Filter by easy to borrow status""" instrument_ids: SequenceNotStr[str] - """Comma-separated OEMS instrument UUIDs""" + """ + Comma-separated instrument identifiers: unique identifiers or symbols (symbol + for equities, OSI for options) + """ instrument_type: Literal["COMMON_STOCK", "OPTION", "CASH"] """Filter by instrument type (e.g. COMMON_STOCK, OPTION)""" diff --git a/src/clearstreet/types/v1/instrument_get_option_contracts_params.py b/src/clearstreet/types/v1/instrument_get_option_contracts_params.py index 813f6aa..43f2387 100644 --- a/src/clearstreet/types/v1/instrument_get_option_contracts_params.py +++ b/src/clearstreet/types/v1/instrument_get_option_contracts_params.py @@ -37,4 +37,4 @@ class InstrumentGetOptionContractsParams(TypedDict, total=False): """Underlier symbol (e.g., AAPL, SPX)""" underlying_instrument_id: InstrumentIDOrSymbol - """OEMS instrument UUID or symbol of the underlying equity/index""" + """Instrument identifier or symbol of the underlying equity/index""" diff --git a/src/clearstreet/types/v1/instrument_search_instruments_params.py b/src/clearstreet/types/v1/instrument_search_instruments_params.py index 25fb7a3..e69ee8a 100644 --- a/src/clearstreet/types/v1/instrument_search_instruments_params.py +++ b/src/clearstreet/types/v1/instrument_search_instruments_params.py @@ -15,8 +15,8 @@ class InstrumentSearchInstrumentsParams(TypedDict, total=False): q: Required[str] """ 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. + (CUSIP, ISIN, OPRA root), and company names for non-option instruments. Option + searches match symbols and alternate identifiers. """ asset_class: str diff --git a/src/clearstreet/types/v1/margin_details.py b/src/clearstreet/types/v1/margin_details.py index 0ada483..f2d7647 100644 --- a/src/clearstreet/types/v1/margin_details.py +++ b/src/clearstreet/types/v1/margin_details.py @@ -4,6 +4,7 @@ from ..._models import BaseModel from .margin_details_usage import MarginDetailsUsage +from .margin_session_details import MarginSessionDetails from .margin_top_contributor import MarginTopContributor __all__ = ["MarginDetails"] @@ -19,20 +20,33 @@ class MarginDetails(BaseModel): initial_margin_requirement: str """Initial margin requirement for trade-date balances.""" + intraday_details: MarginSessionDetails + """Intraday session margin calculation details.""" + maintenance_margin_excess: str """Maintenance margin excess for trade-date balances.""" maintenance_margin_requirement: str """Maintenance margin requirement for trade-date balances.""" + overnight_details: MarginSessionDetails + """Overnight session margin calculation details.""" + pattern_day_trader: bool """`true` if the account is currently flagged as a PDT, otherwise `false`.""" day_trade_buying_power_usage: Optional[str] = None - """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. + """ top_contributors: Optional[List[MarginTopContributor]] = None """Optional top margin contributors, returned only when explicitly requested.""" usage: Optional[MarginDetailsUsage] = None - """Current usage totals.""" + """ + Current usage totals. When a null/undefined value is observed, it indicates that + there is no available data. + """ diff --git a/src/clearstreet/types/v1/margin_session_details.py b/src/clearstreet/types/v1/margin_session_details.py new file mode 100644 index 0000000..e49a532 --- /dev/null +++ b/src/clearstreet/types/v1/margin_session_details.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["MarginSessionDetails"] + + +class MarginSessionDetails(BaseModel): + buying_power: str + """Maximum buying power available in the account during the session.""" + + multiplier: Optional[str] = None + """Effective multiplier for margin calculations during the session.""" diff --git a/src/clearstreet/types/v1/market_status.py b/src/clearstreet/types/v1/market_status.py index 12cb2db..068ac54 100644 --- a/src/clearstreet/types/v1/market_status.py +++ b/src/clearstreet/types/v1/market_status.py @@ -19,4 +19,7 @@ class MarketStatus(BaseModel): """Whether the market is currently open (real-time)""" current_session: Optional[MarketSessionType] = None - """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. + """ diff --git a/src/clearstreet/types/v1/modifier.py b/src/clearstreet/types/v1/modifier.py new file mode 100644 index 0000000..700a32e --- /dev/null +++ b/src/clearstreet/types/v1/modifier.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union + +from ..._models import BaseModel +from .modifier_op import ModifierOp + +__all__ = ["Modifier"] + + +class Modifier(BaseModel): + """Arithmetic modifier applied to a variable value.""" + + args: List[Union[float, str]] + + name: ModifierOp + """The modifier operation.""" diff --git a/src/clearstreet/types/v1/modifier_op.py b/src/clearstreet/types/v1/modifier_op.py new file mode 100644 index 0000000..ea0aede --- /dev/null +++ b/src/clearstreet/types/v1/modifier_op.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ModifierOp"] + +ModifierOp: TypeAlias = Literal["ADD", "SUBTRACT"] diff --git a/src/clearstreet/types/v1/modifier_param.py b/src/clearstreet/types/v1/modifier_param.py new file mode 100644 index 0000000..bb47473 --- /dev/null +++ b/src/clearstreet/types/v1/modifier_param.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from ..._types import SequenceNotStr +from .modifier_op import ModifierOp + +__all__ = ["ModifierParam"] + + +class ModifierParam(TypedDict, total=False): + """Arithmetic modifier applied to a variable value.""" + + args: Required[SequenceNotStr[Union[float, str]]] + + name: Required[ModifierOp] + """The modifier operation.""" diff --git a/src/clearstreet/types/v1/new_order_request.py b/src/clearstreet/types/v1/new_order_request.py index 22c46d3..e6ee1d0 100644 --- a/src/clearstreet/types/v1/new_order_request.py +++ b/src/clearstreet/types/v1/new_order_request.py @@ -52,7 +52,7 @@ class NewOrderRequest(BaseModel): """ instrument_id: Optional[InstrumentIDOrSymbol] = None - """OEMS instrument UUID""" + """Instrument identifier""" limit_offset: Optional[str] = None """Limit offset for trailing stop-limit orders (signed)""" @@ -69,8 +69,8 @@ class NewOrderRequest(BaseModel): symbol: Optional[str] = None """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 + 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. """ diff --git a/src/clearstreet/types/v1/new_order_request_param.py b/src/clearstreet/types/v1/new_order_request_param.py index 3dd128c..930cb0b 100644 --- a/src/clearstreet/types/v1/new_order_request_param.py +++ b/src/clearstreet/types/v1/new_order_request_param.py @@ -55,7 +55,7 @@ class NewOrderRequestParam(TypedDict, total=False): """ instrument_id: Optional[InstrumentIDOrSymbol] - """OEMS instrument UUID""" + """Instrument identifier""" limit_offset: Optional[str] """Limit offset for trailing stop-limit orders (signed)""" @@ -72,8 +72,8 @@ class NewOrderRequestParam(TypedDict, total=False): symbol: Optional[str] """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 + 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. """ diff --git a/src/clearstreet/types/v1/omni_ai/create_feedback_response.py b/src/clearstreet/types/v1/omni_ai/create_feedback_response.py index d652862..506aa43 100644 --- a/src/clearstreet/types/v1/omni_ai/create_feedback_response.py +++ b/src/clearstreet/types/v1/omni_ai/create_feedback_response.py @@ -11,3 +11,7 @@ class CreateFeedbackResponse(BaseModel): created_at: str feedback_id: Optional[str] = None + """ + When a null/undefined value is observed, it indicates that there is no available + data. + """ diff --git a/src/clearstreet/types/v1/omni_ai/error_status.py b/src/clearstreet/types/v1/omni_ai/error_status.py index 2b60920..7cb398b 100644 --- a/src/clearstreet/types/v1/omni_ai/error_status.py +++ b/src/clearstreet/types/v1/omni_ai/error_status.py @@ -15,3 +15,4 @@ class ErrorStatus(BaseModel): message: str details: Optional[object] = None + """When a null/undefined value is observed, it indicates it does not apply.""" diff --git a/src/clearstreet/types/v1/omni_ai/message.py b/src/clearstreet/types/v1/omni_ai/message.py index 4498c96..dfa9496 100644 --- a/src/clearstreet/types/v1/omni_ai/message.py +++ b/src/clearstreet/types/v1/omni_ai/message.py @@ -32,4 +32,4 @@ class Message(BaseModel): thread_id: str error: Optional[ErrorStatus] = None - """Shared sanitized error payload.""" + """When a null/undefined value is observed, it indicates it does not apply.""" diff --git a/src/clearstreet/types/v1/omni_ai/response.py b/src/clearstreet/types/v1/omni_ai/response.py index 35bf98b..32577fd 100644 --- a/src/clearstreet/types/v1/omni_ai/response.py +++ b/src/clearstreet/types/v1/omni_ai/response.py @@ -23,9 +23,13 @@ class Response(BaseModel): user_message_id: str content: Optional[ResponseContent] = None - """Dynamic response content container. May include thinking parts.""" + """ + When a null/undefined value is observed, it indicates that there is no available + data. + """ error: Optional[ErrorStatus] = None - """Shared sanitized error payload.""" + """When a null/undefined value is observed, it indicates it does not apply.""" output_message_id: Optional[str] = None + """When a null/undefined value is observed, it indicates it does not apply.""" diff --git a/src/clearstreet/types/v1/omni_ai/thread_get_thread_response_response.py b/src/clearstreet/types/v1/omni_ai/thread_get_thread_response_response.py index 59f6461..c66dad9 100644 --- a/src/clearstreet/types/v1/omni_ai/thread_get_thread_response_response.py +++ b/src/clearstreet/types/v1/omni_ai/thread_get_thread_response_response.py @@ -1,5 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional + from .response import Response from ...shared.base_response import BaseResponse @@ -7,5 +9,5 @@ class ThreadGetThreadResponseResponse(BaseResponse): - data: Response + data: Optional[Response] = None """Dynamic pollable response.""" diff --git a/src/clearstreet/types/v1/open_chart_action.py b/src/clearstreet/types/v1/open_chart_action.py index 46c7cdb..c30dd5b 100644 --- a/src/clearstreet/types/v1/open_chart_action.py +++ b/src/clearstreet/types/v1/open_chart_action.py @@ -14,7 +14,13 @@ class OpenChartAction(BaseModel): """Trading symbol to chart""" extras: Optional[object] = None - """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. + """ timeframe: Optional[str] = None - """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. + """ diff --git a/src/clearstreet/types/v1/open_screener_action.py b/src/clearstreet/types/v1/open_screener_action.py index 0f81bf7..7ac72e2 100644 --- a/src/clearstreet/types/v1/open_screener_action.py +++ b/src/clearstreet/types/v1/open_screener_action.py @@ -14,14 +14,26 @@ class OpenScreenerAction(BaseModel): filters: List[ScreenerFilter] """Filter criteria for the screener""" - field_filter: Optional[List[str]] = None - """Optional field/column selection for screener results.""" + columns: Optional[List[str]] = None + """ + Optional field/column selection for screener results. When a null/undefined + value is observed, it indicates it does not apply. + """ page_size: Optional[int] = None - """Optional page size.""" + """ + Optional page size. When a null/undefined value is observed, it indicates it + does not apply. + """ sort_by: Optional[str] = None - """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. + """ sort_direction: Optional[str] = None - """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. + """ diff --git a/src/clearstreet/types/v1/operator_arg.py b/src/clearstreet/types/v1/operator_arg.py new file mode 100644 index 0000000..7007c3c --- /dev/null +++ b/src/clearstreet/types/v1/operator_arg.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["OperatorArg"] + +OperatorArg: TypeAlias = Literal[ + "LEFT_INCLUSIVE", "RIGHT_INCLUSIVE", "LEFT_EXCLUSIVE", "RIGHT_EXCLUSIVE", "CASE_INSENSITIVE" +] diff --git a/src/clearstreet/types/v1/options_contract.py b/src/clearstreet/types/v1/options_contract.py index 58454c8..4f9906d 100644 --- a/src/clearstreet/types/v1/options_contract.py +++ b/src/clearstreet/types/v1/options_contract.py @@ -15,7 +15,7 @@ class OptionsContract(BaseModel): """An options contract with options-specific metadata""" id: str - """OEMS instrument identifier""" + """Instrument identifier""" contract_type: ContractType """Whether this is a CALL or PUT""" @@ -51,7 +51,13 @@ class OptionsContract(BaseModel): """OSI symbol (e.g. "AAPL 251219C00150000")""" open_interest: Optional[int] = None - """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. + """ underlying_instrument_id: Optional[str] = None - """OEMS instrument ID of the underlying instrument, if resolvable""" + """ + Instrument ID of the underlying instrument, when available When a null/undefined + value is observed, it indicates that there is no available data. + """ diff --git a/src/clearstreet/types/v1/order.py b/src/clearstreet/types/v1/order.py index 48717ee..e627825 100644 --- a/src/clearstreet/types/v1/order.py +++ b/src/clearstreet/types/v1/order.py @@ -29,7 +29,7 @@ class Order(BaseModel): """Account placing the order""" client_order_id: str - """Client-provided identifier echoed back (FIX tag 11).""" + """Client-provided identifier echoed back.""" created_at: datetime """Timestamp when order was created (UTC)""" @@ -38,7 +38,7 @@ class Order(BaseModel): """Cumulative filled quantity""" instrument_id: str - """OEMS instrument UUID for the traded instrument.""" + """Instrument identifier for the traded instrument.""" instrument_type: SecurityType """Type of security""" @@ -71,7 +71,10 @@ class Order(BaseModel): """MIC code of the venue where the order is routed""" average_fill_price: Optional[str] = None - """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. + """ details: Optional[List[str]] = None """Contains execution, rejection or cancellation details, if any""" @@ -79,51 +82,85 @@ class Order(BaseModel): expires_at: Optional[datetime] = None """Timestamp when the order will expire (UTC). - Present when time_in_force is GOOD_TILL_DATE. + Present when time_in_force is GOOD_TILL_DATE. When a null/undefined value is + observed, it indicates it does not apply. """ extended_hours: Optional[bool] = None """Whether the order is eligible for extended-hours trading.""" limit_offset: Optional[str] = None - """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. + """ limit_price: Optional[str] = None - """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. + """ queue_state: Optional[QueueState] = None """ Parent order queue state, present when the order is awaiting release or - released. + released. When a null/undefined value is observed, it indicates it does not + apply. """ releases_at: Optional[datetime] = None - """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. + """ stop_price: Optional[str] = None - """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. + """ trailing_limit_px: Optional[str] = None - """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. + """ trailing_offset: Optional[str] = None - """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. + """ trailing_offset_type: Optional[TrailingOffsetType] = None - """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. + """ trailing_stop_px: Optional[str] = None - """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. + """ trailing_watermark_px: Optional[str] = None - """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. + """ trailing_watermark_ts: Optional[datetime] = None - """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. + """ underlying_instrument_id: Optional[str] = None - """OEMS instrument ID of the option's underlying instrument. + """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. + 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. """ diff --git a/src/clearstreet/types/v1/order_cancel_all_open_orders_params.py b/src/clearstreet/types/v1/order_cancel_all_open_orders_params.py index 7dce1a7..572a0b4 100644 --- a/src/clearstreet/types/v1/order_cancel_all_open_orders_params.py +++ b/src/clearstreet/types/v1/order_cancel_all_open_orders_params.py @@ -11,7 +11,7 @@ class OrderCancelAllOpenOrdersParams(TypedDict, total=False): instrument_ids: SequenceNotStr[str] - """Comma-separated OEMS instrument UUIDs""" + """Comma-separated instrument identifiers""" instrument_type: Literal["COMMON_STOCK", "OPTION", "CASH"] """Filter by instrument type (e.g., COMMON_STOCK, OPTION)""" diff --git a/src/clearstreet/types/v1/order_get_executions_params.py b/src/clearstreet/types/v1/order_get_executions_params.py index 691383f..cfe1b0f 100644 --- a/src/clearstreet/types/v1/order_get_executions_params.py +++ b/src/clearstreet/types/v1/order_get_executions_params.py @@ -20,7 +20,7 @@ class OrderGetExecutionsParams(TypedDict, total=False): instrument_id: InstrumentIDOrSymbol """Optional instrument to filter by. - Accepts either a symbol (e.g. `AAPL`) or an OEMS instrument UUID. + Accepts either a symbol (e.g. `AAPL`) or an instrument identifier. """ page_size: int diff --git a/src/clearstreet/types/v1/order_get_orders_params.py b/src/clearstreet/types/v1/order_get_orders_params.py index f72f5e6..a80103f 100644 --- a/src/clearstreet/types/v1/order_get_orders_params.py +++ b/src/clearstreet/types/v1/order_get_orders_params.py @@ -17,11 +17,17 @@ class OrderGetOrdersParams(TypedDict, total=False): """The start date and time for the query range, inclusive (ISO 8601 format)""" instrument_ids: SequenceNotStr[str] - """Comma-separated OEMS instrument UUIDs""" + """Comma-separated instrument identifiers""" instrument_type: Literal["COMMON_STOCK", "OPTION", "CASH"] """Instrument type filter (e.g., COMMON_STOCK, OPTION)""" + order_ids: SequenceNotStr[str] + """Comma-separated order IDs to filter by. + + When provided, only orders whose order ID is in this set are returned. + """ + page_size: int """The number of items to return per page. @@ -62,7 +68,7 @@ class OrderGetOrdersParams(TypedDict, total=False): """The end date and time for the query range, inclusive (ISO 8601 format)""" underlying_instrument_ids: SequenceNotStr[str] - """Comma-separated OEMS instrument UUIDs. + """Comma-separated instrument identifiers. Matches options orders whose resolved underlier is any of the given IDs. """ diff --git a/src/clearstreet/types/v1/position.py b/src/clearstreet/types/v1/position.py index 1cbcf48..c3bc293 100644 --- a/src/clearstreet/types/v1/position.py +++ b/src/clearstreet/types/v1/position.py @@ -20,7 +20,7 @@ class Position(BaseModel): """The quantity of a position that is free to be operated on.""" instrument_id: str - """OEMS instrument UUID""" + """Unique instrument identifier""" instrument_type: SecurityType """Type of security""" @@ -38,40 +38,71 @@ class Position(BaseModel): """The trading symbol for the instrument""" avg_price: Optional[str] = None - """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. + """ closing_price: Optional[str] = None - """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. + """ closing_price_date: Optional[date] = None - """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. + """ cost_basis: Optional[str] = None - """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. + """ + + daily_realized_pnl: Optional[str] = None + """ + 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. + """ daily_unrealized_pnl: Optional[str] = None - """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. + """ daily_unrealized_pnl_pct: Optional[str] = None """ 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. """ instrument_price: Optional[str] = None - """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. + """ underlying_instrument_id: Optional[str] = None - """OEMS instrument identifier of the underlying instrument, if resolvable""" + """ + Identifier of the underlying instrument, when available When a null/undefined + value is observed, it indicates it does not apply. + """ unrealized_pnl: Optional[str] = None """ The total unrealized profit or loss for this position based on current market - value + value When a null/undefined value is observed, it indicates that there is no + available data. """ unrealized_pnl_pct: Optional[str] = None """ The unrealized profit/loss for the position, expressed as a percentage of the - position's cost basis (range: 0-100). + position's cost basis (range: 0-100). When a null/undefined value is observed, + it indicates that there is no available data. """ diff --git a/src/clearstreet/types/v1/position_get_position_instructions_params.py b/src/clearstreet/types/v1/position_get_position_instructions_params.py index ccf29c3..7b84fde 100644 --- a/src/clearstreet/types/v1/position_get_position_instructions_params.py +++ b/src/clearstreet/types/v1/position_get_position_instructions_params.py @@ -13,5 +13,5 @@ class PositionGetPositionInstructionsParams(TypedDict, total=False): instrument_id: InstrumentIDOrSymbol """Limit results to a single contract. - Accepts the instrument id or the OSI symbol. + Instrument ID (UUID) or symbol (equity ticker or OSI option symbol). """ diff --git a/src/clearstreet/types/v1/position_get_positions_params.py b/src/clearstreet/types/v1/position_get_positions_params.py index b96e633..f776c02 100644 --- a/src/clearstreet/types/v1/position_get_positions_params.py +++ b/src/clearstreet/types/v1/position_get_positions_params.py @@ -13,7 +13,7 @@ class PositionGetPositionsParams(TypedDict, total=False): instrument_ids: SequenceNotStr[str] - """Comma-separated OEMS instrument UUIDs""" + """Comma-separated instrument identifiers""" page_size: int """The number of items to return per page. @@ -35,6 +35,7 @@ class PositionGetPositionsParams(TypedDict, total=False): "POSITION_TYPE", "UNREALIZED_PNL", "DAILY_UNREALIZED_PNL", + "DAILY_REALIZED_PNL", ] """Field to sort by""" diff --git a/src/clearstreet/types/v1/position_instruction.py b/src/clearstreet/types/v1/position_instruction.py index da7342f..9d00b3e 100644 --- a/src/clearstreet/types/v1/position_instruction.py +++ b/src/clearstreet/types/v1/position_instruction.py @@ -43,19 +43,26 @@ class PositionInstruction(BaseModel): accepted_quantity: Optional[str] = None """Number of contracts accepted by the clearing venue. - Populated once the instruction reaches `ACCEPTED`. + Populated once the instruction reaches `ACCEPTED`. When a null/undefined value + is observed, it indicates that there is no available data. """ created_at: Optional[datetime] = None - """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. + """ rejection_reason: Optional[str] = None """ 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. + `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. When a null/undefined value is observed, it indicates it does not apply. """ updated_at: Optional[datetime] = None - """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. + """ diff --git a/src/clearstreet/types/v1/position_instruction_status.py b/src/clearstreet/types/v1/position_instruction_status.py index 47069c9..5a03672 100644 --- a/src/clearstreet/types/v1/position_instruction_status.py +++ b/src/clearstreet/types/v1/position_instruction_status.py @@ -5,5 +5,5 @@ __all__ = ["PositionInstructionStatus"] PositionInstructionStatus: TypeAlias = Literal[ - "SENT", "ACCEPTED", "REJECTED", "ENGINE_REJECTED", "CANCEL_REQUESTED", "CANCELLED", "CANCEL_FAILED", "UNKNOWN" + "SENT", "ACCEPTED", "REJECTED", "CANCEL_REQUESTED", "CANCELLED", "CANCEL_FAILED", "UNKNOWN" ] diff --git a/src/clearstreet/types/v1/position_type.py b/src/clearstreet/types/v1/position_type.py index 4569289..5391cd6 100644 --- a/src/clearstreet/types/v1/position_type.py +++ b/src/clearstreet/types/v1/position_type.py @@ -4,4 +4,4 @@ __all__ = ["PositionType"] -PositionType: TypeAlias = Literal["LONG", "SHORT", "LONG_CALL", "SHORT_CALL", "LONG_PUT", "SHORT_PUT"] +PositionType: TypeAlias = Literal["LONG", "SHORT"] diff --git a/src/clearstreet/types/v1/risk_settings.py b/src/clearstreet/types/v1/risk_settings.py index 91a51c0..2576b48 100644 --- a/src/clearstreet/types/v1/risk_settings.py +++ b/src/clearstreet/types/v1/risk_settings.py @@ -11,4 +11,7 @@ class RiskSettings(BaseModel): """Risk settings for an account""" max_notional: Optional[str] = None - """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. + """ diff --git a/src/clearstreet/types/v1/risk_settings_param.py b/src/clearstreet/types/v1/risk_settings_param.py index cfd3d8e..9c96dc1 100644 --- a/src/clearstreet/types/v1/risk_settings_param.py +++ b/src/clearstreet/types/v1/risk_settings_param.py @@ -12,4 +12,7 @@ class RiskSettingsParam(TypedDict, total=False): """Risk settings for an account""" max_notional: Optional[str] - """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. + """ diff --git a/src/clearstreet/types/v1/screener_column.py b/src/clearstreet/types/v1/screener_column.py new file mode 100644 index 0000000..d9cdf36 --- /dev/null +++ b/src/clearstreet/types/v1/screener_column.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .field_ref import FieldRef + +__all__ = ["ScreenerColumn"] + + +class ScreenerColumn(BaseModel): + """A single column in the screener search response.""" + + field: FieldRef + """Field reference (same shape as filter/sort field references)""" + + name: str + """Human-readable display name for this field""" + + value: Union[float, str, None] = None + + type: Optional[str] = None + """Value format hint: "CURR_USD", "PERCENT", etc. + + Omitted when not applicable. When a null/undefined value is observed, it + indicates it does not apply. + """ diff --git a/src/clearstreet/types/v1/screener_create_screener_params.py b/src/clearstreet/types/v1/screener_create_screener_params.py new file mode 100644 index 0000000..05eec09 --- /dev/null +++ b/src/clearstreet/types/v1/screener_create_screener_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import TypedDict + +from .field_ref_param import FieldRefParam +from .sort_spec_param import SortSpecParam +from .search_filter_param import SearchFilterParam + +__all__ = ["ScreenerCreateScreenerParams"] + + +class ScreenerCreateScreenerParams(TypedDict, total=False): + columns: Optional[Iterable[FieldRefParam]] + """Structured field references to include when running this screener""" + + filters: Optional[Iterable[SearchFilterParam]] + """Structured search filter criteria""" + + name: Optional[str] + """The name for this screener configuration""" + + sorts: Optional[Iterable[SortSpecParam]] + """Multi-field sort specifications""" diff --git a/src/clearstreet/types/v1/screener_create_screener_response.py b/src/clearstreet/types/v1/screener_create_screener_response.py new file mode 100644 index 0000000..4fa638b --- /dev/null +++ b/src/clearstreet/types/v1/screener_create_screener_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .screener_entry import ScreenerEntry +from ..shared.base_response import BaseResponse + +__all__ = ["ScreenerCreateScreenerResponse"] + + +class ScreenerCreateScreenerResponse(BaseResponse): + data: ScreenerEntry + """A saved screener configuration entry""" diff --git a/src/clearstreet/types/v1/screener_entry.py b/src/clearstreet/types/v1/screener_entry.py new file mode 100644 index 0000000..c38f29c --- /dev/null +++ b/src/clearstreet/types/v1/screener_entry.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel +from .field_ref import FieldRef +from .sort_spec import SortSpec +from .search_filter import SearchFilter + +__all__ = ["ScreenerEntry"] + + +class ScreenerEntry(BaseModel): + """A saved screener configuration entry""" + + id: str + + created_at: datetime + + filters: List[SearchFilter] + + name: str + + updated_at: datetime + + columns: Optional[List[FieldRef]] = None + """Field references included when running this screener.""" + + sorts: Optional[List[SortSpec]] = None diff --git a/src/clearstreet/types/v1/screener_entry_list.py b/src/clearstreet/types/v1/screener_entry_list.py new file mode 100644 index 0000000..3615d9c --- /dev/null +++ b/src/clearstreet/types/v1/screener_entry_list.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .screener_entry import ScreenerEntry + +__all__ = ["ScreenerEntryList"] + +ScreenerEntryList: TypeAlias = List[ScreenerEntry] diff --git a/src/clearstreet/types/v1/screener_get_screener_by_id_response.py b/src/clearstreet/types/v1/screener_get_screener_by_id_response.py new file mode 100644 index 0000000..b71836f --- /dev/null +++ b/src/clearstreet/types/v1/screener_get_screener_by_id_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .screener_entry import ScreenerEntry +from ..shared.base_response import BaseResponse + +__all__ = ["ScreenerGetScreenerByIDResponse"] + + +class ScreenerGetScreenerByIDResponse(BaseResponse): + data: ScreenerEntry + """A saved screener configuration entry""" diff --git a/src/clearstreet/types/v1/screener_get_screeners_response.py b/src/clearstreet/types/v1/screener_get_screeners_response.py new file mode 100644 index 0000000..c02b079 --- /dev/null +++ b/src/clearstreet/types/v1/screener_get_screeners_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .screener_entry_list import ScreenerEntryList +from ..shared.base_response import BaseResponse + +__all__ = ["ScreenerGetScreenersResponse"] + + +class ScreenerGetScreenersResponse(BaseResponse): + data: ScreenerEntryList diff --git a/src/clearstreet/types/v1/screener_replace_screener_params.py b/src/clearstreet/types/v1/screener_replace_screener_params.py new file mode 100644 index 0000000..58ad599 --- /dev/null +++ b/src/clearstreet/types/v1/screener_replace_screener_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import TypedDict + +from .field_ref_param import FieldRefParam +from .sort_spec_param import SortSpecParam +from .search_filter_param import SearchFilterParam + +__all__ = ["ScreenerReplaceScreenerParams"] + + +class ScreenerReplaceScreenerParams(TypedDict, total=False): + columns: Optional[Iterable[FieldRefParam]] + """Structured field references to include when running this screener""" + + filters: Optional[Iterable[SearchFilterParam]] + """Structured search filter criteria""" + + name: Optional[str] + """The name for this screener configuration""" + + sorts: Optional[Iterable[SortSpecParam]] + """Multi-field sort specifications""" diff --git a/src/clearstreet/types/v1/screener_replace_screener_response.py b/src/clearstreet/types/v1/screener_replace_screener_response.py new file mode 100644 index 0000000..9e41b18 --- /dev/null +++ b/src/clearstreet/types/v1/screener_replace_screener_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .screener_entry import ScreenerEntry +from ..shared.base_response import BaseResponse + +__all__ = ["ScreenerReplaceScreenerResponse"] + + +class ScreenerReplaceScreenerResponse(BaseResponse): + data: ScreenerEntry + """A saved screener configuration entry""" diff --git a/src/clearstreet/types/v1/screener_row.py b/src/clearstreet/types/v1/screener_row.py new file mode 100644 index 0000000..9b7e7c1 --- /dev/null +++ b/src/clearstreet/types/v1/screener_row.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .screener_column import ScreenerColumn + +__all__ = ["ScreenerRow"] + +ScreenerRow: TypeAlias = List[ScreenerColumn] diff --git a/src/clearstreet/types/v1/screener_row_list.py b/src/clearstreet/types/v1/screener_row_list.py new file mode 100644 index 0000000..cf316a2 --- /dev/null +++ b/src/clearstreet/types/v1/screener_row_list.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .screener_row import ScreenerRow + +__all__ = ["ScreenerRowList"] + +ScreenerRowList: TypeAlias = List[ScreenerRow] diff --git a/src/clearstreet/types/v1/screener_search_screener_params.py b/src/clearstreet/types/v1/screener_search_screener_params.py new file mode 100644 index 0000000..78745a9 --- /dev/null +++ b/src/clearstreet/types/v1/screener_search_screener_params.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Annotated, TypedDict + +from ..._types import Base64FileInput +from ..._utils import PropertyInfo +from .field_ref_param import FieldRefParam +from .sort_spec_param import SortSpecParam +from .search_filter_param import SearchFilterParam + +__all__ = ["ScreenerSearchScreenerParams"] + + +class ScreenerSearchScreenerParams(TypedDict, total=False): + columns: Optional[Iterable[FieldRefParam]] + """Subset of fields to include in the response.""" + + filters: Optional[Iterable[SearchFilterParam]] + """Filter conditions to apply.""" + + page_size: Optional[int] + """ + The number of items to return per page (only used when page_token is not + provided) + """ + + page_token: Annotated[Union[str, Base64FileInput, None], PropertyInfo(format="base64")] + """Token for retrieving the next page of results. + + Contains encoded pagination state (limit + offset). When provided, page_size is + ignored. + """ + + sort_case_sensitive: Optional[bool] + """Whether string sorts should be case-sensitive (default: false).""" + + sorts: Optional[Iterable[SortSpecParam]] + """Multi-field sort specifications.""" diff --git a/src/clearstreet/types/v1/screener_search_screener_response.py b/src/clearstreet/types/v1/screener_search_screener_response.py new file mode 100644 index 0000000..4af0d1b --- /dev/null +++ b/src/clearstreet/types/v1/screener_search_screener_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .screener_row_list import ScreenerRowList +from ..shared.base_response import BaseResponse + +__all__ = ["ScreenerSearchScreenerResponse"] + + +class ScreenerSearchScreenerResponse(BaseResponse): + data: ScreenerRowList diff --git a/src/clearstreet/types/v1/search_filter.py b/src/clearstreet/types/v1/search_filter.py new file mode 100644 index 0000000..b8ff33b --- /dev/null +++ b/src/clearstreet/types/v1/search_filter.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .field_ref import FieldRef +from .filter_value import FilterValue +from .filter_op_spec import FilterOpSpec + +__all__ = ["SearchFilter"] + + +class SearchFilter(BaseModel): + """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. + """ + + left: FieldRef + """The field to filter on.""" + + op: Optional[FilterOpSpec] = None + """The operator and optional arguments. + + Omit together with `right` for an unenabled filter. + """ + + right: Optional[List[FilterValue]] = None + """The value(s) to compare against. + + Omit together with `op` for an unenabled filter. + """ diff --git a/src/clearstreet/types/v1/search_filter_param.py b/src/clearstreet/types/v1/search_filter_param.py new file mode 100644 index 0000000..16c7b8b --- /dev/null +++ b/src/clearstreet/types/v1/search_filter_param.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Required, TypedDict + +from .field_ref_param import FieldRefParam +from .filter_value_param import FilterValueParam +from .filter_op_spec_param import FilterOpSpecParam + +__all__ = ["SearchFilterParam"] + + +class SearchFilterParam(TypedDict, total=False): + """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. + """ + + left: Required[FieldRefParam] + """The field to filter on.""" + + op: Optional[FilterOpSpecParam] + """The operator and optional arguments. + + Omit together with `right` for an unenabled filter. + """ + + right: Optional[Iterable[FilterValueParam]] + """The value(s) to compare against. + + Omit together with `op` for an unenabled filter. + """ diff --git a/src/clearstreet/types/v1/session_schedule.py b/src/clearstreet/types/v1/session_schedule.py index 087cf7d..8b8a207 100644 --- a/src/clearstreet/types/v1/session_schedule.py +++ b/src/clearstreet/types/v1/session_schedule.py @@ -18,10 +18,15 @@ class SessionSchedule(BaseModel): """Session open timestamp with timezone offset""" time_until_close: Optional[str] = None - """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. + """ time_until_open: Optional[str] = None """ISO 8601 duration until session opens. - Null if session has already started or closed. + Null if session has already started or closed. When a null/undefined value is + observed, it indicates it does not apply. """ diff --git a/src/clearstreet/types/v1/sort_spec.py b/src/clearstreet/types/v1/sort_spec.py new file mode 100644 index 0000000..a1ad830 --- /dev/null +++ b/src/clearstreet/types/v1/sort_spec.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .field_ref import FieldRef +from ..sort_direction import SortDirection + +__all__ = ["SortSpec"] + + +class SortSpec(BaseModel): + """A sort specification pairing a field with a direction.""" + + field: FieldRef + """The field to sort by.""" + + direction: Optional[SortDirection] = None + """Sort direction (defaults to DESC).""" diff --git a/src/clearstreet/types/v1/sort_spec_param.py b/src/clearstreet/types/v1/sort_spec_param.py new file mode 100644 index 0000000..48babda --- /dev/null +++ b/src/clearstreet/types/v1/sort_spec_param.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from ..sort_direction import SortDirection +from .field_ref_param import FieldRefParam + +__all__ = ["SortSpecParam"] + + +class SortSpecParam(TypedDict, total=False): + """A sort specification pairing a field with a direction.""" + + field: Required[FieldRefParam] + """The field to sort by.""" + + direction: SortDirection + """Sort direction (defaults to DESC).""" diff --git a/src/clearstreet/types/v1/structured_action_button_action.py b/src/clearstreet/types/v1/structured_action_button_action.py index 2dd96bf..e228e5f 100644 --- a/src/clearstreet/types/v1/structured_action_button_action.py +++ b/src/clearstreet/types/v1/structured_action_button_action.py @@ -13,4 +13,7 @@ class StructuredActionButtonAction(BaseModel): """Structured-action button behavior.""" action_id: Optional[str] = FieldInfo(alias="actionId", default=None) - """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. + """ diff --git a/src/clearstreet/types/v1/trading_sessions.py b/src/clearstreet/types/v1/trading_sessions.py index cedad9b..2f47b48 100644 --- a/src/clearstreet/types/v1/trading_sessions.py +++ b/src/clearstreet/types/v1/trading_sessions.py @@ -12,10 +12,19 @@ class TradingSessions(BaseModel): """Trading sessions for a market day with full timestamps""" after_hours: Optional[SessionSchedule] = None - """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. + """ pre_market: Optional[SessionSchedule] = None - """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. + """ regular: Optional[SessionSchedule] = None - """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. + """ diff --git a/src/clearstreet/types/v1/variable.py b/src/clearstreet/types/v1/variable.py new file mode 100644 index 0000000..9a1a3e9 --- /dev/null +++ b/src/clearstreet/types/v1/variable.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .modifier import Modifier +from ..._models import BaseModel +from .field_period import FieldPeriod +from .field_lookback import FieldLookback + +__all__ = ["Variable"] + + +class Variable(BaseModel): + """A variable reference (field or built-in like `today`).""" + + name: str + """The variable name.""" + + lookback: Optional[FieldLookback] = None + """Optional historical lookback window.""" + + modifier: Optional[Modifier] = None + """Optional arithmetic modifier.""" + + period: Optional[FieldPeriod] = None + """Optional reporting period.""" diff --git a/src/clearstreet/types/v1/variable_param.py b/src/clearstreet/types/v1/variable_param.py new file mode 100644 index 0000000..9bfb8f6 --- /dev/null +++ b/src/clearstreet/types/v1/variable_param.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from .field_period import FieldPeriod +from .field_lookback import FieldLookback +from .modifier_param import ModifierParam + +__all__ = ["VariableParam"] + + +class VariableParam(TypedDict, total=False): + """A variable reference (field or built-in like `today`).""" + + name: Required[str] + """The variable name.""" + + lookback: Optional[FieldLookback] + """Optional historical lookback window.""" + + modifier: Optional[ModifierParam] + """Optional arithmetic modifier.""" + + period: Optional[FieldPeriod] + """Optional reporting period.""" diff --git a/src/clearstreet/types/v1/watchlist_add_watchlist_item_params.py b/src/clearstreet/types/v1/watchlist_add_watchlist_item_params.py index c716e28..91c4e6c 100644 --- a/src/clearstreet/types/v1/watchlist_add_watchlist_item_params.py +++ b/src/clearstreet/types/v1/watchlist_add_watchlist_item_params.py @@ -11,4 +11,4 @@ class WatchlistAddWatchlistItemParams(TypedDict, total=False): instrument_id: Required[InstrumentIDOrSymbol] - """OEMS instrument UUID""" + """Instrument identifier""" diff --git a/src/clearstreet/types/v1/watchlist_item_entry.py b/src/clearstreet/types/v1/watchlist_item_entry.py index f0ec748..67813c9 100644 --- a/src/clearstreet/types/v1/watchlist_item_entry.py +++ b/src/clearstreet/types/v1/watchlist_item_entry.py @@ -19,7 +19,13 @@ class WatchlistItemEntry(BaseModel): """When the item was added""" added_price: Optional[str] = None - """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. + """ instrument: Optional[Instrument] = None - """Instrument details""" + """ + Instrument details When a null/undefined value is observed, it indicates that + there is no available data. + """ diff --git a/tests/api_resources/v1/instrument_data/test_market_data.py b/tests/api_resources/v1/instrument_data/test_market_data.py index f9b92e6..eeb7a14 100644 --- a/tests/api_resources/v1/instrument_data/test_market_data.py +++ b/tests/api_resources/v1/instrument_data/test_market_data.py @@ -20,7 +20,6 @@ class TestMarketData: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_daily_summaries(self, client: ClearStreet) -> None: market_data = client.v1.instrument_data.market_data.get_daily_summaries( @@ -28,7 +27,6 @@ def test_method_get_daily_summaries(self, client: ClearStreet) -> None: ) assert_matches_type(MarketDataGetDailySummariesResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_daily_summaries(self, client: ClearStreet) -> None: response = client.v1.instrument_data.market_data.with_raw_response.get_daily_summaries( @@ -40,7 +38,6 @@ def test_raw_response_get_daily_summaries(self, client: ClearStreet) -> None: market_data = response.parse() assert_matches_type(MarketDataGetDailySummariesResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_daily_summaries(self, client: ClearStreet) -> None: with client.v1.instrument_data.market_data.with_streaming_response.get_daily_summaries( @@ -54,13 +51,11 @@ def test_streaming_response_get_daily_summaries(self, client: ClearStreet) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_snapshots(self, client: ClearStreet) -> None: market_data = client.v1.instrument_data.market_data.get_snapshots() assert_matches_type(MarketDataGetSnapshotsResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_snapshots_with_all_params(self, client: ClearStreet) -> None: market_data = client.v1.instrument_data.market_data.get_snapshots( @@ -68,7 +63,6 @@ def test_method_get_snapshots_with_all_params(self, client: ClearStreet) -> None ) assert_matches_type(MarketDataGetSnapshotsResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_snapshots(self, client: ClearStreet) -> None: response = client.v1.instrument_data.market_data.with_raw_response.get_snapshots() @@ -78,7 +72,6 @@ def test_raw_response_get_snapshots(self, client: ClearStreet) -> None: market_data = response.parse() assert_matches_type(MarketDataGetSnapshotsResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_snapshots(self, client: ClearStreet) -> None: with client.v1.instrument_data.market_data.with_streaming_response.get_snapshots() as response: @@ -96,7 +89,6 @@ class TestAsyncMarketData: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_daily_summaries(self, async_client: AsyncClearStreet) -> None: market_data = await async_client.v1.instrument_data.market_data.get_daily_summaries( @@ -104,7 +96,6 @@ async def test_method_get_daily_summaries(self, async_client: AsyncClearStreet) ) assert_matches_type(MarketDataGetDailySummariesResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_daily_summaries(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.market_data.with_raw_response.get_daily_summaries( @@ -116,7 +107,6 @@ async def test_raw_response_get_daily_summaries(self, async_client: AsyncClearSt market_data = await response.parse() assert_matches_type(MarketDataGetDailySummariesResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_daily_summaries(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.market_data.with_streaming_response.get_daily_summaries( @@ -130,13 +120,11 @@ async def test_streaming_response_get_daily_summaries(self, async_client: AsyncC assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_snapshots(self, async_client: AsyncClearStreet) -> None: market_data = await async_client.v1.instrument_data.market_data.get_snapshots() assert_matches_type(MarketDataGetSnapshotsResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_snapshots_with_all_params(self, async_client: AsyncClearStreet) -> None: market_data = await async_client.v1.instrument_data.market_data.get_snapshots( @@ -144,7 +132,6 @@ async def test_method_get_snapshots_with_all_params(self, async_client: AsyncCle ) assert_matches_type(MarketDataGetSnapshotsResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_snapshots(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.market_data.with_raw_response.get_snapshots() @@ -154,7 +141,6 @@ async def test_raw_response_get_snapshots(self, async_client: AsyncClearStreet) market_data = await response.parse() assert_matches_type(MarketDataGetSnapshotsResponse, market_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_snapshots(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.market_data.with_streaming_response.get_snapshots() as response: diff --git a/tests/api_resources/v1/instrument_data/test_news.py b/tests/api_resources/v1/instrument_data/test_news.py index 0f977d8..36a2d2b 100644 --- a/tests/api_resources/v1/instrument_data/test_news.py +++ b/tests/api_resources/v1/instrument_data/test_news.py @@ -17,13 +17,11 @@ class TestNews: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_news(self, client: ClearStreet) -> None: news = client.v1.instrument_data.news.get_news() assert_matches_type(NewsGetNewsResponse, news, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_news_with_all_params(self, client: ClearStreet) -> None: news = client.v1.instrument_data.news.get_news( @@ -40,7 +38,6 @@ def test_method_get_news_with_all_params(self, client: ClearStreet) -> None: ) assert_matches_type(NewsGetNewsResponse, news, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_news(self, client: ClearStreet) -> None: response = client.v1.instrument_data.news.with_raw_response.get_news() @@ -50,7 +47,6 @@ def test_raw_response_get_news(self, client: ClearStreet) -> None: news = response.parse() assert_matches_type(NewsGetNewsResponse, news, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_news(self, client: ClearStreet) -> None: with client.v1.instrument_data.news.with_streaming_response.get_news() as response: @@ -68,13 +64,11 @@ class TestAsyncNews: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_news(self, async_client: AsyncClearStreet) -> None: news = await async_client.v1.instrument_data.news.get_news() assert_matches_type(NewsGetNewsResponse, news, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_news_with_all_params(self, async_client: AsyncClearStreet) -> None: news = await async_client.v1.instrument_data.news.get_news( @@ -91,7 +85,6 @@ async def test_method_get_news_with_all_params(self, async_client: AsyncClearStr ) assert_matches_type(NewsGetNewsResponse, news, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_news(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.news.with_raw_response.get_news() @@ -101,7 +94,6 @@ async def test_raw_response_get_news(self, async_client: AsyncClearStreet) -> No news = await response.parse() assert_matches_type(NewsGetNewsResponse, news, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_news(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.news.with_streaming_response.get_news() as response: diff --git a/tests/api_resources/v1/omni_ai/test_entitlements.py b/tests/api_resources/v1/omni_ai/test_entitlements.py index 4ee4e02..fdc7a4a 100644 --- a/tests/api_resources/v1/omni_ai/test_entitlements.py +++ b/tests/api_resources/v1/omni_ai/test_entitlements.py @@ -22,7 +22,6 @@ class TestEntitlements: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_entitlements(self, client: ClearStreet) -> None: entitlement = client.v1.omni_ai.entitlements.create_entitlements( @@ -32,7 +31,6 @@ def test_method_create_entitlements(self, client: ClearStreet) -> None: ) assert_matches_type(EntitlementCreateEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_entitlements(self, client: ClearStreet) -> None: response = client.v1.omni_ai.entitlements.with_raw_response.create_entitlements( @@ -46,7 +44,6 @@ def test_raw_response_create_entitlements(self, client: ClearStreet) -> None: entitlement = response.parse() assert_matches_type(EntitlementCreateEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_entitlements(self, client: ClearStreet) -> None: with client.v1.omni_ai.entitlements.with_streaming_response.create_entitlements( @@ -62,7 +59,6 @@ def test_streaming_response_create_entitlements(self, client: ClearStreet) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_entitlement(self, client: ClearStreet) -> None: entitlement = client.v1.omni_ai.entitlements.delete_entitlement( @@ -70,7 +66,6 @@ def test_method_delete_entitlement(self, client: ClearStreet) -> None: ) assert_matches_type(EntitlementDeleteEntitlementResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_entitlement(self, client: ClearStreet) -> None: response = client.v1.omni_ai.entitlements.with_raw_response.delete_entitlement( @@ -82,7 +77,6 @@ def test_raw_response_delete_entitlement(self, client: ClearStreet) -> None: entitlement = response.parse() assert_matches_type(EntitlementDeleteEntitlementResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_entitlement(self, client: ClearStreet) -> None: with client.v1.omni_ai.entitlements.with_streaming_response.delete_entitlement( @@ -96,7 +90,6 @@ def test_streaming_response_delete_entitlement(self, client: ClearStreet) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete_entitlement(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `entitlement_id` but received ''"): @@ -104,13 +97,11 @@ def test_path_params_delete_entitlement(self, client: ClearStreet) -> None: "", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_entitlement_agreements(self, client: ClearStreet) -> None: entitlement = client.v1.omni_ai.entitlements.get_entitlement_agreements() assert_matches_type(EntitlementGetEntitlementAgreementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_entitlement_agreements(self, client: ClearStreet) -> None: response = client.v1.omni_ai.entitlements.with_raw_response.get_entitlement_agreements() @@ -120,7 +111,6 @@ def test_raw_response_get_entitlement_agreements(self, client: ClearStreet) -> N entitlement = response.parse() assert_matches_type(EntitlementGetEntitlementAgreementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_entitlement_agreements(self, client: ClearStreet) -> None: with client.v1.omni_ai.entitlements.with_streaming_response.get_entitlement_agreements() as response: @@ -132,13 +122,11 @@ def test_streaming_response_get_entitlement_agreements(self, client: ClearStreet assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_entitlements(self, client: ClearStreet) -> None: entitlement = client.v1.omni_ai.entitlements.get_entitlements() assert_matches_type(EntitlementGetEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_entitlements_with_all_params(self, client: ClearStreet) -> None: entitlement = client.v1.omni_ai.entitlements.get_entitlements( @@ -146,7 +134,6 @@ def test_method_get_entitlements_with_all_params(self, client: ClearStreet) -> N ) assert_matches_type(EntitlementGetEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_entitlements(self, client: ClearStreet) -> None: response = client.v1.omni_ai.entitlements.with_raw_response.get_entitlements() @@ -156,7 +143,6 @@ def test_raw_response_get_entitlements(self, client: ClearStreet) -> None: entitlement = response.parse() assert_matches_type(EntitlementGetEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_entitlements(self, client: ClearStreet) -> None: with client.v1.omni_ai.entitlements.with_streaming_response.get_entitlements() as response: @@ -174,7 +160,6 @@ class TestAsyncEntitlements: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_entitlements(self, async_client: AsyncClearStreet) -> None: entitlement = await async_client.v1.omni_ai.entitlements.create_entitlements( @@ -184,7 +169,6 @@ async def test_method_create_entitlements(self, async_client: AsyncClearStreet) ) assert_matches_type(EntitlementCreateEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_entitlements(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.entitlements.with_raw_response.create_entitlements( @@ -198,7 +182,6 @@ async def test_raw_response_create_entitlements(self, async_client: AsyncClearSt entitlement = await response.parse() assert_matches_type(EntitlementCreateEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_entitlements(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.entitlements.with_streaming_response.create_entitlements( @@ -214,7 +197,6 @@ async def test_streaming_response_create_entitlements(self, async_client: AsyncC assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_entitlement(self, async_client: AsyncClearStreet) -> None: entitlement = await async_client.v1.omni_ai.entitlements.delete_entitlement( @@ -222,7 +204,6 @@ async def test_method_delete_entitlement(self, async_client: AsyncClearStreet) - ) assert_matches_type(EntitlementDeleteEntitlementResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_entitlement(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.entitlements.with_raw_response.delete_entitlement( @@ -234,7 +215,6 @@ async def test_raw_response_delete_entitlement(self, async_client: AsyncClearStr entitlement = await response.parse() assert_matches_type(EntitlementDeleteEntitlementResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_entitlement(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.entitlements.with_streaming_response.delete_entitlement( @@ -248,7 +228,6 @@ async def test_streaming_response_delete_entitlement(self, async_client: AsyncCl assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete_entitlement(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `entitlement_id` but received ''"): @@ -256,13 +235,11 @@ async def test_path_params_delete_entitlement(self, async_client: AsyncClearStre "", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_entitlement_agreements(self, async_client: AsyncClearStreet) -> None: entitlement = await async_client.v1.omni_ai.entitlements.get_entitlement_agreements() assert_matches_type(EntitlementGetEntitlementAgreementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_entitlement_agreements(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.entitlements.with_raw_response.get_entitlement_agreements() @@ -272,7 +249,6 @@ async def test_raw_response_get_entitlement_agreements(self, async_client: Async entitlement = await response.parse() assert_matches_type(EntitlementGetEntitlementAgreementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_entitlement_agreements(self, async_client: AsyncClearStreet) -> None: async with ( @@ -286,13 +262,11 @@ async def test_streaming_response_get_entitlement_agreements(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_entitlements(self, async_client: AsyncClearStreet) -> None: entitlement = await async_client.v1.omni_ai.entitlements.get_entitlements() assert_matches_type(EntitlementGetEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_entitlements_with_all_params(self, async_client: AsyncClearStreet) -> None: entitlement = await async_client.v1.omni_ai.entitlements.get_entitlements( @@ -300,7 +274,6 @@ async def test_method_get_entitlements_with_all_params(self, async_client: Async ) assert_matches_type(EntitlementGetEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_entitlements(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.entitlements.with_raw_response.get_entitlements() @@ -310,7 +283,6 @@ async def test_raw_response_get_entitlements(self, async_client: AsyncClearStree entitlement = await response.parse() assert_matches_type(EntitlementGetEntitlementsResponse, entitlement, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_entitlements(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.entitlements.with_streaming_response.get_entitlements() as response: diff --git a/tests/api_resources/v1/omni_ai/test_messages.py b/tests/api_resources/v1/omni_ai/test_messages.py index fe3bcbf..b2349e1 100644 --- a/tests/api_resources/v1/omni_ai/test_messages.py +++ b/tests/api_resources/v1/omni_ai/test_messages.py @@ -20,7 +20,6 @@ class TestMessages: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_message_by_id(self, client: ClearStreet) -> None: message = client.v1.omni_ai.messages.get_message_by_id( @@ -29,7 +28,6 @@ def test_method_get_message_by_id(self, client: ClearStreet) -> None: ) assert_matches_type(MessageGetMessageByIDResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_message_by_id(self, client: ClearStreet) -> None: response = client.v1.omni_ai.messages.with_raw_response.get_message_by_id( @@ -42,7 +40,6 @@ def test_raw_response_get_message_by_id(self, client: ClearStreet) -> None: message = response.parse() assert_matches_type(MessageGetMessageByIDResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_message_by_id(self, client: ClearStreet) -> None: with client.v1.omni_ai.messages.with_streaming_response.get_message_by_id( @@ -57,7 +54,6 @@ def test_streaming_response_get_message_by_id(self, client: ClearStreet) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_message_by_id(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -66,7 +62,6 @@ def test_path_params_get_message_by_id(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_submit_feedback(self, client: ClearStreet) -> None: message = client.v1.omni_ai.messages.submit_feedback( @@ -76,7 +71,6 @@ def test_method_submit_feedback(self, client: ClearStreet) -> None: ) assert_matches_type(MessageSubmitFeedbackResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_submit_feedback_with_all_params(self, client: ClearStreet) -> None: message = client.v1.omni_ai.messages.submit_feedback( @@ -88,7 +82,6 @@ def test_method_submit_feedback_with_all_params(self, client: ClearStreet) -> No ) assert_matches_type(MessageSubmitFeedbackResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_submit_feedback(self, client: ClearStreet) -> None: response = client.v1.omni_ai.messages.with_raw_response.submit_feedback( @@ -102,7 +95,6 @@ def test_raw_response_submit_feedback(self, client: ClearStreet) -> None: message = response.parse() assert_matches_type(MessageSubmitFeedbackResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_submit_feedback(self, client: ClearStreet) -> None: with client.v1.omni_ai.messages.with_streaming_response.submit_feedback( @@ -118,7 +110,6 @@ def test_streaming_response_submit_feedback(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_submit_feedback(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -134,7 +125,6 @@ class TestAsyncMessages: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_message_by_id(self, async_client: AsyncClearStreet) -> None: message = await async_client.v1.omni_ai.messages.get_message_by_id( @@ -143,7 +133,6 @@ async def test_method_get_message_by_id(self, async_client: AsyncClearStreet) -> ) assert_matches_type(MessageGetMessageByIDResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_message_by_id(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.messages.with_raw_response.get_message_by_id( @@ -156,7 +145,6 @@ async def test_raw_response_get_message_by_id(self, async_client: AsyncClearStre message = await response.parse() assert_matches_type(MessageGetMessageByIDResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_message_by_id(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.messages.with_streaming_response.get_message_by_id( @@ -171,7 +159,6 @@ async def test_streaming_response_get_message_by_id(self, async_client: AsyncCle assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_message_by_id(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -180,7 +167,6 @@ async def test_path_params_get_message_by_id(self, async_client: AsyncClearStree account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_submit_feedback(self, async_client: AsyncClearStreet) -> None: message = await async_client.v1.omni_ai.messages.submit_feedback( @@ -190,7 +176,6 @@ async def test_method_submit_feedback(self, async_client: AsyncClearStreet) -> N ) assert_matches_type(MessageSubmitFeedbackResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_submit_feedback_with_all_params(self, async_client: AsyncClearStreet) -> None: message = await async_client.v1.omni_ai.messages.submit_feedback( @@ -202,7 +187,6 @@ async def test_method_submit_feedback_with_all_params(self, async_client: AsyncC ) assert_matches_type(MessageSubmitFeedbackResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_submit_feedback(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.messages.with_raw_response.submit_feedback( @@ -216,7 +200,6 @@ async def test_raw_response_submit_feedback(self, async_client: AsyncClearStreet message = await response.parse() assert_matches_type(MessageSubmitFeedbackResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_submit_feedback(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.messages.with_streaming_response.submit_feedback( @@ -232,7 +215,6 @@ async def test_streaming_response_submit_feedback(self, async_client: AsyncClear assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_submit_feedback(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): diff --git a/tests/api_resources/v1/omni_ai/test_responses.py b/tests/api_resources/v1/omni_ai/test_responses.py index 36a6981..ab8f43d 100644 --- a/tests/api_resources/v1/omni_ai/test_responses.py +++ b/tests/api_resources/v1/omni_ai/test_responses.py @@ -20,7 +20,6 @@ class TestResponses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel_response(self, client: ClearStreet) -> None: response = client.v1.omni_ai.responses.cancel_response( @@ -29,7 +28,6 @@ def test_method_cancel_response(self, client: ClearStreet) -> None: ) assert_matches_type(ResponseCancelResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_cancel_response(self, client: ClearStreet) -> None: http_response = client.v1.omni_ai.responses.with_raw_response.cancel_response( @@ -42,7 +40,6 @@ def test_raw_response_cancel_response(self, client: ClearStreet) -> None: response = http_response.parse() assert_matches_type(ResponseCancelResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_cancel_response(self, client: ClearStreet) -> None: with client.v1.omni_ai.responses.with_streaming_response.cancel_response( @@ -57,7 +54,6 @@ def test_streaming_response_cancel_response(self, client: ClearStreet) -> None: assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_cancel_response(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): @@ -66,7 +62,6 @@ def test_path_params_cancel_response(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_response_by_id(self, client: ClearStreet) -> None: response = client.v1.omni_ai.responses.get_response_by_id( @@ -75,7 +70,6 @@ def test_method_get_response_by_id(self, client: ClearStreet) -> None: ) assert_matches_type(ResponseGetResponseByIDResponse, response, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_response_by_id(self, client: ClearStreet) -> None: http_response = client.v1.omni_ai.responses.with_raw_response.get_response_by_id( @@ -88,7 +82,6 @@ def test_raw_response_get_response_by_id(self, client: ClearStreet) -> None: response = http_response.parse() assert_matches_type(ResponseGetResponseByIDResponse, response, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_response_by_id(self, client: ClearStreet) -> None: with client.v1.omni_ai.responses.with_streaming_response.get_response_by_id( @@ -103,7 +96,6 @@ def test_streaming_response_get_response_by_id(self, client: ClearStreet) -> Non assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_response_by_id(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): @@ -118,7 +110,6 @@ class TestAsyncResponses: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel_response(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.responses.cancel_response( @@ -127,7 +118,6 @@ async def test_method_cancel_response(self, async_client: AsyncClearStreet) -> N ) assert_matches_type(ResponseCancelResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_cancel_response(self, async_client: AsyncClearStreet) -> None: http_response = await async_client.v1.omni_ai.responses.with_raw_response.cancel_response( @@ -140,7 +130,6 @@ async def test_raw_response_cancel_response(self, async_client: AsyncClearStreet response = await http_response.parse() assert_matches_type(ResponseCancelResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_cancel_response(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.responses.with_streaming_response.cancel_response( @@ -155,7 +144,6 @@ async def test_streaming_response_cancel_response(self, async_client: AsyncClear assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_cancel_response(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): @@ -164,7 +152,6 @@ async def test_path_params_cancel_response(self, async_client: AsyncClearStreet) account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_response_by_id(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.responses.get_response_by_id( @@ -173,7 +160,6 @@ async def test_method_get_response_by_id(self, async_client: AsyncClearStreet) - ) assert_matches_type(ResponseGetResponseByIDResponse, response, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_response_by_id(self, async_client: AsyncClearStreet) -> None: http_response = await async_client.v1.omni_ai.responses.with_raw_response.get_response_by_id( @@ -186,7 +172,6 @@ async def test_raw_response_get_response_by_id(self, async_client: AsyncClearStr response = await http_response.parse() assert_matches_type(ResponseGetResponseByIDResponse, response, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_response_by_id(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.responses.with_streaming_response.get_response_by_id( @@ -201,7 +186,6 @@ async def test_streaming_response_get_response_by_id(self, async_client: AsyncCl assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_response_by_id(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): diff --git a/tests/api_resources/v1/omni_ai/test_threads.py b/tests/api_resources/v1/omni_ai/test_threads.py index c214ae3..430582b 100644 --- a/tests/api_resources/v1/omni_ai/test_threads.py +++ b/tests/api_resources/v1/omni_ai/test_threads.py @@ -24,7 +24,6 @@ class TestThreads: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_message(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.create_message( @@ -34,7 +33,6 @@ def test_method_create_message(self, client: ClearStreet) -> None: ) assert_matches_type(ThreadCreateMessageResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_message_with_all_params(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.create_message( @@ -45,7 +43,6 @@ def test_method_create_message_with_all_params(self, client: ClearStreet) -> Non ) assert_matches_type(ThreadCreateMessageResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_message(self, client: ClearStreet) -> None: response = client.v1.omni_ai.threads.with_raw_response.create_message( @@ -59,7 +56,6 @@ def test_raw_response_create_message(self, client: ClearStreet) -> None: thread = response.parse() assert_matches_type(ThreadCreateMessageResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_message(self, client: ClearStreet) -> None: with client.v1.omni_ai.threads.with_streaming_response.create_message( @@ -75,7 +71,6 @@ def test_streaming_response_create_message(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_create_message(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -85,7 +80,6 @@ def test_path_params_create_message(self, client: ClearStreet) -> None: text="Compare that to AMD.", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_thread(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.create_thread( @@ -94,7 +88,6 @@ def test_method_create_thread(self, client: ClearStreet) -> None: ) assert_matches_type(ThreadCreateThreadResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_thread_with_all_params(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.create_thread( @@ -110,7 +103,6 @@ def test_method_create_thread_with_all_params(self, client: ClearStreet) -> None ) assert_matches_type(ThreadCreateThreadResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_thread(self, client: ClearStreet) -> None: response = client.v1.omni_ai.threads.with_raw_response.create_thread( @@ -123,7 +115,6 @@ def test_raw_response_create_thread(self, client: ClearStreet) -> None: thread = response.parse() assert_matches_type(ThreadCreateThreadResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_thread(self, client: ClearStreet) -> None: with client.v1.omni_ai.threads.with_streaming_response.create_thread( @@ -138,7 +129,6 @@ def test_streaming_response_create_thread(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_messages(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.get_messages( @@ -147,7 +137,6 @@ def test_method_get_messages(self, client: ClearStreet) -> None: ) assert_matches_type(ThreadGetMessagesResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_messages_with_all_params(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.get_messages( @@ -158,7 +147,6 @@ def test_method_get_messages_with_all_params(self, client: ClearStreet) -> None: ) assert_matches_type(ThreadGetMessagesResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_messages(self, client: ClearStreet) -> None: response = client.v1.omni_ai.threads.with_raw_response.get_messages( @@ -171,7 +159,6 @@ def test_raw_response_get_messages(self, client: ClearStreet) -> None: thread = response.parse() assert_matches_type(ThreadGetMessagesResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_messages(self, client: ClearStreet) -> None: with client.v1.omni_ai.threads.with_streaming_response.get_messages( @@ -186,7 +173,6 @@ def test_streaming_response_get_messages(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_messages(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -195,7 +181,6 @@ def test_path_params_get_messages(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_thread_by_id(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.get_thread_by_id( @@ -204,7 +189,6 @@ def test_method_get_thread_by_id(self, client: ClearStreet) -> None: ) assert_matches_type(ThreadGetThreadByIDResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_thread_by_id(self, client: ClearStreet) -> None: response = client.v1.omni_ai.threads.with_raw_response.get_thread_by_id( @@ -217,7 +201,6 @@ def test_raw_response_get_thread_by_id(self, client: ClearStreet) -> None: thread = response.parse() assert_matches_type(ThreadGetThreadByIDResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_thread_by_id(self, client: ClearStreet) -> None: with client.v1.omni_ai.threads.with_streaming_response.get_thread_by_id( @@ -232,7 +215,6 @@ def test_streaming_response_get_thread_by_id(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_thread_by_id(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -241,7 +223,6 @@ def test_path_params_get_thread_by_id(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_thread_response(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.get_thread_response( @@ -250,7 +231,6 @@ def test_method_get_thread_response(self, client: ClearStreet) -> None: ) assert_matches_type(ThreadGetThreadResponseResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_thread_response(self, client: ClearStreet) -> None: response = client.v1.omni_ai.threads.with_raw_response.get_thread_response( @@ -263,7 +243,6 @@ def test_raw_response_get_thread_response(self, client: ClearStreet) -> None: thread = response.parse() assert_matches_type(ThreadGetThreadResponseResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_thread_response(self, client: ClearStreet) -> None: with client.v1.omni_ai.threads.with_streaming_response.get_thread_response( @@ -278,7 +257,6 @@ def test_streaming_response_get_thread_response(self, client: ClearStreet) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_thread_response(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -287,7 +265,6 @@ def test_path_params_get_thread_response(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_threads(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.get_threads( @@ -295,7 +272,6 @@ def test_method_get_threads(self, client: ClearStreet) -> None: ) assert_matches_type(ThreadGetThreadsResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_threads_with_all_params(self, client: ClearStreet) -> None: thread = client.v1.omni_ai.threads.get_threads( @@ -305,7 +281,6 @@ def test_method_get_threads_with_all_params(self, client: ClearStreet) -> None: ) assert_matches_type(ThreadGetThreadsResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_threads(self, client: ClearStreet) -> None: response = client.v1.omni_ai.threads.with_raw_response.get_threads( @@ -317,7 +292,6 @@ def test_raw_response_get_threads(self, client: ClearStreet) -> None: thread = response.parse() assert_matches_type(ThreadGetThreadsResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_threads(self, client: ClearStreet) -> None: with client.v1.omni_ai.threads.with_streaming_response.get_threads( @@ -337,7 +311,6 @@ class TestAsyncThreads: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_message(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.create_message( @@ -347,7 +320,6 @@ async def test_method_create_message(self, async_client: AsyncClearStreet) -> No ) assert_matches_type(ThreadCreateMessageResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_message_with_all_params(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.create_message( @@ -358,7 +330,6 @@ async def test_method_create_message_with_all_params(self, async_client: AsyncCl ) assert_matches_type(ThreadCreateMessageResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_message(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.threads.with_raw_response.create_message( @@ -372,7 +343,6 @@ async def test_raw_response_create_message(self, async_client: AsyncClearStreet) thread = await response.parse() assert_matches_type(ThreadCreateMessageResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_message(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.threads.with_streaming_response.create_message( @@ -388,7 +358,6 @@ async def test_streaming_response_create_message(self, async_client: AsyncClearS assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_create_message(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -398,7 +367,6 @@ async def test_path_params_create_message(self, async_client: AsyncClearStreet) text="Compare that to AMD.", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_thread(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.create_thread( @@ -407,7 +375,6 @@ async def test_method_create_thread(self, async_client: AsyncClearStreet) -> Non ) assert_matches_type(ThreadCreateThreadResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_thread_with_all_params(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.create_thread( @@ -423,7 +390,6 @@ async def test_method_create_thread_with_all_params(self, async_client: AsyncCle ) assert_matches_type(ThreadCreateThreadResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_thread(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.threads.with_raw_response.create_thread( @@ -436,7 +402,6 @@ async def test_raw_response_create_thread(self, async_client: AsyncClearStreet) thread = await response.parse() assert_matches_type(ThreadCreateThreadResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_thread(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.threads.with_streaming_response.create_thread( @@ -451,7 +416,6 @@ async def test_streaming_response_create_thread(self, async_client: AsyncClearSt assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_messages(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.get_messages( @@ -460,7 +424,6 @@ async def test_method_get_messages(self, async_client: AsyncClearStreet) -> None ) assert_matches_type(ThreadGetMessagesResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_messages_with_all_params(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.get_messages( @@ -471,7 +434,6 @@ async def test_method_get_messages_with_all_params(self, async_client: AsyncClea ) assert_matches_type(ThreadGetMessagesResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_messages(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.threads.with_raw_response.get_messages( @@ -484,7 +446,6 @@ async def test_raw_response_get_messages(self, async_client: AsyncClearStreet) - thread = await response.parse() assert_matches_type(ThreadGetMessagesResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_messages(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.threads.with_streaming_response.get_messages( @@ -499,7 +460,6 @@ async def test_streaming_response_get_messages(self, async_client: AsyncClearStr assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_messages(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -508,7 +468,6 @@ async def test_path_params_get_messages(self, async_client: AsyncClearStreet) -> account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_thread_by_id(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.get_thread_by_id( @@ -517,7 +476,6 @@ async def test_method_get_thread_by_id(self, async_client: AsyncClearStreet) -> ) assert_matches_type(ThreadGetThreadByIDResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_thread_by_id(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.threads.with_raw_response.get_thread_by_id( @@ -530,7 +488,6 @@ async def test_raw_response_get_thread_by_id(self, async_client: AsyncClearStree thread = await response.parse() assert_matches_type(ThreadGetThreadByIDResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_thread_by_id(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.threads.with_streaming_response.get_thread_by_id( @@ -545,7 +502,6 @@ async def test_streaming_response_get_thread_by_id(self, async_client: AsyncClea assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_thread_by_id(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -554,7 +510,6 @@ async def test_path_params_get_thread_by_id(self, async_client: AsyncClearStreet account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_thread_response(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.get_thread_response( @@ -563,7 +518,6 @@ async def test_method_get_thread_response(self, async_client: AsyncClearStreet) ) assert_matches_type(ThreadGetThreadResponseResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_thread_response(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.threads.with_raw_response.get_thread_response( @@ -576,7 +530,6 @@ async def test_raw_response_get_thread_response(self, async_client: AsyncClearSt thread = await response.parse() assert_matches_type(ThreadGetThreadResponseResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_thread_response(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.threads.with_streaming_response.get_thread_response( @@ -591,7 +544,6 @@ async def test_streaming_response_get_thread_response(self, async_client: AsyncC assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_thread_response(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -600,7 +552,6 @@ async def test_path_params_get_thread_response(self, async_client: AsyncClearStr account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_threads(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.get_threads( @@ -608,7 +559,6 @@ async def test_method_get_threads(self, async_client: AsyncClearStreet) -> None: ) assert_matches_type(ThreadGetThreadsResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_threads_with_all_params(self, async_client: AsyncClearStreet) -> None: thread = await async_client.v1.omni_ai.threads.get_threads( @@ -618,7 +568,6 @@ async def test_method_get_threads_with_all_params(self, async_client: AsyncClear ) assert_matches_type(ThreadGetThreadsResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_threads(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.omni_ai.threads.with_raw_response.get_threads( @@ -630,7 +579,6 @@ async def test_raw_response_get_threads(self, async_client: AsyncClearStreet) -> thread = await response.parse() assert_matches_type(ThreadGetThreadsResponse, thread, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_threads(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.omni_ai.threads.with_streaming_response.get_threads( diff --git a/tests/api_resources/v1/test_accounts.py b/tests/api_resources/v1/test_accounts.py index 207842d..fca93a5 100644 --- a/tests/api_resources/v1/test_accounts.py +++ b/tests/api_resources/v1/test_accounts.py @@ -24,7 +24,6 @@ class TestAccounts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_account_balances(self, client: ClearStreet) -> None: account = client.v1.accounts.get_account_balances( @@ -32,7 +31,6 @@ def test_method_get_account_balances(self, client: ClearStreet) -> None: ) assert_matches_type(AccountGetAccountBalancesResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_account_balances_with_all_params(self, client: ClearStreet) -> None: account = client.v1.accounts.get_account_balances( @@ -41,7 +39,6 @@ def test_method_get_account_balances_with_all_params(self, client: ClearStreet) ) assert_matches_type(AccountGetAccountBalancesResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_account_balances(self, client: ClearStreet) -> None: response = client.v1.accounts.with_raw_response.get_account_balances( @@ -53,7 +50,6 @@ def test_raw_response_get_account_balances(self, client: ClearStreet) -> None: account = response.parse() assert_matches_type(AccountGetAccountBalancesResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_account_balances(self, client: ClearStreet) -> None: with client.v1.accounts.with_streaming_response.get_account_balances( @@ -67,7 +63,6 @@ def test_streaming_response_get_account_balances(self, client: ClearStreet) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_account_by_id(self, client: ClearStreet) -> None: account = client.v1.accounts.get_account_by_id( @@ -75,7 +70,6 @@ def test_method_get_account_by_id(self, client: ClearStreet) -> None: ) assert_matches_type(AccountGetAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_account_by_id(self, client: ClearStreet) -> None: response = client.v1.accounts.with_raw_response.get_account_by_id( @@ -87,7 +81,6 @@ def test_raw_response_get_account_by_id(self, client: ClearStreet) -> None: account = response.parse() assert_matches_type(AccountGetAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_account_by_id(self, client: ClearStreet) -> None: with client.v1.accounts.with_streaming_response.get_account_by_id( @@ -101,22 +94,21 @@ def test_streaming_response_get_account_by_id(self, client: ClearStreet) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_accounts(self, client: ClearStreet) -> None: account = client.v1.accounts.get_accounts() assert_matches_type(AccountGetAccountsResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_accounts_with_all_params(self, client: ClearStreet) -> None: account = client.v1.accounts.get_accounts( + account_id="account_id", + account_name="account_name", page_size=1, page_token="U3RhaW5sZXNzIHJvY2tz", ) assert_matches_type(AccountGetAccountsResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_accounts(self, client: ClearStreet) -> None: response = client.v1.accounts.with_raw_response.get_accounts() @@ -126,7 +118,6 @@ def test_raw_response_get_accounts(self, client: ClearStreet) -> None: account = response.parse() assert_matches_type(AccountGetAccountsResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_accounts(self, client: ClearStreet) -> None: with client.v1.accounts.with_streaming_response.get_accounts() as response: @@ -138,7 +129,6 @@ def test_streaming_response_get_accounts(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_portfolio_history(self, client: ClearStreet) -> None: account = client.v1.accounts.get_portfolio_history( @@ -147,7 +137,6 @@ def test_method_get_portfolio_history(self, client: ClearStreet) -> None: ) assert_matches_type(AccountGetPortfolioHistoryResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_portfolio_history_with_all_params(self, client: ClearStreet) -> None: account = client.v1.accounts.get_portfolio_history( @@ -157,7 +146,6 @@ def test_method_get_portfolio_history_with_all_params(self, client: ClearStreet) ) assert_matches_type(AccountGetPortfolioHistoryResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_portfolio_history(self, client: ClearStreet) -> None: response = client.v1.accounts.with_raw_response.get_portfolio_history( @@ -170,7 +158,6 @@ def test_raw_response_get_portfolio_history(self, client: ClearStreet) -> None: account = response.parse() assert_matches_type(AccountGetPortfolioHistoryResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_portfolio_history(self, client: ClearStreet) -> None: with client.v1.accounts.with_streaming_response.get_portfolio_history( @@ -185,7 +172,6 @@ def test_streaming_response_get_portfolio_history(self, client: ClearStreet) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_patch_account_by_id(self, client: ClearStreet) -> None: account = client.v1.accounts.patch_account_by_id( @@ -193,7 +179,6 @@ def test_method_patch_account_by_id(self, client: ClearStreet) -> None: ) assert_matches_type(AccountPatchAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_patch_account_by_id_with_all_params(self, client: ClearStreet) -> None: account = client.v1.accounts.patch_account_by_id( @@ -202,7 +187,6 @@ def test_method_patch_account_by_id_with_all_params(self, client: ClearStreet) - ) assert_matches_type(AccountPatchAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_patch_account_by_id(self, client: ClearStreet) -> None: response = client.v1.accounts.with_raw_response.patch_account_by_id( @@ -214,7 +198,6 @@ def test_raw_response_patch_account_by_id(self, client: ClearStreet) -> None: account = response.parse() assert_matches_type(AccountPatchAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_patch_account_by_id(self, client: ClearStreet) -> None: with client.v1.accounts.with_streaming_response.patch_account_by_id( @@ -234,7 +217,6 @@ class TestAsyncAccounts: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_account_balances(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.get_account_balances( @@ -242,7 +224,6 @@ async def test_method_get_account_balances(self, async_client: AsyncClearStreet) ) assert_matches_type(AccountGetAccountBalancesResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_account_balances_with_all_params(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.get_account_balances( @@ -251,7 +232,6 @@ async def test_method_get_account_balances_with_all_params(self, async_client: A ) assert_matches_type(AccountGetAccountBalancesResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_account_balances(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.accounts.with_raw_response.get_account_balances( @@ -263,7 +243,6 @@ async def test_raw_response_get_account_balances(self, async_client: AsyncClearS account = await response.parse() assert_matches_type(AccountGetAccountBalancesResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_account_balances(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.accounts.with_streaming_response.get_account_balances( @@ -277,7 +256,6 @@ async def test_streaming_response_get_account_balances(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_account_by_id(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.get_account_by_id( @@ -285,7 +263,6 @@ async def test_method_get_account_by_id(self, async_client: AsyncClearStreet) -> ) assert_matches_type(AccountGetAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_account_by_id(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.accounts.with_raw_response.get_account_by_id( @@ -297,7 +274,6 @@ async def test_raw_response_get_account_by_id(self, async_client: AsyncClearStre account = await response.parse() assert_matches_type(AccountGetAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_account_by_id(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.accounts.with_streaming_response.get_account_by_id( @@ -311,22 +287,21 @@ async def test_streaming_response_get_account_by_id(self, async_client: AsyncCle assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_accounts(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.get_accounts() assert_matches_type(AccountGetAccountsResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_accounts_with_all_params(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.get_accounts( + account_id="account_id", + account_name="account_name", page_size=1, page_token="U3RhaW5sZXNzIHJvY2tz", ) assert_matches_type(AccountGetAccountsResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_accounts(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.accounts.with_raw_response.get_accounts() @@ -336,7 +311,6 @@ async def test_raw_response_get_accounts(self, async_client: AsyncClearStreet) - account = await response.parse() assert_matches_type(AccountGetAccountsResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_accounts(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.accounts.with_streaming_response.get_accounts() as response: @@ -348,7 +322,6 @@ async def test_streaming_response_get_accounts(self, async_client: AsyncClearStr assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_portfolio_history(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.get_portfolio_history( @@ -357,7 +330,6 @@ async def test_method_get_portfolio_history(self, async_client: AsyncClearStreet ) assert_matches_type(AccountGetPortfolioHistoryResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_portfolio_history_with_all_params(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.get_portfolio_history( @@ -367,7 +339,6 @@ async def test_method_get_portfolio_history_with_all_params(self, async_client: ) assert_matches_type(AccountGetPortfolioHistoryResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_portfolio_history(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.accounts.with_raw_response.get_portfolio_history( @@ -380,7 +351,6 @@ async def test_raw_response_get_portfolio_history(self, async_client: AsyncClear account = await response.parse() assert_matches_type(AccountGetPortfolioHistoryResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_portfolio_history(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.accounts.with_streaming_response.get_portfolio_history( @@ -395,7 +365,6 @@ async def test_streaming_response_get_portfolio_history(self, async_client: Asyn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_patch_account_by_id(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.patch_account_by_id( @@ -403,7 +372,6 @@ async def test_method_patch_account_by_id(self, async_client: AsyncClearStreet) ) assert_matches_type(AccountPatchAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_patch_account_by_id_with_all_params(self, async_client: AsyncClearStreet) -> None: account = await async_client.v1.accounts.patch_account_by_id( @@ -412,7 +380,6 @@ async def test_method_patch_account_by_id_with_all_params(self, async_client: As ) assert_matches_type(AccountPatchAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_patch_account_by_id(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.accounts.with_raw_response.patch_account_by_id( @@ -424,7 +391,6 @@ async def test_raw_response_patch_account_by_id(self, async_client: AsyncClearSt account = await response.parse() assert_matches_type(AccountPatchAccountByIDResponse, account, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_patch_account_by_id(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.accounts.with_streaming_response.patch_account_by_id( diff --git a/tests/api_resources/v1/test_api_version.py b/tests/api_resources/v1/test_api_version.py index 32dfd26..359f0c7 100644 --- a/tests/api_resources/v1/test_api_version.py +++ b/tests/api_resources/v1/test_api_version.py @@ -17,13 +17,11 @@ class TestAPIVersion: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_version(self, client: ClearStreet) -> None: api_version = client.v1.api_version.get_version() assert_matches_type(APIVersionGetVersionResponse, api_version, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_version(self, client: ClearStreet) -> None: response = client.v1.api_version.with_raw_response.get_version() @@ -33,7 +31,6 @@ def test_raw_response_get_version(self, client: ClearStreet) -> None: api_version = response.parse() assert_matches_type(APIVersionGetVersionResponse, api_version, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_version(self, client: ClearStreet) -> None: with client.v1.api_version.with_streaming_response.get_version() as response: @@ -51,13 +48,11 @@ class TestAsyncAPIVersion: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_version(self, async_client: AsyncClearStreet) -> None: api_version = await async_client.v1.api_version.get_version() assert_matches_type(APIVersionGetVersionResponse, api_version, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_version(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.api_version.with_raw_response.get_version() @@ -67,7 +62,6 @@ async def test_raw_response_get_version(self, async_client: AsyncClearStreet) -> api_version = await response.parse() assert_matches_type(APIVersionGetVersionResponse, api_version, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_version(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.api_version.with_streaming_response.get_version() as response: diff --git a/tests/api_resources/v1/test_calendar.py b/tests/api_resources/v1/test_calendar.py index 5c70351..32abbe2 100644 --- a/tests/api_resources/v1/test_calendar.py +++ b/tests/api_resources/v1/test_calendar.py @@ -20,13 +20,11 @@ class TestCalendar: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_clock(self, client: ClearStreet) -> None: calendar = client.v1.calendar.get_clock() assert_matches_type(CalendarGetClockResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_clock(self, client: ClearStreet) -> None: response = client.v1.calendar.with_raw_response.get_clock() @@ -36,7 +34,6 @@ def test_raw_response_get_clock(self, client: ClearStreet) -> None: calendar = response.parse() assert_matches_type(CalendarGetClockResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_clock(self, client: ClearStreet) -> None: with client.v1.calendar.with_streaming_response.get_clock() as response: @@ -48,7 +45,6 @@ def test_streaming_response_get_clock(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_market_hours_calendar(self, client: ClearStreet) -> None: calendar = client.v1.calendar.get_market_hours_calendar( @@ -56,7 +52,6 @@ def test_method_get_market_hours_calendar(self, client: ClearStreet) -> None: ) assert_matches_type(CalendarGetMarketHoursCalendarResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_market_hours_calendar_with_all_params(self, client: ClearStreet) -> None: calendar = client.v1.calendar.get_market_hours_calendar( @@ -65,7 +60,6 @@ def test_method_get_market_hours_calendar_with_all_params(self, client: ClearStr ) assert_matches_type(CalendarGetMarketHoursCalendarResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_market_hours_calendar(self, client: ClearStreet) -> None: response = client.v1.calendar.with_raw_response.get_market_hours_calendar( @@ -77,7 +71,6 @@ def test_raw_response_get_market_hours_calendar(self, client: ClearStreet) -> No calendar = response.parse() assert_matches_type(CalendarGetMarketHoursCalendarResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_market_hours_calendar(self, client: ClearStreet) -> None: with client.v1.calendar.with_streaming_response.get_market_hours_calendar( @@ -97,13 +90,11 @@ class TestAsyncCalendar: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_clock(self, async_client: AsyncClearStreet) -> None: calendar = await async_client.v1.calendar.get_clock() assert_matches_type(CalendarGetClockResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_clock(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.calendar.with_raw_response.get_clock() @@ -113,7 +104,6 @@ async def test_raw_response_get_clock(self, async_client: AsyncClearStreet) -> N calendar = await response.parse() assert_matches_type(CalendarGetClockResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_clock(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.calendar.with_streaming_response.get_clock() as response: @@ -125,7 +115,6 @@ async def test_streaming_response_get_clock(self, async_client: AsyncClearStreet assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_market_hours_calendar(self, async_client: AsyncClearStreet) -> None: calendar = await async_client.v1.calendar.get_market_hours_calendar( @@ -133,7 +122,6 @@ async def test_method_get_market_hours_calendar(self, async_client: AsyncClearSt ) assert_matches_type(CalendarGetMarketHoursCalendarResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_market_hours_calendar_with_all_params(self, async_client: AsyncClearStreet) -> None: calendar = await async_client.v1.calendar.get_market_hours_calendar( @@ -142,7 +130,6 @@ async def test_method_get_market_hours_calendar_with_all_params(self, async_clie ) assert_matches_type(CalendarGetMarketHoursCalendarResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_market_hours_calendar(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.calendar.with_raw_response.get_market_hours_calendar( @@ -154,7 +141,6 @@ async def test_raw_response_get_market_hours_calendar(self, async_client: AsyncC calendar = await response.parse() assert_matches_type(CalendarGetMarketHoursCalendarResponse, calendar, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_market_hours_calendar(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.calendar.with_streaming_response.get_market_hours_calendar( diff --git a/tests/api_resources/v1/test_instrument_data.py b/tests/api_resources/v1/test_instrument_data.py index deb8c19..b90c544 100644 --- a/tests/api_resources/v1/test_instrument_data.py +++ b/tests/api_resources/v1/test_instrument_data.py @@ -26,13 +26,11 @@ class TestInstrumentData: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_all_instrument_events(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_all_instrument_events() assert_matches_type(InstrumentDataGetAllInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_all_instrument_events_with_all_params(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_all_instrument_events( @@ -43,7 +41,6 @@ def test_method_get_all_instrument_events_with_all_params(self, client: ClearStr ) assert_matches_type(InstrumentDataGetAllInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_all_instrument_events(self, client: ClearStreet) -> None: response = client.v1.instrument_data.with_raw_response.get_all_instrument_events() @@ -53,7 +50,6 @@ def test_raw_response_get_all_instrument_events(self, client: ClearStreet) -> No instrument_data = response.parse() assert_matches_type(InstrumentDataGetAllInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_all_instrument_events(self, client: ClearStreet) -> None: with client.v1.instrument_data.with_streaming_response.get_all_instrument_events() as response: @@ -65,7 +61,6 @@ def test_streaming_response_get_all_instrument_events(self, client: ClearStreet) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_analyst_consensus(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_analyst_consensus( @@ -73,7 +68,6 @@ def test_method_get_instrument_analyst_consensus(self, client: ClearStreet) -> N ) assert_matches_type(InstrumentDataGetInstrumentAnalystConsensusResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_analyst_consensus_with_all_params(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_analyst_consensus( @@ -83,7 +77,6 @@ def test_method_get_instrument_analyst_consensus_with_all_params(self, client: C ) assert_matches_type(InstrumentDataGetInstrumentAnalystConsensusResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_instrument_analyst_consensus(self, client: ClearStreet) -> None: response = client.v1.instrument_data.with_raw_response.get_instrument_analyst_consensus( @@ -95,7 +88,6 @@ def test_raw_response_get_instrument_analyst_consensus(self, client: ClearStreet instrument_data = response.parse() assert_matches_type(InstrumentDataGetInstrumentAnalystConsensusResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_instrument_analyst_consensus(self, client: ClearStreet) -> None: with client.v1.instrument_data.with_streaming_response.get_instrument_analyst_consensus( @@ -109,7 +101,6 @@ def test_streaming_response_get_instrument_analyst_consensus(self, client: Clear assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_instrument_analyst_consensus(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -117,7 +108,6 @@ def test_path_params_get_instrument_analyst_consensus(self, client: ClearStreet) instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_balance_sheet_statements(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_balance_sheet_statements( @@ -127,7 +117,6 @@ def test_method_get_instrument_balance_sheet_statements(self, client: ClearStree InstrumentDataGetInstrumentBalanceSheetStatementsResponse, instrument_data, path=["response"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_balance_sheet_statements_with_all_params(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_balance_sheet_statements( @@ -141,7 +130,6 @@ def test_method_get_instrument_balance_sheet_statements_with_all_params(self, cl InstrumentDataGetInstrumentBalanceSheetStatementsResponse, instrument_data, path=["response"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_instrument_balance_sheet_statements(self, client: ClearStreet) -> None: response = client.v1.instrument_data.with_raw_response.get_instrument_balance_sheet_statements( @@ -155,7 +143,6 @@ def test_raw_response_get_instrument_balance_sheet_statements(self, client: Clea InstrumentDataGetInstrumentBalanceSheetStatementsResponse, instrument_data, path=["response"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_instrument_balance_sheet_statements(self, client: ClearStreet) -> None: with client.v1.instrument_data.with_streaming_response.get_instrument_balance_sheet_statements( @@ -171,7 +158,6 @@ def test_streaming_response_get_instrument_balance_sheet_statements(self, client assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_instrument_balance_sheet_statements(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -179,7 +165,6 @@ def test_path_params_get_instrument_balance_sheet_statements(self, client: Clear instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_cash_flow_statements(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_cash_flow_statements( @@ -187,7 +172,6 @@ def test_method_get_instrument_cash_flow_statements(self, client: ClearStreet) - ) assert_matches_type(InstrumentDataGetInstrumentCashFlowStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_cash_flow_statements_with_all_params(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_cash_flow_statements( @@ -199,7 +183,6 @@ def test_method_get_instrument_cash_flow_statements_with_all_params(self, client ) assert_matches_type(InstrumentDataGetInstrumentCashFlowStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_instrument_cash_flow_statements(self, client: ClearStreet) -> None: response = client.v1.instrument_data.with_raw_response.get_instrument_cash_flow_statements( @@ -211,7 +194,6 @@ def test_raw_response_get_instrument_cash_flow_statements(self, client: ClearStr instrument_data = response.parse() assert_matches_type(InstrumentDataGetInstrumentCashFlowStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_instrument_cash_flow_statements(self, client: ClearStreet) -> None: with client.v1.instrument_data.with_streaming_response.get_instrument_cash_flow_statements( @@ -227,7 +209,6 @@ def test_streaming_response_get_instrument_cash_flow_statements(self, client: Cl assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_instrument_cash_flow_statements(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -235,7 +216,6 @@ def test_path_params_get_instrument_cash_flow_statements(self, client: ClearStre instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_events(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_events( @@ -243,7 +223,6 @@ def test_method_get_instrument_events(self, client: ClearStreet) -> None: ) assert_matches_type(InstrumentDataGetInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_events_with_all_params(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_events( @@ -253,7 +232,6 @@ def test_method_get_instrument_events_with_all_params(self, client: ClearStreet) ) assert_matches_type(InstrumentDataGetInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_instrument_events(self, client: ClearStreet) -> None: response = client.v1.instrument_data.with_raw_response.get_instrument_events( @@ -265,7 +243,6 @@ def test_raw_response_get_instrument_events(self, client: ClearStreet) -> None: instrument_data = response.parse() assert_matches_type(InstrumentDataGetInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_instrument_events(self, client: ClearStreet) -> None: with client.v1.instrument_data.with_streaming_response.get_instrument_events( @@ -279,7 +256,6 @@ def test_streaming_response_get_instrument_events(self, client: ClearStreet) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_instrument_events(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -287,7 +263,6 @@ def test_path_params_get_instrument_events(self, client: ClearStreet) -> None: instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_fundamentals(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_fundamentals( @@ -295,7 +270,6 @@ def test_method_get_instrument_fundamentals(self, client: ClearStreet) -> None: ) assert_matches_type(InstrumentDataGetInstrumentFundamentalsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_instrument_fundamentals(self, client: ClearStreet) -> None: response = client.v1.instrument_data.with_raw_response.get_instrument_fundamentals( @@ -307,7 +281,6 @@ def test_raw_response_get_instrument_fundamentals(self, client: ClearStreet) -> instrument_data = response.parse() assert_matches_type(InstrumentDataGetInstrumentFundamentalsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_instrument_fundamentals(self, client: ClearStreet) -> None: with client.v1.instrument_data.with_streaming_response.get_instrument_fundamentals( @@ -321,7 +294,6 @@ def test_streaming_response_get_instrument_fundamentals(self, client: ClearStree assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_instrument_fundamentals(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -329,7 +301,6 @@ def test_path_params_get_instrument_fundamentals(self, client: ClearStreet) -> N "", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_income_statements(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_income_statements( @@ -337,7 +308,6 @@ def test_method_get_instrument_income_statements(self, client: ClearStreet) -> N ) assert_matches_type(InstrumentDataGetInstrumentIncomeStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_income_statements_with_all_params(self, client: ClearStreet) -> None: instrument_data = client.v1.instrument_data.get_instrument_income_statements( @@ -349,7 +319,6 @@ def test_method_get_instrument_income_statements_with_all_params(self, client: C ) assert_matches_type(InstrumentDataGetInstrumentIncomeStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_instrument_income_statements(self, client: ClearStreet) -> None: response = client.v1.instrument_data.with_raw_response.get_instrument_income_statements( @@ -361,7 +330,6 @@ def test_raw_response_get_instrument_income_statements(self, client: ClearStreet instrument_data = response.parse() assert_matches_type(InstrumentDataGetInstrumentIncomeStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_instrument_income_statements(self, client: ClearStreet) -> None: with client.v1.instrument_data.with_streaming_response.get_instrument_income_statements( @@ -375,7 +343,6 @@ def test_streaming_response_get_instrument_income_statements(self, client: Clear assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_instrument_income_statements(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -389,13 +356,11 @@ class TestAsyncInstrumentData: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_all_instrument_events(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_all_instrument_events() assert_matches_type(InstrumentDataGetAllInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_all_instrument_events_with_all_params(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_all_instrument_events( @@ -406,7 +371,6 @@ async def test_method_get_all_instrument_events_with_all_params(self, async_clie ) assert_matches_type(InstrumentDataGetAllInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_all_instrument_events(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.with_raw_response.get_all_instrument_events() @@ -416,7 +380,6 @@ async def test_raw_response_get_all_instrument_events(self, async_client: AsyncC instrument_data = await response.parse() assert_matches_type(InstrumentDataGetAllInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_all_instrument_events(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.with_streaming_response.get_all_instrument_events() as response: @@ -428,7 +391,6 @@ async def test_streaming_response_get_all_instrument_events(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_analyst_consensus(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_instrument_analyst_consensus( @@ -436,7 +398,6 @@ async def test_method_get_instrument_analyst_consensus(self, async_client: Async ) assert_matches_type(InstrumentDataGetInstrumentAnalystConsensusResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_analyst_consensus_with_all_params( self, async_client: AsyncClearStreet @@ -448,7 +409,6 @@ async def test_method_get_instrument_analyst_consensus_with_all_params( ) assert_matches_type(InstrumentDataGetInstrumentAnalystConsensusResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_instrument_analyst_consensus(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.with_raw_response.get_instrument_analyst_consensus( @@ -460,7 +420,6 @@ async def test_raw_response_get_instrument_analyst_consensus(self, async_client: instrument_data = await response.parse() assert_matches_type(InstrumentDataGetInstrumentAnalystConsensusResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_instrument_analyst_consensus(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.with_streaming_response.get_instrument_analyst_consensus( @@ -474,7 +433,6 @@ async def test_streaming_response_get_instrument_analyst_consensus(self, async_c assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_instrument_analyst_consensus(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -482,7 +440,6 @@ async def test_path_params_get_instrument_analyst_consensus(self, async_client: instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_balance_sheet_statements(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_instrument_balance_sheet_statements( @@ -492,7 +449,6 @@ async def test_method_get_instrument_balance_sheet_statements(self, async_client InstrumentDataGetInstrumentBalanceSheetStatementsResponse, instrument_data, path=["response"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_balance_sheet_statements_with_all_params( self, async_client: AsyncClearStreet @@ -508,7 +464,6 @@ async def test_method_get_instrument_balance_sheet_statements_with_all_params( InstrumentDataGetInstrumentBalanceSheetStatementsResponse, instrument_data, path=["response"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_instrument_balance_sheet_statements(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.with_raw_response.get_instrument_balance_sheet_statements( @@ -522,7 +477,6 @@ async def test_raw_response_get_instrument_balance_sheet_statements(self, async_ InstrumentDataGetInstrumentBalanceSheetStatementsResponse, instrument_data, path=["response"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_instrument_balance_sheet_statements( self, async_client: AsyncClearStreet @@ -540,7 +494,6 @@ async def test_streaming_response_get_instrument_balance_sheet_statements( assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_instrument_balance_sheet_statements(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -548,7 +501,6 @@ async def test_path_params_get_instrument_balance_sheet_statements(self, async_c instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_cash_flow_statements(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_instrument_cash_flow_statements( @@ -556,7 +508,6 @@ async def test_method_get_instrument_cash_flow_statements(self, async_client: As ) assert_matches_type(InstrumentDataGetInstrumentCashFlowStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_cash_flow_statements_with_all_params( self, async_client: AsyncClearStreet @@ -570,7 +521,6 @@ async def test_method_get_instrument_cash_flow_statements_with_all_params( ) assert_matches_type(InstrumentDataGetInstrumentCashFlowStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_instrument_cash_flow_statements(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.with_raw_response.get_instrument_cash_flow_statements( @@ -582,7 +532,6 @@ async def test_raw_response_get_instrument_cash_flow_statements(self, async_clie instrument_data = await response.parse() assert_matches_type(InstrumentDataGetInstrumentCashFlowStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_instrument_cash_flow_statements(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.with_streaming_response.get_instrument_cash_flow_statements( @@ -598,7 +547,6 @@ async def test_streaming_response_get_instrument_cash_flow_statements(self, asyn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_instrument_cash_flow_statements(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -606,7 +554,6 @@ async def test_path_params_get_instrument_cash_flow_statements(self, async_clien instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_events(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_instrument_events( @@ -614,7 +561,6 @@ async def test_method_get_instrument_events(self, async_client: AsyncClearStreet ) assert_matches_type(InstrumentDataGetInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_events_with_all_params(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_instrument_events( @@ -624,7 +570,6 @@ async def test_method_get_instrument_events_with_all_params(self, async_client: ) assert_matches_type(InstrumentDataGetInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_instrument_events(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.with_raw_response.get_instrument_events( @@ -636,7 +581,6 @@ async def test_raw_response_get_instrument_events(self, async_client: AsyncClear instrument_data = await response.parse() assert_matches_type(InstrumentDataGetInstrumentEventsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_instrument_events(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.with_streaming_response.get_instrument_events( @@ -650,7 +594,6 @@ async def test_streaming_response_get_instrument_events(self, async_client: Asyn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_instrument_events(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -658,7 +601,6 @@ async def test_path_params_get_instrument_events(self, async_client: AsyncClearS instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_fundamentals(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_instrument_fundamentals( @@ -666,7 +608,6 @@ async def test_method_get_instrument_fundamentals(self, async_client: AsyncClear ) assert_matches_type(InstrumentDataGetInstrumentFundamentalsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_instrument_fundamentals(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.with_raw_response.get_instrument_fundamentals( @@ -678,7 +619,6 @@ async def test_raw_response_get_instrument_fundamentals(self, async_client: Asyn instrument_data = await response.parse() assert_matches_type(InstrumentDataGetInstrumentFundamentalsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_instrument_fundamentals(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.with_streaming_response.get_instrument_fundamentals( @@ -692,7 +632,6 @@ async def test_streaming_response_get_instrument_fundamentals(self, async_client assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_instrument_fundamentals(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -700,7 +639,6 @@ async def test_path_params_get_instrument_fundamentals(self, async_client: Async "", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_income_statements(self, async_client: AsyncClearStreet) -> None: instrument_data = await async_client.v1.instrument_data.get_instrument_income_statements( @@ -708,7 +646,6 @@ async def test_method_get_instrument_income_statements(self, async_client: Async ) assert_matches_type(InstrumentDataGetInstrumentIncomeStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_income_statements_with_all_params( self, async_client: AsyncClearStreet @@ -722,7 +659,6 @@ async def test_method_get_instrument_income_statements_with_all_params( ) assert_matches_type(InstrumentDataGetInstrumentIncomeStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_instrument_income_statements(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instrument_data.with_raw_response.get_instrument_income_statements( @@ -734,7 +670,6 @@ async def test_raw_response_get_instrument_income_statements(self, async_client: instrument_data = await response.parse() assert_matches_type(InstrumentDataGetInstrumentIncomeStatementsResponse, instrument_data, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_instrument_income_statements(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instrument_data.with_streaming_response.get_instrument_income_statements( @@ -748,7 +683,6 @@ async def test_streaming_response_get_instrument_income_statements(self, async_c assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_instrument_income_statements(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): diff --git a/tests/api_resources/v1/test_instruments.py b/tests/api_resources/v1/test_instruments.py index f954cef..7fc1e1c 100644 --- a/tests/api_resources/v1/test_instruments.py +++ b/tests/api_resources/v1/test_instruments.py @@ -23,7 +23,6 @@ class TestInstruments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_by_id(self, client: ClearStreet) -> None: instrument = client.v1.instruments.get_instrument_by_id( @@ -31,7 +30,6 @@ def test_method_get_instrument_by_id(self, client: ClearStreet) -> None: ) assert_matches_type(InstrumentGetInstrumentByIDResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instrument_by_id_with_all_params(self, client: ClearStreet) -> None: instrument = client.v1.instruments.get_instrument_by_id( @@ -40,7 +38,6 @@ def test_method_get_instrument_by_id_with_all_params(self, client: ClearStreet) ) assert_matches_type(InstrumentGetInstrumentByIDResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_instrument_by_id(self, client: ClearStreet) -> None: response = client.v1.instruments.with_raw_response.get_instrument_by_id( @@ -52,7 +49,6 @@ def test_raw_response_get_instrument_by_id(self, client: ClearStreet) -> None: instrument = response.parse() assert_matches_type(InstrumentGetInstrumentByIDResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_instrument_by_id(self, client: ClearStreet) -> None: with client.v1.instruments.with_streaming_response.get_instrument_by_id( @@ -66,7 +62,6 @@ def test_streaming_response_get_instrument_by_id(self, client: ClearStreet) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_instrument_by_id(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -74,13 +69,11 @@ def test_path_params_get_instrument_by_id(self, client: ClearStreet) -> None: instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instruments(self, client: ClearStreet) -> None: instrument = client.v1.instruments.get_instruments() assert_matches_type(InstrumentGetInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_instruments_with_all_params(self, client: ClearStreet) -> None: instrument = client.v1.instruments.get_instruments( @@ -97,7 +90,6 @@ def test_method_get_instruments_with_all_params(self, client: ClearStreet) -> No ) assert_matches_type(InstrumentGetInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_instruments(self, client: ClearStreet) -> None: response = client.v1.instruments.with_raw_response.get_instruments() @@ -107,7 +99,6 @@ def test_raw_response_get_instruments(self, client: ClearStreet) -> None: instrument = response.parse() assert_matches_type(InstrumentGetInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_instruments(self, client: ClearStreet) -> None: with client.v1.instruments.with_streaming_response.get_instruments() as response: @@ -119,13 +110,11 @@ def test_streaming_response_get_instruments(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_option_contracts(self, client: ClearStreet) -> None: instrument = client.v1.instruments.get_option_contracts() assert_matches_type(InstrumentGetOptionContractsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_option_contracts_with_all_params(self, client: ClearStreet) -> None: instrument = client.v1.instruments.get_option_contracts( @@ -138,7 +127,6 @@ def test_method_get_option_contracts_with_all_params(self, client: ClearStreet) ) assert_matches_type(InstrumentGetOptionContractsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_option_contracts(self, client: ClearStreet) -> None: response = client.v1.instruments.with_raw_response.get_option_contracts() @@ -148,7 +136,6 @@ def test_raw_response_get_option_contracts(self, client: ClearStreet) -> None: instrument = response.parse() assert_matches_type(InstrumentGetOptionContractsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_option_contracts(self, client: ClearStreet) -> None: with client.v1.instruments.with_streaming_response.get_option_contracts() as response: @@ -160,7 +147,6 @@ def test_streaming_response_get_option_contracts(self, client: ClearStreet) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_search_instruments(self, client: ClearStreet) -> None: instrument = client.v1.instruments.search_instruments( @@ -168,7 +154,6 @@ def test_method_search_instruments(self, client: ClearStreet) -> None: ) assert_matches_type(InstrumentSearchInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_search_instruments_with_all_params(self, client: ClearStreet) -> None: instrument = client.v1.instruments.search_instruments( @@ -183,7 +168,6 @@ def test_method_search_instruments_with_all_params(self, client: ClearStreet) -> ) assert_matches_type(InstrumentSearchInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_search_instruments(self, client: ClearStreet) -> None: response = client.v1.instruments.with_raw_response.search_instruments( @@ -195,7 +179,6 @@ def test_raw_response_search_instruments(self, client: ClearStreet) -> None: instrument = response.parse() assert_matches_type(InstrumentSearchInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_search_instruments(self, client: ClearStreet) -> None: with client.v1.instruments.with_streaming_response.search_instruments( @@ -215,7 +198,6 @@ class TestAsyncInstruments: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_by_id(self, async_client: AsyncClearStreet) -> None: instrument = await async_client.v1.instruments.get_instrument_by_id( @@ -223,7 +205,6 @@ async def test_method_get_instrument_by_id(self, async_client: AsyncClearStreet) ) assert_matches_type(InstrumentGetInstrumentByIDResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instrument_by_id_with_all_params(self, async_client: AsyncClearStreet) -> None: instrument = await async_client.v1.instruments.get_instrument_by_id( @@ -232,7 +213,6 @@ async def test_method_get_instrument_by_id_with_all_params(self, async_client: A ) assert_matches_type(InstrumentGetInstrumentByIDResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_instrument_by_id(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instruments.with_raw_response.get_instrument_by_id( @@ -244,7 +224,6 @@ async def test_raw_response_get_instrument_by_id(self, async_client: AsyncClearS instrument = await response.parse() assert_matches_type(InstrumentGetInstrumentByIDResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_instrument_by_id(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instruments.with_streaming_response.get_instrument_by_id( @@ -258,7 +237,6 @@ async def test_streaming_response_get_instrument_by_id(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_instrument_by_id(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -266,13 +244,11 @@ async def test_path_params_get_instrument_by_id(self, async_client: AsyncClearSt instrument_id="", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instruments(self, async_client: AsyncClearStreet) -> None: instrument = await async_client.v1.instruments.get_instruments() assert_matches_type(InstrumentGetInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_instruments_with_all_params(self, async_client: AsyncClearStreet) -> None: instrument = await async_client.v1.instruments.get_instruments( @@ -289,7 +265,6 @@ async def test_method_get_instruments_with_all_params(self, async_client: AsyncC ) assert_matches_type(InstrumentGetInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_instruments(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instruments.with_raw_response.get_instruments() @@ -299,7 +274,6 @@ async def test_raw_response_get_instruments(self, async_client: AsyncClearStreet instrument = await response.parse() assert_matches_type(InstrumentGetInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_instruments(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instruments.with_streaming_response.get_instruments() as response: @@ -311,13 +285,11 @@ async def test_streaming_response_get_instruments(self, async_client: AsyncClear assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_option_contracts(self, async_client: AsyncClearStreet) -> None: instrument = await async_client.v1.instruments.get_option_contracts() assert_matches_type(InstrumentGetOptionContractsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_option_contracts_with_all_params(self, async_client: AsyncClearStreet) -> None: instrument = await async_client.v1.instruments.get_option_contracts( @@ -330,7 +302,6 @@ async def test_method_get_option_contracts_with_all_params(self, async_client: A ) assert_matches_type(InstrumentGetOptionContractsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_option_contracts(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instruments.with_raw_response.get_option_contracts() @@ -340,7 +311,6 @@ async def test_raw_response_get_option_contracts(self, async_client: AsyncClearS instrument = await response.parse() assert_matches_type(InstrumentGetOptionContractsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_option_contracts(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instruments.with_streaming_response.get_option_contracts() as response: @@ -352,7 +322,6 @@ async def test_streaming_response_get_option_contracts(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_search_instruments(self, async_client: AsyncClearStreet) -> None: instrument = await async_client.v1.instruments.search_instruments( @@ -360,7 +329,6 @@ async def test_method_search_instruments(self, async_client: AsyncClearStreet) - ) assert_matches_type(InstrumentSearchInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_search_instruments_with_all_params(self, async_client: AsyncClearStreet) -> None: instrument = await async_client.v1.instruments.search_instruments( @@ -375,7 +343,6 @@ async def test_method_search_instruments_with_all_params(self, async_client: Asy ) assert_matches_type(InstrumentSearchInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_search_instruments(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.instruments.with_raw_response.search_instruments( @@ -387,7 +354,6 @@ async def test_raw_response_search_instruments(self, async_client: AsyncClearStr instrument = await response.parse() assert_matches_type(InstrumentSearchInstrumentsResponse, instrument, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_search_instruments(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.instruments.with_streaming_response.search_instruments( diff --git a/tests/api_resources/v1/test_orders.py b/tests/api_resources/v1/test_orders.py index 83a8234..73e0543 100644 --- a/tests/api_resources/v1/test_orders.py +++ b/tests/api_resources/v1/test_orders.py @@ -26,7 +26,6 @@ class TestOrders: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel_all_open_orders(self, client: ClearStreet) -> None: order = client.v1.orders.cancel_all_open_orders( @@ -34,7 +33,6 @@ def test_method_cancel_all_open_orders(self, client: ClearStreet) -> None: ) assert_matches_type(OrderCancelAllOpenOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel_all_open_orders_with_all_params(self, client: ClearStreet) -> None: order = client.v1.orders.cancel_all_open_orders( @@ -46,7 +44,6 @@ def test_method_cancel_all_open_orders_with_all_params(self, client: ClearStreet ) assert_matches_type(OrderCancelAllOpenOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_cancel_all_open_orders(self, client: ClearStreet) -> None: response = client.v1.orders.with_raw_response.cancel_all_open_orders( @@ -58,7 +55,6 @@ def test_raw_response_cancel_all_open_orders(self, client: ClearStreet) -> None: order = response.parse() assert_matches_type(OrderCancelAllOpenOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_cancel_all_open_orders(self, client: ClearStreet) -> None: with client.v1.orders.with_streaming_response.cancel_all_open_orders( @@ -72,7 +68,6 @@ def test_streaming_response_cancel_all_open_orders(self, client: ClearStreet) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel_open_order(self, client: ClearStreet) -> None: order = client.v1.orders.cancel_open_order( @@ -81,7 +76,6 @@ def test_method_cancel_open_order(self, client: ClearStreet) -> None: ) assert_matches_type(OrderCancelOpenOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_cancel_open_order(self, client: ClearStreet) -> None: response = client.v1.orders.with_raw_response.cancel_open_order( @@ -94,7 +88,6 @@ def test_raw_response_cancel_open_order(self, client: ClearStreet) -> None: order = response.parse() assert_matches_type(OrderCancelOpenOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_cancel_open_order(self, client: ClearStreet) -> None: with client.v1.orders.with_streaming_response.cancel_open_order( @@ -109,7 +102,6 @@ def test_streaming_response_cancel_open_order(self, client: ClearStreet) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_cancel_open_order(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `order_id` but received ''"): @@ -118,7 +110,6 @@ def test_path_params_cancel_open_order(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_executions(self, client: ClearStreet) -> None: order = client.v1.orders.get_executions( @@ -126,7 +117,6 @@ def test_method_get_executions(self, client: ClearStreet) -> None: ) assert_matches_type(OrderGetExecutionsResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_executions_with_all_params(self, client: ClearStreet) -> None: order = client.v1.orders.get_executions( @@ -139,7 +129,6 @@ def test_method_get_executions_with_all_params(self, client: ClearStreet) -> Non ) assert_matches_type(OrderGetExecutionsResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_executions(self, client: ClearStreet) -> None: response = client.v1.orders.with_raw_response.get_executions( @@ -151,7 +140,6 @@ def test_raw_response_get_executions(self, client: ClearStreet) -> None: order = response.parse() assert_matches_type(OrderGetExecutionsResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_executions(self, client: ClearStreet) -> None: with client.v1.orders.with_streaming_response.get_executions( @@ -165,7 +153,6 @@ def test_streaming_response_get_executions(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_order_by_id(self, client: ClearStreet) -> None: order = client.v1.orders.get_order_by_id( @@ -174,7 +161,6 @@ def test_method_get_order_by_id(self, client: ClearStreet) -> None: ) assert_matches_type(OrderGetOrderByIDResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_order_by_id(self, client: ClearStreet) -> None: response = client.v1.orders.with_raw_response.get_order_by_id( @@ -187,7 +173,6 @@ def test_raw_response_get_order_by_id(self, client: ClearStreet) -> None: order = response.parse() assert_matches_type(OrderGetOrderByIDResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_order_by_id(self, client: ClearStreet) -> None: with client.v1.orders.with_streaming_response.get_order_by_id( @@ -202,7 +187,6 @@ def test_streaming_response_get_order_by_id(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_order_by_id(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `order_id` but received ''"): @@ -211,7 +195,6 @@ def test_path_params_get_order_by_id(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_orders(self, client: ClearStreet) -> None: order = client.v1.orders.get_orders( @@ -219,7 +202,6 @@ def test_method_get_orders(self, client: ClearStreet) -> None: ) assert_matches_type(OrderGetOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_orders_with_all_params(self, client: ClearStreet) -> None: order = client.v1.orders.get_orders( @@ -227,6 +209,7 @@ def test_method_get_orders_with_all_params(self, client: ClearStreet) -> None: from_=parse_datetime("2019-12-27T18:11:19.117Z"), instrument_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], instrument_type="COMMON_STOCK", + order_ids=["string"], page_size=1, page_token="U3RhaW5sZXNzIHJvY2tz", status=["PENDING_NEW"], @@ -236,7 +219,6 @@ def test_method_get_orders_with_all_params(self, client: ClearStreet) -> None: ) assert_matches_type(OrderGetOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_orders(self, client: ClearStreet) -> None: response = client.v1.orders.with_raw_response.get_orders( @@ -248,7 +230,6 @@ def test_raw_response_get_orders(self, client: ClearStreet) -> None: order = response.parse() assert_matches_type(OrderGetOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_orders(self, client: ClearStreet) -> None: with client.v1.orders.with_streaming_response.get_orders( @@ -262,7 +243,6 @@ def test_streaming_response_get_orders(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_replace_order(self, client: ClearStreet) -> None: order = client.v1.orders.replace_order( @@ -271,20 +251,18 @@ def test_method_replace_order(self, client: ClearStreet) -> None: ) assert_matches_type(OrderReplaceOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_replace_order_with_all_params(self, client: ClearStreet) -> None: order = client.v1.orders.replace_order( order_id="order_id", account_id=0, - limit_price="150.50", - quantity="125", - stop_price="148.00", + limit_price="49.00", + quantity="1", + stop_price="52.00", time_in_force="DAY", ) assert_matches_type(OrderReplaceOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_replace_order(self, client: ClearStreet) -> None: response = client.v1.orders.with_raw_response.replace_order( @@ -297,7 +275,6 @@ def test_raw_response_replace_order(self, client: ClearStreet) -> None: order = response.parse() assert_matches_type(OrderReplaceOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_replace_order(self, client: ClearStreet) -> None: with client.v1.orders.with_streaming_response.replace_order( @@ -312,7 +289,6 @@ def test_streaming_response_replace_order(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_replace_order(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `order_id` but received ''"): @@ -321,62 +297,30 @@ def test_path_params_replace_order(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_submit_orders(self, client: ClearStreet) -> None: order = client.v1.orders.submit_orders( account_id=0, orders=[ { - "legs": [ - { - "ratio": "ratio", - "security": "0193bb84-447a-706f-996f-097254663f02", - "side": "BUY", - }, - { - "ratio": "ratio", - "security": "0193bb84-4db4-78ec-b4fd-cba8be61cf8a", - "side": "SELL", - }, - { - "ratio": "ratio", - "security": "0193bb84-5264-7f20-8fd3-35df82cd6ef0", - "side": "BUY", - }, - ], "order_type": "LIMIT", + "quantity": "1", + "side": "BUY", "time_in_force": "DAY", } ], ) assert_matches_type(OrderSubmitOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_submit_orders(self, client: ClearStreet) -> None: response = client.v1.orders.with_raw_response.submit_orders( account_id=0, orders=[ { - "legs": [ - { - "ratio": "ratio", - "security": "0193bb84-447a-706f-996f-097254663f02", - "side": "BUY", - }, - { - "ratio": "ratio", - "security": "0193bb84-4db4-78ec-b4fd-cba8be61cf8a", - "side": "SELL", - }, - { - "ratio": "ratio", - "security": "0193bb84-5264-7f20-8fd3-35df82cd6ef0", - "side": "BUY", - }, - ], "order_type": "LIMIT", + "quantity": "1", + "side": "BUY", "time_in_force": "DAY", } ], @@ -387,31 +331,15 @@ def test_raw_response_submit_orders(self, client: ClearStreet) -> None: order = response.parse() assert_matches_type(OrderSubmitOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_submit_orders(self, client: ClearStreet) -> None: with client.v1.orders.with_streaming_response.submit_orders( account_id=0, orders=[ { - "legs": [ - { - "ratio": "ratio", - "security": "0193bb84-447a-706f-996f-097254663f02", - "side": "BUY", - }, - { - "ratio": "ratio", - "security": "0193bb84-4db4-78ec-b4fd-cba8be61cf8a", - "side": "SELL", - }, - { - "ratio": "ratio", - "security": "0193bb84-5264-7f20-8fd3-35df82cd6ef0", - "side": "BUY", - }, - ], "order_type": "LIMIT", + "quantity": "1", + "side": "BUY", "time_in_force": "DAY", } ], @@ -430,7 +358,6 @@ class TestAsyncOrders: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel_all_open_orders(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.cancel_all_open_orders( @@ -438,7 +365,6 @@ async def test_method_cancel_all_open_orders(self, async_client: AsyncClearStree ) assert_matches_type(OrderCancelAllOpenOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel_all_open_orders_with_all_params(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.cancel_all_open_orders( @@ -450,7 +376,6 @@ async def test_method_cancel_all_open_orders_with_all_params(self, async_client: ) assert_matches_type(OrderCancelAllOpenOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_cancel_all_open_orders(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.orders.with_raw_response.cancel_all_open_orders( @@ -462,7 +387,6 @@ async def test_raw_response_cancel_all_open_orders(self, async_client: AsyncClea order = await response.parse() assert_matches_type(OrderCancelAllOpenOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_cancel_all_open_orders(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.orders.with_streaming_response.cancel_all_open_orders( @@ -476,7 +400,6 @@ async def test_streaming_response_cancel_all_open_orders(self, async_client: Asy assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel_open_order(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.cancel_open_order( @@ -485,7 +408,6 @@ async def test_method_cancel_open_order(self, async_client: AsyncClearStreet) -> ) assert_matches_type(OrderCancelOpenOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_cancel_open_order(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.orders.with_raw_response.cancel_open_order( @@ -498,7 +420,6 @@ async def test_raw_response_cancel_open_order(self, async_client: AsyncClearStre order = await response.parse() assert_matches_type(OrderCancelOpenOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_cancel_open_order(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.orders.with_streaming_response.cancel_open_order( @@ -513,7 +434,6 @@ async def test_streaming_response_cancel_open_order(self, async_client: AsyncCle assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_cancel_open_order(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `order_id` but received ''"): @@ -522,7 +442,6 @@ async def test_path_params_cancel_open_order(self, async_client: AsyncClearStree account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_executions(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.get_executions( @@ -530,7 +449,6 @@ async def test_method_get_executions(self, async_client: AsyncClearStreet) -> No ) assert_matches_type(OrderGetExecutionsResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_executions_with_all_params(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.get_executions( @@ -543,7 +461,6 @@ async def test_method_get_executions_with_all_params(self, async_client: AsyncCl ) assert_matches_type(OrderGetExecutionsResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_executions(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.orders.with_raw_response.get_executions( @@ -555,7 +472,6 @@ async def test_raw_response_get_executions(self, async_client: AsyncClearStreet) order = await response.parse() assert_matches_type(OrderGetExecutionsResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_executions(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.orders.with_streaming_response.get_executions( @@ -569,7 +485,6 @@ async def test_streaming_response_get_executions(self, async_client: AsyncClearS assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_order_by_id(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.get_order_by_id( @@ -578,7 +493,6 @@ async def test_method_get_order_by_id(self, async_client: AsyncClearStreet) -> N ) assert_matches_type(OrderGetOrderByIDResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_order_by_id(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.orders.with_raw_response.get_order_by_id( @@ -591,7 +505,6 @@ async def test_raw_response_get_order_by_id(self, async_client: AsyncClearStreet order = await response.parse() assert_matches_type(OrderGetOrderByIDResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_order_by_id(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.orders.with_streaming_response.get_order_by_id( @@ -606,7 +519,6 @@ async def test_streaming_response_get_order_by_id(self, async_client: AsyncClear assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_order_by_id(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `order_id` but received ''"): @@ -615,7 +527,6 @@ async def test_path_params_get_order_by_id(self, async_client: AsyncClearStreet) account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_orders(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.get_orders( @@ -623,7 +534,6 @@ async def test_method_get_orders(self, async_client: AsyncClearStreet) -> None: ) assert_matches_type(OrderGetOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_orders_with_all_params(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.get_orders( @@ -631,6 +541,7 @@ async def test_method_get_orders_with_all_params(self, async_client: AsyncClearS from_=parse_datetime("2019-12-27T18:11:19.117Z"), instrument_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], instrument_type="COMMON_STOCK", + order_ids=["string"], page_size=1, page_token="U3RhaW5sZXNzIHJvY2tz", status=["PENDING_NEW"], @@ -640,7 +551,6 @@ async def test_method_get_orders_with_all_params(self, async_client: AsyncClearS ) assert_matches_type(OrderGetOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_orders(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.orders.with_raw_response.get_orders( @@ -652,7 +562,6 @@ async def test_raw_response_get_orders(self, async_client: AsyncClearStreet) -> order = await response.parse() assert_matches_type(OrderGetOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_orders(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.orders.with_streaming_response.get_orders( @@ -666,7 +575,6 @@ async def test_streaming_response_get_orders(self, async_client: AsyncClearStree assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_replace_order(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.replace_order( @@ -675,20 +583,18 @@ async def test_method_replace_order(self, async_client: AsyncClearStreet) -> Non ) assert_matches_type(OrderReplaceOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_replace_order_with_all_params(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.replace_order( order_id="order_id", account_id=0, - limit_price="150.50", - quantity="125", - stop_price="148.00", + limit_price="49.00", + quantity="1", + stop_price="52.00", time_in_force="DAY", ) assert_matches_type(OrderReplaceOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_replace_order(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.orders.with_raw_response.replace_order( @@ -701,7 +607,6 @@ async def test_raw_response_replace_order(self, async_client: AsyncClearStreet) order = await response.parse() assert_matches_type(OrderReplaceOrderResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_replace_order(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.orders.with_streaming_response.replace_order( @@ -716,7 +621,6 @@ async def test_streaming_response_replace_order(self, async_client: AsyncClearSt assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_replace_order(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `order_id` but received ''"): @@ -725,62 +629,30 @@ async def test_path_params_replace_order(self, async_client: AsyncClearStreet) - account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_submit_orders(self, async_client: AsyncClearStreet) -> None: order = await async_client.v1.orders.submit_orders( account_id=0, orders=[ { - "legs": [ - { - "ratio": "ratio", - "security": "0193bb84-447a-706f-996f-097254663f02", - "side": "BUY", - }, - { - "ratio": "ratio", - "security": "0193bb84-4db4-78ec-b4fd-cba8be61cf8a", - "side": "SELL", - }, - { - "ratio": "ratio", - "security": "0193bb84-5264-7f20-8fd3-35df82cd6ef0", - "side": "BUY", - }, - ], "order_type": "LIMIT", + "quantity": "1", + "side": "BUY", "time_in_force": "DAY", } ], ) assert_matches_type(OrderSubmitOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_submit_orders(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.orders.with_raw_response.submit_orders( account_id=0, orders=[ { - "legs": [ - { - "ratio": "ratio", - "security": "0193bb84-447a-706f-996f-097254663f02", - "side": "BUY", - }, - { - "ratio": "ratio", - "security": "0193bb84-4db4-78ec-b4fd-cba8be61cf8a", - "side": "SELL", - }, - { - "ratio": "ratio", - "security": "0193bb84-5264-7f20-8fd3-35df82cd6ef0", - "side": "BUY", - }, - ], "order_type": "LIMIT", + "quantity": "1", + "side": "BUY", "time_in_force": "DAY", } ], @@ -791,31 +663,15 @@ async def test_raw_response_submit_orders(self, async_client: AsyncClearStreet) order = await response.parse() assert_matches_type(OrderSubmitOrdersResponse, order, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_submit_orders(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.orders.with_streaming_response.submit_orders( account_id=0, orders=[ { - "legs": [ - { - "ratio": "ratio", - "security": "0193bb84-447a-706f-996f-097254663f02", - "side": "BUY", - }, - { - "ratio": "ratio", - "security": "0193bb84-4db4-78ec-b4fd-cba8be61cf8a", - "side": "SELL", - }, - { - "ratio": "ratio", - "security": "0193bb84-5264-7f20-8fd3-35df82cd6ef0", - "side": "BUY", - }, - ], "order_type": "LIMIT", + "quantity": "1", + "side": "BUY", "time_in_force": "DAY", } ], diff --git a/tests/api_resources/v1/test_positions.py b/tests/api_resources/v1/test_positions.py index afe634f..57e9acf 100644 --- a/tests/api_resources/v1/test_positions.py +++ b/tests/api_resources/v1/test_positions.py @@ -24,7 +24,6 @@ class TestPositions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel_position_instruction(self, client: ClearStreet) -> None: position = client.v1.positions.cancel_position_instruction( @@ -33,7 +32,6 @@ def test_method_cancel_position_instruction(self, client: ClearStreet) -> None: ) assert_matches_type(PositionCancelPositionInstructionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_cancel_position_instruction(self, client: ClearStreet) -> None: response = client.v1.positions.with_raw_response.cancel_position_instruction( @@ -46,7 +44,6 @@ def test_raw_response_cancel_position_instruction(self, client: ClearStreet) -> position = response.parse() assert_matches_type(PositionCancelPositionInstructionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_cancel_position_instruction(self, client: ClearStreet) -> None: with client.v1.positions.with_streaming_response.cancel_position_instruction( @@ -61,7 +58,6 @@ def test_streaming_response_cancel_position_instruction(self, client: ClearStree assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_cancel_position_instruction(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instruction_id` but received ''"): @@ -70,7 +66,6 @@ def test_path_params_cancel_position_instruction(self, client: ClearStreet) -> N account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_close_position(self, client: ClearStreet) -> None: position = client.v1.positions.close_position( @@ -79,7 +74,6 @@ def test_method_close_position(self, client: ClearStreet) -> None: ) assert_matches_type(PositionClosePositionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_close_position_with_all_params(self, client: ClearStreet) -> None: position = client.v1.positions.close_position( @@ -89,7 +83,6 @@ def test_method_close_position_with_all_params(self, client: ClearStreet) -> Non ) assert_matches_type(PositionClosePositionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_close_position(self, client: ClearStreet) -> None: response = client.v1.positions.with_raw_response.close_position( @@ -102,7 +95,6 @@ def test_raw_response_close_position(self, client: ClearStreet) -> None: position = response.parse() assert_matches_type(PositionClosePositionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_close_position(self, client: ClearStreet) -> None: with client.v1.positions.with_streaming_response.close_position( @@ -117,7 +109,6 @@ def test_streaming_response_close_position(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_close_position(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -126,7 +117,6 @@ def test_path_params_close_position(self, client: ClearStreet) -> None: account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_close_positions(self, client: ClearStreet) -> None: position = client.v1.positions.close_positions( @@ -134,7 +124,6 @@ def test_method_close_positions(self, client: ClearStreet) -> None: ) assert_matches_type(PositionClosePositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_close_positions_with_all_params(self, client: ClearStreet) -> None: position = client.v1.positions.close_positions( @@ -143,7 +132,6 @@ def test_method_close_positions_with_all_params(self, client: ClearStreet) -> No ) assert_matches_type(PositionClosePositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_close_positions(self, client: ClearStreet) -> None: response = client.v1.positions.with_raw_response.close_positions( @@ -155,7 +143,6 @@ def test_raw_response_close_positions(self, client: ClearStreet) -> None: position = response.parse() assert_matches_type(PositionClosePositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_close_positions(self, client: ClearStreet) -> None: with client.v1.positions.with_streaming_response.close_positions( @@ -169,7 +156,6 @@ def test_streaming_response_close_positions(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_position_instructions(self, client: ClearStreet) -> None: position = client.v1.positions.get_position_instructions( @@ -177,7 +163,6 @@ def test_method_get_position_instructions(self, client: ClearStreet) -> None: ) assert_matches_type(PositionGetPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_position_instructions_with_all_params(self, client: ClearStreet) -> None: position = client.v1.positions.get_position_instructions( @@ -186,7 +171,6 @@ def test_method_get_position_instructions_with_all_params(self, client: ClearStr ) assert_matches_type(PositionGetPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_position_instructions(self, client: ClearStreet) -> None: response = client.v1.positions.with_raw_response.get_position_instructions( @@ -198,7 +182,6 @@ def test_raw_response_get_position_instructions(self, client: ClearStreet) -> No position = response.parse() assert_matches_type(PositionGetPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_position_instructions(self, client: ClearStreet) -> None: with client.v1.positions.with_streaming_response.get_position_instructions( @@ -212,7 +195,6 @@ def test_streaming_response_get_position_instructions(self, client: ClearStreet) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_positions(self, client: ClearStreet) -> None: position = client.v1.positions.get_positions( @@ -220,7 +202,6 @@ def test_method_get_positions(self, client: ClearStreet) -> None: ) assert_matches_type(PositionGetPositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_positions_with_all_params(self, client: ClearStreet) -> None: position = client.v1.positions.get_positions( @@ -233,7 +214,6 @@ def test_method_get_positions_with_all_params(self, client: ClearStreet) -> None ) assert_matches_type(PositionGetPositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_positions(self, client: ClearStreet) -> None: response = client.v1.positions.with_raw_response.get_positions( @@ -245,7 +225,6 @@ def test_raw_response_get_positions(self, client: ClearStreet) -> None: position = response.parse() assert_matches_type(PositionGetPositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_positions(self, client: ClearStreet) -> None: with client.v1.positions.with_streaming_response.get_positions( @@ -259,7 +238,6 @@ def test_streaming_response_get_positions(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_submit_position_instructions(self, client: ClearStreet) -> None: position = client.v1.positions.submit_position_instructions( @@ -274,7 +252,6 @@ def test_method_submit_position_instructions(self, client: ClearStreet) -> None: ) assert_matches_type(PositionSubmitPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_submit_position_instructions(self, client: ClearStreet) -> None: response = client.v1.positions.with_raw_response.submit_position_instructions( @@ -293,7 +270,6 @@ def test_raw_response_submit_position_instructions(self, client: ClearStreet) -> position = response.parse() assert_matches_type(PositionSubmitPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_submit_position_instructions(self, client: ClearStreet) -> None: with client.v1.positions.with_streaming_response.submit_position_instructions( @@ -320,7 +296,6 @@ class TestAsyncPositions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel_position_instruction(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.cancel_position_instruction( @@ -329,7 +304,6 @@ async def test_method_cancel_position_instruction(self, async_client: AsyncClear ) assert_matches_type(PositionCancelPositionInstructionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_cancel_position_instruction(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.positions.with_raw_response.cancel_position_instruction( @@ -342,7 +316,6 @@ async def test_raw_response_cancel_position_instruction(self, async_client: Asyn position = await response.parse() assert_matches_type(PositionCancelPositionInstructionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_cancel_position_instruction(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.positions.with_streaming_response.cancel_position_instruction( @@ -357,7 +330,6 @@ async def test_streaming_response_cancel_position_instruction(self, async_client assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_cancel_position_instruction(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instruction_id` but received ''"): @@ -366,7 +338,6 @@ async def test_path_params_cancel_position_instruction(self, async_client: Async account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_close_position(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.close_position( @@ -375,7 +346,6 @@ async def test_method_close_position(self, async_client: AsyncClearStreet) -> No ) assert_matches_type(PositionClosePositionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_close_position_with_all_params(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.close_position( @@ -385,7 +355,6 @@ async def test_method_close_position_with_all_params(self, async_client: AsyncCl ) assert_matches_type(PositionClosePositionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_close_position(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.positions.with_raw_response.close_position( @@ -398,7 +367,6 @@ async def test_raw_response_close_position(self, async_client: AsyncClearStreet) position = await response.parse() assert_matches_type(PositionClosePositionResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_close_position(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.positions.with_streaming_response.close_position( @@ -413,7 +381,6 @@ async def test_streaming_response_close_position(self, async_client: AsyncClearS assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_close_position(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `instrument_id` but received ''"): @@ -422,7 +389,6 @@ async def test_path_params_close_position(self, async_client: AsyncClearStreet) account_id=0, ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_close_positions(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.close_positions( @@ -430,7 +396,6 @@ async def test_method_close_positions(self, async_client: AsyncClearStreet) -> N ) assert_matches_type(PositionClosePositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_close_positions_with_all_params(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.close_positions( @@ -439,7 +404,6 @@ async def test_method_close_positions_with_all_params(self, async_client: AsyncC ) assert_matches_type(PositionClosePositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_close_positions(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.positions.with_raw_response.close_positions( @@ -451,7 +415,6 @@ async def test_raw_response_close_positions(self, async_client: AsyncClearStreet position = await response.parse() assert_matches_type(PositionClosePositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_close_positions(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.positions.with_streaming_response.close_positions( @@ -465,7 +428,6 @@ async def test_streaming_response_close_positions(self, async_client: AsyncClear assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_position_instructions(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.get_position_instructions( @@ -473,7 +435,6 @@ async def test_method_get_position_instructions(self, async_client: AsyncClearSt ) assert_matches_type(PositionGetPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_position_instructions_with_all_params(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.get_position_instructions( @@ -482,7 +443,6 @@ async def test_method_get_position_instructions_with_all_params(self, async_clie ) assert_matches_type(PositionGetPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_position_instructions(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.positions.with_raw_response.get_position_instructions( @@ -494,7 +454,6 @@ async def test_raw_response_get_position_instructions(self, async_client: AsyncC position = await response.parse() assert_matches_type(PositionGetPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_position_instructions(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.positions.with_streaming_response.get_position_instructions( @@ -508,7 +467,6 @@ async def test_streaming_response_get_position_instructions(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_positions(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.get_positions( @@ -516,7 +474,6 @@ async def test_method_get_positions(self, async_client: AsyncClearStreet) -> Non ) assert_matches_type(PositionGetPositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_positions_with_all_params(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.get_positions( @@ -529,7 +486,6 @@ async def test_method_get_positions_with_all_params(self, async_client: AsyncCle ) assert_matches_type(PositionGetPositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_positions(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.positions.with_raw_response.get_positions( @@ -541,7 +497,6 @@ async def test_raw_response_get_positions(self, async_client: AsyncClearStreet) position = await response.parse() assert_matches_type(PositionGetPositionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_positions(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.positions.with_streaming_response.get_positions( @@ -555,7 +510,6 @@ async def test_streaming_response_get_positions(self, async_client: AsyncClearSt assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_submit_position_instructions(self, async_client: AsyncClearStreet) -> None: position = await async_client.v1.positions.submit_position_instructions( @@ -570,7 +524,6 @@ async def test_method_submit_position_instructions(self, async_client: AsyncClea ) assert_matches_type(PositionSubmitPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_submit_position_instructions(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.positions.with_raw_response.submit_position_instructions( @@ -589,7 +542,6 @@ async def test_raw_response_submit_position_instructions(self, async_client: Asy position = await response.parse() assert_matches_type(PositionSubmitPositionInstructionsResponse, position, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_submit_position_instructions(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.positions.with_streaming_response.submit_position_instructions( diff --git a/tests/api_resources/v1/test_screener.py b/tests/api_resources/v1/test_screener.py new file mode 100644 index 0000000..33146ac --- /dev/null +++ b/tests/api_resources/v1/test_screener.py @@ -0,0 +1,762 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from clearstreet import ClearStreet, AsyncClearStreet +from tests.utils import assert_matches_type +from clearstreet.types.v1 import ( + ScreenerGetScreenersResponse, + ScreenerCreateScreenerResponse, + ScreenerSearchScreenerResponse, + ScreenerGetScreenerByIDResponse, + ScreenerReplaceScreenerResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestScreener: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create_screener(self, client: ClearStreet) -> None: + screener = client.v1.screener.create_screener() + assert_matches_type(ScreenerCreateScreenerResponse, screener, path=["response"]) + + @parametrize + def test_method_create_screener_with_all_params(self, client: ClearStreet) -> None: + screener = client.v1.screener.create_screener( + columns=[ + { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + } + ], + filters=[ + { + "left": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "op": { + "name": "GREATER_OR_EQUAL", + "args": ["LEFT_INCLUSIVE"], + }, + "right": [ + { + "value": 1000000000, + "variable": { + "name": "today", + "lookback": "ONE_DAY", + "modifier": { + "args": [30, "DAY"], + "name": "SUBTRACT", + }, + "period": "QUARTER", + }, + } + ], + } + ], + name="name", + sorts=[ + { + "field": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "direction": "DESC", + } + ], + ) + assert_matches_type(ScreenerCreateScreenerResponse, screener, path=["response"]) + + @parametrize + def test_raw_response_create_screener(self, client: ClearStreet) -> None: + response = client.v1.screener.with_raw_response.create_screener() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = response.parse() + assert_matches_type(ScreenerCreateScreenerResponse, screener, path=["response"]) + + @parametrize + def test_streaming_response_create_screener(self, client: ClearStreet) -> None: + with client.v1.screener.with_streaming_response.create_screener() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = response.parse() + assert_matches_type(ScreenerCreateScreenerResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete_screener(self, client: ClearStreet) -> None: + screener = client.v1.screener.delete_screener( + "550e8400-e29b-41d4-a716-446655440000", + ) + assert screener is None + + @parametrize + def test_raw_response_delete_screener(self, client: ClearStreet) -> None: + response = client.v1.screener.with_raw_response.delete_screener( + "550e8400-e29b-41d4-a716-446655440000", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = response.parse() + assert screener is None + + @parametrize + def test_streaming_response_delete_screener(self, client: ClearStreet) -> None: + with client.v1.screener.with_streaming_response.delete_screener( + "550e8400-e29b-41d4-a716-446655440000", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = response.parse() + assert screener is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete_screener(self, client: ClearStreet) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `screener_id` but received ''"): + client.v1.screener.with_raw_response.delete_screener( + "", + ) + + @parametrize + def test_method_get_screener_by_id(self, client: ClearStreet) -> None: + screener = client.v1.screener.get_screener_by_id( + "550e8400-e29b-41d4-a716-446655440000", + ) + assert_matches_type(ScreenerGetScreenerByIDResponse, screener, path=["response"]) + + @parametrize + def test_raw_response_get_screener_by_id(self, client: ClearStreet) -> None: + response = client.v1.screener.with_raw_response.get_screener_by_id( + "550e8400-e29b-41d4-a716-446655440000", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = response.parse() + assert_matches_type(ScreenerGetScreenerByIDResponse, screener, path=["response"]) + + @parametrize + def test_streaming_response_get_screener_by_id(self, client: ClearStreet) -> None: + with client.v1.screener.with_streaming_response.get_screener_by_id( + "550e8400-e29b-41d4-a716-446655440000", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = response.parse() + assert_matches_type(ScreenerGetScreenerByIDResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_screener_by_id(self, client: ClearStreet) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `screener_id` but received ''"): + client.v1.screener.with_raw_response.get_screener_by_id( + "", + ) + + @parametrize + def test_method_get_screeners(self, client: ClearStreet) -> None: + screener = client.v1.screener.get_screeners() + assert_matches_type(ScreenerGetScreenersResponse, screener, path=["response"]) + + @parametrize + def test_raw_response_get_screeners(self, client: ClearStreet) -> None: + response = client.v1.screener.with_raw_response.get_screeners() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = response.parse() + assert_matches_type(ScreenerGetScreenersResponse, screener, path=["response"]) + + @parametrize + def test_streaming_response_get_screeners(self, client: ClearStreet) -> None: + with client.v1.screener.with_streaming_response.get_screeners() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = response.parse() + assert_matches_type(ScreenerGetScreenersResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_replace_screener(self, client: ClearStreet) -> None: + screener = client.v1.screener.replace_screener( + screener_id="550e8400-e29b-41d4-a716-446655440000", + ) + assert_matches_type(ScreenerReplaceScreenerResponse, screener, path=["response"]) + + @parametrize + def test_method_replace_screener_with_all_params(self, client: ClearStreet) -> None: + screener = client.v1.screener.replace_screener( + screener_id="550e8400-e29b-41d4-a716-446655440000", + columns=[ + { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + } + ], + filters=[ + { + "left": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "op": { + "name": "GREATER_OR_EQUAL", + "args": ["LEFT_INCLUSIVE"], + }, + "right": [ + { + "value": 1000000000, + "variable": { + "name": "today", + "lookback": "ONE_DAY", + "modifier": { + "args": [30, "DAY"], + "name": "SUBTRACT", + }, + "period": "QUARTER", + }, + } + ], + } + ], + name="name", + sorts=[ + { + "field": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "direction": "DESC", + } + ], + ) + assert_matches_type(ScreenerReplaceScreenerResponse, screener, path=["response"]) + + @parametrize + def test_raw_response_replace_screener(self, client: ClearStreet) -> None: + response = client.v1.screener.with_raw_response.replace_screener( + screener_id="550e8400-e29b-41d4-a716-446655440000", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = response.parse() + assert_matches_type(ScreenerReplaceScreenerResponse, screener, path=["response"]) + + @parametrize + def test_streaming_response_replace_screener(self, client: ClearStreet) -> None: + with client.v1.screener.with_streaming_response.replace_screener( + screener_id="550e8400-e29b-41d4-a716-446655440000", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = response.parse() + assert_matches_type(ScreenerReplaceScreenerResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_replace_screener(self, client: ClearStreet) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `screener_id` but received ''"): + client.v1.screener.with_raw_response.replace_screener( + screener_id="", + ) + + @parametrize + def test_method_search_screener(self, client: ClearStreet) -> None: + screener = client.v1.screener.search_screener() + assert_matches_type(ScreenerSearchScreenerResponse, screener, path=["response"]) + + @parametrize + def test_method_search_screener_with_all_params(self, client: ClearStreet) -> None: + screener = client.v1.screener.search_screener( + columns=[ + { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + { + "name": "price", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + { + "name": "volume", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + ], + filters=[ + { + "left": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "op": { + "name": "GREATER_OR_EQUAL", + "args": ["LEFT_INCLUSIVE"], + }, + "right": [ + { + "value": 1000000000, + "variable": { + "name": "today", + "lookback": "ONE_DAY", + "modifier": { + "args": [30, "DAY"], + "name": "SUBTRACT", + }, + "period": "QUARTER", + }, + } + ], + } + ], + page_size=25, + page_token="U3RhaW5sZXNzIHJvY2tz", + sort_case_sensitive=True, + sorts=[ + { + "field": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "direction": "DESC", + } + ], + ) + assert_matches_type(ScreenerSearchScreenerResponse, screener, path=["response"]) + + @parametrize + def test_raw_response_search_screener(self, client: ClearStreet) -> None: + response = client.v1.screener.with_raw_response.search_screener() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = response.parse() + assert_matches_type(ScreenerSearchScreenerResponse, screener, path=["response"]) + + @parametrize + def test_streaming_response_search_screener(self, client: ClearStreet) -> None: + with client.v1.screener.with_streaming_response.search_screener() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = response.parse() + assert_matches_type(ScreenerSearchScreenerResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncScreener: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create_screener(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.create_screener() + assert_matches_type(ScreenerCreateScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_method_create_screener_with_all_params(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.create_screener( + columns=[ + { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + } + ], + filters=[ + { + "left": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "op": { + "name": "GREATER_OR_EQUAL", + "args": ["LEFT_INCLUSIVE"], + }, + "right": [ + { + "value": 1000000000, + "variable": { + "name": "today", + "lookback": "ONE_DAY", + "modifier": { + "args": [30, "DAY"], + "name": "SUBTRACT", + }, + "period": "QUARTER", + }, + } + ], + } + ], + name="name", + sorts=[ + { + "field": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "direction": "DESC", + } + ], + ) + assert_matches_type(ScreenerCreateScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_raw_response_create_screener(self, async_client: AsyncClearStreet) -> None: + response = await async_client.v1.screener.with_raw_response.create_screener() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = await response.parse() + assert_matches_type(ScreenerCreateScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_streaming_response_create_screener(self, async_client: AsyncClearStreet) -> None: + async with async_client.v1.screener.with_streaming_response.create_screener() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = await response.parse() + assert_matches_type(ScreenerCreateScreenerResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete_screener(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.delete_screener( + "550e8400-e29b-41d4-a716-446655440000", + ) + assert screener is None + + @parametrize + async def test_raw_response_delete_screener(self, async_client: AsyncClearStreet) -> None: + response = await async_client.v1.screener.with_raw_response.delete_screener( + "550e8400-e29b-41d4-a716-446655440000", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = await response.parse() + assert screener is None + + @parametrize + async def test_streaming_response_delete_screener(self, async_client: AsyncClearStreet) -> None: + async with async_client.v1.screener.with_streaming_response.delete_screener( + "550e8400-e29b-41d4-a716-446655440000", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = await response.parse() + assert screener is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete_screener(self, async_client: AsyncClearStreet) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `screener_id` but received ''"): + await async_client.v1.screener.with_raw_response.delete_screener( + "", + ) + + @parametrize + async def test_method_get_screener_by_id(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.get_screener_by_id( + "550e8400-e29b-41d4-a716-446655440000", + ) + assert_matches_type(ScreenerGetScreenerByIDResponse, screener, path=["response"]) + + @parametrize + async def test_raw_response_get_screener_by_id(self, async_client: AsyncClearStreet) -> None: + response = await async_client.v1.screener.with_raw_response.get_screener_by_id( + "550e8400-e29b-41d4-a716-446655440000", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = await response.parse() + assert_matches_type(ScreenerGetScreenerByIDResponse, screener, path=["response"]) + + @parametrize + async def test_streaming_response_get_screener_by_id(self, async_client: AsyncClearStreet) -> None: + async with async_client.v1.screener.with_streaming_response.get_screener_by_id( + "550e8400-e29b-41d4-a716-446655440000", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = await response.parse() + assert_matches_type(ScreenerGetScreenerByIDResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_screener_by_id(self, async_client: AsyncClearStreet) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `screener_id` but received ''"): + await async_client.v1.screener.with_raw_response.get_screener_by_id( + "", + ) + + @parametrize + async def test_method_get_screeners(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.get_screeners() + assert_matches_type(ScreenerGetScreenersResponse, screener, path=["response"]) + + @parametrize + async def test_raw_response_get_screeners(self, async_client: AsyncClearStreet) -> None: + response = await async_client.v1.screener.with_raw_response.get_screeners() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = await response.parse() + assert_matches_type(ScreenerGetScreenersResponse, screener, path=["response"]) + + @parametrize + async def test_streaming_response_get_screeners(self, async_client: AsyncClearStreet) -> None: + async with async_client.v1.screener.with_streaming_response.get_screeners() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = await response.parse() + assert_matches_type(ScreenerGetScreenersResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_replace_screener(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.replace_screener( + screener_id="550e8400-e29b-41d4-a716-446655440000", + ) + assert_matches_type(ScreenerReplaceScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_method_replace_screener_with_all_params(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.replace_screener( + screener_id="550e8400-e29b-41d4-a716-446655440000", + columns=[ + { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + } + ], + filters=[ + { + "left": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "op": { + "name": "GREATER_OR_EQUAL", + "args": ["LEFT_INCLUSIVE"], + }, + "right": [ + { + "value": 1000000000, + "variable": { + "name": "today", + "lookback": "ONE_DAY", + "modifier": { + "args": [30, "DAY"], + "name": "SUBTRACT", + }, + "period": "QUARTER", + }, + } + ], + } + ], + name="name", + sorts=[ + { + "field": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "direction": "DESC", + } + ], + ) + assert_matches_type(ScreenerReplaceScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_raw_response_replace_screener(self, async_client: AsyncClearStreet) -> None: + response = await async_client.v1.screener.with_raw_response.replace_screener( + screener_id="550e8400-e29b-41d4-a716-446655440000", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = await response.parse() + assert_matches_type(ScreenerReplaceScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_streaming_response_replace_screener(self, async_client: AsyncClearStreet) -> None: + async with async_client.v1.screener.with_streaming_response.replace_screener( + screener_id="550e8400-e29b-41d4-a716-446655440000", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = await response.parse() + assert_matches_type(ScreenerReplaceScreenerResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_replace_screener(self, async_client: AsyncClearStreet) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `screener_id` but received ''"): + await async_client.v1.screener.with_raw_response.replace_screener( + screener_id="", + ) + + @parametrize + async def test_method_search_screener(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.search_screener() + assert_matches_type(ScreenerSearchScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_method_search_screener_with_all_params(self, async_client: AsyncClearStreet) -> None: + screener = await async_client.v1.screener.search_screener( + columns=[ + { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + { + "name": "price", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + { + "name": "volume", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + ], + filters=[ + { + "left": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "op": { + "name": "GREATER_OR_EQUAL", + "args": ["LEFT_INCLUSIVE"], + }, + "right": [ + { + "value": 1000000000, + "variable": { + "name": "today", + "lookback": "ONE_DAY", + "modifier": { + "args": [30, "DAY"], + "name": "SUBTRACT", + }, + "period": "QUARTER", + }, + } + ], + } + ], + page_size=25, + page_token="U3RhaW5sZXNzIHJvY2tz", + sort_case_sensitive=True, + sorts=[ + { + "field": { + "name": "market_cap", + "lookback": "ONE_DAY", + "period": "QUARTER", + "value_type": "DECIMAL", + }, + "direction": "DESC", + } + ], + ) + assert_matches_type(ScreenerSearchScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_raw_response_search_screener(self, async_client: AsyncClearStreet) -> None: + response = await async_client.v1.screener.with_raw_response.search_screener() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + screener = await response.parse() + assert_matches_type(ScreenerSearchScreenerResponse, screener, path=["response"]) + + @parametrize + async def test_streaming_response_search_screener(self, async_client: AsyncClearStreet) -> None: + async with async_client.v1.screener.with_streaming_response.search_screener() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + screener = await response.parse() + assert_matches_type(ScreenerSearchScreenerResponse, screener, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/v1/test_watchlist.py b/tests/api_resources/v1/test_watchlist.py index c9cef2e..431d60a 100644 --- a/tests/api_resources/v1/test_watchlist.py +++ b/tests/api_resources/v1/test_watchlist.py @@ -24,7 +24,6 @@ class TestWatchlist: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add_watchlist_item(self, client: ClearStreet) -> None: watchlist = client.v1.watchlist.add_watchlist_item( @@ -33,7 +32,6 @@ def test_method_add_watchlist_item(self, client: ClearStreet) -> None: ) assert_matches_type(WatchlistAddWatchlistItemResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_add_watchlist_item(self, client: ClearStreet) -> None: response = client.v1.watchlist.with_raw_response.add_watchlist_item( @@ -46,7 +44,6 @@ def test_raw_response_add_watchlist_item(self, client: ClearStreet) -> None: watchlist = response.parse() assert_matches_type(WatchlistAddWatchlistItemResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_add_watchlist_item(self, client: ClearStreet) -> None: with client.v1.watchlist.with_streaming_response.add_watchlist_item( @@ -61,7 +58,6 @@ def test_streaming_response_add_watchlist_item(self, client: ClearStreet) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_add_watchlist_item(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `watchlist_id` but received ''"): @@ -70,7 +66,6 @@ def test_path_params_add_watchlist_item(self, client: ClearStreet) -> None: instrument_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_watchlist(self, client: ClearStreet) -> None: watchlist = client.v1.watchlist.create_watchlist( @@ -78,7 +73,6 @@ def test_method_create_watchlist(self, client: ClearStreet) -> None: ) assert_matches_type(WatchlistCreateWatchlistResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_watchlist(self, client: ClearStreet) -> None: response = client.v1.watchlist.with_raw_response.create_watchlist( @@ -90,7 +84,6 @@ def test_raw_response_create_watchlist(self, client: ClearStreet) -> None: watchlist = response.parse() assert_matches_type(WatchlistCreateWatchlistResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_watchlist(self, client: ClearStreet) -> None: with client.v1.watchlist.with_streaming_response.create_watchlist( @@ -104,7 +97,6 @@ def test_streaming_response_create_watchlist(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_watchlist(self, client: ClearStreet) -> None: watchlist = client.v1.watchlist.delete_watchlist( @@ -112,7 +104,6 @@ def test_method_delete_watchlist(self, client: ClearStreet) -> None: ) assert_matches_type(WatchlistDeleteWatchlistResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_watchlist(self, client: ClearStreet) -> None: response = client.v1.watchlist.with_raw_response.delete_watchlist( @@ -124,7 +115,6 @@ def test_raw_response_delete_watchlist(self, client: ClearStreet) -> None: watchlist = response.parse() assert_matches_type(WatchlistDeleteWatchlistResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_watchlist(self, client: ClearStreet) -> None: with client.v1.watchlist.with_streaming_response.delete_watchlist( @@ -138,7 +128,6 @@ def test_streaming_response_delete_watchlist(self, client: ClearStreet) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete_watchlist(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `watchlist_id` but received ''"): @@ -146,7 +135,6 @@ def test_path_params_delete_watchlist(self, client: ClearStreet) -> None: "", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_watchlist_item(self, client: ClearStreet) -> None: watchlist = client.v1.watchlist.delete_watchlist_item( @@ -155,7 +143,6 @@ def test_method_delete_watchlist_item(self, client: ClearStreet) -> None: ) assert_matches_type(WatchlistDeleteWatchlistItemResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_watchlist_item(self, client: ClearStreet) -> None: response = client.v1.watchlist.with_raw_response.delete_watchlist_item( @@ -168,7 +155,6 @@ def test_raw_response_delete_watchlist_item(self, client: ClearStreet) -> None: watchlist = response.parse() assert_matches_type(WatchlistDeleteWatchlistItemResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_watchlist_item(self, client: ClearStreet) -> None: with client.v1.watchlist.with_streaming_response.delete_watchlist_item( @@ -183,7 +169,6 @@ def test_streaming_response_delete_watchlist_item(self, client: ClearStreet) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete_watchlist_item(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `watchlist_id` but received ''"): @@ -198,7 +183,6 @@ def test_path_params_delete_watchlist_item(self, client: ClearStreet) -> None: watchlist_id="550e8400-e29b-41d4-a716-446655440000", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_watchlist_by_id(self, client: ClearStreet) -> None: watchlist = client.v1.watchlist.get_watchlist_by_id( @@ -206,7 +190,6 @@ def test_method_get_watchlist_by_id(self, client: ClearStreet) -> None: ) assert_matches_type(WatchlistGetWatchlistByIDResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_watchlist_by_id(self, client: ClearStreet) -> None: response = client.v1.watchlist.with_raw_response.get_watchlist_by_id( @@ -218,7 +201,6 @@ def test_raw_response_get_watchlist_by_id(self, client: ClearStreet) -> None: watchlist = response.parse() assert_matches_type(WatchlistGetWatchlistByIDResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_watchlist_by_id(self, client: ClearStreet) -> None: with client.v1.watchlist.with_streaming_response.get_watchlist_by_id( @@ -232,7 +214,6 @@ def test_streaming_response_get_watchlist_by_id(self, client: ClearStreet) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_get_watchlist_by_id(self, client: ClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `watchlist_id` but received ''"): @@ -240,13 +221,11 @@ def test_path_params_get_watchlist_by_id(self, client: ClearStreet) -> None: "", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_watchlists(self, client: ClearStreet) -> None: watchlist = client.v1.watchlist.get_watchlists() assert_matches_type(WatchlistGetWatchlistsResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_get_watchlists_with_all_params(self, client: ClearStreet) -> None: watchlist = client.v1.watchlist.get_watchlists( @@ -255,7 +234,6 @@ def test_method_get_watchlists_with_all_params(self, client: ClearStreet) -> Non ) assert_matches_type(WatchlistGetWatchlistsResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_get_watchlists(self, client: ClearStreet) -> None: response = client.v1.watchlist.with_raw_response.get_watchlists() @@ -265,7 +243,6 @@ def test_raw_response_get_watchlists(self, client: ClearStreet) -> None: watchlist = response.parse() assert_matches_type(WatchlistGetWatchlistsResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_get_watchlists(self, client: ClearStreet) -> None: with client.v1.watchlist.with_streaming_response.get_watchlists() as response: @@ -283,7 +260,6 @@ class TestAsyncWatchlist: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add_watchlist_item(self, async_client: AsyncClearStreet) -> None: watchlist = await async_client.v1.watchlist.add_watchlist_item( @@ -292,7 +268,6 @@ async def test_method_add_watchlist_item(self, async_client: AsyncClearStreet) - ) assert_matches_type(WatchlistAddWatchlistItemResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_add_watchlist_item(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.watchlist.with_raw_response.add_watchlist_item( @@ -305,7 +280,6 @@ async def test_raw_response_add_watchlist_item(self, async_client: AsyncClearStr watchlist = await response.parse() assert_matches_type(WatchlistAddWatchlistItemResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_add_watchlist_item(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.watchlist.with_streaming_response.add_watchlist_item( @@ -320,7 +294,6 @@ async def test_streaming_response_add_watchlist_item(self, async_client: AsyncCl assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_add_watchlist_item(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `watchlist_id` but received ''"): @@ -329,7 +302,6 @@ async def test_path_params_add_watchlist_item(self, async_client: AsyncClearStre instrument_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_watchlist(self, async_client: AsyncClearStreet) -> None: watchlist = await async_client.v1.watchlist.create_watchlist( @@ -337,7 +309,6 @@ async def test_method_create_watchlist(self, async_client: AsyncClearStreet) -> ) assert_matches_type(WatchlistCreateWatchlistResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_watchlist(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.watchlist.with_raw_response.create_watchlist( @@ -349,7 +320,6 @@ async def test_raw_response_create_watchlist(self, async_client: AsyncClearStree watchlist = await response.parse() assert_matches_type(WatchlistCreateWatchlistResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_watchlist(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.watchlist.with_streaming_response.create_watchlist( @@ -363,7 +333,6 @@ async def test_streaming_response_create_watchlist(self, async_client: AsyncClea assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_watchlist(self, async_client: AsyncClearStreet) -> None: watchlist = await async_client.v1.watchlist.delete_watchlist( @@ -371,7 +340,6 @@ async def test_method_delete_watchlist(self, async_client: AsyncClearStreet) -> ) assert_matches_type(WatchlistDeleteWatchlistResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_watchlist(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.watchlist.with_raw_response.delete_watchlist( @@ -383,7 +351,6 @@ async def test_raw_response_delete_watchlist(self, async_client: AsyncClearStree watchlist = await response.parse() assert_matches_type(WatchlistDeleteWatchlistResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_watchlist(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.watchlist.with_streaming_response.delete_watchlist( @@ -397,7 +364,6 @@ async def test_streaming_response_delete_watchlist(self, async_client: AsyncClea assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete_watchlist(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `watchlist_id` but received ''"): @@ -405,7 +371,6 @@ async def test_path_params_delete_watchlist(self, async_client: AsyncClearStreet "", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_watchlist_item(self, async_client: AsyncClearStreet) -> None: watchlist = await async_client.v1.watchlist.delete_watchlist_item( @@ -414,7 +379,6 @@ async def test_method_delete_watchlist_item(self, async_client: AsyncClearStreet ) assert_matches_type(WatchlistDeleteWatchlistItemResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_watchlist_item(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.watchlist.with_raw_response.delete_watchlist_item( @@ -427,7 +391,6 @@ async def test_raw_response_delete_watchlist_item(self, async_client: AsyncClear watchlist = await response.parse() assert_matches_type(WatchlistDeleteWatchlistItemResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_watchlist_item(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.watchlist.with_streaming_response.delete_watchlist_item( @@ -442,7 +405,6 @@ async def test_streaming_response_delete_watchlist_item(self, async_client: Asyn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete_watchlist_item(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `watchlist_id` but received ''"): @@ -457,7 +419,6 @@ async def test_path_params_delete_watchlist_item(self, async_client: AsyncClearS watchlist_id="550e8400-e29b-41d4-a716-446655440000", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_watchlist_by_id(self, async_client: AsyncClearStreet) -> None: watchlist = await async_client.v1.watchlist.get_watchlist_by_id( @@ -465,7 +426,6 @@ async def test_method_get_watchlist_by_id(self, async_client: AsyncClearStreet) ) assert_matches_type(WatchlistGetWatchlistByIDResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_watchlist_by_id(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.watchlist.with_raw_response.get_watchlist_by_id( @@ -477,7 +437,6 @@ async def test_raw_response_get_watchlist_by_id(self, async_client: AsyncClearSt watchlist = await response.parse() assert_matches_type(WatchlistGetWatchlistByIDResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_watchlist_by_id(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.watchlist.with_streaming_response.get_watchlist_by_id( @@ -491,7 +450,6 @@ async def test_streaming_response_get_watchlist_by_id(self, async_client: AsyncC assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_get_watchlist_by_id(self, async_client: AsyncClearStreet) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `watchlist_id` but received ''"): @@ -499,13 +457,11 @@ async def test_path_params_get_watchlist_by_id(self, async_client: AsyncClearStr "", ) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_watchlists(self, async_client: AsyncClearStreet) -> None: watchlist = await async_client.v1.watchlist.get_watchlists() assert_matches_type(WatchlistGetWatchlistsResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_get_watchlists_with_all_params(self, async_client: AsyncClearStreet) -> None: watchlist = await async_client.v1.watchlist.get_watchlists( @@ -514,7 +470,6 @@ async def test_method_get_watchlists_with_all_params(self, async_client: AsyncCl ) assert_matches_type(WatchlistGetWatchlistsResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_get_watchlists(self, async_client: AsyncClearStreet) -> None: response = await async_client.v1.watchlist.with_raw_response.get_watchlists() @@ -524,7 +479,6 @@ async def test_raw_response_get_watchlists(self, async_client: AsyncClearStreet) watchlist = await response.parse() assert_matches_type(WatchlistGetWatchlistsResponse, watchlist, path=["response"]) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_get_watchlists(self, async_client: AsyncClearStreet) -> None: async with async_client.v1.watchlist.with_streaming_response.get_watchlists() as response: diff --git a/tests/api_resources/v1/test_websocket.py b/tests/api_resources/v1/test_websocket.py deleted file mode 100644 index 8b2291f..0000000 --- a/tests/api_resources/v1/test_websocket.py +++ /dev/null @@ -1,78 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from clearstreet import ClearStreet, AsyncClearStreet - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestWebsocket: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - def test_method_websocket_handler(self, client: ClearStreet) -> None: - websocket = client.v1.websocket.websocket_handler() - assert websocket is None - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - def test_raw_response_websocket_handler(self, client: ClearStreet) -> None: - response = client.v1.websocket.with_raw_response.websocket_handler() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - websocket = response.parse() - assert websocket is None - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - def test_streaming_response_websocket_handler(self, client: ClearStreet) -> None: - with client.v1.websocket.with_streaming_response.websocket_handler() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - websocket = response.parse() - assert websocket is None - - assert cast(Any, response.is_closed) is True - - -class TestAsyncWebsocket: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - async def test_method_websocket_handler(self, async_client: AsyncClearStreet) -> None: - websocket = await async_client.v1.websocket.websocket_handler() - assert websocket is None - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - async def test_raw_response_websocket_handler(self, async_client: AsyncClearStreet) -> None: - response = await async_client.v1.websocket.with_raw_response.websocket_handler() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - websocket = await response.parse() - assert websocket is None - - @pytest.mark.skip(reason="Mock server tests are disabled") - @parametrize - async def test_streaming_response_websocket_handler(self, async_client: AsyncClearStreet) -> None: - async with async_client.v1.websocket.with_streaming_response.websocket_handler() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - websocket = await response.parse() - assert websocket is None - - assert cast(Any, response.is_closed) is True