From d5d968623c15993f316ad31ff332e5c5c3cbfa7b Mon Sep 17 00:00:00 2001 From: Passiv Ops Date: Sat, 6 Jun 2026 00:10:43 +0000 Subject: [PATCH 1/2] Regenerate SDKs --- .konfig/generate-id.txt | 2 +- README.md | 5 ++ lib/Api/TradingApi.php | 4 + lib/Model/ManualTradeFormWithOptions.php | 49 +++++++++++- .../ManualTradePlaceTimeInForceStrict.php | 65 ++++++++++++++++ test/Model/ManualTradeFormWithOptionsTest.php | 9 +++ .../ManualTradePlaceTimeInForceStrictTest.php | 74 +++++++++++++++++++ 7 files changed, 204 insertions(+), 4 deletions(-) create mode 100644 lib/Model/ManualTradePlaceTimeInForceStrict.php create mode 100644 test/Model/ManualTradePlaceTimeInForceStrictTest.php diff --git a/.konfig/generate-id.txt b/.konfig/generate-id.txt index 2da34c0..d8d5dbd 100644 --- a/.konfig/generate-id.txt +++ b/.konfig/generate-id.txt @@ -1 +1 @@ -57e4306c-afdd-4579-be29-74de65f3dcfb \ No newline at end of file +56e4fd4e-9ce7-4be2-9280-ebcf4de71d7c \ No newline at end of file diff --git a/README.md b/README.md index 70b8ac5..103f2c2 100644 --- a/README.md +++ b/README.md @@ -2725,6 +2725,7 @@ $result = $snaptrade->trading->placeForceOrder( universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3", symbol: "AAPL", trading_session: "REGULAR", + expiry_date: "2026-08-21T23:27:55.027Z", price: 31.33, stop: 31.33, units: 10.5, @@ -2758,6 +2759,10 @@ The security's trading ticker symbol. If 'symbol' is provided, then 'universal_s ##### trading_session: +##### expiry_date: `\DateTime` + +Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the order expires. Required when `time_in_force` is `GTD`. Include a timezone offset or `Z` for UTC; if no timezone is provided, UTC is assumed. GTD orders are only available on certain brokerages. Visit https://support.snaptrade.com/brokerages for brokerage support. + ##### price: `float` The limit price for `Limit` and `StopLimit` orders. diff --git a/lib/Api/TradingApi.php b/lib/Api/TradingApi.php index 93d1532..36861a5 100644 --- a/lib/Api/TradingApi.php +++ b/lib/Api/TradingApi.php @@ -5051,6 +5051,7 @@ public function placeForceOrder( $universal_symbol_id = SENTINEL_VALUE, $symbol = SENTINEL_VALUE, $trading_session = SENTINEL_VALUE, + $expiry_date = SENTINEL_VALUE, $price = SENTINEL_VALUE, $stop = SENTINEL_VALUE, $units = SENTINEL_VALUE, @@ -5066,6 +5067,7 @@ public function placeForceOrder( $this->setRequestBodyProperty($_body, "order_type", $order_type); $this->setRequestBodyProperty($_body, "time_in_force", $time_in_force); $this->setRequestBodyProperty($_body, "trading_session", $trading_session); + $this->setRequestBodyProperty($_body, "expiry_date", $expiry_date); $this->setRequestBodyProperty($_body, "price", $price); $this->setRequestBodyProperty($_body, "stop", $stop); $this->setRequestBodyProperty($_body, "units", $units); @@ -5269,6 +5271,7 @@ public function placeForceOrderAsync( $universal_symbol_id = SENTINEL_VALUE, $symbol = SENTINEL_VALUE, $trading_session = SENTINEL_VALUE, + $expiry_date = SENTINEL_VALUE, $price = SENTINEL_VALUE, $stop = SENTINEL_VALUE, $units = SENTINEL_VALUE, @@ -5284,6 +5287,7 @@ public function placeForceOrderAsync( $this->setRequestBodyProperty($_body, "order_type", $order_type); $this->setRequestBodyProperty($_body, "time_in_force", $time_in_force); $this->setRequestBodyProperty($_body, "trading_session", $trading_session); + $this->setRequestBodyProperty($_body, "expiry_date", $expiry_date); $this->setRequestBodyProperty($_body, "price", $price); $this->setRequestBodyProperty($_body, "stop", $stop); $this->setRequestBodyProperty($_body, "units", $units); diff --git a/lib/Model/ManualTradeFormWithOptions.php b/lib/Model/ManualTradeFormWithOptions.php index 05760f4..6e8005e 100644 --- a/lib/Model/ManualTradeFormWithOptions.php +++ b/lib/Model/ManualTradeFormWithOptions.php @@ -56,8 +56,9 @@ class ManualTradeFormWithOptions implements ModelInterface, ArrayAccess, \JsonSe 'universal_symbol_id' => 'string', 'symbol' => 'string', 'order_type' => '\SnapTrade\Model\OrderTypeStrict', - 'time_in_force' => '\SnapTrade\Model\TimeInForceStrict', + 'time_in_force' => '\SnapTrade\Model\ManualTradePlaceTimeInForceStrict', 'trading_session' => '\SnapTrade\Model\TradingSession', + 'expiry_date' => '\DateTime', 'price' => 'float', 'stop' => 'float', 'units' => 'float', @@ -79,6 +80,7 @@ class ManualTradeFormWithOptions implements ModelInterface, ArrayAccess, \JsonSe 'order_type' => null, 'time_in_force' => null, 'trading_session' => null, + 'expiry_date' => 'date-time', 'price' => null, 'stop' => null, 'units' => null, @@ -98,6 +100,7 @@ class ManualTradeFormWithOptions implements ModelInterface, ArrayAccess, \JsonSe 'order_type' => false, 'time_in_force' => false, 'trading_session' => false, + 'expiry_date' => true, 'price' => true, 'stop' => true, 'units' => true, @@ -197,6 +200,7 @@ public function isNullableSetToNull(string $property): bool 'order_type' => 'order_type', 'time_in_force' => 'time_in_force', 'trading_session' => 'trading_session', + 'expiry_date' => 'expiry_date', 'price' => 'price', 'stop' => 'stop', 'units' => 'units', @@ -216,6 +220,7 @@ public function isNullableSetToNull(string $property): bool 'order_type' => 'setOrderType', 'time_in_force' => 'setTimeInForce', 'trading_session' => 'setTradingSession', + 'expiry_date' => 'setExpiryDate', 'price' => 'setPrice', 'stop' => 'setStop', 'units' => 'setUnits', @@ -235,6 +240,7 @@ public function isNullableSetToNull(string $property): bool 'order_type' => 'getOrderType', 'time_in_force' => 'getTimeInForce', 'trading_session' => 'getTradingSession', + 'expiry_date' => 'getExpiryDate', 'price' => 'getPrice', 'stop' => 'getStop', 'units' => 'getUnits', @@ -305,6 +311,7 @@ public function __construct(array $data = null) $this->setIfExists('order_type', $data ?? [], null); $this->setIfExists('time_in_force', $data ?? [], null); $this->setIfExists('trading_session', $data ?? [], null); + $this->setIfExists('expiry_date', $data ?? [], null); $this->setIfExists('price', $data ?? [], null); $this->setIfExists('stop', $data ?? [], null); $this->setIfExists('units', $data ?? [], null); @@ -527,7 +534,7 @@ public function setOrderType($order_type) /** * Gets time_in_force * - * @return \SnapTrade\Model\TimeInForceStrict + * @return \SnapTrade\Model\ManualTradePlaceTimeInForceStrict */ public function getTimeInForce() { @@ -537,7 +544,7 @@ public function getTimeInForce() /** * Sets time_in_force * - * @param \SnapTrade\Model\TimeInForceStrict $time_in_force time_in_force + * @param \SnapTrade\Model\ManualTradePlaceTimeInForceStrict $time_in_force time_in_force * * @return self */ @@ -582,6 +589,42 @@ public function setTradingSession($trading_session) return $this; } + /** + * Gets expiry_date + * + * @return \DateTime|null + */ + public function getExpiryDate() + { + return $this->container['expiry_date']; + } + + /** + * Sets expiry_date + * + * @param \DateTime|null $expiry_date Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the order expires. Required when `time_in_force` is `GTD`. Include a timezone offset or `Z` for UTC; if no timezone is provided, UTC is assumed. GTD orders are only available on certain brokerages. Visit https://support.snaptrade.com/brokerages for brokerage support. + * + * @return self + */ + public function setExpiryDate($expiry_date) + { + + if (is_null($expiry_date)) { + array_push($this->openAPINullablesSetToNull, 'expiry_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expiry_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + + $this->container['expiry_date'] = $expiry_date; + + return $this; + } + /** * Gets price * diff --git a/lib/Model/ManualTradePlaceTimeInForceStrict.php b/lib/Model/ManualTradePlaceTimeInForceStrict.php new file mode 100644 index 0000000..0f93fff --- /dev/null +++ b/lib/Model/ManualTradePlaceTimeInForceStrict.php @@ -0,0 +1,65 @@ +markTestIncomplete('Not implemented'); } + /** + * Test attribute "expiry_date" + */ + public function testPropertyExpiryDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "price" */ diff --git a/test/Model/ManualTradePlaceTimeInForceStrictTest.php b/test/Model/ManualTradePlaceTimeInForceStrictTest.php new file mode 100644 index 0000000..f6e204d --- /dev/null +++ b/test/Model/ManualTradePlaceTimeInForceStrictTest.php @@ -0,0 +1,74 @@ +markTestIncomplete('Not implemented'); + } +} From 347b2c840157722919b8c646a680f055735a7445 Mon Sep 17 00:00:00 2001 From: Passiv Ops Date: Mon, 8 Jun 2026 15:47:49 +0000 Subject: [PATCH 2/2] Regenerate SDKs --- .konfig/generate-id.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.konfig/generate-id.txt b/.konfig/generate-id.txt index d8d5dbd..af33d5e 100644 --- a/.konfig/generate-id.txt +++ b/.konfig/generate-id.txt @@ -1 +1 @@ -56e4fd4e-9ce7-4be2-9280-ebcf4de71d7c \ No newline at end of file +06ced896-0ac1-47b3-b506-5a377cd78777 \ No newline at end of file