diff --git a/package-lock.json b/package-lock.json index 486f986..866a15f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.22.1", "@seamapi/nextlove-sdk-generator": "1.18.1", - "@seamapi/types": "1.384.0", + "@seamapi/types": "1.385.0", "del": "^7.1.0", "prettier": "^3.0.0" } @@ -456,9 +456,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.384.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.384.0.tgz", - "integrity": "sha512-pFQF4O7LaLu9J2yfNxtiuN/kCYX5WH0Sdccx6BC1rYQqwQSD1m5/yXTq14iCBa6z2R8Fw09WRU5Zp+NjHtleQQ==", + "version": "1.385.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.385.0.tgz", + "integrity": "sha512-XafuAs5nzVAMtN1UHTUgUK6BeyiuNR3ZAel3yWPtfEI42hyI+U/KpNHg+Poh2mzRxNq1vdwEf0WWLdEcaJ8Zgg==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index b928901..1aefba3 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.22.1", "@seamapi/nextlove-sdk-generator": "1.18.1", - "@seamapi/types": "1.384.0", + "@seamapi/types": "1.385.0", "del": "^7.1.0", "prettier": "^3.0.0" } diff --git a/src/SeamClient.php b/src/SeamClient.php index 9847684..2e62a27 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -60,6 +60,7 @@ class SeamClient public NetworksClient $networks; public NoiseSensorsClient $noise_sensors; public PhonesClient $phones; + public SeamClient $seam; public ThermostatsClient $thermostats; public UserIdentitiesClient $user_identities; public WebhooksClient $webhooks; @@ -101,6 +102,7 @@ public function __construct( $this->networks = new NetworksClient($this); $this->noise_sensors = new NoiseSensorsClient($this); $this->phones = new PhonesClient($this); + $this->seam = new SeamClient($this); $this->thermostats = new ThermostatsClient($this); $this->user_identities = new UserIdentitiesClient($this); $this->webhooks = new WebhooksClient($this); @@ -3417,6 +3419,44 @@ public function create_sandbox_phone( } } +class SeamInstantKeyV1ClientSessionsClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + } + + public function exchange_short_code(string $short_code): ClientSession + { + $request_payload = []; + + if ($short_code !== null) { + $request_payload["short_code"] = $short_code; + } + + $res = $this->seam->request( + "POST", + "/seam/instant_key/v1/client_sessions/exchange_short_code", + json: (object) $request_payload + ); + + return ClientSession::from_json($res->client_session); + } +} + +class SeamClient +{ + private SeamClient $seam; + public SeamInstantKeyClient $instant_key; + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + $this->instant_key = new SeamInstantKeyClient($seam); + } +} + class ThermostatsClient { private SeamClient $seam;