diff --git a/.konfig/generate-id.txt b/.konfig/generate-id.txt index 0dfe1f1..2b58beb 100644 --- a/.konfig/generate-id.txt +++ b/.konfig/generate-id.txt @@ -1 +1 @@ -a0c1adb3-872f-4b04-9c66-72b150225d7f \ No newline at end of file +71158f6b-4082-4973-8d3a-88a836954548 \ No newline at end of file diff --git a/README.md b/README.md index fb0a31d..6015c8d 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.33-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.33" } } ``` @@ -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 @@ -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 @@ -551,7 +551,7 @@ $result = $snaptrade->authentication->loginSnapTradeUser( 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 @@ -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. @@ -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 randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret) #### 🔄 Return @@ -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 @@ -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 @@ -1756,7 +1760,7 @@ $result = $snaptrade->transactionsAndReporting->getActivities( 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 @@ -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..5f6c33f 100644 --- a/lib/Api/AccountInformationApi.php +++ b/lib/Api/AccountInformationApi.php @@ -163,7 +163,7 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * @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 @@ -191,7 +191,7 @@ public function getAllUserHoldings( * * @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 @@ -357,7 +357,7 @@ public function getAllUserHoldingsWithHttpInfo($user_id, $user_secret, $brokerag * * @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 @@ -388,7 +388,7 @@ function ($response) { * * @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 +444,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 diff --git a/lib/Api/AuthenticationApi.php b/lib/Api/AuthenticationApi.php index 176a1ad..dfe41b5 100644 --- a/lib/Api/AuthenticationApi.php +++ b/lib/Api/AuthenticationApi.php @@ -150,7 +150,7 @@ private function setRequestBodyProperty(&$body, $property, $value) { /** * Operation deleteSnapTradeUser * - * Delete SnapTrade user + * Delete user * * @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 +173,7 @@ public function deleteSnapTradeUser( /** * Operation deleteSnapTradeUserWithHttpInfo * - * Delete SnapTrade user + * Delete user * * @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 +357,7 @@ public function deleteSnapTradeUserWithHttpInfo($user_id, string $contentType = /** * Operation deleteSnapTradeUserAsync * - * Delete SnapTrade user + * Delete user * * @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 +383,7 @@ function ($response) { /** * Operation deleteSnapTradeUserAsyncWithHttpInfo * - * Delete SnapTrade user + * Delete user * * @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 +558,7 @@ public function deleteSnapTradeUserRequest($user_id, string $contentType = self: /** * Operation listSnapTradeUsers * - * List SnapTrade users + * List all users * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSnapTradeUsers'] to see the possible values for this operation * @@ -580,7 +580,7 @@ public function listSnapTradeUsers( /** * Operation listSnapTradeUsersWithHttpInfo * - * List SnapTrade users + * List all users * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSnapTradeUsers'] to see the possible values for this operation * @@ -762,7 +762,7 @@ public function listSnapTradeUsersWithHttpInfo(string $contentType = self::conte /** * Operation listSnapTradeUsersAsync * - * List SnapTrade users + * List all users * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSnapTradeUsers'] to see the possible values for this operation * @@ -787,7 +787,7 @@ function ($response) { /** * Operation listSnapTradeUsersAsyncWithHttpInfo * - * List SnapTrade users + * List all users * * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSnapTradeUsers'] to see the possible values for this operation * @@ -957,8 +957,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] ) @@ -1184,8 +1184,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] ) @@ -1425,7 +1425,7 @@ public function loginSnapTradeUserRequest($user_id, $user_secret, $snap_trade_lo /** * Operation registerSnapTradeUser * - * Create SnapTrade user + * Register user * * @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 +1451,7 @@ public function registerSnapTradeUser( /** * Operation registerSnapTradeUserWithHttpInfo * - * Create SnapTrade user + * Register user * * @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 +1635,7 @@ public function registerSnapTradeUserWithHttpInfo($snap_trade_register_user_requ /** * Operation registerSnapTradeUserAsync * - * Create SnapTrade user + * Register user * * @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 +1664,7 @@ function ($response) { /** * Operation registerSnapTradeUserAsyncWithHttpInfo * - * Create SnapTrade user + * Register user * * @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 +1839,7 @@ public function registerSnapTradeUserRequest($snap_trade_register_user_request_b /** * Operation resetSnapTradeUserSecret * - * Obtain a new user secret for a user + * Rotate user secret * * @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 +1867,7 @@ public function resetSnapTradeUserSecret( /** * Operation resetSnapTradeUserSecretWithHttpInfo * - * Obtain a new user secret for a user + * Rotate user secret * * @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 +2051,7 @@ public function resetSnapTradeUserSecretWithHttpInfo($user_i_dand_secret, string /** * Operation resetSnapTradeUserSecretAsync * - * Obtain a new user secret for a user + * Rotate user secret * * @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 +2082,7 @@ function ($response) { /** * Operation resetSnapTradeUserSecretAsyncWithHttpInfo * - * Obtain a new user secret for a user + * Rotate user secret * * @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..8dfdb6c 100644 --- a/lib/Api/ConnectionsApi.php +++ b/lib/Api/ConnectionsApi.php @@ -2230,8 +2230,8 @@ public function removeBrokerageAuthorizationRequest($authorization_id, $user_id, * Get all session events for 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 @@ -2257,8 +2257,8 @@ public function sessionEvents( * Get all session events for 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 @@ -2376,8 +2376,8 @@ public function sessionEventsWithHttpInfo($partner_client_id, $user_id = null, $ * Get all session events for 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 @@ -2406,8 +2406,8 @@ function ($response) { * Get all session events for 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 +2461,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/TransactionsAndReportingApi.php b/lib/Api/TransactionsAndReportingApi.php index d81c657..2e70113 100644 --- a/lib/Api/TransactionsAndReportingApi.php +++ b/lib/Api/TransactionsAndReportingApi.php @@ -145,11 +145,11 @@ private function setRequestBodyProperty(&$body, $property, $value) { * * @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 @@ -180,11 +180,11 @@ public function getActivities( * * @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 @@ -307,11 +307,11 @@ public function getActivitiesWithHttpInfo($user_id, $user_secret, $start_date = * * @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 @@ -345,11 +345,11 @@ function ($response) { * * @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 +404,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 @@ -622,7 +622,7 @@ public function getActivitiesRequest($user_id, $user_secret, $start_date = SENTI * @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 @@ -658,7 +658,7 @@ public function getReportingCustomRange( * @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 @@ -786,7 +786,7 @@ public function getReportingCustomRangeWithHttpInfo($start_date, $end_date, $use * @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 @@ -825,7 +825,7 @@ function ($response) { * @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 +885,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..cee2f35 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.33/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.33' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; 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..be4ea98 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 brokerage account at a financial institution. * @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 financial institution itself. For certain institutions, SnapTrade appends the institution 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 financial institution. * * @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..b6318e8 100644 --- a/lib/Model/UserIDandSecret.php +++ b/lib/Model/UserIDandSecret.php @@ -332,7 +332,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 randomly generated by SnapTrade. This is privileged information and if compromised, should be rotated 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..4a14160 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 brokerage account at a financial institution. * @package SnapTrade */ class AccountSimpleTest 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');