From 009568e50e62b990730fabc44159d19885f49062 Mon Sep 17 00:00:00 2001 From: Passiv Ops Date: Tue, 9 Sep 2025 23:40:08 +0000 Subject: [PATCH] Regenerate SDKs --- .konfig/generate-id.txt | 2 +- README.md | 24 +- lib/Api/TradingApi.php | 112 ++--- lib/Model/StopLoss.php | 2 +- lib/Model/TakeProfit.php | 2 +- .../TradingCancelUserAccountOrderRequest.php | 404 ------------------ test/Model/StopLossTest.php | 2 +- test/Model/TakeProfitTest.php | 2 +- ...adingCancelUserAccountOrderRequestTest.php | 83 ---- 9 files changed, 73 insertions(+), 560 deletions(-) delete mode 100644 lib/Model/TradingCancelUserAccountOrderRequest.php delete mode 100644 test/Model/TradingCancelUserAccountOrderRequestTest.php diff --git a/.konfig/generate-id.txt b/.konfig/generate-id.txt index d31ee07..a186995 100644 --- a/.konfig/generate-id.txt +++ b/.konfig/generate-id.txt @@ -1 +1 @@ -effc755a-4186-4409-8200-1c4d0b9ca28a \ No newline at end of file +1b645ddf-bcef-4d79-9c21-f109d922c1ef \ No newline at end of file diff --git a/README.md b/README.md index 5754eab..4151d0a 100644 --- a/README.md +++ b/README.md @@ -1623,25 +1623,25 @@ Cancels an order in the specified account. Accepts order IDs for all asset types ```php $result = $snaptrade->trading->cancelOrder( + brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e", user_id: "snaptrade-user-123", user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", - account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", - brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e" + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631" ); ``` #### ⚙️ Parameters +##### brokerage_order_id: `string` + +Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system. + ##### user_id: `string` ##### user_secret: `string` ##### account_id: `string` -##### brokerage_order_id: `string` - -Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system. - #### 🔄 Return @@ -1668,25 +1668,25 @@ Attempts to cancel an open order with the brokerage. If the order is no longer c ```php $result = $snaptrade->trading->cancelUserAccountOrder( + brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e", user_id: "snaptrade-user-123", user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61", - account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631", - brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e" + account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631" ); ``` #### ⚙️ Parameters +##### brokerage_order_id: `string` + +Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system. + ##### user_id: `string` ##### user_secret: `string` ##### account_id: `string` -##### brokerage_order_id: `string` - -Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system. - #### 🔄 Return diff --git a/lib/Api/TradingApi.php b/lib/Api/TradingApi.php index 32c2b66..38fda10 100644 --- a/lib/Api/TradingApi.php +++ b/lib/Api/TradingApi.php @@ -181,7 +181,7 @@ private function setRequestBodyProperty(&$body, $property, $value) { * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrder'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -190,18 +190,18 @@ private function setRequestBodyProperty(&$body, $property, $value) { */ public function cancelOrder( + $brokerage_order_id, $user_id, $user_secret, $account_id, - $brokerage_order_id = SENTINEL_VALUE, string $contentType = self::contentTypes['cancelOrder'][0] ) { $_body = []; $this->setRequestBodyProperty($_body, "brokerage_order_id", $brokerage_order_id); - $trading_cancel_user_account_order_request = $_body; + $account_information_get_user_account_order_detail_request = $_body; - list($response) = $this->cancelOrderWithHttpInfo($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, $contentType); + list($response) = $this->cancelOrderWithHttpInfo($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, $contentType); return $response; } @@ -215,16 +215,16 @@ public function cancelOrder( * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrder'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \SnapTrade\Model\CancelOrderResponse|\SnapTrade\Model\Model400FailedRequestResponse, HTTP status code, HTTP response headers (array of strings) */ - public function cancelOrderWithHttpInfo($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, string $contentType = self::contentTypes['cancelOrder'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) + public function cancelOrderWithHttpInfo($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, string $contentType = self::contentTypes['cancelOrder'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) { - ["request" => $request, "serializedBody" => $serializedBody] = $this->cancelOrderRequest($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, $contentType); + ["request" => $request, "serializedBody" => $serializedBody] = $this->cancelOrderRequest($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, $contentType); // Customization hook $this->beforeSendHook($request, $requestOptions, $this->config, $serializedBody); @@ -243,7 +243,7 @@ public function cancelOrderWithHttpInfo($user_id, $user_secret, $account_id, $tr $user_id, $user_secret, $account_id, - $trading_cancel_user_account_order_request, + $account_information_get_user_account_order_detail_request, $contentType, $requestOptions->setRetryOAuth(false) ); @@ -361,7 +361,7 @@ public function cancelOrderWithHttpInfo($user_id, $user_secret, $account_id, $tr * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -369,18 +369,18 @@ public function cancelOrderWithHttpInfo($user_id, $user_secret, $account_id, $tr */ public function cancelOrderAsync( + $brokerage_order_id, $user_id, $user_secret, $account_id, - $brokerage_order_id = SENTINEL_VALUE, string $contentType = self::contentTypes['cancelOrder'][0] ) { $_body = []; $this->setRequestBodyProperty($_body, "brokerage_order_id", $brokerage_order_id); - $trading_cancel_user_account_order_request = $_body; + $account_information_get_user_account_order_detail_request = $_body; - return $this->cancelOrderAsyncWithHttpInfo($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, $contentType) + return $this->cancelOrderAsyncWithHttpInfo($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, $contentType) ->then( function ($response) { return $response[0]; @@ -398,16 +398,16 @@ function ($response) { * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function cancelOrderAsyncWithHttpInfo($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, string $contentType = self::contentTypes['cancelOrder'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) + public function cancelOrderAsyncWithHttpInfo($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, string $contentType = self::contentTypes['cancelOrder'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) { $returnType = '\SnapTrade\Model\CancelOrderResponse'; - ["request" => $request, "serializedBody" => $serializedBody] = $this->cancelOrderRequest($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, $contentType); + ["request" => $request, "serializedBody" => $serializedBody] = $this->cancelOrderRequest($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, $contentType); // Customization hook $this->beforeSendHook($request, $requestOptions, $this->config, $serializedBody); @@ -454,13 +454,13 @@ function ($exception) { * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function cancelOrderRequest($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, string $contentType = self::contentTypes['cancelOrder'][0]) + public function cancelOrderRequest($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, string $contentType = self::contentTypes['cancelOrder'][0]) { // Check if $user_id is a string @@ -493,18 +493,18 @@ public function cancelOrderRequest($user_id, $user_secret, $account_id, $trading 'Missing the required parameter account_id when calling cancelOrder' ); } - if ($trading_cancel_user_account_order_request !== SENTINEL_VALUE) { - if (!($trading_cancel_user_account_order_request instanceof \SnapTrade\Model\TradingCancelUserAccountOrderRequest)) { - if (!is_array($trading_cancel_user_account_order_request)) - throw new \InvalidArgumentException('"trading_cancel_user_account_order_request" must be associative array or an instance of \SnapTrade\Model\TradingCancelUserAccountOrderRequest TradingApi.cancelOrder.'); + if ($account_information_get_user_account_order_detail_request !== SENTINEL_VALUE) { + if (!($account_information_get_user_account_order_detail_request instanceof \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest)) { + if (!is_array($account_information_get_user_account_order_detail_request)) + throw new \InvalidArgumentException('"account_information_get_user_account_order_detail_request" must be associative array or an instance of \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest TradingApi.cancelOrder.'); else - $trading_cancel_user_account_order_request = new \SnapTrade\Model\TradingCancelUserAccountOrderRequest($trading_cancel_user_account_order_request); + $account_information_get_user_account_order_detail_request = new \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest($account_information_get_user_account_order_detail_request); } } - // verify the required parameter 'trading_cancel_user_account_order_request' is set - if ($trading_cancel_user_account_order_request === SENTINEL_VALUE || (is_array($trading_cancel_user_account_order_request) && count($trading_cancel_user_account_order_request) === 0)) { + // verify the required parameter 'account_information_get_user_account_order_detail_request' is set + if ($account_information_get_user_account_order_detail_request === SENTINEL_VALUE || (is_array($account_information_get_user_account_order_detail_request) && count($account_information_get_user_account_order_detail_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter trading_cancel_user_account_order_request when calling cancelOrder' + 'Missing the required parameter account_information_get_user_account_order_detail_request when calling cancelOrder' ); } @@ -557,12 +557,12 @@ public function cancelOrderRequest($user_id, $user_secret, $account_id, $trading ); // for model (json/xml) - if (isset($trading_cancel_user_account_order_request)) { + if (isset($account_information_get_user_account_order_detail_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($trading_cancel_user_account_order_request)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($account_information_get_user_account_order_detail_request)); } else { - $httpBody = $trading_cancel_user_account_order_request; + $httpBody = $account_information_get_user_account_order_detail_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -641,7 +641,7 @@ public function cancelOrderRequest($user_id, $user_secret, $account_id, $trading * @param string $user_id user_id (required) * @param string $user_secret user_secret (required) * @param string $account_id account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelUserAccountOrder'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -651,18 +651,18 @@ public function cancelOrderRequest($user_id, $user_secret, $account_id, $trading */ public function cancelUserAccountOrder( + $brokerage_order_id, $user_id, $user_secret, $account_id, - $brokerage_order_id = SENTINEL_VALUE, string $contentType = self::contentTypes['cancelUserAccountOrder'][0] ) { $_body = []; $this->setRequestBodyProperty($_body, "brokerage_order_id", $brokerage_order_id); - $trading_cancel_user_account_order_request = $_body; + $account_information_get_user_account_order_detail_request = $_body; - list($response) = $this->cancelUserAccountOrderWithHttpInfo($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, $contentType); + list($response) = $this->cancelUserAccountOrderWithHttpInfo($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, $contentType); return $response; } @@ -676,7 +676,7 @@ public function cancelUserAccountOrder( * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelUserAccountOrder'] to see the possible values for this operation * * @throws \SnapTrade\ApiException on non-2xx response @@ -684,9 +684,9 @@ public function cancelUserAccountOrder( * @return array of \SnapTrade\Model\AccountOrderRecord|\SnapTrade\Model\Model400FailedRequestResponse|\SnapTrade\Model\Model500UnexpectedExceptionResponse, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function cancelUserAccountOrderWithHttpInfo($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, string $contentType = self::contentTypes['cancelUserAccountOrder'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) + public function cancelUserAccountOrderWithHttpInfo($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, string $contentType = self::contentTypes['cancelUserAccountOrder'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) { - ["request" => $request, "serializedBody" => $serializedBody] = $this->cancelUserAccountOrderRequest($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, $contentType); + ["request" => $request, "serializedBody" => $serializedBody] = $this->cancelUserAccountOrderRequest($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, $contentType); // Customization hook $this->beforeSendHook($request, $requestOptions, $this->config, $serializedBody); @@ -705,7 +705,7 @@ public function cancelUserAccountOrderWithHttpInfo($user_id, $user_secret, $acco $user_id, $user_secret, $account_id, - $trading_cancel_user_account_order_request, + $account_information_get_user_account_order_detail_request, $contentType, $requestOptions->setRetryOAuth(false) ); @@ -846,7 +846,7 @@ public function cancelUserAccountOrderWithHttpInfo($user_id, $user_secret, $acco * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelUserAccountOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -855,18 +855,18 @@ public function cancelUserAccountOrderWithHttpInfo($user_id, $user_secret, $acco */ public function cancelUserAccountOrderAsync( + $brokerage_order_id, $user_id, $user_secret, $account_id, - $brokerage_order_id = SENTINEL_VALUE, string $contentType = self::contentTypes['cancelUserAccountOrder'][0] ) { $_body = []; $this->setRequestBodyProperty($_body, "brokerage_order_id", $brokerage_order_id); - $trading_cancel_user_account_order_request = $_body; + $account_information_get_user_account_order_detail_request = $_body; - return $this->cancelUserAccountOrderAsyncWithHttpInfo($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, $contentType) + return $this->cancelUserAccountOrderAsyncWithHttpInfo($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, $contentType) ->then( function ($response) { return $response[0]; @@ -884,17 +884,17 @@ function ($response) { * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelUserAccountOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function cancelUserAccountOrderAsyncWithHttpInfo($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, string $contentType = self::contentTypes['cancelUserAccountOrder'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) + public function cancelUserAccountOrderAsyncWithHttpInfo($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, string $contentType = self::contentTypes['cancelUserAccountOrder'][0], \SnapTrade\RequestOptions $requestOptions = new \SnapTrade\RequestOptions()) { $returnType = '\SnapTrade\Model\AccountOrderRecord'; - ["request" => $request, "serializedBody" => $serializedBody] = $this->cancelUserAccountOrderRequest($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, $contentType); + ["request" => $request, "serializedBody" => $serializedBody] = $this->cancelUserAccountOrderRequest($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, $contentType); // Customization hook $this->beforeSendHook($request, $requestOptions, $this->config, $serializedBody); @@ -941,14 +941,14 @@ function ($exception) { * @param string $user_id (required) * @param string $user_secret (required) * @param string $account_id (required) - * @param \SnapTrade\Model\TradingCancelUserAccountOrderRequest $trading_cancel_user_account_order_request (required) + * @param \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest $account_information_get_user_account_order_detail_request (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelUserAccountOrder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function cancelUserAccountOrderRequest($user_id, $user_secret, $account_id, $trading_cancel_user_account_order_request, string $contentType = self::contentTypes['cancelUserAccountOrder'][0]) + public function cancelUserAccountOrderRequest($user_id, $user_secret, $account_id, $account_information_get_user_account_order_detail_request, string $contentType = self::contentTypes['cancelUserAccountOrder'][0]) { // Check if $user_id is a string @@ -981,18 +981,18 @@ public function cancelUserAccountOrderRequest($user_id, $user_secret, $account_i 'Missing the required parameter account_id when calling cancelUserAccountOrder' ); } - if ($trading_cancel_user_account_order_request !== SENTINEL_VALUE) { - if (!($trading_cancel_user_account_order_request instanceof \SnapTrade\Model\TradingCancelUserAccountOrderRequest)) { - if (!is_array($trading_cancel_user_account_order_request)) - throw new \InvalidArgumentException('"trading_cancel_user_account_order_request" must be associative array or an instance of \SnapTrade\Model\TradingCancelUserAccountOrderRequest TradingApi.cancelUserAccountOrder.'); + if ($account_information_get_user_account_order_detail_request !== SENTINEL_VALUE) { + if (!($account_information_get_user_account_order_detail_request instanceof \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest)) { + if (!is_array($account_information_get_user_account_order_detail_request)) + throw new \InvalidArgumentException('"account_information_get_user_account_order_detail_request" must be associative array or an instance of \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest TradingApi.cancelUserAccountOrder.'); else - $trading_cancel_user_account_order_request = new \SnapTrade\Model\TradingCancelUserAccountOrderRequest($trading_cancel_user_account_order_request); + $account_information_get_user_account_order_detail_request = new \SnapTrade\Model\AccountInformationGetUserAccountOrderDetailRequest($account_information_get_user_account_order_detail_request); } } - // verify the required parameter 'trading_cancel_user_account_order_request' is set - if ($trading_cancel_user_account_order_request === SENTINEL_VALUE || (is_array($trading_cancel_user_account_order_request) && count($trading_cancel_user_account_order_request) === 0)) { + // verify the required parameter 'account_information_get_user_account_order_detail_request' is set + if ($account_information_get_user_account_order_detail_request === SENTINEL_VALUE || (is_array($account_information_get_user_account_order_detail_request) && count($account_information_get_user_account_order_detail_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter trading_cancel_user_account_order_request when calling cancelUserAccountOrder' + 'Missing the required parameter account_information_get_user_account_order_detail_request when calling cancelUserAccountOrder' ); } @@ -1045,12 +1045,12 @@ public function cancelUserAccountOrderRequest($user_id, $user_secret, $account_i ); // for model (json/xml) - if (isset($trading_cancel_user_account_order_request)) { + if (isset($account_information_get_user_account_order_detail_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($trading_cancel_user_account_order_request)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($account_information_get_user_account_order_detail_request)); } else { - $httpBody = $trading_cancel_user_account_order_request; + $httpBody = $account_information_get_user_account_order_detail_request; } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/lib/Model/StopLoss.php b/lib/Model/StopLoss.php index 18ff94f..74a06d8 100644 --- a/lib/Model/StopLoss.php +++ b/lib/Model/StopLoss.php @@ -30,7 +30,7 @@ * StopLoss Class Doc Comment * * @category Class - * @description Details of the stop loss order. Only to be used when order_class = BRACKET. stop_price is required, limit_price is optional + * @description Takes in string value for stop_price and limit_price. stop_price is required, limit_price is optional * @package SnapTrade * @implements \ArrayAccess */ diff --git a/lib/Model/TakeProfit.php b/lib/Model/TakeProfit.php index 749dfd6..ae795d5 100644 --- a/lib/Model/TakeProfit.php +++ b/lib/Model/TakeProfit.php @@ -30,7 +30,7 @@ * TakeProfit Class Doc Comment * * @category Class - * @description Details of the take profit order. Only to be used when order_class = BRACKET. + * @description Takes in a string value for limit_price * @package SnapTrade * @implements \ArrayAccess */ diff --git a/lib/Model/TradingCancelUserAccountOrderRequest.php b/lib/Model/TradingCancelUserAccountOrderRequest.php deleted file mode 100644 index 25ccf9d..0000000 --- a/lib/Model/TradingCancelUserAccountOrderRequest.php +++ /dev/null @@ -1,404 +0,0 @@ - - */ -class TradingCancelUserAccountOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'Trading_cancelUserAccountOrder_request'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'brokerage_order_id' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'brokerage_order_id' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'brokerage_order_id' => 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 = [ - 'brokerage_order_id' => 'brokerage_order_id' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'brokerage_order_id' => 'setBrokerageOrderId' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'brokerage_order_id' => 'getBrokerageOrderId' - ]; - - /** - * 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('brokerage_order_id', $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 brokerage_order_id - * - * @return string|null - */ - public function getBrokerageOrderId() - { - return $this->container['brokerage_order_id']; - } - - /** - * Sets brokerage_order_id - * - * @param string|null $brokerage_order_id Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system. - * - * @return self - */ - public function setBrokerageOrderId($brokerage_order_id) - { - - if (is_null($brokerage_order_id)) { - throw new \InvalidArgumentException('non-nullable brokerage_order_id cannot be null'); - } - - $this->container['brokerage_order_id'] = $brokerage_order_id; - - 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/test/Model/StopLossTest.php b/test/Model/StopLossTest.php index c1523a9..607f755 100644 --- a/test/Model/StopLossTest.php +++ b/test/Model/StopLossTest.php @@ -29,7 +29,7 @@ * StopLossTest Class Doc Comment * * @category Class - * @description Details of the stop loss order. Only to be used when order_class = BRACKET. stop_price is required, limit_price is optional + * @description Takes in string value for stop_price and limit_price. stop_price is required, limit_price is optional * @package SnapTrade */ class StopLossTest extends TestCase diff --git a/test/Model/TakeProfitTest.php b/test/Model/TakeProfitTest.php index 00ff289..ee1f127 100644 --- a/test/Model/TakeProfitTest.php +++ b/test/Model/TakeProfitTest.php @@ -29,7 +29,7 @@ * TakeProfitTest Class Doc Comment * * @category Class - * @description Details of the take profit order. Only to be used when order_class = BRACKET. + * @description Takes in a string value for limit_price * @package SnapTrade */ class TakeProfitTest extends TestCase diff --git a/test/Model/TradingCancelUserAccountOrderRequestTest.php b/test/Model/TradingCancelUserAccountOrderRequestTest.php deleted file mode 100644 index ae1078a..0000000 --- a/test/Model/TradingCancelUserAccountOrderRequestTest.php +++ /dev/null @@ -1,83 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "brokerage_order_id" - */ - public function testPropertyBrokerageOrderId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -}