diff --git a/.konfig/generate-id.txt b/.konfig/generate-id.txt index 0dfe1f1..9349d4d 100644 --- a/.konfig/generate-id.txt +++ b/.konfig/generate-id.txt @@ -1 +1 @@ -a0c1adb3-872f-4b04-9c66-72b150225d7f \ No newline at end of file +a4b90609-1bd0-4533-a1b6-c843c7d0a02d \ No newline at end of file diff --git a/README.md b/README.md index fb0a31d..ff730d5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Connect brokerage accounts to your app for live positions and trading -[![Packagist](https://img.shields.io/badge/Packagist-v2.0.32-blue)](https://packagist.org/packages/konfig/snaptrade-php-sdk) +[![Packagist](https://img.shields.io/badge/Packagist-v2.0.35-blue)](https://packagist.org/packages/konfig/snaptrade-php-sdk) [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/) @@ -86,7 +86,7 @@ To install the bindings via [Composer](https://getcomposer.org/), add the follow } ], "require": { - "konfig/snaptrade-php-sdk": "2.0.32" + "konfig/snaptrade-php-sdk": "2.0.35" } } ``` @@ -117,7 +117,7 @@ $snaptrade = new \SnapTrade\Client( $result = $snaptrade->accountInformation->getAllUserHoldings( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631" ); ``` @@ -139,7 +139,7 @@ account. ```php $result = $snaptrade->accountInformation->getAllUserHoldings( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631" ); ``` @@ -152,7 +152,7 @@ $result = $snaptrade->accountInformation->getAllUserHoldings( ##### brokerage_authorizations: `string` -Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). +Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations). #### πŸ”„ Return @@ -181,7 +181,7 @@ The data returned here is cached. How long the data is cached for varies by brok ```php $result = $snaptrade->accountInformation->getUserAccountBalance( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631" ); ``` @@ -221,7 +221,7 @@ The data returned here is always cached and refreshed once a day. **If you need ```php $result = $snaptrade->accountInformation->getUserAccountDetails( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631" ); ``` @@ -261,7 +261,7 @@ The data returned here is cached. How long the data is cached for varies by brok ```php $result = $snaptrade->accountInformation->getUserAccountOrders( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", state: "all", days: 30 @@ -311,7 +311,7 @@ The data returned here is cached. How long the data is cached for varies by brok ```php $result = $snaptrade->accountInformation->getUserAccountPositions( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631" ); ``` @@ -352,7 +352,7 @@ The data returned here is cached. How long the data is cached for varies by brok $result = $snaptrade->accountInformation->getUserHoldings( account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123" + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61" ); ``` @@ -391,7 +391,7 @@ The data returned here is always cached and refreshed once a day. **If you need ```php $result = $snaptrade->accountInformation->listUserAccounts( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123" + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61" ); ``` @@ -425,7 +425,7 @@ Updates various properties of a specified account. ```php $result = $snaptrade->accountInformation->updateUserAccount( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "accountId_example" ); ``` @@ -481,7 +481,7 @@ $result = $snaptrade->apiStatus->check(); ### `snaptrade.authentication.deleteSnapTradeUser` -Deletes a user you've registered over the SnapTrade API, and any data associated with them or their investment accounts. +Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a `USER_DELETED` webhook will be sent. #### πŸ› οΈ Usage @@ -512,7 +512,7 @@ $result = $snaptrade->authentication->deleteSnapTradeUser( ### `snaptrade.authentication.listSnapTradeUsers` -Returns a list of users you've registered over the SnapTrade API. +Returns a list of all registered user IDs. #### πŸ› οΈ Usage @@ -545,13 +545,13 @@ Logs in a SnapTrade user and returns an authenticated connection portal URL for ```php $result = $snaptrade->authentication->loginSnapTradeUser( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", broker: "ALPACA", immediate_redirect: True, custom_redirect: "https://snaptrade.com", reconnect: "8b5f262d-4bb9-365d-888a-202bd3b15fa1", connection_type: "read", - connection_portal_version: "v2" + connection_portal_version: "v3" ); ``` @@ -563,27 +563,27 @@ $result = $snaptrade->authentication->loginSnapTradeUser( ##### broker: `string` -Slug of the brokerage to connect the user to. See [this document](https://snaptrade.notion.site/SnapTrade-Brokerage-Integrations-f83946a714a84c3caf599f6a945f0ead) for a list of supported brokerages and their slugs. +Slug of the brokerage to connect the user to. See [the integrations page](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=3cfea70ef4254afc89704e47275a7a9a&pvs=4) for a list of supported brokerages and their slugs. ##### immediateRedirect: `bool` -When set to True, user will be redirected back to the partner's site instead of the connection portal +When set to `true`, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](https://docs.snaptrade.com/docs/implement-connection-portal) for more information. ##### customRedirect: `string` -URL to redirect the user to after the user connects their brokerage account +URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](https://docs.snaptrade.com/docs/implement-connection-portal) for more information. ##### reconnect: `string` -The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See β€˜Reconnecting Accounts’ for more information. +The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](https://docs.snaptrade.com/docs/fix-broken-connections) for more information. ##### connectionType: `string` -Sets whether the connection should be read or trade +Sets whether the connection should be read-only or trade-enabled. ##### connectionPortalVersion: `string` -Sets the version of the connection portal to render, with a default to 'v3' +Sets the version of the connection portal to render. #### πŸ”„ Return @@ -601,8 +601,8 @@ Sets the version of the connection portal to render, with a default to 'v3' ### `snaptrade.authentication.registerSnapTradeUser` -Registers a new SnapTrade user under your ClientID. A user secret will be automatically generated for you and must be properly stored in your database. -Most SnapTrade operations require a user ID and user secret to be passed as a parameter. +Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. +Most SnapTrade operations require a user ID and user secret to be passed in as parameters. @@ -636,8 +636,7 @@ SnapTrade User ID. This is chosen by the API partner and can be any string that ### `snaptrade.authentication.resetSnapTradeUserSecret` -This API is used to rotate the secret for a SnapTrade user. You might use this if a userSecret -is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. +Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. @@ -646,7 +645,7 @@ is compromised. Please note that if you call this endpoint and fail to save the ```php $result = $snaptrade->authentication->resetSnapTradeUserSecret( user_id: "snaptrade-user-123", - user_secret: "h81@cx1lkalablakwjaltkejraj11=" + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61" ); ``` @@ -658,7 +657,7 @@ SnapTrade User ID. This is chosen by the API partner and can be any string that ##### userSecret: `string` -SnapTrade User Secret randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the SnapTrade API. +SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret). #### πŸ”„ Return @@ -685,7 +684,7 @@ Returns a single brokerage authorization object for the specified ID. $result = $snaptrade->connections->detailBrokerageAuthorization( authorization_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123" + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61" ); ``` @@ -724,7 +723,7 @@ Manually disable a connection. This should only be used for testing a reconnect $result = $snaptrade->connections->disableBrokerageAuthorization( authorization_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123" + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61" ); ``` @@ -762,7 +761,7 @@ Returns a list of Brokerage Authorization objects for the user ```php $result = $snaptrade->connections->listBrokerageAuthorizations( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123" + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61" ); ``` @@ -797,7 +796,7 @@ Trigger a holdings update for all accounts under this authorization. Updates wil $result = $snaptrade->connections->refreshBrokerageAuthorization( authorization_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123" + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61" ); ``` @@ -836,7 +835,7 @@ Deletes a specified brokerage authorization given by the ID. $snaptrade->connections->removeBrokerageAuthorization( authorization_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123" + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61" ); ``` @@ -885,11 +884,11 @@ $result = $snaptrade->connections->sessionEvents( ##### user_id: `string` -Optional comma seperated list of user IDs used to filter the request on specific users +Optional comma separated list of user IDs used to filter the request on specific users ##### session_id: `string` -Optional comma seperated list of session IDs used to filter the request on specific users +Optional comma separated list of session IDs used to filter the request on specific users #### πŸ”„ Return @@ -925,7 +924,7 @@ $result = $snaptrade->options->getOptionStrategy( ], strategy_type: "CUSTOM", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "accountId_example" ); ``` @@ -970,7 +969,7 @@ Returns the option chain for the specified symbol in the specified account. ```php $result = $snaptrade->options->getOptionsChain( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "accountId_example", symbol: "symbol_example" ); @@ -1015,7 +1014,7 @@ Returns a Strategy Quotes object which has latest market data of the specified o ```php $result = $snaptrade->options->getOptionsStrategyQuote( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "accountId_example", option_strategy_id: "2bcd7cc3-e922-4976-bce1-9858296801c3" ); @@ -1062,7 +1061,7 @@ The data returned here is cached. How long the data is cached for varies by brok ```php $result = $snaptrade->options->listOptionHoldings( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631" ); ``` @@ -1101,7 +1100,7 @@ $result = $snaptrade->options->placeOptionStrategy( order_type: "Limit", time_in_force: "FOK", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", option_strategy_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", price: 31.33 @@ -1440,7 +1439,7 @@ provided search string, matching on ticker and name. ```php $result = $snaptrade->referenceData->symbolSearchUserAccount( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", substring: "apple" ); @@ -1484,7 +1483,7 @@ This will only work if the order has not yet been executed. ```php $result = $snaptrade->trading->cancelUserAccountOrder( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", brokerage_order_id: "2bcd7cc3-e922-4976-bce1-9858296801c3" ); @@ -1526,7 +1525,7 @@ Return the trade object and it's impact on the account for the specified order. ```php $result = $snaptrade->trading->getOrderImpact( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", action: "BUY", order_type: "Limit", @@ -1591,7 +1590,7 @@ Returns quote(s) from the brokerage for the specified symbol(s). ```php $result = $snaptrade->trading->getUserAccountQuotes( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", symbols: "symbols_example", account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", use_ticker: True @@ -1640,7 +1639,7 @@ Places a specified trade in the specified account. ```php $result = $snaptrade->trading->placeForceOrder( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", action: "BUY", order_type: "Limit", @@ -1708,7 +1707,7 @@ returns the status of the order from the brokerage. $result = $snaptrade->trading->placeOrder( trade_id: "tradeId_example", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", wait_to_confirm: True ); ``` @@ -1743,7 +1742,12 @@ Optional, defaults to true. Determines if a wait is performed to check on order ### `snaptrade.transactionsAndReporting.getActivities` -Returns activities (transactions) for a user. Specifying start and end date is highly recommended for better performance +Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. + +There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. + +The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + #### πŸ› οΈ Usage @@ -1751,12 +1755,12 @@ Returns activities (transactions) for a user. Specifying start and end date is h ```php $result = $snaptrade->transactionsAndReporting->getActivities( user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", start_date: "2022-01-24", end_date: "2022-01-24", accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", brokerage_authorizations: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", - type: "DIVIDEND" + type: "BUY,SELL,DIVIDEND" ); ``` @@ -1768,19 +1772,23 @@ $result = $snaptrade->transactionsAndReporting->getActivities( ##### start_date: `\DateTime` +The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`. + ##### end_date: `\DateTime` +The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`. + ##### accounts: `string` -Optional comma seperated list of account IDs used to filter the request on specific accounts +Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter. ##### brokerage_authorizations: `string` -Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations +Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter. ##### type: `string` -Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT +Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE #### πŸ”„ Return @@ -1809,7 +1817,7 @@ $result = $snaptrade->transactionsAndReporting->getReportingCustomRange( start_date: "2022-01-24", end_date: "2022-01-24", user_id: "snaptrade-user-123", - user_secret: "USERSECRET123", + user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", accounts: "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2", detailed: True, frequency: "monthly" @@ -1828,7 +1836,7 @@ $result = $snaptrade->transactionsAndReporting->getReportingCustomRange( ##### accounts: `string` -Optional comma seperated list of account IDs used to filter the request on specific accounts +Optional comma separated list of account IDs used to filter the request on specific accounts ##### detailed: `bool` diff --git a/lib/Api/AccountInformationApi.php b/lib/Api/AccountInformationApi.php index 38852f5..f947f22 100644 --- a/lib/Api/AccountInformationApi.php +++ b/lib/Api/AccountInformationApi.php @@ -161,9 +161,11 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * List all accounts for the user, plus balances, positions, and orders for each account. * + * **Deprecated, please use the account-specific holdings endpoint instead.** List all accounts for the user, plus balances, positions, and orders for each account. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) - * @param string $brokerage_authorizations Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) + * @param string $brokerage_authorizations Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllUserHoldings'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -189,9 +191,11 @@ public function getAllUserHoldings( * * List all accounts for the user, plus balances, positions, and orders for each account. * + * **Deprecated, please use the account-specific holdings endpoint instead.** List all accounts for the user, plus balances, positions, and orders for each account. + * * @param string $user_id (required) * @param string $user_secret (required) - * @param string $brokerage_authorizations Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) + * @param string $brokerage_authorizations Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllUserHoldings'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -355,9 +359,11 @@ public function getAllUserHoldingsWithHttpInfo($user_id, $user_secret, $brokerag * * List all accounts for the user, plus balances, positions, and orders for each account. * + * **Deprecated, please use the account-specific holdings endpoint instead.** List all accounts for the user, plus balances, positions, and orders for each account. + * * @param string $user_id (required) * @param string $user_secret (required) - * @param string $brokerage_authorizations Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) + * @param string $brokerage_authorizations Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllUserHoldings'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -386,9 +392,11 @@ function ($response) { * * List all accounts for the user, plus balances, positions, and orders for each account. * + * **Deprecated, please use the account-specific holdings endpoint instead.** List all accounts for the user, plus balances, positions, and orders for each account. + * * @param string $user_id (required) * @param string $user_secret (required) - * @param string $brokerage_authorizations Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) + * @param string $brokerage_authorizations Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllUserHoldings'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -444,7 +452,7 @@ function ($exception) { * * @param string $user_id (required) * @param string $user_secret (required) - * @param string $brokerage_authorizations Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) + * @param string $brokerage_authorizations Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllUserHoldings'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -603,6 +611,8 @@ public function getAllUserHoldingsRequest($user_id, $user_secret, $brokerage_aut * * List account balances * + * Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id account_id (required) @@ -630,6 +640,8 @@ public function getUserAccountBalance( * * List account balances * + * Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -749,6 +761,8 @@ public function getUserAccountBalanceWithHttpInfo($user_id, $user_secret, $accou * * List account balances * + * Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -779,6 +793,8 @@ function ($response) { * * List account balances * + * Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -997,6 +1013,8 @@ public function getUserAccountBalanceRequest($user_id, $user_secret, $account_id * * Get account detail * + * Returns account detail known to SnapTrade for the specified account. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id account_id (required) @@ -1024,6 +1042,8 @@ public function getUserAccountDetails( * * Get account detail * + * Returns account detail known to SnapTrade for the specified account. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1143,6 +1163,8 @@ public function getUserAccountDetailsWithHttpInfo($user_id, $user_secret, $accou * * Get account detail * + * Returns account detail known to SnapTrade for the specified account. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1173,6 +1195,8 @@ function ($response) { * * Get account detail * + * Returns account detail known to SnapTrade for the specified account. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1391,6 +1415,8 @@ public function getUserAccountDetailsRequest($user_id, $user_secret, $account_id * * List account recent orders * + * Returns a list of recent orders in the specified account. The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id account_id (required) @@ -1422,6 +1448,8 @@ public function getUserAccountOrders( * * List account recent orders * + * Returns a list of recent orders in the specified account. The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1568,6 +1596,8 @@ public function getUserAccountOrdersWithHttpInfo($user_id, $user_secret, $accoun * * List account recent orders * + * Returns a list of recent orders in the specified account. The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1602,6 +1632,8 @@ function ($response) { * * List account recent orders * + * Returns a list of recent orders in the specified account. The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1853,6 +1885,8 @@ public function getUserAccountOrdersRequest($user_id, $user_secret, $account_id, * * List account positions * + * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id account_id (required) @@ -1880,6 +1914,8 @@ public function getUserAccountPositions( * * List account positions * + * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1999,6 +2035,8 @@ public function getUserAccountPositionsWithHttpInfo($user_id, $user_secret, $acc * * List account positions * + * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -2029,6 +2067,8 @@ function ($response) { * * List account positions * + * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -2247,6 +2287,8 @@ public function getUserAccountPositionsRequest($user_id, $user_secret, $account_ * * 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.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $account_id account_id (required) * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) @@ -2274,6 +2316,8 @@ 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.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $account_id (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -2439,6 +2483,8 @@ 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.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $account_id (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -2469,6 +2515,8 @@ 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.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $account_id (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -2687,6 +2735,8 @@ public function getUserHoldingsRequest($account_id, $user_id, $user_secret, stri * * List accounts * + * Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUserAccounts'] to see the possible values for this operation @@ -2712,6 +2762,8 @@ public function listUserAccounts( * * List accounts * + * Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUserAccounts'] to see the possible values for this operation @@ -2829,6 +2881,8 @@ public function listUserAccountsWithHttpInfo($user_id, $user_secret, string $con * * List accounts * + * Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUserAccounts'] to see the possible values for this operation @@ -2857,6 +2911,8 @@ function ($response) { * * List accounts * + * Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listUserAccounts'] to see the possible values for this operation @@ -3055,6 +3111,8 @@ public function listUserAccountsRequest($user_id, $user_secret, string $contentT * * Update details of an investment account * + * Updates various properties of a specified account. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id The ID of the account to update. (required) @@ -3082,6 +3140,8 @@ public function updateUserAccount( * * Update details of an investment account * + * Updates various properties of a specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to update. (required) @@ -3201,6 +3261,8 @@ public function updateUserAccountWithHttpInfo($user_id, $user_secret, $account_i * * Update details of an investment account * + * Updates various properties of a specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to update. (required) @@ -3231,6 +3293,8 @@ function ($response) { * * Update details of an investment account * + * Updates various properties of a specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to update. (required) diff --git a/lib/Api/ApiStatusApi.php b/lib/Api/ApiStatusApi.php index f635aeb..85e85d3 100644 --- a/lib/Api/ApiStatusApi.php +++ b/lib/Api/ApiStatusApi.php @@ -140,6 +140,8 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * Get API Status * + * Check whether the API is operational and verify timestamps. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['check'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -162,6 +164,8 @@ public function check( * * Get API Status * + * Check whether the API is operational and verify timestamps. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['check'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -275,6 +279,8 @@ public function checkWithHttpInfo(string $contentType = self::contentTypes['chec * * Get API Status * + * Check whether the API is operational and verify timestamps. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['check'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -300,6 +306,8 @@ function ($response) { * * Get API Status * + * Check whether the API is operational and verify timestamps. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['check'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/lib/Api/AuthenticationApi.php b/lib/Api/AuthenticationApi.php index 176a1ad..2c3da29 100644 --- a/lib/Api/AuthenticationApi.php +++ b/lib/Api/AuthenticationApi.php @@ -150,7 +150,9 @@ private function setRequestBodyProperty(&$body, $property, $value) { /** * Operation deleteSnapTradeUser * - * Delete SnapTrade user + * Delete user + * + * Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a `USER_DELETED` webhook will be sent. * * @param string $user_id user_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSnapTradeUser'] to see the possible values for this operation @@ -173,7 +175,9 @@ public function deleteSnapTradeUser( /** * Operation deleteSnapTradeUserWithHttpInfo * - * Delete SnapTrade user + * Delete user + * + * Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a `USER_DELETED` webhook will be sent. * * @param string $user_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSnapTradeUser'] to see the possible values for this operation @@ -357,7 +361,9 @@ public function deleteSnapTradeUserWithHttpInfo($user_id, string $contentType = /** * Operation deleteSnapTradeUserAsync * - * Delete SnapTrade user + * Delete user + * + * Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a `USER_DELETED` webhook will be sent. * * @param string $user_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSnapTradeUser'] to see the possible values for this operation @@ -383,7 +389,9 @@ function ($response) { /** * Operation deleteSnapTradeUserAsyncWithHttpInfo * - * Delete SnapTrade user + * Delete user + * + * Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a `USER_DELETED` webhook will be sent. * * @param string $user_id (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteSnapTradeUser'] to see the possible values for this operation @@ -558,7 +566,9 @@ public function deleteSnapTradeUserRequest($user_id, string $contentType = self: /** * Operation listSnapTradeUsers * - * List SnapTrade users + * List all users + * + * Returns a list of all registered user IDs. * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSnapTradeUsers'] to see the possible values for this operation * @@ -580,7 +590,9 @@ public function listSnapTradeUsers( /** * Operation listSnapTradeUsersWithHttpInfo * - * List SnapTrade users + * List all users + * + * Returns a list of all registered user IDs. * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSnapTradeUsers'] to see the possible values for this operation * @@ -762,7 +774,9 @@ public function listSnapTradeUsersWithHttpInfo(string $contentType = self::conte /** * Operation listSnapTradeUsersAsync * - * List SnapTrade users + * List all users + * + * Returns a list of all registered user IDs. * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSnapTradeUsers'] to see the possible values for this operation * @@ -787,7 +801,9 @@ function ($response) { /** * Operation listSnapTradeUsersAsyncWithHttpInfo * - * List SnapTrade users + * List all users + * + * Returns a list of all registered user IDs. * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSnapTradeUsers'] to see the possible values for this operation * @@ -941,6 +957,8 @@ public function listSnapTradeUsersRequest(string $contentType = self::contentTyp * * Login user & generate connection link * + * Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param \SnapTrade\Model\SnapTradeLoginUserRequestBody $snap_trade_login_user_request_body snap_trade_login_user_request_body (optional) @@ -957,8 +975,8 @@ public function loginSnapTradeUser( $immediate_redirect = SENTINEL_VALUE, $custom_redirect = SENTINEL_VALUE, $reconnect = SENTINEL_VALUE, - $connection_type = SENTINEL_VALUE, - $connection_portal_version = SENTINEL_VALUE, + $connection_type = 'read', + $connection_portal_version = 'v3', string $contentType = self::contentTypes['loginSnapTradeUser'][0] ) @@ -981,6 +999,8 @@ public function loginSnapTradeUser( * * Login user & generate connection link * + * Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\SnapTradeLoginUserRequestBody $snap_trade_login_user_request_body (optional) @@ -1169,6 +1189,8 @@ public function loginSnapTradeUserWithHttpInfo($user_id, $user_secret, $snap_tra * * Login user & generate connection link * + * Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\SnapTradeLoginUserRequestBody $snap_trade_login_user_request_body (optional) @@ -1184,8 +1206,8 @@ public function loginSnapTradeUserAsync( $immediate_redirect = SENTINEL_VALUE, $custom_redirect = SENTINEL_VALUE, $reconnect = SENTINEL_VALUE, - $connection_type = SENTINEL_VALUE, - $connection_portal_version = SENTINEL_VALUE, + $connection_type = 'read', + $connection_portal_version = 'v3', string $contentType = self::contentTypes['loginSnapTradeUser'][0] ) @@ -1212,6 +1234,8 @@ function ($response) { * * Login user & generate connection link * + * Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\SnapTradeLoginUserRequestBody $snap_trade_login_user_request_body (optional) @@ -1425,7 +1449,9 @@ public function loginSnapTradeUserRequest($user_id, $user_secret, $snap_trade_lo /** * Operation registerSnapTradeUser * - * Create SnapTrade user + * Register user + * + * Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters. * * @param \SnapTrade\Model\SnapTradeRegisterUserRequestBody $snap_trade_register_user_request_body snap_trade_register_user_request_body (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['registerSnapTradeUser'] to see the possible values for this operation @@ -1451,7 +1477,9 @@ public function registerSnapTradeUser( /** * Operation registerSnapTradeUserWithHttpInfo * - * Create SnapTrade user + * Register user + * + * Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters. * * @param \SnapTrade\Model\SnapTradeRegisterUserRequestBody $snap_trade_register_user_request_body (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['registerSnapTradeUser'] to see the possible values for this operation @@ -1635,7 +1663,9 @@ public function registerSnapTradeUserWithHttpInfo($snap_trade_register_user_requ /** * Operation registerSnapTradeUserAsync * - * Create SnapTrade user + * Register user + * + * Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters. * * @param \SnapTrade\Model\SnapTradeRegisterUserRequestBody $snap_trade_register_user_request_body (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['registerSnapTradeUser'] to see the possible values for this operation @@ -1664,7 +1694,9 @@ function ($response) { /** * Operation registerSnapTradeUserAsyncWithHttpInfo * - * Create SnapTrade user + * Register user + * + * Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters. * * @param \SnapTrade\Model\SnapTradeRegisterUserRequestBody $snap_trade_register_user_request_body (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['registerSnapTradeUser'] to see the possible values for this operation @@ -1839,7 +1871,9 @@ public function registerSnapTradeUserRequest($snap_trade_register_user_request_b /** * Operation resetSnapTradeUserSecret * - * Obtain a new user secret for a user + * Rotate user secret + * + * Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. * * @param \SnapTrade\Model\UserIDandSecret $user_i_dand_secret user_i_dand_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resetSnapTradeUserSecret'] to see the possible values for this operation @@ -1867,7 +1901,9 @@ public function resetSnapTradeUserSecret( /** * Operation resetSnapTradeUserSecretWithHttpInfo * - * Obtain a new user secret for a user + * Rotate user secret + * + * Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. * * @param \SnapTrade\Model\UserIDandSecret $user_i_dand_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resetSnapTradeUserSecret'] to see the possible values for this operation @@ -2051,7 +2087,9 @@ public function resetSnapTradeUserSecretWithHttpInfo($user_i_dand_secret, string /** * Operation resetSnapTradeUserSecretAsync * - * Obtain a new user secret for a user + * Rotate user secret + * + * Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. * * @param \SnapTrade\Model\UserIDandSecret $user_i_dand_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resetSnapTradeUserSecret'] to see the possible values for this operation @@ -2082,7 +2120,9 @@ function ($response) { /** * Operation resetSnapTradeUserSecretAsyncWithHttpInfo * - * Obtain a new user secret for a user + * Rotate user secret + * + * Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you'll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect. * * @param \SnapTrade\Model\UserIDandSecret $user_i_dand_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resetSnapTradeUserSecret'] to see the possible values for this operation diff --git a/lib/Api/ConnectionsApi.php b/lib/Api/ConnectionsApi.php index 43f4cb3..b3d313d 100644 --- a/lib/Api/ConnectionsApi.php +++ b/lib/Api/ConnectionsApi.php @@ -155,6 +155,8 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * Get brokerage authorization details * + * Returns a single brokerage authorization object for the specified ID. + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) @@ -182,6 +184,8 @@ public function detailBrokerageAuthorization( * * Get brokerage authorization details * + * Returns a single brokerage authorization object for the specified ID. + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -301,6 +305,8 @@ public function detailBrokerageAuthorizationWithHttpInfo($authorization_id, $use * * Get brokerage authorization details * + * Returns a single brokerage authorization object for the specified ID. + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -331,6 +337,8 @@ function ($response) { * * Get brokerage authorization details * + * Returns a single brokerage authorization object for the specified ID. + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -549,6 +557,8 @@ public function detailBrokerageAuthorizationRequest($authorization_id, $user_id, * * Manually disable a connection for testing * + * Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) @@ -576,6 +586,8 @@ public function disableBrokerageAuthorization( * * Manually disable a connection for testing * + * Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -787,6 +799,8 @@ public function disableBrokerageAuthorizationWithHttpInfo($authorization_id, $us * * Manually disable a connection for testing * + * Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -817,6 +831,8 @@ function ($response) { * * Manually disable a connection for testing * + * Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default. + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -1035,6 +1051,8 @@ public function disableBrokerageAuthorizationRequest($authorization_id, $user_id * * List all brokerage authorizations for the User * + * Returns a list of Brokerage Authorization objects for the user + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrokerageAuthorizations'] to see the possible values for this operation @@ -1060,6 +1078,8 @@ public function listBrokerageAuthorizations( * * List all brokerage authorizations for the User * + * Returns a list of Brokerage Authorization objects for the user + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrokerageAuthorizations'] to see the possible values for this operation @@ -1177,6 +1197,8 @@ public function listBrokerageAuthorizationsWithHttpInfo($user_id, $user_secret, * * List all brokerage authorizations for the User * + * Returns a list of Brokerage Authorization objects for the user + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrokerageAuthorizations'] to see the possible values for this operation @@ -1205,6 +1227,8 @@ function ($response) { * * List all brokerage authorizations for the User * + * Returns a list of Brokerage Authorization objects for the user + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBrokerageAuthorizations'] to see the possible values for this operation @@ -1403,6 +1427,8 @@ public function listBrokerageAuthorizationsRequest($user_id, $user_secret, strin * * Refresh holdings for a connection * + * Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes. Please contact support for access as this endpoint is not enabled by default + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) @@ -1430,6 +1456,8 @@ public function refreshBrokerageAuthorization( * * Refresh holdings for a connection * + * Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes. Please contact support for access as this endpoint is not enabled by default + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -1641,6 +1669,8 @@ public function refreshBrokerageAuthorizationWithHttpInfo($authorization_id, $us * * Refresh holdings for a connection * + * Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes. Please contact support for access as this endpoint is not enabled by default + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -1671,6 +1701,8 @@ function ($response) { * * Refresh holdings for a connection * + * Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes. Please contact support for access as this endpoint is not enabled by default + * * @param string $authorization_id The ID of a brokerage authorization object. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -1889,6 +1921,8 @@ public function refreshBrokerageAuthorizationRequest($authorization_id, $user_id * * Delete brokerage authorization * + * Deletes a specified brokerage authorization given by the ID. + * * @param string $authorization_id The ID of the Authorization to delete. (required) * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) @@ -1915,6 +1949,8 @@ public function removeBrokerageAuthorization( * * Delete brokerage authorization * + * Deletes a specified brokerage authorization given by the ID. + * * @param string $authorization_id The ID of the Authorization to delete. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -1994,6 +2030,8 @@ public function removeBrokerageAuthorizationWithHttpInfo($authorization_id, $use * * Delete brokerage authorization * + * Deletes a specified brokerage authorization given by the ID. + * * @param string $authorization_id The ID of the Authorization to delete. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -2024,6 +2062,8 @@ function ($response) { * * Delete brokerage authorization * + * Deletes a specified brokerage authorization given by the ID. + * * @param string $authorization_id The ID of the Authorization to delete. (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -2229,9 +2269,11 @@ public function removeBrokerageAuthorizationRequest($authorization_id, $user_id, * * Get all session events for a user * + * Returns a list of session events associated with a user. + * * @param string $partner_client_id partner_client_id (required) - * @param string $user_id Optional comma seperated list of user IDs used to filter the request on specific users (optional) - * @param string $session_id Optional comma seperated list of session IDs used to filter the request on specific users (optional) + * @param string $user_id Optional comma separated list of user IDs used to filter the request on specific users (optional) + * @param string $session_id Optional comma separated list of session IDs used to filter the request on specific users (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sessionEvents'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -2256,9 +2298,11 @@ public function sessionEvents( * * Get all session events for a user * + * Returns a list of session events associated with a user. + * * @param string $partner_client_id (required) - * @param string $user_id Optional comma seperated list of user IDs used to filter the request on specific users (optional) - * @param string $session_id Optional comma seperated list of session IDs used to filter the request on specific users (optional) + * @param string $user_id Optional comma separated list of user IDs used to filter the request on specific users (optional) + * @param string $session_id Optional comma separated list of session IDs used to filter the request on specific users (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sessionEvents'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -2375,9 +2419,11 @@ public function sessionEventsWithHttpInfo($partner_client_id, $user_id = null, $ * * Get all session events for a user * + * Returns a list of session events associated with a user. + * * @param string $partner_client_id (required) - * @param string $user_id Optional comma seperated list of user IDs used to filter the request on specific users (optional) - * @param string $session_id Optional comma seperated list of session IDs used to filter the request on specific users (optional) + * @param string $user_id Optional comma separated list of user IDs used to filter the request on specific users (optional) + * @param string $session_id Optional comma separated list of session IDs used to filter the request on specific users (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sessionEvents'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2405,9 +2451,11 @@ function ($response) { * * Get all session events for a user * + * Returns a list of session events associated with a user. + * * @param string $partner_client_id (required) - * @param string $user_id Optional comma seperated list of user IDs used to filter the request on specific users (optional) - * @param string $session_id Optional comma seperated list of session IDs used to filter the request on specific users (optional) + * @param string $user_id Optional comma separated list of user IDs used to filter the request on specific users (optional) + * @param string $session_id Optional comma separated list of session IDs used to filter the request on specific users (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sessionEvents'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2461,8 +2509,8 @@ function ($exception) { * Create request for operation 'sessionEvents' * * @param string $partner_client_id (required) - * @param string $user_id Optional comma seperated list of user IDs used to filter the request on specific users (optional) - * @param string $session_id Optional comma seperated list of session IDs used to filter the request on specific users (optional) + * @param string $user_id Optional comma separated list of user IDs used to filter the request on specific users (optional) + * @param string $session_id Optional comma separated list of session IDs used to filter the request on specific users (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sessionEvents'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/lib/Api/OptionsApi.php b/lib/Api/OptionsApi.php index 4f2b154..039c278 100644 --- a/lib/Api/OptionsApi.php +++ b/lib/Api/OptionsApi.php @@ -152,6 +152,8 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * Create options strategy * + * Creates an option strategy object that will be used to place an option strategy order. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id The ID of the account to create the option strategy object in. (required) @@ -188,6 +190,8 @@ public function getOptionStrategy( * * Create options strategy * + * Creates an option strategy object that will be used to place an option strategy order. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to create the option strategy object in. (required) @@ -332,6 +336,8 @@ public function getOptionStrategyWithHttpInfo($user_id, $user_secret, $account_i * * Create options strategy * + * Creates an option strategy object that will be used to place an option strategy order. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to create the option strategy object in. (required) @@ -371,6 +377,8 @@ function ($response) { * * Create options strategy * + * Creates an option strategy object that will be used to place an option strategy order. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to create the option strategy object in. (required) @@ -612,6 +620,8 @@ public function getOptionStrategyRequest($user_id, $user_secret, $account_id, $o * * Get the options chain for a symbol * + * Returns the option chain for the specified symbol in the specified account. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id The ID of the account to get the options chain from. (required) @@ -641,6 +651,8 @@ public function getOptionsChain( * * Get the options chain for a symbol * + * Returns the option chain for the specified symbol in the specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to get the options chain from. (required) @@ -785,6 +797,8 @@ public function getOptionsChainWithHttpInfo($user_id, $user_secret, $account_id, * * Get the options chain for a symbol * + * Returns the option chain for the specified symbol in the specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to get the options chain from. (required) @@ -817,6 +831,8 @@ function ($response) { * * Get the options chain for a symbol * + * Returns the option chain for the specified symbol in the specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to get the options chain from. (required) @@ -1058,6 +1074,8 @@ public function getOptionsChainRequest($user_id, $user_secret, $account_id, $sym * * Get options strategy quotes * + * Returns a Strategy Quotes object which has latest market data of the specified option strategy. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id The ID of the account the strategy will be placed in. (required) @@ -1087,6 +1105,8 @@ public function getOptionsStrategyQuote( * * Get options strategy quotes * + * Returns a Strategy Quotes object which has latest market data of the specified option strategy. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account the strategy will be placed in. (required) @@ -1231,6 +1251,8 @@ public function getOptionsStrategyQuoteWithHttpInfo($user_id, $user_secret, $acc * * Get options strategy quotes * + * Returns a Strategy Quotes object which has latest market data of the specified option strategy. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account the strategy will be placed in. (required) @@ -1263,6 +1285,8 @@ function ($response) { * * Get options strategy quotes * + * Returns a Strategy Quotes object which has latest market data of the specified option strategy. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account the strategy will be placed in. (required) @@ -1501,6 +1525,8 @@ public function getOptionsStrategyQuoteRequest($user_id, $user_secret, $account_ * * List account option positions * + * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id account_id (required) @@ -1528,6 +1554,8 @@ public function listOptionHoldings( * * List account option positions * + * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1670,6 +1698,8 @@ public function listOptionHoldingsWithHttpInfo($user_id, $user_secret, $account_ * * List account option positions * + * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1700,6 +1730,8 @@ function ($response) { * * List account option positions * + * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) @@ -1918,6 +1950,8 @@ public function listOptionHoldingsRequest($user_id, $user_secret, $account_id, s * * Place an option strategy order * + * Places the option strategy order and returns the order record received from the brokerage. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id The ID of the account to execute the strategy in. (required) @@ -1956,6 +1990,8 @@ public function placeOptionStrategy( * * Place an option strategy order * + * Places the option strategy order and returns the order record received from the brokerage. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to execute the strategy in. (required) @@ -2102,6 +2138,8 @@ public function placeOptionStrategyWithHttpInfo($user_id, $user_secret, $account * * Place an option strategy order * + * Places the option strategy order and returns the order record received from the brokerage. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to execute the strategy in. (required) @@ -2143,6 +2181,8 @@ function ($response) { * * Place an option strategy order * + * Places the option strategy order and returns the order record received from the brokerage. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to execute the strategy in. (required) diff --git a/lib/Api/ReferenceDataApi.php b/lib/Api/ReferenceDataApi.php index bbebb48..5b1df6b 100644 --- a/lib/Api/ReferenceDataApi.php +++ b/lib/Api/ReferenceDataApi.php @@ -170,6 +170,8 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * Get exchange rate of a currency pair * + * Returns an Exchange Rate Pair object for the specified Currency Pair. + * * @param string $currency_pair A currency pair based on currency code for example, {CAD-USD} (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCurrencyExchangeRatePair'] to see the possible values for this operation * @@ -193,6 +195,8 @@ public function getCurrencyExchangeRatePair( * * Get exchange rate of a currency pair * + * Returns an Exchange Rate Pair object for the specified Currency Pair. + * * @param string $currency_pair A currency pair based on currency code for example, {CAD-USD} (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCurrencyExchangeRatePair'] to see the possible values for this operation * @@ -308,6 +312,8 @@ public function getCurrencyExchangeRatePairWithHttpInfo($currency_pair, string $ * * Get exchange rate of a currency pair * + * Returns an Exchange Rate Pair object for the specified Currency Pair. + * * @param string $currency_pair A currency pair based on currency code for example, {CAD-USD} (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCurrencyExchangeRatePair'] to see the possible values for this operation * @@ -334,6 +340,8 @@ function ($response) { * * Get exchange rate of a currency pair * + * Returns an Exchange Rate Pair object for the specified Currency Pair. + * * @param string $currency_pair A currency pair based on currency code for example, {CAD-USD} (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCurrencyExchangeRatePair'] to see the possible values for this operation * @@ -506,6 +514,8 @@ public function getCurrencyExchangeRatePairRequest($currency_pair, string $conte * * Get metadata related to Snaptrade partner * + * Returns useful data related to the specified ClientID, including allowed brokerages and data access. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPartnerInfo'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -528,6 +538,8 @@ public function getPartnerInfo( * * Get metadata related to Snaptrade partner * + * Returns useful data related to the specified ClientID, including allowed brokerages and data access. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPartnerInfo'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -710,6 +722,8 @@ public function getPartnerInfoWithHttpInfo(string $contentType = self::contentTy * * Get metadata related to Snaptrade partner * + * Returns useful data related to the specified ClientID, including allowed brokerages and data access. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPartnerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -735,6 +749,8 @@ function ($response) { * * Get metadata related to Snaptrade partner * + * Returns useful data related to the specified ClientID, including allowed brokerages and data access. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPartnerInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -887,6 +903,8 @@ public function getPartnerInfoRequest(string $contentType = self::contentTypes[' * * List of all security types * + * List security types available on SnapTrade. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSecurityTypes'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -909,6 +927,8 @@ public function getSecurityTypes( * * List of all security types * + * List security types available on SnapTrade. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSecurityTypes'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -1022,6 +1042,8 @@ public function getSecurityTypesWithHttpInfo(string $contentType = self::content * * List of all security types * + * List security types available on SnapTrade. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSecurityTypes'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1047,6 +1069,8 @@ function ($response) { * * List of all security types * + * List security types available on SnapTrade. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSecurityTypes'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1199,6 +1223,8 @@ public function getSecurityTypesRequest(string $contentType = self::contentTypes * * Get exchanges * + * Returns a list of all supported Exchanges. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStockExchanges'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -1221,6 +1247,8 @@ public function getStockExchanges( * * Get exchanges * + * Returns a list of all supported Exchanges. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStockExchanges'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -1334,6 +1362,8 @@ public function getStockExchangesWithHttpInfo(string $contentType = self::conten * * Get exchanges * + * Returns a list of all supported Exchanges. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStockExchanges'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1359,6 +1389,8 @@ function ($response) { * * Get exchanges * + * Returns a list of all supported Exchanges. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStockExchanges'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1511,6 +1543,8 @@ public function getStockExchangesRequest(string $contentType = self::contentType * * Search for symbols * + * Returns a list of Universal Symbol objects that match a defined string. Matches on ticker or name. + * * @param \SnapTrade\Model\SymbolQuery $symbol_query symbol_query (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSymbols'] to see the possible values for this operation * @@ -1537,6 +1571,8 @@ public function getSymbols( * * Search for symbols * + * Returns a list of Universal Symbol objects that match a defined string. Matches on ticker or name. + * * @param \SnapTrade\Model\SymbolQuery $symbol_query (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSymbols'] to see the possible values for this operation * @@ -1652,6 +1688,8 @@ public function getSymbolsWithHttpInfo($symbol_query = null, string $contentType * * Search for symbols * + * Returns a list of Universal Symbol objects that match a defined string. Matches on ticker or name. + * * @param \SnapTrade\Model\SymbolQuery $symbol_query (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSymbols'] to see the possible values for this operation * @@ -1681,6 +1719,8 @@ function ($response) { * * Search for symbols * + * Returns a list of Universal Symbol objects that match a defined string. Matches on ticker or name. + * * @param \SnapTrade\Model\SymbolQuery $symbol_query (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSymbols'] to see the possible values for this operation * @@ -1850,6 +1890,8 @@ public function getSymbolsRequest($symbol_query = SENTINEL_VALUE, string $conten * * Get details of a symbol * + * Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. + * * @param string $query The ticker or universal_symbol_id of the UniversalSymbol to get. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSymbolsByTicker'] to see the possible values for this operation * @@ -1873,6 +1915,8 @@ public function getSymbolsByTicker( * * Get details of a symbol * + * Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. + * * @param string $query The ticker or universal_symbol_id of the UniversalSymbol to get. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSymbolsByTicker'] to see the possible values for this operation * @@ -1988,6 +2032,8 @@ public function getSymbolsByTickerWithHttpInfo($query, string $contentType = sel * * Get details of a symbol * + * Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. + * * @param string $query The ticker or universal_symbol_id of the UniversalSymbol to get. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSymbolsByTicker'] to see the possible values for this operation * @@ -2014,6 +2060,8 @@ function ($response) { * * Get details of a symbol * + * Returns the Universal Symbol object specified by the ticker or the universal_symbol_id. + * * @param string $query The ticker or universal_symbol_id of the UniversalSymbol to get. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSymbolsByTicker'] to see the possible values for this operation * @@ -2186,6 +2234,8 @@ public function getSymbolsByTickerRequest($query, string $contentType = self::co * * Get all brokerage authorization types * + * Returns a list of all defined Brokerage authorization Type objects. + * * @param string $brokerage Comma separated value of brokerage slugs (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllBrokerageAuthorizationType'] to see the possible values for this operation * @@ -2209,6 +2259,8 @@ public function listAllBrokerageAuthorizationType( * * Get all brokerage authorization types * + * Returns a list of all defined Brokerage authorization Type objects. + * * @param string $brokerage Comma separated value of brokerage slugs (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllBrokerageAuthorizationType'] to see the possible values for this operation * @@ -2324,6 +2376,8 @@ public function listAllBrokerageAuthorizationTypeWithHttpInfo($brokerage = null, * * Get all brokerage authorization types * + * Returns a list of all defined Brokerage authorization Type objects. + * * @param string $brokerage Comma separated value of brokerage slugs (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllBrokerageAuthorizationType'] to see the possible values for this operation * @@ -2350,6 +2404,8 @@ function ($response) { * * Get all brokerage authorization types * + * Returns a list of all defined Brokerage authorization Type objects. + * * @param string $brokerage Comma separated value of brokerage slugs (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllBrokerageAuthorizationType'] to see the possible values for this operation * @@ -2519,6 +2575,8 @@ public function listAllBrokerageAuthorizationTypeRequest($brokerage = SENTINEL_V * * Get brokerages * + * Returns a list of all defined Brokerage objects. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllBrokerages'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -2541,6 +2599,8 @@ public function listAllBrokerages( * * Get brokerages * + * Returns a list of all defined Brokerage objects. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllBrokerages'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -2654,6 +2714,8 @@ public function listAllBrokeragesWithHttpInfo(string $contentType = self::conten * * Get brokerages * + * Returns a list of all defined Brokerage objects. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllBrokerages'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2679,6 +2741,8 @@ function ($response) { * * Get brokerages * + * Returns a list of all defined Brokerage objects. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllBrokerages'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2831,6 +2895,8 @@ public function listAllBrokeragesRequest(string $contentType = self::contentType * * Get currencies * + * Returns a list of all defined Currency objects. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllCurrencies'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -2853,6 +2919,8 @@ public function listAllCurrencies( * * Get currencies * + * Returns a list of all defined Currency objects. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllCurrencies'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -2966,6 +3034,8 @@ public function listAllCurrenciesWithHttpInfo(string $contentType = self::conten * * Get currencies * + * Returns a list of all defined Currency objects. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllCurrencies'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2991,6 +3061,8 @@ function ($response) { * * Get currencies * + * Returns a list of all defined Currency objects. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllCurrencies'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3143,6 +3215,8 @@ public function listAllCurrenciesRequest(string $contentType = self::contentType * * Get currency exchange rates * + * Returns a list of all Exchange Rate Pairs for all supported Currencies. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllCurrenciesRates'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -3165,6 +3239,8 @@ public function listAllCurrenciesRates( * * Get currency exchange rates * + * Returns a list of all Exchange Rate Pairs for all supported Currencies. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllCurrenciesRates'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -3278,6 +3354,8 @@ public function listAllCurrenciesRatesWithHttpInfo(string $contentType = self::c * * Get currency exchange rates * + * Returns a list of all Exchange Rate Pairs for all supported Currencies. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllCurrenciesRates'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3303,6 +3381,8 @@ function ($response) { * * Get currency exchange rates * + * Returns a list of all Exchange Rate Pairs for all supported Currencies. + * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listAllCurrenciesRates'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -3455,6 +3535,8 @@ public function listAllCurrenciesRatesRequest(string $contentType = self::conten * * Search for symbols available in an account * + * Returns a list of universal symbols that are supported by the specificied account. Returned symbols are based on the provided search string, matching on ticker and name. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id The ID of the account to search for symbols within. (required) @@ -3487,6 +3569,8 @@ public function symbolSearchUserAccount( * * Search for symbols available in an account * + * Returns a list of universal symbols that are supported by the specificied account. Returned symbols are based on the provided search string, matching on ticker and name. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to search for symbols within. (required) @@ -3608,6 +3692,8 @@ public function symbolSearchUserAccountWithHttpInfo($user_id, $user_secret, $acc * * Search for symbols available in an account * + * Returns a list of universal symbols that are supported by the specificied account. Returned symbols are based on the provided search string, matching on ticker and name. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to search for symbols within. (required) @@ -3643,6 +3729,8 @@ function ($response) { * * Search for symbols available in an account * + * Returns a list of universal symbols that are supported by the specificied account. Returned symbols are based on the provided search string, matching on ticker and name. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to search for symbols within. (required) diff --git a/lib/Api/TradingApi.php b/lib/Api/TradingApi.php index 2e1a4ac..98fdfe2 100644 --- a/lib/Api/TradingApi.php +++ b/lib/Api/TradingApi.php @@ -152,6 +152,8 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * Cancel open order in account * + * Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id The ID of the account to cancel the order in. (required) @@ -184,6 +186,8 @@ public function cancelUserAccountOrder( * * Cancel open order in account * + * Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to cancel the order in. (required) @@ -351,6 +355,8 @@ public function cancelUserAccountOrderWithHttpInfo($user_id, $user_secret, $acco * * Cancel open order in account * + * Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to cancel the order in. (required) @@ -386,6 +392,8 @@ function ($response) { * * Cancel open order in account * + * Sends a signal to the brokerage to cancel the specified order. This will only work if the order has not yet been executed. + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id The ID of the account to cancel the order in. (required) @@ -627,6 +635,8 @@ public function cancelUserAccountOrderRequest($user_id, $user_secret, $account_i * * Check the impact of a trade on an account * + * Return the trade object and it's impact on the account for the specified order. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param \SnapTrade\Model\ManualTradeForm $manual_trade_form manual_trade_form (required) @@ -673,6 +683,8 @@ public function getOrderImpact( * * Check the impact of a trade on an account * + * Return the trade object and it's impact on the account for the specified order. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\ManualTradeForm $manual_trade_form (required) @@ -838,6 +850,8 @@ public function getOrderImpactWithHttpInfo($user_id, $user_secret, $manual_trade * * Check the impact of a trade on an account * + * Return the trade object and it's impact on the account for the specified order. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\ManualTradeForm $manual_trade_form (required) @@ -887,6 +901,8 @@ function ($response) { * * Check the impact of a trade on an account * + * Return the trade object and it's impact on the account for the specified order. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\ManualTradeForm $manual_trade_form (required) @@ -1108,6 +1124,8 @@ public function getOrderImpactRequest($user_id, $user_secret, $manual_trade_form * * Get symbol quotes * + * Returns quote(s) from the brokerage for the specified symbol(s). + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $symbols List of universal_symbol_id or tickers to get quotes for. (required) @@ -1139,6 +1157,8 @@ public function getUserAccountQuotes( * * Get symbol quotes * + * Returns quote(s) from the brokerage for the specified symbol(s). + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $symbols List of universal_symbol_id or tickers to get quotes for. (required) @@ -1285,6 +1305,8 @@ public function getUserAccountQuotesWithHttpInfo($user_id, $user_secret, $symbol * * Get symbol quotes * + * Returns quote(s) from the brokerage for the specified symbol(s). + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $symbols List of universal_symbol_id or tickers to get quotes for. (required) @@ -1319,6 +1341,8 @@ function ($response) { * * Get symbol quotes * + * Returns quote(s) from the brokerage for the specified symbol(s). + * * @param string $user_id (required) * @param string $user_secret (required) * @param string $symbols List of universal_symbol_id or tickers to get quotes for. (required) @@ -1573,6 +1597,8 @@ public function getUserAccountQuotesRequest($user_id, $user_secret, $symbols, $a * * Place a trade with NO validation. * + * Places a specified trade in the specified account. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param \SnapTrade\Model\ManualTradeForm $manual_trade_form manual_trade_form (required) @@ -1619,6 +1645,8 @@ public function placeForceOrder( * * Place a trade with NO validation. * + * Places a specified trade in the specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\ManualTradeForm $manual_trade_form (required) @@ -1784,6 +1812,8 @@ public function placeForceOrderWithHttpInfo($user_id, $user_secret, $manual_trad * * Place a trade with NO validation. * + * Places a specified trade in the specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\ManualTradeForm $manual_trade_form (required) @@ -1833,6 +1863,8 @@ function ($response) { * * Place a trade with NO validation. * + * Places a specified trade in the specified account. + * * @param string $user_id (required) * @param string $user_secret (required) * @param \SnapTrade\Model\ManualTradeForm $manual_trade_form (required) @@ -2054,6 +2086,8 @@ public function placeForceOrderRequest($user_id, $user_secret, $manual_trade_for * * Place order * + * Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage. + * * @param string $trade_id The ID of trade object obtained from trade/impact endpoint (required) * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) @@ -2086,6 +2120,8 @@ public function placeOrder( * * Place order * + * Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage. + * * @param string $trade_id The ID of trade object obtained from trade/impact endpoint (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -2230,6 +2266,8 @@ public function placeOrderWithHttpInfo($trade_id, $user_id, $user_secret, $valid * * Place order * + * Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage. + * * @param string $trade_id The ID of trade object obtained from trade/impact endpoint (required) * @param string $user_id (required) * @param string $user_secret (required) @@ -2265,6 +2303,8 @@ function ($response) { * * Place order * + * Places the specified trade object. This places the order in the account and returns the status of the order from the brokerage. + * * @param string $trade_id The ID of trade object obtained from trade/impact endpoint (required) * @param string $user_id (required) * @param string $user_secret (required) diff --git a/lib/Api/TransactionsAndReportingApi.php b/lib/Api/TransactionsAndReportingApi.php index d81c657..4b1e00c 100644 --- a/lib/Api/TransactionsAndReportingApi.php +++ b/lib/Api/TransactionsAndReportingApi.php @@ -143,13 +143,15 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * Get transaction history for a user * + * Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) - * @param \DateTime $start_date start_date (optional) - * @param \DateTime $end_date end_date (optional) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) - * @param string $brokerage_authorizations Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations (optional) - * @param string $type Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT (optional) + * @param \DateTime $start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`. (optional) + * @param \DateTime $end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`. (optional) + * @param string $accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter. (optional) + * @param string $brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter. (optional) + * @param string $type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActivities'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -178,13 +180,15 @@ public function getActivities( * * Get transaction history for a user * + * Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) - * @param \DateTime $start_date (optional) - * @param \DateTime $end_date (optional) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) - * @param string $brokerage_authorizations Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations (optional) - * @param string $type Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT (optional) + * @param \DateTime $start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`. (optional) + * @param \DateTime $end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`. (optional) + * @param string $accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter. (optional) + * @param string $brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter. (optional) + * @param string $type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActivities'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -305,13 +309,15 @@ public function getActivitiesWithHttpInfo($user_id, $user_secret, $start_date = * * Get transaction history for a user * + * Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) - * @param \DateTime $start_date (optional) - * @param \DateTime $end_date (optional) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) - * @param string $brokerage_authorizations Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations (optional) - * @param string $type Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT (optional) + * @param \DateTime $start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`. (optional) + * @param \DateTime $end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`. (optional) + * @param string $accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter. (optional) + * @param string $brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter. (optional) + * @param string $type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActivities'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -343,13 +349,15 @@ function ($response) { * * Get transaction history for a user * + * Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**. + * * @param string $user_id (required) * @param string $user_secret (required) - * @param \DateTime $start_date (optional) - * @param \DateTime $end_date (optional) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) - * @param string $brokerage_authorizations Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations (optional) - * @param string $type Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT (optional) + * @param \DateTime $start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`. (optional) + * @param \DateTime $end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`. (optional) + * @param string $accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter. (optional) + * @param string $brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter. (optional) + * @param string $type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActivities'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -404,11 +412,11 @@ function ($exception) { * * @param string $user_id (required) * @param string $user_secret (required) - * @param \DateTime $start_date (optional) - * @param \DateTime $end_date (optional) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) - * @param string $brokerage_authorizations Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations (optional) - * @param string $type Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT (optional) + * @param \DateTime $start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`. (optional) + * @param \DateTime $end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`. (optional) + * @param string $accounts Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The `brokerageAuthorizations` parameter takes precedence over this parameter. (optional) + * @param string $brokerage_authorizations Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the `accounts` parameter. (optional) + * @param string $type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActivities'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -618,11 +626,13 @@ public function getActivitiesRequest($user_id, $user_secret, $start_date = SENTI * * Get performance information for a specific timeframe * + * Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies. + * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) + * @param string $accounts Optional comma separated list of account IDs used to filter the request on specific accounts (optional) * @param bool $detailed Optional, increases frequency of data points for the total value and contribution charts if set to true (optional) * @param string $frequency Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportingCustomRange'] to see the possible values for this operation @@ -654,11 +664,13 @@ public function getReportingCustomRange( * * Get performance information for a specific timeframe * + * Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies. + * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) * @param string $user_id (required) * @param string $user_secret (required) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) + * @param string $accounts Optional comma separated list of account IDs used to filter the request on specific accounts (optional) * @param bool $detailed Optional, increases frequency of data points for the total value and contribution charts if set to true (optional) * @param string $frequency Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportingCustomRange'] to see the possible values for this operation @@ -782,11 +794,13 @@ public function getReportingCustomRangeWithHttpInfo($start_date, $end_date, $use * * Get performance information for a specific timeframe * + * Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies. + * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) * @param string $user_id (required) * @param string $user_secret (required) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) + * @param string $accounts Optional comma separated list of account IDs used to filter the request on specific accounts (optional) * @param bool $detailed Optional, increases frequency of data points for the total value and contribution charts if set to true (optional) * @param string $frequency Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportingCustomRange'] to see the possible values for this operation @@ -821,11 +835,13 @@ function ($response) { * * Get performance information for a specific timeframe * + * Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies. + * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) * @param string $user_id (required) * @param string $user_secret (required) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) + * @param string $accounts Optional comma separated list of account IDs used to filter the request on specific accounts (optional) * @param bool $detailed Optional, increases frequency of data points for the total value and contribution charts if set to true (optional) * @param string $frequency Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportingCustomRange'] to see the possible values for this operation @@ -885,7 +901,7 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $user_id (required) * @param string $user_secret (required) - * @param string $accounts Optional comma seperated list of account IDs used to filter the request on specific accounts (optional) + * @param string $accounts Optional comma separated list of account IDs used to filter the request on specific accounts (optional) * @param bool $detailed Optional, increases frequency of data points for the total value and contribution charts if set to true (optional) * @param string $frequency Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getReportingCustomRange'] to see the possible values for this operation diff --git a/lib/Configuration.php b/lib/Configuration.php index 3b0a423..d0b5c20 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -97,7 +97,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Konfig/2.0.32/PHP'; + protected $userAgent = 'Konfig/2.0.35/PHP'; /** * Debug switch (default set to false) @@ -487,7 +487,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 1.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 2.0.32' . PHP_EOL; + $report .= ' SDK Package Version: 2.0.35' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/Account.php b/lib/Model/Account.php index 4676599..2729c4e 100644 --- a/lib/Model/Account.php +++ b/lib/Model/Account.php @@ -30,7 +30,7 @@ * Account Class Doc Comment * * @category Class - * @description A single brokerage account at a financial institution. + * @description A single account at a brokerage. * @package SnapTrade * @implements \ArrayAccess */ @@ -366,7 +366,7 @@ public function getId() /** * Sets id * - * @param string|null $id Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade. This ID should not change for as long as the connection stays active. If the connection is deleted and re-added, a new account ID will be generated. If you want a stable identifier for the account, use the `number` field. + * @param string|null $id Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade. This ID should not change for as long as the connection stays active. If the connection is deleted and re-added, a new account ID will be generated. * * @return self */ @@ -455,7 +455,7 @@ public function getName() /** * Sets name * - * @param string|null $name A display name for the account. Either assigned by the user or by the financial institution itself. For certain institutions, SnapTrade appends the institution name to the account name for clarity. + * @param string|null $name A display name for the account. Either assigned by the user or by the brokerage itself. For certain brokerages, SnapTrade appends the brokerage name to the account name for clarity. * * @return self */ @@ -491,7 +491,7 @@ public function getNumber() /** * Sets number * - * @param string|null $number The account number assigned by the financial institution. + * @param string|null $number The account number assigned by the brokerage. For some brokerages, this field may be masked for security reasons. * * @return self */ @@ -520,7 +520,7 @@ public function getInstitutionName() /** * Sets institution_name * - * @param string|null $institution_name The name of the financial institution that holds the account. + * @param string|null $institution_name The name of the brokerage that holds the account. * * @return self */ @@ -549,7 +549,7 @@ public function getCreatedDate() /** * Sets created_date * - * @param \DateTime|null $created_date Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was created in SnapTrade. This is _not_ the account opening date at the financial institution. + * @param \DateTime|null $created_date Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was created in SnapTrade. This is _not_ the account opening date at the brokerage. * * @return self */ @@ -579,7 +579,7 @@ public function getMeta() /** * Sets meta * - * @param array|null $meta Additional information about the account, such as account type, status, etc. This information is specific to the financial institution and there's no standard format for this data. Please use at your own risk. + * @param array|null $meta Additional information about the account, such as account type, status, etc. This information is specific to the brokerage and there's no standard format for this data. Please use at your own risk. * * @return self * @deprecated diff --git a/lib/Model/AccountOrderRecord.php b/lib/Model/AccountOrderRecord.php index 00d6445..ac621a6 100644 --- a/lib/Model/AccountOrderRecord.php +++ b/lib/Model/AccountOrderRecord.php @@ -886,7 +886,7 @@ public function getTimeInForce() /** * Sets time_in_force * - * @param string|null $time_in_force The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. We try our best to map brokerage time in force values to the following. When mapping fails, we will return the brokerage's time in force value. - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until the specified date. + * @param string|null $time_in_force The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. We try our best to map brokerage time in force values to the following. When mapping fails, we will return the brokerage's time in force value. - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until the specified date. - `MOO` - Market On Open. The order is to be executed at the day's opening price. - `EHP` - Extended Hours P.M. The order is to be placed during extended hour trading, after markets close. * * @return self */ diff --git a/lib/Model/AccountOrderRecordUniversalSymbol.php b/lib/Model/AccountOrderRecordUniversalSymbol.php index 656f3af..bb2fc0f 100644 --- a/lib/Model/AccountOrderRecordUniversalSymbol.php +++ b/lib/Model/AccountOrderRecordUniversalSymbol.php @@ -55,8 +55,8 @@ class AccountOrderRecordUniversalSymbol implements ModelInterface, ArrayAccess, 'symbol' => 'string', 'raw_symbol' => 'string', 'description' => 'string', - 'currency' => '\SnapTrade\Model\UniversalSymbolCurrency', - 'exchange' => '\SnapTrade\Model\UniversalSymbolExchange', + 'currency' => '\SnapTrade\Model\SymbolCurrency', + 'exchange' => '\SnapTrade\Model\SymbolExchange', 'type' => '\SnapTrade\Model\SecurityType', 'currencies' => '\SnapTrade\Model\Currency[]', 'figi_code' => 'string', @@ -490,7 +490,7 @@ public function setDescription($description) /** * Gets currency * - * @return \SnapTrade\Model\UniversalSymbolCurrency + * @return \SnapTrade\Model\SymbolCurrency */ public function getCurrency() { @@ -500,7 +500,7 @@ public function getCurrency() /** * Sets currency * - * @param \SnapTrade\Model\UniversalSymbolCurrency $currency currency + * @param \SnapTrade\Model\SymbolCurrency $currency currency * * @return self */ @@ -519,7 +519,7 @@ public function setCurrency($currency) /** * Gets exchange * - * @return \SnapTrade\Model\UniversalSymbolExchange|null + * @return \SnapTrade\Model\SymbolExchange|null */ public function getExchange() { @@ -529,7 +529,7 @@ public function getExchange() /** * Sets exchange * - * @param \SnapTrade\Model\UniversalSymbolExchange|null $exchange exchange + * @param \SnapTrade\Model\SymbolExchange|null $exchange exchange * * @return self */ diff --git a/lib/Model/AccountSimple.php b/lib/Model/AccountSimple.php index b6d9a39..d3140ac 100644 --- a/lib/Model/AccountSimple.php +++ b/lib/Model/AccountSimple.php @@ -30,7 +30,7 @@ * AccountSimple Class Doc Comment * * @category Class - * @description SnapTradeUser Investment Account + * @description A single account at a brokerage. * @package SnapTrade * @implements \ArrayAccess */ @@ -317,7 +317,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade. * * @return self */ @@ -346,7 +346,7 @@ public function getName() /** * Sets name * - * @param string|null $name name + * @param string|null $name A display name for the account. Either assigned by the user or by the brokerage itself. For certain brokerages, SnapTrade appends the brokerage name to the account name for clarity. * * @return self */ @@ -375,7 +375,7 @@ public function getNumber() /** * Sets number * - * @param string|null $number number + * @param string|null $number The account number assigned by the brokerage. For some brokerages, this field may be masked for security reasons. * * @return self */ diff --git a/lib/Model/AuthenticationLoginSnapTradeUser200Response.php b/lib/Model/AuthenticationLoginSnapTradeUser200Response.php index 07dca9e..bf7f308 100644 --- a/lib/Model/AuthenticationLoginSnapTradeUser200Response.php +++ b/lib/Model/AuthenticationLoginSnapTradeUser200Response.php @@ -50,7 +50,7 @@ class AuthenticationLoginSnapTradeUser200Response implements ModelInterface, Arr * @var string[] */ protected static $openAPITypes = [ - 'redirect_uri' => 'mixed', + 'redirect_uri' => 'string', 'session_id' => 'string', 'encrypted_shared_key' => 'string', 'encrypted_message_data' => '\SnapTrade\Model\EncryptedResponseEncryptedMessageData' @@ -76,7 +76,7 @@ class AuthenticationLoginSnapTradeUser200Response implements ModelInterface, Arr * @var boolean[] */ protected static array $openAPINullables = [ - 'redirect_uri' => true, + 'redirect_uri' => false, 'session_id' => false, 'encrypted_shared_key' => false, 'encrypted_message_data' => false @@ -306,7 +306,7 @@ public function valid() /** * Gets redirect_uri * - * @return mixed|null + * @return string|null */ public function getRedirectUri() { @@ -316,7 +316,7 @@ public function getRedirectUri() /** * Sets redirect_uri * - * @param mixed|null $redirect_uri redirect_uri + * @param string|null $redirect_uri Connection Portal link to redirect user to connect a brokerage account. * * @return self */ @@ -324,14 +324,7 @@ public function setRedirectUri($redirect_uri) { if (is_null($redirect_uri)) { - array_push($this->openAPINullablesSetToNull, 'redirect_uri'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('redirect_uri', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } + throw new \InvalidArgumentException('non-nullable redirect_uri cannot be null'); } $this->container['redirect_uri'] = $redirect_uri; @@ -352,7 +345,7 @@ public function getSessionId() /** * Sets session_id * - * @param string|null $session_id session_id + * @param string|null $session_id ID to identify the connection portal session. * * @return self */ diff --git a/lib/Model/DeleteUserResponse.php b/lib/Model/DeleteUserResponse.php index 4571d1e..7d68eb2 100644 --- a/lib/Model/DeleteUserResponse.php +++ b/lib/Model/DeleteUserResponse.php @@ -30,7 +30,6 @@ * DeleteUserResponse Class Doc Comment * * @category Class - * @description Response when delete user is successful * @package SnapTrade * @implements \ArrayAccess */ @@ -52,6 +51,7 @@ class DeleteUserResponse implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'status' => 'string', + 'detail' => 'string', 'user_id' => 'string' ]; @@ -64,6 +64,7 @@ class DeleteUserResponse implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPIFormats = [ 'status' => null, + 'detail' => null, 'user_id' => null ]; @@ -74,6 +75,7 @@ class DeleteUserResponse implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static array $openAPINullables = [ 'status' => false, + 'detail' => false, 'user_id' => false ]; @@ -164,6 +166,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'status' => 'status', + 'detail' => 'detail', 'user_id' => 'userId' ]; @@ -174,6 +177,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'status' => 'setStatus', + 'detail' => 'setDetail', 'user_id' => 'setUserId' ]; @@ -184,6 +188,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'status' => 'getStatus', + 'detail' => 'getDetail', 'user_id' => 'getUserId' ]; @@ -245,6 +250,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('detail', $data ?? [], null); $this->setIfExists('user_id', $data ?? [], null); } @@ -303,7 +309,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Delete status + * @param string|null $status This is always `deleted` when a user is queued for deletion. * * @return self */ @@ -319,6 +325,35 @@ public function setStatus($status) return $this; } + /** + * Gets detail + * + * @return string|null + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string|null $detail Human friendly message about the deletion status. + * + * @return self + */ + public function setDetail($detail) + { + + if (is_null($detail)) { + throw new \InvalidArgumentException('non-nullable detail cannot be null'); + } + + $this->container['detail'] = $detail; + + return $this; + } + /** * Gets user_id * diff --git a/lib/Model/LoginRedirectURI.php b/lib/Model/LoginRedirectURI.php index 027d13f..ffc286d 100644 --- a/lib/Model/LoginRedirectURI.php +++ b/lib/Model/LoginRedirectURI.php @@ -51,7 +51,7 @@ class LoginRedirectURI implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'redirect_uri' => 'mixed', + 'redirect_uri' => 'string', 'session_id' => 'string' ]; @@ -73,7 +73,7 @@ class LoginRedirectURI implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'redirect_uri' => true, + 'redirect_uri' => false, 'session_id' => false ]; @@ -293,7 +293,7 @@ public function valid() /** * Gets redirect_uri * - * @return mixed|null + * @return string|null */ public function getRedirectUri() { @@ -303,7 +303,7 @@ public function getRedirectUri() /** * Sets redirect_uri * - * @param mixed|null $redirect_uri redirect_uri + * @param string|null $redirect_uri Connection Portal link to redirect user to connect a brokerage account. * * @return self */ @@ -311,14 +311,7 @@ public function setRedirectUri($redirect_uri) { if (is_null($redirect_uri)) { - array_push($this->openAPINullablesSetToNull, 'redirect_uri'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('redirect_uri', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } + throw new \InvalidArgumentException('non-nullable redirect_uri cannot be null'); } $this->container['redirect_uri'] = $redirect_uri; @@ -339,7 +332,7 @@ public function getSessionId() /** * Sets session_id * - * @param string|null $session_id session_id + * @param string|null $session_id ID to identify the connection portal session. * * @return self */ diff --git a/lib/Model/SnapTradeLoginUserRequestBody.php b/lib/Model/SnapTradeLoginUserRequestBody.php index aead6c1..461dba5 100644 --- a/lib/Model/SnapTradeLoginUserRequestBody.php +++ b/lib/Model/SnapTradeLoginUserRequestBody.php @@ -302,8 +302,8 @@ public function __construct(array $data = null) $this->setIfExists('immediate_redirect', $data ?? [], null); $this->setIfExists('custom_redirect', $data ?? [], null); $this->setIfExists('reconnect', $data ?? [], null); - $this->setIfExists('connection_type', $data ?? [], null); - $this->setIfExists('connection_portal_version', $data ?? [], null); + $this->setIfExists('connection_type', $data ?? [], 'read'); + $this->setIfExists('connection_portal_version', $data ?? [], 'v3'); } /** @@ -379,7 +379,7 @@ public function getBroker() /** * Sets broker * - * @param string|null $broker Slug of the brokerage to connect the user to. See [this document](https://snaptrade.notion.site/SnapTrade-Brokerage-Integrations-f83946a714a84c3caf599f6a945f0ead) for a list of supported brokerages and their slugs. + * @param string|null $broker Slug of the brokerage to connect the user to. See [the integrations page](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=3cfea70ef4254afc89704e47275a7a9a&pvs=4) for a list of supported brokerages and their slugs. * * @return self */ @@ -408,7 +408,7 @@ public function getImmediateRedirect() /** * Sets immediate_redirect * - * @param bool|null $immediate_redirect When set to True, user will be redirected back to the partner's site instead of the connection portal + * @param bool|null $immediate_redirect When set to `true`, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](https://docs.snaptrade.com/docs/implement-connection-portal) for more information. * * @return self */ @@ -437,7 +437,7 @@ public function getCustomRedirect() /** * Sets custom_redirect * - * @param string|null $custom_redirect URL to redirect the user to after the user connects their brokerage account + * @param string|null $custom_redirect URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](https://docs.snaptrade.com/docs/implement-connection-portal) for more information. * * @return self */ @@ -466,7 +466,7 @@ public function getReconnect() /** * Sets reconnect * - * @param string|null $reconnect The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See β€˜Reconnecting Accounts’ for more information. + * @param string|null $reconnect The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](https://docs.snaptrade.com/docs/fix-broken-connections) for more information. * * @return self */ @@ -495,7 +495,7 @@ public function getConnectionType() /** * Sets connection_type * - * @param string|null $connection_type Sets whether the connection should be read or trade + * @param string|null $connection_type Sets whether the connection should be read-only or trade-enabled. * * @return self */ @@ -534,7 +534,7 @@ public function getConnectionPortalVersion() /** * Sets connection_portal_version * - * @param string|null $connection_portal_version Sets the version of the connection portal to render, with a default to 'v3' + * @param string|null $connection_portal_version Sets the version of the connection portal to render. * * @return self */ diff --git a/lib/Model/Symbol.php b/lib/Model/Symbol.php index a04755b..c07643c 100644 --- a/lib/Model/Symbol.php +++ b/lib/Model/Symbol.php @@ -30,7 +30,7 @@ * Symbol Class Doc Comment * * @category Class - * @description Symbol + * @description Uniquely describes a single security + exchange combination across all brokerages. * @package SnapTrade * @implements \ArrayAccess */ @@ -54,9 +54,9 @@ class Symbol implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'symbol' => 'string', 'raw_symbol' => 'string', - 'name' => 'string', - 'currency' => '\SnapTrade\Model\Currency', - 'exchange' => '\SnapTrade\Model\Exchange', + 'description' => 'string', + 'currency' => '\SnapTrade\Model\SymbolCurrency', + 'exchange' => '\SnapTrade\Model\SymbolExchange', 'type' => '\SnapTrade\Model\SecurityType', 'figi_code' => 'string', 'figi_instrument' => '\SnapTrade\Model\SymbolFigiInstrument' @@ -73,7 +73,7 @@ class Symbol implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'uuid', 'symbol' => null, 'raw_symbol' => null, - 'name' => null, + 'description' => null, 'currency' => null, 'exchange' => null, 'type' => null, @@ -90,7 +90,7 @@ class Symbol implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => false, 'symbol' => false, 'raw_symbol' => false, - 'name' => false, + 'description' => true, 'currency' => false, 'exchange' => false, 'type' => false, @@ -187,7 +187,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'symbol' => 'symbol', 'raw_symbol' => 'raw_symbol', - 'name' => 'name', + 'description' => 'description', 'currency' => 'currency', 'exchange' => 'exchange', 'type' => 'type', @@ -204,7 +204,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'symbol' => 'setSymbol', 'raw_symbol' => 'setRawSymbol', - 'name' => 'setName', + 'description' => 'setDescription', 'currency' => 'setCurrency', 'exchange' => 'setExchange', 'type' => 'setType', @@ -221,7 +221,7 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'symbol' => 'getSymbol', 'raw_symbol' => 'getRawSymbol', - 'name' => 'getName', + 'description' => 'getDescription', 'currency' => 'getCurrency', 'exchange' => 'getExchange', 'type' => 'getType', @@ -289,7 +289,7 @@ public function __construct(array $data = null) $this->setIfExists('id', $data ?? [], null); $this->setIfExists('symbol', $data ?? [], null); $this->setIfExists('raw_symbol', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); $this->setIfExists('currency', $data ?? [], null); $this->setIfExists('exchange', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); @@ -352,7 +352,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls. * * @return self */ @@ -381,7 +381,7 @@ public function getSymbol() /** * Sets symbol * - * @param string|null $symbol symbol + * @param string|null $symbol The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. * * @return self */ @@ -410,7 +410,7 @@ public function getRawSymbol() /** * Sets raw_symbol * - * @param string|null $raw_symbol raw_symbol + * @param string|null $raw_symbol The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\". * * @return self */ @@ -427,30 +427,37 @@ public function setRawSymbol($raw_symbol) } /** - * Gets name + * Gets description * * @return string|null */ - public function getName() + public function getDescription() { - return $this->container['name']; + return $this->container['description']; } /** - * Sets name + * Sets description * - * @param string|null $name name + * @param string|null $description A human-readable description of the security. This is usually the company name or ETF name. * * @return self */ - public function setName($name) + public function setDescription($description) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['name'] = $name; + $this->container['description'] = $description; return $this; } @@ -458,7 +465,7 @@ public function setName($name) /** * Gets currency * - * @return \SnapTrade\Model\Currency|null + * @return \SnapTrade\Model\SymbolCurrency|null */ public function getCurrency() { @@ -468,7 +475,7 @@ public function getCurrency() /** * Sets currency * - * @param \SnapTrade\Model\Currency|null $currency currency + * @param \SnapTrade\Model\SymbolCurrency|null $currency currency * * @return self */ @@ -487,7 +494,7 @@ public function setCurrency($currency) /** * Gets exchange * - * @return \SnapTrade\Model\Exchange|null + * @return \SnapTrade\Model\SymbolExchange|null */ public function getExchange() { @@ -497,7 +504,7 @@ public function getExchange() /** * Sets exchange * - * @param \SnapTrade\Model\Exchange|null $exchange exchange + * @param \SnapTrade\Model\SymbolExchange|null $exchange exchange * * @return self */ @@ -555,7 +562,7 @@ public function getFigiCode() /** * Sets figi_code * - * @param string|null $figi_code figi_code + * @param string|null $figi_code This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information. This value should be the same as the `figi_code` in the `figi_instrument` child property. * * @return self */ diff --git a/lib/Model/UniversalSymbolCurrency.php b/lib/Model/SymbolCurrency.php similarity index 97% rename from lib/Model/UniversalSymbolCurrency.php rename to lib/Model/SymbolCurrency.php index a0e4a92..52381d1 100644 --- a/lib/Model/UniversalSymbolCurrency.php +++ b/lib/Model/SymbolCurrency.php @@ -1,6 +1,6 @@ */ -class UniversalSymbolCurrency implements ModelInterface, ArrayAccess, \JsonSerializable +class SymbolCurrency implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -43,7 +43,7 @@ class UniversalSymbolCurrency implements ModelInterface, ArrayAccess, \JsonSeria * * @var string */ - protected static $openAPIModelName = 'UniversalSymbol_currency'; + protected static $openAPIModelName = 'Symbol_currency'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/UniversalSymbolExchange.php b/lib/Model/SymbolExchange.php similarity index 98% rename from lib/Model/UniversalSymbolExchange.php rename to lib/Model/SymbolExchange.php index 89d533a..31e375a 100644 --- a/lib/Model/UniversalSymbolExchange.php +++ b/lib/Model/SymbolExchange.php @@ -1,6 +1,6 @@ */ -class UniversalSymbolExchange implements ModelInterface, ArrayAccess, \JsonSerializable +class SymbolExchange implements ModelInterface, ArrayAccess, \JsonSerializable { public const DISCRIMINATOR = null; @@ -43,7 +43,7 @@ class UniversalSymbolExchange implements ModelInterface, ArrayAccess, \JsonSeria * * @var string */ - protected static $openAPIModelName = 'UniversalSymbol_exchange'; + protected static $openAPIModelName = 'Symbol_exchange'; /** * Array of property to type mappings. Used for (de)serialization diff --git a/lib/Model/UnderlyingSymbol.php b/lib/Model/UnderlyingSymbol.php index 2e412ae..837857a 100644 --- a/lib/Model/UnderlyingSymbol.php +++ b/lib/Model/UnderlyingSymbol.php @@ -55,7 +55,7 @@ class UnderlyingSymbol implements ModelInterface, ArrayAccess, \JsonSerializable 'symbol' => 'string', 'raw_symbol' => 'string', 'description' => 'string', - 'currency' => '\SnapTrade\Model\UniversalSymbolCurrency', + 'currency' => '\SnapTrade\Model\SymbolCurrency', 'exchange' => '\SnapTrade\Model\UnderlyingSymbolExchange', 'type' => '\SnapTrade\Model\UnderlyingSymbolType', 'currencies' => '\SnapTrade\Model\Currency[]', @@ -472,7 +472,7 @@ public function setDescription($description) /** * Gets currency * - * @return \SnapTrade\Model\UniversalSymbolCurrency|null + * @return \SnapTrade\Model\SymbolCurrency|null */ public function getCurrency() { @@ -482,7 +482,7 @@ public function getCurrency() /** * Sets currency * - * @param \SnapTrade\Model\UniversalSymbolCurrency|null $currency currency + * @param \SnapTrade\Model\SymbolCurrency|null $currency currency * * @return self */ diff --git a/lib/Model/UniversalActivity.php b/lib/Model/UniversalActivity.php index 5ea6d39..c1d6888 100644 --- a/lib/Model/UniversalActivity.php +++ b/lib/Model/UniversalActivity.php @@ -53,21 +53,21 @@ class UniversalActivity implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPITypes = [ 'id' => 'string', 'account' => '\SnapTrade\Model\AccountSimple', + 'symbol' => '\SnapTrade\Model\UniversalActivitySymbol', + 'option_symbol' => '\SnapTrade\Model\UniversalActivityOptionSymbol', + 'price' => 'float', + 'units' => 'float', 'amount' => 'float', - 'currency' => '\SnapTrade\Model\Currency', + 'currency' => '\SnapTrade\Model\UniversalActivityCurrency', + 'type' => 'string', + 'option_type' => 'string', 'description' => 'string', + 'trade_date' => '\DateTime', + 'settlement_date' => '\DateTime', 'fee' => 'float', 'fx_rate' => 'float', 'institution' => 'string', - 'option_type' => 'string', - 'price' => 'float', - 'settlement_date' => 'string', - 'external_reference_id' => 'string', - 'symbol' => '\SnapTrade\Model\Symbol', - 'option_symbol' => '\SnapTrade\Model\OptionsSymbol', - 'trade_date' => 'string', - 'type' => 'string', - 'units' => 'float' + 'external_reference_id' => 'string' ]; /** @@ -80,21 +80,21 @@ class UniversalActivity implements ModelInterface, ArrayAccess, \JsonSerializabl protected static $openAPIFormats = [ 'id' => null, 'account' => null, + 'symbol' => null, + 'option_symbol' => null, + 'price' => null, + 'units' => null, 'amount' => null, 'currency' => null, + 'type' => null, + 'option_type' => null, 'description' => null, + 'trade_date' => 'date-time', + 'settlement_date' => 'date-time', 'fee' => null, 'fx_rate' => null, 'institution' => null, - 'option_type' => null, - 'price' => null, - 'settlement_date' => null, - 'external_reference_id' => null, - 'symbol' => null, - 'option_symbol' => null, - 'trade_date' => null, - 'type' => null, - 'units' => null + 'external_reference_id' => null ]; /** @@ -105,21 +105,21 @@ class UniversalActivity implements ModelInterface, ArrayAccess, \JsonSerializabl protected static array $openAPINullables = [ 'id' => false, 'account' => false, + 'symbol' => true, + 'option_symbol' => true, + 'price' => false, + 'units' => false, 'amount' => true, 'currency' => false, + 'type' => false, + 'option_type' => false, 'description' => false, + 'trade_date' => true, + 'settlement_date' => false, 'fee' => false, 'fx_rate' => true, 'institution' => false, - 'option_type' => false, - 'price' => false, - 'settlement_date' => false, - 'external_reference_id' => true, - 'symbol' => false, - 'option_symbol' => false, - 'trade_date' => true, - 'type' => false, - 'units' => false + 'external_reference_id' => true ]; /** @@ -210,21 +210,21 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'id' => 'id', 'account' => 'account', + 'symbol' => 'symbol', + 'option_symbol' => 'option_symbol', + 'price' => 'price', + 'units' => 'units', 'amount' => 'amount', 'currency' => 'currency', + 'type' => 'type', + 'option_type' => 'option_type', 'description' => 'description', + 'trade_date' => 'trade_date', + 'settlement_date' => 'settlement_date', 'fee' => 'fee', 'fx_rate' => 'fx_rate', 'institution' => 'institution', - 'option_type' => 'option_type', - 'price' => 'price', - 'settlement_date' => 'settlement_date', - 'external_reference_id' => 'external_reference_id', - 'symbol' => 'symbol', - 'option_symbol' => 'option_symbol', - 'trade_date' => 'trade_date', - 'type' => 'type', - 'units' => 'units' + 'external_reference_id' => 'external_reference_id' ]; /** @@ -235,21 +235,21 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'id' => 'setId', 'account' => 'setAccount', + 'symbol' => 'setSymbol', + 'option_symbol' => 'setOptionSymbol', + 'price' => 'setPrice', + 'units' => 'setUnits', 'amount' => 'setAmount', 'currency' => 'setCurrency', + 'type' => 'setType', + 'option_type' => 'setOptionType', 'description' => 'setDescription', + 'trade_date' => 'setTradeDate', + 'settlement_date' => 'setSettlementDate', 'fee' => 'setFee', 'fx_rate' => 'setFxRate', 'institution' => 'setInstitution', - 'option_type' => 'setOptionType', - 'price' => 'setPrice', - 'settlement_date' => 'setSettlementDate', - 'external_reference_id' => 'setExternalReferenceId', - 'symbol' => 'setSymbol', - 'option_symbol' => 'setOptionSymbol', - 'trade_date' => 'setTradeDate', - 'type' => 'setType', - 'units' => 'setUnits' + 'external_reference_id' => 'setExternalReferenceId' ]; /** @@ -260,21 +260,21 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'id' => 'getId', 'account' => 'getAccount', + 'symbol' => 'getSymbol', + 'option_symbol' => 'getOptionSymbol', + 'price' => 'getPrice', + 'units' => 'getUnits', 'amount' => 'getAmount', 'currency' => 'getCurrency', + 'type' => 'getType', + 'option_type' => 'getOptionType', 'description' => 'getDescription', + 'trade_date' => 'getTradeDate', + 'settlement_date' => 'getSettlementDate', 'fee' => 'getFee', 'fx_rate' => 'getFxRate', 'institution' => 'getInstitution', - 'option_type' => 'getOptionType', - 'price' => 'getPrice', - 'settlement_date' => 'getSettlementDate', - 'external_reference_id' => 'getExternalReferenceId', - 'symbol' => 'getSymbol', - 'option_symbol' => 'getOptionSymbol', - 'trade_date' => 'getTradeDate', - 'type' => 'getType', - 'units' => 'getUnits' + 'external_reference_id' => 'getExternalReferenceId' ]; /** @@ -336,21 +336,21 @@ public function __construct(array $data = null) { $this->setIfExists('id', $data ?? [], null); $this->setIfExists('account', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('option_symbol', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('units', $data ?? [], null); $this->setIfExists('amount', $data ?? [], null); $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('option_type', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('trade_date', $data ?? [], null); + $this->setIfExists('settlement_date', $data ?? [], null); $this->setIfExists('fee', $data ?? [], null); $this->setIfExists('fx_rate', $data ?? [], null); $this->setIfExists('institution', $data ?? [], null); - $this->setIfExists('option_type', $data ?? [], null); - $this->setIfExists('price', $data ?? [], null); - $this->setIfExists('settlement_date', $data ?? [], null); $this->setIfExists('external_reference_id', $data ?? [], null); - $this->setIfExists('symbol', $data ?? [], null); - $this->setIfExists('option_symbol', $data ?? [], null); - $this->setIfExists('trade_date', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('units', $data ?? [], null); } /** @@ -408,7 +408,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id Unique identifier for the transaction. This is the ID used to reference the transaction in SnapTrade. Please note that this ID _can_ change if the transaction is deleted and re-added. Under normal circumstances, SnapTrade does not delete transactions. The only time this would happen is if SnapTrade re-fetches and reprocesses the data from the brokerage, which is rare. If you require a stable ID, please let us know and we can work with you to provide one. * * @return self */ @@ -454,464 +454,478 @@ public function setAccount($account) } /** - * Gets amount + * Gets symbol * - * @return float|null + * @return \SnapTrade\Model\UniversalActivitySymbol|null */ - public function getAmount() + public function getSymbol() { - return $this->container['amount']; + return $this->container['symbol']; } /** - * Sets amount + * Sets symbol * - * @param float|null $amount amount + * @param \SnapTrade\Model\UniversalActivitySymbol|null $symbol symbol * * @return self */ - public function setAmount($amount) + public function setSymbol($symbol) { - if (is_null($amount)) { - array_push($this->openAPINullablesSetToNull, 'amount'); + if (is_null($symbol)) { + array_push($this->openAPINullablesSetToNull, 'symbol'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('amount', $nullablesSetToNull); + $index = array_search('symbol', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['amount'] = $amount; + $this->container['symbol'] = $symbol; return $this; } /** - * Gets currency + * Gets option_symbol * - * @return \SnapTrade\Model\Currency|null + * @return \SnapTrade\Model\UniversalActivityOptionSymbol|null */ - public function getCurrency() + public function getOptionSymbol() { - return $this->container['currency']; + return $this->container['option_symbol']; } /** - * Sets currency + * Sets option_symbol * - * @param \SnapTrade\Model\Currency|null $currency currency + * @param \SnapTrade\Model\UniversalActivityOptionSymbol|null $option_symbol option_symbol * * @return self */ - public function setCurrency($currency) + public function setOptionSymbol($option_symbol) { - if (is_null($currency)) { - throw new \InvalidArgumentException('non-nullable currency cannot be null'); + if (is_null($option_symbol)) { + array_push($this->openAPINullablesSetToNull, 'option_symbol'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('option_symbol', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['currency'] = $currency; + $this->container['option_symbol'] = $option_symbol; return $this; } /** - * Gets description + * Gets price * - * @return string|null + * @return float|null */ - public function getDescription() + public function getPrice() { - return $this->container['description']; + return $this->container['price']; } /** - * Sets description + * Sets price * - * @param string|null $description description + * @param float|null $price The price of the security for the transaction. This is mostly applicable to `BUY`, `SELL`, and `DIVIDEND` transactions. * * @return self */ - public function setDescription($description) + public function setPrice($price) { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); } - $this->container['description'] = $description; + $this->container['price'] = $price; return $this; } /** - * Gets fee + * Gets units * * @return float|null */ - public function getFee() + public function getUnits() { - return $this->container['fee']; + return $this->container['units']; } /** - * Sets fee + * Sets units * - * @param float|null $fee fee + * @param float|null $units The number of units of the security for the transaction. This is mostly applicable to `BUY`, `SELL`, and `DIVIDEND` transactions. * * @return self */ - public function setFee($fee) + public function setUnits($units) { - if (is_null($fee)) { - throw new \InvalidArgumentException('non-nullable fee cannot be null'); + if (is_null($units)) { + throw new \InvalidArgumentException('non-nullable units cannot be null'); } - $this->container['fee'] = $fee; + $this->container['units'] = $units; return $this; } /** - * Gets fx_rate + * Gets amount * * @return float|null */ - public function getFxRate() + public function getAmount() { - return $this->container['fx_rate']; + return $this->container['amount']; } /** - * Sets fx_rate + * Sets amount * - * @param float|null $fx_rate The forex conversion rate involved in the transaction if provided by the brokerage. Used in cases where securities of one currency are purchased in a different currency, and the forex conversion is automatic. In those cases, price, amount and fee will be in the top level currency (activity -> currency) + * @param float|null $amount The amount of the transaction denominated in `currency`. This can be positive or negative. In general, transactions that positively affect the account balance (like sell, deposits, dividends, etc) will have a positive amount, while transactions that negatively affect the account balance (like buy, withdrawals, fees, etc) will have a negative amount. * * @return self */ - public function setFxRate($fx_rate) + public function setAmount($amount) { - if (is_null($fx_rate)) { - array_push($this->openAPINullablesSetToNull, 'fx_rate'); + if (is_null($amount)) { + array_push($this->openAPINullablesSetToNull, 'amount'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('fx_rate', $nullablesSetToNull); + $index = array_search('amount', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['fx_rate'] = $fx_rate; + $this->container['amount'] = $amount; return $this; } /** - * Gets institution + * Gets currency * - * @return string|null + * @return \SnapTrade\Model\UniversalActivityCurrency|null */ - public function getInstitution() + public function getCurrency() { - return $this->container['institution']; + return $this->container['currency']; } /** - * Sets institution + * Sets currency * - * @param string|null $institution institution + * @param \SnapTrade\Model\UniversalActivityCurrency|null $currency currency * * @return self */ - public function setInstitution($institution) + public function setCurrency($currency) { - if (is_null($institution)) { - throw new \InvalidArgumentException('non-nullable institution cannot be null'); + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); } - $this->container['institution'] = $institution; + $this->container['currency'] = $currency; return $this; } /** - * Gets option_type + * Gets type * * @return string|null */ - public function getOptionType() + public function getType() { - return $this->container['option_type']; + return $this->container['type']; } /** - * Sets option_type + * Sets type * - * @param string|null $option_type If an option transaction, then it's type (BUY_TO_OPEN, SELL_TO_CLOSE, etc), otherwise empty string + * @param string|null $type A string representing the type of transaction. SnapTrade does a best effort to categorize the brokerage transaction types into a common set of values. Here are some of the most popular values: - BUY - SELL - DIVIDEND - CONTRIBUTION - WITHDRAWAL - REI - INTEREST - FEE * * @return self */ - public function setOptionType($option_type) + public function setType($type) { - if (is_null($option_type)) { - throw new \InvalidArgumentException('non-nullable option_type cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['option_type'] = $option_type; + $this->container['type'] = $type; return $this; } /** - * Gets price + * Gets option_type * - * @return float|null + * @return string|null */ - public function getPrice() + public function getOptionType() { - return $this->container['price']; + return $this->container['option_type']; } /** - * Sets price + * Sets option_type * - * @param float|null $price price + * @param string|null $option_type If an option `BUY` or `SELL` transaction, this further specifies the type of action. The possible values are: - BUY_TO_OPEN - BUY_TO_CLOSE - SELL_TO_OPEN - SELL_TO_CLOSE * * @return self */ - public function setPrice($price) + public function setOptionType($option_type) { - if (is_null($price)) { - throw new \InvalidArgumentException('non-nullable price cannot be null'); + if (is_null($option_type)) { + throw new \InvalidArgumentException('non-nullable option_type cannot be null'); } - $this->container['price'] = $price; + $this->container['option_type'] = $option_type; return $this; } /** - * Gets settlement_date + * Gets description * * @return string|null */ - public function getSettlementDate() + public function getDescription() { - return $this->container['settlement_date']; + return $this->container['description']; } /** - * Sets settlement_date + * Sets description * - * @param string|null $settlement_date settlement_date + * @param string|null $description A human-readable description of the transaction. This is usually the brokerage's description of the transaction. * * @return self */ - public function setSettlementDate($settlement_date) + public function setDescription($description) { - if (is_null($settlement_date)) { - throw new \InvalidArgumentException('non-nullable settlement_date cannot be null'); + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); } - $this->container['settlement_date'] = $settlement_date; + $this->container['description'] = $description; return $this; } /** - * Gets external_reference_id + * Gets trade_date * - * @return string|null + * @return \DateTime|null */ - public function getExternalReferenceId() + public function getTradeDate() { - return $this->container['external_reference_id']; + return $this->container['trade_date']; } /** - * Sets external_reference_id + * Sets trade_date * - * @param string|null $external_reference_id Reference ID from brokerage used to identify related transactions. For example if an order comprises of several transactions (buy, fee, fx), they can be grouped if they share the same external_reference_id + * @param \DateTime|null $trade_date The recorded time for the transaction. The granularity of this timestamp depends on the brokerage. Some brokerages provide the exact time of the transaction, while others provide only the date. Please check the [integrations page](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=6fab8012ade6441fa0c6d9af9c55ce3a) for the specific brokerage to see the granularity of the timestamps. Note that even though the field is named `trade_date`, it can represent any type of transaction, not just trades. * * @return self */ - public function setExternalReferenceId($external_reference_id) + public function setTradeDate($trade_date) { - if (is_null($external_reference_id)) { - array_push($this->openAPINullablesSetToNull, 'external_reference_id'); + if (is_null($trade_date)) { + array_push($this->openAPINullablesSetToNull, 'trade_date'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('external_reference_id', $nullablesSetToNull); + $index = array_search('trade_date', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['external_reference_id'] = $external_reference_id; + $this->container['trade_date'] = $trade_date; return $this; } /** - * Gets symbol + * Gets settlement_date * - * @return \SnapTrade\Model\Symbol|null + * @return \DateTime|null */ - public function getSymbol() + public function getSettlementDate() { - return $this->container['symbol']; + return $this->container['settlement_date']; } /** - * Sets symbol + * Sets settlement_date * - * @param \SnapTrade\Model\Symbol|null $symbol symbol + * @param \DateTime|null $settlement_date The date on which the transaction is settled. * * @return self */ - public function setSymbol($symbol) + public function setSettlementDate($settlement_date) { - if (is_null($symbol)) { - throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + if (is_null($settlement_date)) { + throw new \InvalidArgumentException('non-nullable settlement_date cannot be null'); } - $this->container['symbol'] = $symbol; + $this->container['settlement_date'] = $settlement_date; return $this; } /** - * Gets option_symbol + * Gets fee * - * @return \SnapTrade\Model\OptionsSymbol|null + * @return float|null */ - public function getOptionSymbol() + public function getFee() { - return $this->container['option_symbol']; + return $this->container['fee']; } /** - * Sets option_symbol + * Sets fee * - * @param \SnapTrade\Model\OptionsSymbol|null $option_symbol option_symbol + * @param float|null $fee Any fee associated with the transaction if provided by the brokerage. * * @return self */ - public function setOptionSymbol($option_symbol) + public function setFee($fee) { - if (is_null($option_symbol)) { - throw new \InvalidArgumentException('non-nullable option_symbol cannot be null'); + if (is_null($fee)) { + throw new \InvalidArgumentException('non-nullable fee cannot be null'); } - $this->container['option_symbol'] = $option_symbol; + $this->container['fee'] = $fee; return $this; } /** - * Gets trade_date + * Gets fx_rate * - * @return string|null + * @return float|null */ - public function getTradeDate() + public function getFxRate() { - return $this->container['trade_date']; + return $this->container['fx_rate']; } /** - * Sets trade_date + * Sets fx_rate * - * @param string|null $trade_date trade_date + * @param float|null $fx_rate The forex conversion rate involved in the transaction if provided by the brokerage. Used in cases where securities of one currency are purchased in a different currency, and the forex conversion is automatic. In those cases, price, amount and fee will be in the top level currency (activity -> currency) * * @return self */ - public function setTradeDate($trade_date) + public function setFxRate($fx_rate) { - if (is_null($trade_date)) { - array_push($this->openAPINullablesSetToNull, 'trade_date'); + if (is_null($fx_rate)) { + array_push($this->openAPINullablesSetToNull, 'fx_rate'); } else { $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('trade_date', $nullablesSetToNull); + $index = array_search('fx_rate', $nullablesSetToNull); if ($index !== FALSE) { unset($nullablesSetToNull[$index]); $this->setOpenAPINullablesSetToNull($nullablesSetToNull); } } - $this->container['trade_date'] = $trade_date; + $this->container['fx_rate'] = $fx_rate; return $this; } /** - * Gets type + * Gets institution * * @return string|null */ - public function getType() + public function getInstitution() { - return $this->container['type']; + return $this->container['institution']; } /** - * Sets type + * Sets institution * - * @param string|null $type Potential values include (but are not limited to) - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT + * @param string|null $institution The institution that the transaction is associated with. This is usually the brokerage name. * * @return self */ - public function setType($type) + public function setInstitution($institution) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($institution)) { + throw new \InvalidArgumentException('non-nullable institution cannot be null'); } - $this->container['type'] = $type; + $this->container['institution'] = $institution; return $this; } /** - * Gets units + * Gets external_reference_id * - * @return float|null + * @return string|null */ - public function getUnits() + public function getExternalReferenceId() { - return $this->container['units']; + return $this->container['external_reference_id']; } /** - * Sets units + * Sets external_reference_id * - * @param float|null $units Usually but not necessarily an integer + * @param string|null $external_reference_id Reference ID from brokerage used to identify related transactions. For example if an order comprises of several transactions (buy, fee, fx), they can be grouped if they share the same `external_reference_id` * * @return self */ - public function setUnits($units) + public function setExternalReferenceId($external_reference_id) { - if (is_null($units)) { - throw new \InvalidArgumentException('non-nullable units cannot be null'); + if (is_null($external_reference_id)) { + array_push($this->openAPINullablesSetToNull, 'external_reference_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('external_reference_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['units'] = $units; + $this->container['external_reference_id'] = $external_reference_id; return $this; } diff --git a/lib/Model/UniversalActivityCurrency.php b/lib/Model/UniversalActivityCurrency.php new file mode 100644 index 0000000..3a55a27 --- /dev/null +++ b/lib/Model/UniversalActivityCurrency.php @@ -0,0 +1,477 @@ + + */ +class UniversalActivityCurrency implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalActivity_currency'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'code' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'code' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'code' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'code' => 'code', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'code' => 'setCode', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'code' => 'getCode', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade. + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets code + * + * @return string|null + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string|null $code The ISO-4217 currency code for the currency. + * + * @return self + */ + public function setCode($code) + { + + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name A human-friendly name of the currency. + * + * @return self + */ + public function setName($name) + { + + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UniversalActivityOptionSymbol.php b/lib/Model/UniversalActivityOptionSymbol.php new file mode 100644 index 0000000..40e4e58 --- /dev/null +++ b/lib/Model/UniversalActivityOptionSymbol.php @@ -0,0 +1,673 @@ + + */ +class UniversalActivityOptionSymbol implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalActivity_option_symbol'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'ticker' => 'string', + 'option_type' => 'string', + 'strike_price' => 'float', + 'expiration_date' => '\DateTime', + 'is_mini_option' => 'bool', + 'underlying_symbol' => '\SnapTrade\Model\UnderlyingSymbol' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'ticker' => null, + 'option_type' => null, + 'strike_price' => null, + 'expiration_date' => 'date', + 'is_mini_option' => null, + 'underlying_symbol' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'ticker' => false, + 'option_type' => false, + 'strike_price' => false, + 'expiration_date' => false, + 'is_mini_option' => false, + 'underlying_symbol' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'ticker' => 'ticker', + 'option_type' => 'option_type', + 'strike_price' => 'strike_price', + 'expiration_date' => 'expiration_date', + 'is_mini_option' => 'is_mini_option', + 'underlying_symbol' => 'underlying_symbol' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'ticker' => 'setTicker', + 'option_type' => 'setOptionType', + 'strike_price' => 'setStrikePrice', + 'expiration_date' => 'setExpirationDate', + 'is_mini_option' => 'setIsMiniOption', + 'underlying_symbol' => 'setUnderlyingSymbol' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'ticker' => 'getTicker', + 'option_type' => 'getOptionType', + 'strike_price' => 'getStrikePrice', + 'expiration_date' => 'getExpirationDate', + 'is_mini_option' => 'getIsMiniOption', + 'underlying_symbol' => 'getUnderlyingSymbol' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const OPTION_TYPE_CALL = 'CALL'; + public const OPTION_TYPE_PUT = 'PUT'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOptionTypeAllowableValues() + { + return [ + self::OPTION_TYPE_CALL, + self::OPTION_TYPE_PUT, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('ticker', $data ?? [], null); + $this->setIfExists('option_type', $data ?? [], null); + $this->setIfExists('strike_price', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('is_mini_option', $data ?? [], null); + $this->setIfExists('underlying_symbol', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['ticker'] === null) { + $invalidProperties[] = "'ticker' can't be null"; + } + if ($this->container['option_type'] === null) { + $invalidProperties[] = "'option_type' can't be null"; + } + $allowedValues = $this->getOptionTypeAllowableValues(); + if (!is_null($this->container['option_type']) && !in_array($this->container['option_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'option_type', must be one of '%s'", + $this->container['option_type'], + implode("', '", $allowedValues) + ); + } + + 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_symbol'] === null) { + $invalidProperties[] = "'underlying_symbol' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Unique identifier for the option symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls. + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets ticker + * + * @return string + */ + public function getTicker() + { + return $this->container['ticker']; + } + + /** + * Sets ticker + * + * @param string $ticker The [OCC symbol](https://en.wikipedia.org/wiki/Option_symbol) for the option. + * + * @return self + */ + public function setTicker($ticker) + { + + if (is_null($ticker)) { + throw new \InvalidArgumentException('non-nullable ticker cannot be null'); + } + + $this->container['ticker'] = $ticker; + + return $this; + } + + /** + * Gets option_type + * + * @return string + */ + public function getOptionType() + { + return $this->container['option_type']; + } + + /** + * Sets option_type + * + * @param string $option_type The type of option. Either \"CALL\" or \"PUT\". + * + * @return self + */ + 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($option_type)) { + throw new \InvalidArgumentException('non-nullable option_type cannot be null'); + } + + $this->container['option_type'] = $option_type; + + return $this; + } + + /** + * Gets strike_price + * + * @return float + */ + public function getStrikePrice() + { + return $this->container['strike_price']; + } + + /** + * Sets strike_price + * + * @param float $strike_price The option strike price. + * + * @return self + */ + public function setStrikePrice($strike_price) + { + + if (is_null($strike_price)) { + throw new \InvalidArgumentException('non-nullable strike_price cannot be null'); + } + + $this->container['strike_price'] = $strike_price; + + return $this; + } + + /** + * Gets expiration_date + * + * @return \DateTime + */ + public function getExpirationDate() + { + return $this->container['expiration_date']; + } + + /** + * Sets expiration_date + * + * @param \DateTime $expiration_date The option expiration date. + * + * @return self + */ + public function setExpirationDate($expiration_date) + { + + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } + + $this->container['expiration_date'] = $expiration_date; + + return $this; + } + + /** + * Gets is_mini_option + * + * @return bool|null + */ + public function getIsMiniOption() + { + return $this->container['is_mini_option']; + } + + /** + * Sets is_mini_option + * + * @param bool|null $is_mini_option Whether the option is a mini option. Mini options have 10 underlying shares per contract instead of the standard 100. + * + * @return self + */ + public function setIsMiniOption($is_mini_option) + { + + if (is_null($is_mini_option)) { + throw new \InvalidArgumentException('non-nullable is_mini_option cannot be null'); + } + + $this->container['is_mini_option'] = $is_mini_option; + + return $this; + } + + /** + * Gets underlying_symbol + * + * @return \SnapTrade\Model\UnderlyingSymbol + */ + public function getUnderlyingSymbol() + { + return $this->container['underlying_symbol']; + } + + /** + * Sets underlying_symbol + * + * @param \SnapTrade\Model\UnderlyingSymbol $underlying_symbol underlying_symbol + * + * @return self + */ + public function setUnderlyingSymbol($underlying_symbol) + { + + if (is_null($underlying_symbol)) { + throw new \InvalidArgumentException('non-nullable underlying_symbol cannot be null'); + } + + $this->container['underlying_symbol'] = $underlying_symbol; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UniversalActivitySymbol.php b/lib/Model/UniversalActivitySymbol.php new file mode 100644 index 0000000..088b65e --- /dev/null +++ b/lib/Model/UniversalActivitySymbol.php @@ -0,0 +1,714 @@ + + */ +class UniversalActivitySymbol implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UniversalActivity_symbol'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'symbol' => 'string', + 'raw_symbol' => 'string', + 'description' => 'string', + 'currency' => '\SnapTrade\Model\SymbolCurrency', + 'exchange' => '\SnapTrade\Model\SymbolExchange', + 'type' => '\SnapTrade\Model\SecurityType', + 'figi_code' => 'string', + 'figi_instrument' => '\SnapTrade\Model\SymbolFigiInstrument' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'symbol' => null, + 'raw_symbol' => null, + 'description' => null, + 'currency' => null, + 'exchange' => null, + 'type' => null, + 'figi_code' => null, + 'figi_instrument' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'symbol' => false, + 'raw_symbol' => false, + 'description' => true, + 'currency' => false, + 'exchange' => false, + 'type' => false, + 'figi_code' => true, + 'figi_instrument' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'symbol' => 'symbol', + 'raw_symbol' => 'raw_symbol', + 'description' => 'description', + 'currency' => 'currency', + 'exchange' => 'exchange', + 'type' => 'type', + 'figi_code' => 'figi_code', + 'figi_instrument' => 'figi_instrument' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'symbol' => 'setSymbol', + 'raw_symbol' => 'setRawSymbol', + 'description' => 'setDescription', + 'currency' => 'setCurrency', + 'exchange' => 'setExchange', + 'type' => 'setType', + 'figi_code' => 'setFigiCode', + 'figi_instrument' => 'setFigiInstrument' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'symbol' => 'getSymbol', + 'raw_symbol' => 'getRawSymbol', + 'description' => 'getDescription', + 'currency' => 'getCurrency', + 'exchange' => 'getExchange', + 'type' => 'getType', + 'figi_code' => 'getFigiCode', + 'figi_instrument' => 'getFigiInstrument' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('symbol', $data ?? [], null); + $this->setIfExists('raw_symbol', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('exchange', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('figi_code', $data ?? [], null); + $this->setIfExists('figi_instrument', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls. + * + * @return self + */ + public function setId($id) + { + + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets symbol + * + * @return string|null + */ + public function getSymbol() + { + return $this->container['symbol']; + } + + /** + * Sets symbol + * + * @param string|null $symbol The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. + * + * @return self + */ + public function setSymbol($symbol) + { + + if (is_null($symbol)) { + throw new \InvalidArgumentException('non-nullable symbol cannot be null'); + } + + $this->container['symbol'] = $symbol; + + return $this; + } + + /** + * Gets raw_symbol + * + * @return string|null + */ + public function getRawSymbol() + { + return $this->container['raw_symbol']; + } + + /** + * Sets raw_symbol + * + * @param string|null $raw_symbol The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\". + * + * @return self + */ + public function setRawSymbol($raw_symbol) + { + + if (is_null($raw_symbol)) { + throw new \InvalidArgumentException('non-nullable raw_symbol cannot be null'); + } + + $this->container['raw_symbol'] = $raw_symbol; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A human-readable description of the security. This is usually the company name or ETF name. + * + * @return self + */ + public function setDescription($description) + { + + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets currency + * + * @return \SnapTrade\Model\SymbolCurrency|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \SnapTrade\Model\SymbolCurrency|null $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets exchange + * + * @return \SnapTrade\Model\SymbolExchange|null + */ + public function getExchange() + { + return $this->container['exchange']; + } + + /** + * Sets exchange + * + * @param \SnapTrade\Model\SymbolExchange|null $exchange exchange + * + * @return self + */ + public function setExchange($exchange) + { + + if (is_null($exchange)) { + throw new \InvalidArgumentException('non-nullable exchange cannot be null'); + } + + $this->container['exchange'] = $exchange; + + return $this; + } + + /** + * Gets type + * + * @return \SnapTrade\Model\SecurityType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \SnapTrade\Model\SecurityType|null $type type + * + * @return self + */ + public function setType($type) + { + + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets figi_code + * + * @return string|null + */ + public function getFigiCode() + { + return $this->container['figi_code']; + } + + /** + * Sets figi_code + * + * @param string|null $figi_code This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information. This value should be the same as the `figi_code` in the `figi_instrument` child property. + * + * @return self + */ + public function setFigiCode($figi_code) + { + + if (is_null($figi_code)) { + array_push($this->openAPINullablesSetToNull, 'figi_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('figi_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['figi_code'] = $figi_code; + + return $this; + } + + /** + * Gets figi_instrument + * + * @return \SnapTrade\Model\SymbolFigiInstrument|null + */ + public function getFigiInstrument() + { + return $this->container['figi_instrument']; + } + + /** + * Sets figi_instrument + * + * @param \SnapTrade\Model\SymbolFigiInstrument|null $figi_instrument figi_instrument + * + * @return self + */ + public function setFigiInstrument($figi_instrument) + { + + if (is_null($figi_instrument)) { + array_push($this->openAPINullablesSetToNull, 'figi_instrument'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('figi_instrument', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['figi_instrument'] = $figi_instrument; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UniversalSymbol.php b/lib/Model/UniversalSymbol.php index 90c9276..bc3059f 100644 --- a/lib/Model/UniversalSymbol.php +++ b/lib/Model/UniversalSymbol.php @@ -55,8 +55,8 @@ class UniversalSymbol implements ModelInterface, ArrayAccess, \JsonSerializable 'symbol' => 'string', 'raw_symbol' => 'string', 'description' => 'string', - 'currency' => '\SnapTrade\Model\UniversalSymbolCurrency', - 'exchange' => '\SnapTrade\Model\UniversalSymbolExchange', + 'currency' => '\SnapTrade\Model\SymbolCurrency', + 'exchange' => '\SnapTrade\Model\SymbolExchange', 'type' => '\SnapTrade\Model\SecurityType', 'currencies' => '\SnapTrade\Model\Currency[]', 'figi_code' => 'string', @@ -490,7 +490,7 @@ public function setDescription($description) /** * Gets currency * - * @return \SnapTrade\Model\UniversalSymbolCurrency + * @return \SnapTrade\Model\SymbolCurrency */ public function getCurrency() { @@ -500,7 +500,7 @@ public function getCurrency() /** * Sets currency * - * @param \SnapTrade\Model\UniversalSymbolCurrency $currency currency + * @param \SnapTrade\Model\SymbolCurrency $currency currency * * @return self */ @@ -519,7 +519,7 @@ public function setCurrency($currency) /** * Gets exchange * - * @return \SnapTrade\Model\UniversalSymbolExchange|null + * @return \SnapTrade\Model\SymbolExchange|null */ public function getExchange() { @@ -529,7 +529,7 @@ public function getExchange() /** * Sets exchange * - * @param \SnapTrade\Model\UniversalSymbolExchange|null $exchange exchange + * @param \SnapTrade\Model\SymbolExchange|null $exchange exchange * * @return self */ diff --git a/lib/Model/UserIDandSecret.php b/lib/Model/UserIDandSecret.php index 831d173..be17fcd 100644 --- a/lib/Model/UserIDandSecret.php +++ b/lib/Model/UserIDandSecret.php @@ -30,7 +30,6 @@ * UserIDandSecret Class Doc Comment * * @category Class - * @description Response when register user is successful * @package SnapTrade * @implements \ArrayAccess */ @@ -332,7 +331,7 @@ public function getUserSecret() /** * Sets user_secret * - * @param string|null $user_secret SnapTrade User Secret randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the SnapTrade API. + * @param string|null $user_secret SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret). * * @return self */ diff --git a/test/Api/AuthenticationApiTest.php b/test/Api/AuthenticationApiTest.php index 5b9803c..0811252 100644 --- a/test/Api/AuthenticationApiTest.php +++ b/test/Api/AuthenticationApiTest.php @@ -61,7 +61,7 @@ public static function tearDownAfterClass(): void /** * Test case for deleteSnapTradeUser * - * Delete SnapTrade user. + * Delete user. * */ public function testDeleteSnapTradeUser() @@ -73,7 +73,7 @@ public function testDeleteSnapTradeUser() /** * Test case for listSnapTradeUsers * - * List SnapTrade users. + * List all users. * */ public function testListSnapTradeUsers() @@ -97,7 +97,7 @@ public function testLoginSnapTradeUser() /** * Test case for registerSnapTradeUser * - * Create SnapTrade user. + * Register user. * */ public function testRegisterSnapTradeUser() @@ -109,7 +109,7 @@ public function testRegisterSnapTradeUser() /** * Test case for resetSnapTradeUserSecret * - * Obtain a new user secret for a user. + * Rotate user secret. * */ public function testResetSnapTradeUserSecret() diff --git a/test/Model/AccountSimpleTest.php b/test/Model/AccountSimpleTest.php index ec124c6..173fb71 100644 --- a/test/Model/AccountSimpleTest.php +++ b/test/Model/AccountSimpleTest.php @@ -29,7 +29,7 @@ * AccountSimpleTest Class Doc Comment * * @category Class - * @description SnapTradeUser Investment Account + * @description A single account at a brokerage. * @package SnapTrade */ class AccountSimpleTest extends TestCase diff --git a/test/Model/AccountTest.php b/test/Model/AccountTest.php index 913d525..6e9c6f2 100644 --- a/test/Model/AccountTest.php +++ b/test/Model/AccountTest.php @@ -29,7 +29,7 @@ * AccountTest Class Doc Comment * * @category Class - * @description A single brokerage account at a financial institution. + * @description A single account at a brokerage. * @package SnapTrade */ class AccountTest extends TestCase diff --git a/test/Model/DeleteUserResponseTest.php b/test/Model/DeleteUserResponseTest.php index b17ecc1..a56ac8e 100644 --- a/test/Model/DeleteUserResponseTest.php +++ b/test/Model/DeleteUserResponseTest.php @@ -29,7 +29,7 @@ * DeleteUserResponseTest Class Doc Comment * * @category Class - * @description Response when delete user is successful + * @description DeleteUserResponse * @package SnapTrade */ class DeleteUserResponseTest extends TestCase @@ -81,6 +81,15 @@ public function testPropertyStatus() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "detail" + */ + public function testPropertyDetail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "user_id" */ diff --git a/test/Model/UniversalSymbolCurrencyTest.php b/test/Model/SymbolCurrencyTest.php similarity index 88% rename from test/Model/UniversalSymbolCurrencyTest.php rename to test/Model/SymbolCurrencyTest.php index 2ff2502..208649b 100644 --- a/test/Model/UniversalSymbolCurrencyTest.php +++ b/test/Model/SymbolCurrencyTest.php @@ -1,6 +1,6 @@ markTestIncomplete('Not implemented'); diff --git a/test/Model/UniversalSymbolExchangeTest.php b/test/Model/SymbolExchangeTest.php similarity index 92% rename from test/Model/UniversalSymbolExchangeTest.php rename to test/Model/SymbolExchangeTest.php index 7cd361f..089eea7 100644 --- a/test/Model/UniversalSymbolExchangeTest.php +++ b/test/Model/SymbolExchangeTest.php @@ -1,6 +1,6 @@ markTestIncomplete('Not implemented'); diff --git a/test/Model/SymbolTest.php b/test/Model/SymbolTest.php index 64dd26d..d947992 100644 --- a/test/Model/SymbolTest.php +++ b/test/Model/SymbolTest.php @@ -29,7 +29,7 @@ * SymbolTest Class Doc Comment * * @category Class - * @description Symbol + * @description Uniquely describes a single security + exchange combination across all brokerages. * @package SnapTrade */ class SymbolTest extends TestCase @@ -100,9 +100,9 @@ public function testPropertyRawSymbol() } /** - * Test attribute "name" + * Test attribute "description" */ - public function testPropertyName() + public function testPropertyDescription() { // TODO: implement $this->markTestIncomplete('Not implemented'); diff --git a/test/Model/UniversalActivityCurrencyTest.php b/test/Model/UniversalActivityCurrencyTest.php new file mode 100644 index 0000000..1eb799f --- /dev/null +++ b/test/Model/UniversalActivityCurrencyTest.php @@ -0,0 +1,101 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UniversalActivityOptionSymbolTest.php b/test/Model/UniversalActivityOptionSymbolTest.php new file mode 100644 index 0000000..bf151e6 --- /dev/null +++ b/test/Model/UniversalActivityOptionSymbolTest.php @@ -0,0 +1,137 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticker" + */ + public function testPropertyTicker() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "option_type" + */ + public function testPropertyOptionType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "strike_price" + */ + public function testPropertyStrikePrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expiration_date" + */ + public function testPropertyExpirationDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_mini_option" + */ + public function testPropertyIsMiniOption() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "underlying_symbol" + */ + public function testPropertyUnderlyingSymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UniversalActivitySymbolTest.php b/test/Model/UniversalActivitySymbolTest.php new file mode 100644 index 0000000..428a8df --- /dev/null +++ b/test/Model/UniversalActivitySymbolTest.php @@ -0,0 +1,155 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "symbol" + */ + public function testPropertySymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "raw_symbol" + */ + public function testPropertyRawSymbol() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exchange" + */ + public function testPropertyExchange() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "figi_code" + */ + public function testPropertyFigiCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "figi_instrument" + */ + public function testPropertyFigiInstrument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UniversalActivityTest.php b/test/Model/UniversalActivityTest.php index 1fa588d..7c835a8 100644 --- a/test/Model/UniversalActivityTest.php +++ b/test/Model/UniversalActivityTest.php @@ -91,135 +91,135 @@ public function testPropertyAccount() } /** - * Test attribute "amount" + * Test attribute "symbol" */ - public function testPropertyAmount() + public function testPropertySymbol() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "currency" + * Test attribute "option_symbol" */ - public function testPropertyCurrency() + public function testPropertyOptionSymbol() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "description" + * Test attribute "price" */ - public function testPropertyDescription() + public function testPropertyPrice() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "fee" + * Test attribute "units" */ - public function testPropertyFee() + public function testPropertyUnits() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "fx_rate" + * Test attribute "amount" */ - public function testPropertyFxRate() + public function testPropertyAmount() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "institution" + * Test attribute "currency" */ - public function testPropertyInstitution() + public function testPropertyCurrency() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "option_type" + * Test attribute "type" */ - public function testPropertyOptionType() + public function testPropertyType() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "price" + * Test attribute "option_type" */ - public function testPropertyPrice() + public function testPropertyOptionType() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "settlement_date" + * Test attribute "description" */ - public function testPropertySettlementDate() + public function testPropertyDescription() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "external_reference_id" + * Test attribute "trade_date" */ - public function testPropertyExternalReferenceId() + public function testPropertyTradeDate() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "symbol" + * Test attribute "settlement_date" */ - public function testPropertySymbol() + public function testPropertySettlementDate() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "option_symbol" + * Test attribute "fee" */ - public function testPropertyOptionSymbol() + public function testPropertyFee() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "trade_date" + * Test attribute "fx_rate" */ - public function testPropertyTradeDate() + public function testPropertyFxRate() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "type" + * Test attribute "institution" */ - public function testPropertyType() + public function testPropertyInstitution() { // TODO: implement $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "units" + * Test attribute "external_reference_id" */ - public function testPropertyUnits() + public function testPropertyExternalReferenceId() { // TODO: implement $this->markTestIncomplete('Not implemented'); diff --git a/test/Model/UserIDandSecretTest.php b/test/Model/UserIDandSecretTest.php index 9b8f44a..db98450 100644 --- a/test/Model/UserIDandSecretTest.php +++ b/test/Model/UserIDandSecretTest.php @@ -29,7 +29,7 @@ * UserIDandSecretTest Class Doc Comment * * @category Class - * @description Response when register user is successful + * @description UserIDandSecret * @package SnapTrade */ class UserIDandSecretTest extends TestCase