diff --git a/package-lock.json b/package-lock.json index 3d11e35..a448670 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.24.0", "@seamapi/nextlove-sdk-generator": "^1.19.1", - "@seamapi/types": "1.582.0", + "@seamapi/types": "1.586.0", "del": "^7.1.0", "prettier": "^3.0.0" } @@ -456,9 +456,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.582.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.582.0.tgz", - "integrity": "sha512-IV80fc2QH6LCBbmd5k9Fegj3BhhPEi0kajgY0dP0o/ue4ixjmfhyQM/HeQn4gpG//+XQE3twCK1wjPqcL4g7bQ==", + "version": "1.586.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.586.0.tgz", + "integrity": "sha512-ItYTH1tJF9Q+ZI+toTJnMFl6QHldoeZ5cF3gRtn7+8AM1eRs6p3V1tXVJXoQ8MtDNjBT4cdmSB2L7bXyS03Sjg==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index e61c767..57be633 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.24.0", "@seamapi/nextlove-sdk-generator": "^1.19.1", - "@seamapi/types": "1.582.0", + "@seamapi/types": "1.586.0", "del": "^7.1.0", "prettier": "^3.0.0" } diff --git a/src/SeamClient.php b/src/SeamClient.php index 1075f0d..4595e4b 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -876,10 +876,11 @@ public function update( class AccessGrantsClient { private SeamClient $seam; - + public AccessGrantsUnmanagedClient $unmanaged; public function __construct(SeamClient $seam) { $this->seam = $seam; + $this->unmanaged = new AccessGrantsUnmanagedClient($seam); } public function create( @@ -1091,7 +1092,7 @@ public function update( } } -class AccessMethodsClient +class AccessGrantsUnmanagedClient { private SeamClient $seam; @@ -1100,6 +1101,56 @@ public function __construct(SeamClient $seam) $this->seam = $seam; } + public function get(string $access_grant_id): void + { + $request_payload = []; + + if ($access_grant_id !== null) { + $request_payload["access_grant_id"] = $access_grant_id; + } + + $this->seam->request( + "POST", + "/access_grants/unmanaged/get", + json: (object) $request_payload, + ); + } + + public function list( + ?string $acs_entrance_id = null, + ?string $acs_system_id = null, + ?string $user_identity_id = null, + ): void { + $request_payload = []; + + if ($acs_entrance_id !== null) { + $request_payload["acs_entrance_id"] = $acs_entrance_id; + } + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; + } + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } + + $this->seam->request( + "POST", + "/access_grants/unmanaged/list", + json: (object) $request_payload, + ); + } +} + +class AccessMethodsClient +{ + private SeamClient $seam; + public AccessMethodsUnmanagedClient $unmanaged; + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + $this->unmanaged = new AccessMethodsUnmanagedClient($seam); + } + public function delete(string $access_method_id): void { $request_payload = []; @@ -1221,6 +1272,59 @@ public function list( } } +class AccessMethodsUnmanagedClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + } + + public function get(string $access_method_id): void + { + $request_payload = []; + + if ($access_method_id !== null) { + $request_payload["access_method_id"] = $access_method_id; + } + + $this->seam->request( + "POST", + "/access_methods/unmanaged/get", + json: (object) $request_payload, + ); + } + + public function list( + string $access_grant_id, + ?string $acs_entrance_id = null, + ?string $device_id = null, + ?string $space_id = null, + ): void { + $request_payload = []; + + if ($access_grant_id !== null) { + $request_payload["access_grant_id"] = $access_grant_id; + } + if ($acs_entrance_id !== null) { + $request_payload["acs_entrance_id"] = $acs_entrance_id; + } + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($space_id !== null) { + $request_payload["space_id"] = $space_id; + } + + $this->seam->request( + "POST", + "/access_methods/unmanaged/list", + json: (object) $request_payload, + ); + } +} + class AcsAccessGroupsClient { private SeamClient $seam; @@ -5759,10 +5863,11 @@ public function temperature_reached( class UserIdentitiesClient { private SeamClient $seam; - + public UserIdentitiesUnmanagedClient $unmanaged; public function __construct(SeamClient $seam) { $this->seam = $seam; + $this->unmanaged = new UserIdentitiesUnmanagedClient($seam); } public function add_acs_user( @@ -6059,6 +6164,46 @@ public function update( } } +class UserIdentitiesUnmanagedClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + } + + public function get(string $user_identity_id): void + { + $request_payload = []; + + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } + + $this->seam->request( + "POST", + "/user_identities/unmanaged/get", + json: (object) $request_payload, + ); + } + + public function list(?string $search = null): void + { + $request_payload = []; + + if ($search !== null) { + $request_payload["search"] = $search; + } + + $this->seam->request( + "POST", + "/user_identities/unmanaged/list", + json: (object) $request_payload, + ); + } +} + class WebhooksClient { private SeamClient $seam;