From 0a675e3091aa0af846841ecc3196720db8c41aa8 Mon Sep 17 00:00:00 2001 From: Passiv Ops Date: Fri, 8 May 2026 20:15:30 +0000 Subject: [PATCH] Regenerate SDKs --- .konfig/generate-id.txt | 2 +- README.md | 6 +- lib/Api/AccountInformationApi.php | 21 ++- lib/Model/AccountPosition.php | 2 +- lib/Model/FutureInstrument.php | 2 +- lib/Model/Instrument.php | 263 +++++++++++++++--------------- lib/Model/OptionInstrument.php | 2 +- test/Model/InstrumentTest.php | 24 +-- 8 files changed, 168 insertions(+), 154 deletions(-) diff --git a/.konfig/generate-id.txt b/.konfig/generate-id.txt index b736935..7a12fa4 100644 --- a/.konfig/generate-id.txt +++ b/.konfig/generate-id.txt @@ -1 +1 @@ -5976471e-e701-47e8-b53a-270998bf9390 \ No newline at end of file +694e1c2e-aad4-4e08-962c-a6c5990458bc \ No newline at end of file diff --git a/README.md b/README.md index db6e295..6fa8863 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. -Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. +`mutualfund` positions may also include `cash_equivalent`. `stock` positions may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. @@ -676,8 +676,10 @@ Optional comma separated list of rate-of-return timeframes to return. Supported ### `snaptrade.accountInformation.getUserHoldings` +![Deprecated](https://img.shields.io/badge/deprecated-yellow) -Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ +**Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). +Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. diff --git a/lib/Api/AccountInformationApi.php b/lib/Api/AccountInformationApi.php index b9cc2dd..0d98708 100644 --- a/lib/Api/AccountInformationApi.php +++ b/lib/Api/AccountInformationApi.php @@ -1111,7 +1111,7 @@ public function getAccountBalanceHistoryRequest($user_id, $user_secret, $account * * List all account positions * - * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. + * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock` positions may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) @@ -1140,7 +1140,7 @@ public function getAllAccountPositions( * * List all account positions * - * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. + * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock` positions may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. * * @param string $user_id (required) * @param string $user_secret (required) @@ -1261,7 +1261,7 @@ public function getAllAccountPositionsWithHttpInfo($user_id, $user_secret, $acco * * List all account positions * - * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. + * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock` positions may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. * * @param string $user_id (required) * @param string $user_secret (required) @@ -1293,7 +1293,7 @@ function ($response) { * * List all account positions * - * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. Stock positions may also include `cash_equivalent`, and may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. + * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock` positions may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. * * @param string $user_id (required) * @param string $user_secret (required) @@ -5109,7 +5109,7 @@ public function getUserAccountReturnRatesRequest($user_id, $user_secret, $accoun * * List account holdings * - * Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. + * **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. * * @param string $account_id account_id (required) * @param string $user_id user_id (required) @@ -5119,6 +5119,7 @@ public function getUserAccountReturnRatesRequest($user_id, $user_secret, $accoun * @throws \SnapTrade\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \SnapTrade\Model\AccountHoldingsAccount|\SnapTrade\Model\Model400FailedRequestResponse|\SnapTrade\Model\Model403FailedRequestResponse|\SnapTrade\Model\Model425FailedRequestResponse + * @deprecated */ public function getUserHoldings( $account_id, @@ -5138,7 +5139,7 @@ public function getUserHoldings( * * List account holdings * - * Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. + * **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. * * @param string $account_id (required) * @param string $user_id (required) @@ -5148,6 +5149,7 @@ public function getUserHoldings( * @throws \SnapTrade\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \SnapTrade\Model\AccountHoldingsAccount|\SnapTrade\Model\Model400FailedRequestResponse|\SnapTrade\Model\Model403FailedRequestResponse|\SnapTrade\Model\Model425FailedRequestResponse, HTTP status code, HTTP response headers (array of strings) + * @deprecated */ public function getUserHoldingsWithHttpInfo($account_id, $user_id, $user_secret, string $contentType = self::contentTypes['getUserHoldings'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) { @@ -5328,7 +5330,7 @@ public function getUserHoldingsWithHttpInfo($account_id, $user_id, $user_secret, * * List account holdings * - * Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. + * **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. * * @param string $account_id (required) * @param string $user_id (required) @@ -5337,6 +5339,7 @@ public function getUserHoldingsWithHttpInfo($account_id, $user_id, $user_secret, * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ public function getUserHoldingsAsync( $account_id, @@ -5360,7 +5363,7 @@ function ($response) { * * List account holdings * - * Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. + * **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://support.snaptrade.com/brokerages-table?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection. * * @param string $account_id (required) * @param string $user_id (required) @@ -5369,6 +5372,7 @@ function ($response) { * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated */ public function getUserHoldingsAsyncWithHttpInfo($account_id, $user_id, $user_secret, string $contentType = self::contentTypes['getUserHoldings'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) { @@ -5424,6 +5428,7 @@ function ($exception) { * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request + * @deprecated */ public function getUserHoldingsRequest($account_id, $user_id, $user_secret, string $contentType = self::contentTypes['getUserHoldings'][0]) { diff --git a/lib/Model/AccountPosition.php b/lib/Model/AccountPosition.php index 39ace0e..54eafe1 100644 --- a/lib/Model/AccountPosition.php +++ b/lib/Model/AccountPosition.php @@ -514,7 +514,7 @@ public function getCashEquivalent() /** * Sets cash_equivalent * - * @param bool|null $cash_equivalent Present for stock positions that are also counted in cash balance or buying power. + * @param bool|null $cash_equivalent Present for mutual fund positions that are also counted in cash balance or buying power. * * @return self */ diff --git a/lib/Model/FutureInstrument.php b/lib/Model/FutureInstrument.php index 39e9838..9e7f644 100644 --- a/lib/Model/FutureInstrument.php +++ b/lib/Model/FutureInstrument.php @@ -389,7 +389,7 @@ public function getKind() /** * Sets kind * - * @param string $kind kind + * @param string $kind Type of security instrument. * * @return self */ diff --git a/lib/Model/Instrument.php b/lib/Model/Instrument.php index edcca94..3c78240 100644 --- a/lib/Model/Instrument.php +++ b/lib/Model/Instrument.php @@ -59,13 +59,13 @@ class Instrument implements ModelInterface, ArrayAccess, \JsonSerializable 'currency' => 'string', 'exchange' => 'string', 'figi_instrument' => '\SnapTrade\Model\StockInstrumentFigiInstrument', - 'root_symbol' => 'string', - 'expiration_code' => 'string', - 'expiration_date' => '\DateTime', - 'multiplier' => 'float', 'option_type' => 'string', 'strike_price' => 'float', - 'underlying' => '\SnapTrade\Model\UnderlyingOptionInstrument' + 'expiration_date' => '\DateTime', + 'underlying' => '\SnapTrade\Model\UnderlyingOptionInstrument', + 'root_symbol' => 'string', + 'expiration_code' => 'string', + 'multiplier' => 'float' ]; /** @@ -84,13 +84,13 @@ class Instrument implements ModelInterface, ArrayAccess, \JsonSerializable 'currency' => null, 'exchange' => null, 'figi_instrument' => null, - 'root_symbol' => null, - 'expiration_code' => null, - 'expiration_date' => 'date', - 'multiplier' => 'decimal', 'option_type' => null, 'strike_price' => 'decimal', - 'underlying' => null + 'expiration_date' => 'date', + 'underlying' => null, + 'root_symbol' => null, + 'expiration_code' => null, + 'multiplier' => 'decimal' ]; /** @@ -107,13 +107,13 @@ class Instrument implements ModelInterface, ArrayAccess, \JsonSerializable 'currency' => true, 'exchange' => true, 'figi_instrument' => true, - 'root_symbol' => false, - 'expiration_code' => false, - 'expiration_date' => false, - 'multiplier' => true, 'option_type' => false, 'strike_price' => false, - 'underlying' => false + 'expiration_date' => true, + 'underlying' => false, + 'root_symbol' => false, + 'expiration_code' => false, + 'multiplier' => true ]; /** @@ -210,13 +210,13 @@ public function isNullableSetToNull(string $property): bool 'currency' => 'currency', 'exchange' => 'exchange', 'figi_instrument' => 'figi_instrument', - 'root_symbol' => 'root_symbol', - 'expiration_code' => 'expiration_code', - 'expiration_date' => 'expiration_date', - 'multiplier' => 'multiplier', 'option_type' => 'option_type', 'strike_price' => 'strike_price', - 'underlying' => 'underlying' + 'expiration_date' => 'expiration_date', + 'underlying' => 'underlying', + 'root_symbol' => 'root_symbol', + 'expiration_code' => 'expiration_code', + 'multiplier' => 'multiplier' ]; /** @@ -233,13 +233,13 @@ public function isNullableSetToNull(string $property): bool 'currency' => 'setCurrency', 'exchange' => 'setExchange', 'figi_instrument' => 'setFigiInstrument', - 'root_symbol' => 'setRootSymbol', - 'expiration_code' => 'setExpirationCode', - 'expiration_date' => 'setExpirationDate', - 'multiplier' => 'setMultiplier', 'option_type' => 'setOptionType', 'strike_price' => 'setStrikePrice', - 'underlying' => 'setUnderlying' + 'expiration_date' => 'setExpirationDate', + 'underlying' => 'setUnderlying', + 'root_symbol' => 'setRootSymbol', + 'expiration_code' => 'setExpirationCode', + 'multiplier' => 'setMultiplier' ]; /** @@ -256,13 +256,13 @@ public function isNullableSetToNull(string $property): bool 'currency' => 'getCurrency', 'exchange' => 'getExchange', 'figi_instrument' => 'getFigiInstrument', - 'root_symbol' => 'getRootSymbol', - 'expiration_code' => 'getExpirationCode', - 'expiration_date' => 'getExpirationDate', - 'multiplier' => 'getMultiplier', 'option_type' => 'getOptionType', 'strike_price' => 'getStrikePrice', - 'underlying' => 'getUnderlying' + 'expiration_date' => 'getExpirationDate', + 'underlying' => 'getUnderlying', + 'root_symbol' => 'getRootSymbol', + 'expiration_code' => 'getExpirationCode', + 'multiplier' => 'getMultiplier' ]; /** @@ -306,7 +306,7 @@ public function getModelName() return self::$openAPIModelName; } - public const KIND_OPTION = 'option'; + public const KIND_OTHER = 'other'; public const OPTION_TYPE_CALL = 'CALL'; public const OPTION_TYPE_PUT = 'PUT'; @@ -318,7 +318,7 @@ public function getModelName() public function getKindAllowableValues() { return [ - self::KIND_OPTION, + self::KIND_OTHER, ]; } @@ -358,13 +358,13 @@ public function __construct(array $data = null) $this->setIfExists('currency', $data ?? [], null); $this->setIfExists('exchange', $data ?? [], null); $this->setIfExists('figi_instrument', $data ?? [], null); - $this->setIfExists('root_symbol', $data ?? [], null); - $this->setIfExists('expiration_code', $data ?? [], null); - $this->setIfExists('expiration_date', $data ?? [], null); - $this->setIfExists('multiplier', $data ?? [], null); $this->setIfExists('option_type', $data ?? [], null); $this->setIfExists('strike_price', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); $this->setIfExists('underlying', $data ?? [], null); + $this->setIfExists('root_symbol', $data ?? [], null); + $this->setIfExists('expiration_code', $data ?? [], null); + $this->setIfExists('multiplier', $data ?? [], null); // Initialize discriminator property with the model name. $this->container['kind'] = static::$openAPIModelName; @@ -418,15 +418,6 @@ public function listInvalidProperties() if ($this->container['raw_symbol'] === null) { $invalidProperties[] = "'raw_symbol' can't be null"; } - if ($this->container['root_symbol'] === null) { - $invalidProperties[] = "'root_symbol' can't be null"; - } - if ($this->container['expiration_code'] === null) { - $invalidProperties[] = "'expiration_code' can't be null"; - } - if ($this->container['expiration_date'] === null) { - $invalidProperties[] = "'expiration_date' can't be null"; - } if ($this->container['option_type'] === null) { $invalidProperties[] = "'option_type' can't be null"; } @@ -442,9 +433,18 @@ public function listInvalidProperties() if ($this->container['strike_price'] === null) { $invalidProperties[] = "'strike_price' can't be null"; } + if ($this->container['expiration_date'] === null) { + $invalidProperties[] = "'expiration_date' can't be null"; + } if ($this->container['underlying'] === null) { $invalidProperties[] = "'underlying' can't be null"; } + if ($this->container['root_symbol'] === null) { + $invalidProperties[] = "'root_symbol' can't be null"; + } + if ($this->container['expiration_code'] === null) { + $invalidProperties[] = "'expiration_code' can't be null"; + } return $invalidProperties; } @@ -473,7 +473,7 @@ public function getKind() /** * Sets kind * - * @param string $kind kind + * @param string $kind Type of security instrument. * * @return self */ @@ -512,7 +512,7 @@ public function getId() /** * Sets id * - * @param string $id Unique identifier for the option instrument. + * @param string $id Unique identifier for the instrument. * * @return self */ @@ -541,7 +541,7 @@ public function getSymbol() /** * Sets symbol * - * @param string $symbol OCC symbol for the option contract. + * @param string $symbol The formatted trading symbol for the security. * * @return self */ @@ -599,7 +599,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description Human-readable description of the option contract. + * @param string|null $description Human-readable description of the security. * * @return self */ @@ -635,7 +635,7 @@ public function getCurrency() /** * Sets currency * - * @param string|null $currency ISO-4217 currency code for the contract. + * @param string|null $currency ISO-4217 currency code for the security listing. * * @return self */ @@ -671,7 +671,7 @@ public function getExchange() /** * Sets exchange * - * @param string|null $exchange Exchange MIC code or exchange code for the contract. + * @param string|null $exchange Exchange MIC code or exchange code for the security. * * @return self */ @@ -731,59 +731,69 @@ public function setFigiInstrument($figi_instrument) } /** - * Gets root_symbol + * Gets option_type * * @return string */ - public function getRootSymbol() + public function getOptionType() { - return $this->container['root_symbol']; + return $this->container['option_type']; } /** - * Sets root_symbol + * Sets option_type * - * @param string $root_symbol Root symbol for the future contract. + * @param string $option_type Whether the contract is a call or put. * * @return self */ - public function setRootSymbol($root_symbol) + public function setOptionType($option_type) { + $allowedValues = $this->getOptionTypeAllowableValues(); + if (!in_array($option_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'option_type', must be one of '%s'", + $option_type, + implode("', '", $allowedValues) + ) + ); + } - if (is_null($root_symbol)) { - throw new \InvalidArgumentException('non-nullable root_symbol cannot be null'); + if (is_null($option_type)) { + throw new \InvalidArgumentException('non-nullable option_type cannot be null'); } - $this->container['root_symbol'] = $root_symbol; + $this->container['option_type'] = $option_type; return $this; } /** - * Gets expiration_code + * Gets strike_price * - * @return string + * @return float */ - public function getExpirationCode() + public function getStrikePrice() { - return $this->container['expiration_code']; + return $this->container['strike_price']; } /** - * Sets expiration_code + * Sets strike_price * - * @param string $expiration_code Exchange expiration code for the contract. + * @param float $strike_price Strike price for the option contract. * * @return self */ - public function setExpirationCode($expiration_code) + public function setStrikePrice($strike_price) { - if (is_null($expiration_code)) { - throw new \InvalidArgumentException('non-nullable expiration_code cannot be null'); + if (is_null($strike_price)) { + throw new \InvalidArgumentException('non-nullable strike_price cannot be null'); } - $this->container['expiration_code'] = $expiration_code; + $this->container['strike_price'] = $strike_price; return $this; } @@ -801,7 +811,7 @@ public function getExpirationDate() /** * Sets expiration_date * - * @param \DateTime $expiration_date Expiration date of the option contract. + * @param \DateTime $expiration_date Expiration date of the contract. * * @return self */ @@ -809,7 +819,14 @@ public function setExpirationDate($expiration_date) { if (is_null($expiration_date)) { - throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + array_push($this->openAPINullablesSetToNull, 'expiration_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expiration_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['expiration_date'] = $expiration_date; @@ -818,134 +835,124 @@ public function setExpirationDate($expiration_date) } /** - * Gets multiplier + * Gets underlying * - * @return float|null + * @return \SnapTrade\Model\UnderlyingOptionInstrument */ - public function getMultiplier() + public function getUnderlying() { - return $this->container['multiplier']; + return $this->container['underlying']; } /** - * Sets multiplier + * Sets underlying * - * @param float|null $multiplier Multiplier for the future contract. + * @param \SnapTrade\Model\UnderlyingOptionInstrument $underlying underlying * * @return self */ - public function setMultiplier($multiplier) + public function setUnderlying($underlying) { - if (is_null($multiplier)) { - array_push($this->openAPINullablesSetToNull, 'multiplier'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('multiplier', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } + if (is_null($underlying)) { + throw new \InvalidArgumentException('non-nullable underlying cannot be null'); } - $this->container['multiplier'] = $multiplier; + $this->container['underlying'] = $underlying; return $this; } /** - * Gets option_type + * Gets root_symbol * * @return string */ - public function getOptionType() + public function getRootSymbol() { - return $this->container['option_type']; + return $this->container['root_symbol']; } /** - * Sets option_type + * Sets root_symbol * - * @param string $option_type Whether the contract is a call or put. + * @param string $root_symbol Root symbol for the future contract. * * @return self */ - public function setOptionType($option_type) + public function setRootSymbol($root_symbol) { - $allowedValues = $this->getOptionTypeAllowableValues(); - if (!in_array($option_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'option_type', must be one of '%s'", - $option_type, - implode("', '", $allowedValues) - ) - ); - } - if (is_null($option_type)) { - throw new \InvalidArgumentException('non-nullable option_type cannot be null'); + if (is_null($root_symbol)) { + throw new \InvalidArgumentException('non-nullable root_symbol cannot be null'); } - $this->container['option_type'] = $option_type; + $this->container['root_symbol'] = $root_symbol; return $this; } /** - * Gets strike_price + * Gets expiration_code * - * @return float + * @return string */ - public function getStrikePrice() + public function getExpirationCode() { - return $this->container['strike_price']; + return $this->container['expiration_code']; } /** - * Sets strike_price + * Sets expiration_code * - * @param float $strike_price Strike price for the option contract. + * @param string $expiration_code Exchange expiration code for the contract. * * @return self */ - public function setStrikePrice($strike_price) + public function setExpirationCode($expiration_code) { - if (is_null($strike_price)) { - throw new \InvalidArgumentException('non-nullable strike_price cannot be null'); + if (is_null($expiration_code)) { + throw new \InvalidArgumentException('non-nullable expiration_code cannot be null'); } - $this->container['strike_price'] = $strike_price; + $this->container['expiration_code'] = $expiration_code; return $this; } /** - * Gets underlying + * Gets multiplier * - * @return \SnapTrade\Model\UnderlyingOptionInstrument + * @return float|null */ - public function getUnderlying() + public function getMultiplier() { - return $this->container['underlying']; + return $this->container['multiplier']; } /** - * Sets underlying + * Sets multiplier * - * @param \SnapTrade\Model\UnderlyingOptionInstrument $underlying underlying + * @param float|null $multiplier Multiplier for the future contract. * * @return self */ - public function setUnderlying($underlying) + public function setMultiplier($multiplier) { - if (is_null($underlying)) { - throw new \InvalidArgumentException('non-nullable underlying cannot be null'); + if (is_null($multiplier)) { + array_push($this->openAPINullablesSetToNull, 'multiplier'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('multiplier', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['underlying'] = $underlying; + $this->container['multiplier'] = $multiplier; return $this; } diff --git a/lib/Model/OptionInstrument.php b/lib/Model/OptionInstrument.php index 5b4613d..63ef2a2 100644 --- a/lib/Model/OptionInstrument.php +++ b/lib/Model/OptionInstrument.php @@ -412,7 +412,7 @@ public function getKind() /** * Sets kind * - * @param string $kind kind + * @param string $kind Type of security instrument. * * @return self */ diff --git a/test/Model/InstrumentTest.php b/test/Model/InstrumentTest.php index a615ecd..e67b206 100644 --- a/test/Model/InstrumentTest.php +++ b/test/Model/InstrumentTest.php @@ -145,18 +145,18 @@ public function testPropertyFigiInstrument() } /** - * Test attribute "root_symbol" + * Test attribute "option_type" */ - public function testPropertyRootSymbol() + public function testPropertyOptionType() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expiration_code" + * Test attribute "strike_price" */ - public function testPropertyExpirationCode() + public function testPropertyStrikePrice() { // TODO: implement $this->markTestIncomplete('Not implemented'); @@ -172,36 +172,36 @@ public function testPropertyExpirationDate() } /** - * Test attribute "multiplier" + * Test attribute "underlying" */ - public function testPropertyMultiplier() + public function testPropertyUnderlying() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "option_type" + * Test attribute "root_symbol" */ - public function testPropertyOptionType() + public function testPropertyRootSymbol() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "strike_price" + * Test attribute "expiration_code" */ - public function testPropertyStrikePrice() + public function testPropertyExpirationCode() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "underlying" + * Test attribute "multiplier" */ - public function testPropertyUnderlying() + public function testPropertyMultiplier() { // TODO: implement $this->markTestIncomplete('Not implemented');