diff --git a/README.md b/README.md index 37d0d10..dd85a49 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,13 @@ $seam->access_codes->delete($access_code->access_code_id); ## Installation -Run `composer require seamapi/seam` +To install the latest version of the automatically generated SDK, run: + +`composer require seamapi/seam` + +If you want to install our previous handwritten version, run: + +`composer require seamapi/seam:1.1` ## Development Setup diff --git a/src/Objects/Device.php b/src/Objects/Device.php index 39d8325..6a8c53a 100644 --- a/src/Objects/Device.php +++ b/src/Objects/Device.php @@ -29,6 +29,8 @@ public static function from_json(mixed $json): Device|null created_at: $json->created_at, is_managed: $json->is_managed, custom_metadata: $json->custom_metadata ?? null, + can_remotely_unlock: $json->can_remotely_unlock ?? null, + can_program_online_access_codes: $json->can_program_online_access_codes ?? null, ); } @@ -47,6 +49,8 @@ public function __construct( public string $created_at, public bool $is_managed, public mixed $custom_metadata, + public bool | null $can_remotely_unlock, + public bool | null $can_program_online_access_codes, ) { } diff --git a/src/Objects/DeviceHoneywellMetadata.php b/src/Objects/DeviceHoneywellMetadata.php new file mode 100644 index 0000000..6d3314d --- /dev/null +++ b/src/Objects/DeviceHoneywellMetadata.php @@ -0,0 +1,27 @@ +honeywell_device_id, + device_name: $json->device_name, + ); + } + + + + public function __construct( + public string $honeywell_device_id, + public string $device_name, + ) { + } + +} diff --git a/src/Objects/DeviceProperties.php b/src/Objects/DeviceProperties.php index c95443e..913b194 100644 --- a/src/Objects/DeviceProperties.php +++ b/src/Objects/DeviceProperties.php @@ -47,6 +47,7 @@ public static function from_json(mixed $json): DeviceProperties|null igloohome_metadata: isset($json->igloohome_metadata) ? DeviceIgloohomeMetadata::from_json($json->igloohome_metadata) : null, nest_metadata: isset($json->nest_metadata) ? DeviceNestMetadata::from_json($json->nest_metadata) : null, ecobee_metadata: isset($json->ecobee_metadata) ? DeviceEcobeeMetadata::from_json($json->ecobee_metadata) : null, + honeywell_metadata: isset($json->honeywell_metadata) ? DeviceHoneywellMetadata::from_json($json->honeywell_metadata) : null, hubitat_metadata: isset($json->hubitat_metadata) ? DeviceHubitatMetadata::from_json($json->hubitat_metadata) : null, dormakaba_oracode_metadata: isset($json->dormakaba_oracode_metadata) ? DeviceDormakabaOracodeMetadata::from_json($json->dormakaba_oracode_metadata) : null, wyze_metadata: isset($json->wyze_metadata) ? DeviceWyzeMetadata::from_json($json->wyze_metadata) : null, @@ -132,6 +133,7 @@ public function __construct( public DeviceIgloohomeMetadata | null $igloohome_metadata, public DeviceNestMetadata | null $nest_metadata, public DeviceEcobeeMetadata | null $ecobee_metadata, + public DeviceHoneywellMetadata | null $honeywell_metadata, public DeviceHubitatMetadata | null $hubitat_metadata, public DeviceDormakabaOracodeMetadata | null $dormakaba_oracode_metadata, public DeviceWyzeMetadata | null $wyze_metadata, diff --git a/src/Objects/Phone.php b/src/Objects/Phone.php index e716dff..2fc6a21 100644 --- a/src/Objects/Phone.php +++ b/src/Objects/Phone.php @@ -28,6 +28,8 @@ public static function from_json(mixed $json): Phone|null created_at: $json->created_at, is_managed: $json->is_managed, custom_metadata: $json->custom_metadata ?? null, + can_remotely_unlock: $json->can_remotely_unlock ?? null, + can_program_online_access_codes: $json->can_program_online_access_codes ?? null, ); } @@ -45,6 +47,8 @@ public function __construct( public string $created_at, public bool $is_managed, public mixed $custom_metadata, + public bool | null $can_remotely_unlock, + public bool | null $can_program_online_access_codes, ) { } diff --git a/src/SeamClient.php b/src/SeamClient.php index a7480ac..42a53c7 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -2376,6 +2376,45 @@ public function revoke_access_to_device( + } + + public function update( + string $user_identity_id, + string $user_identity_key = null, + string $email_address = null, + string $phone_number = null, + string $full_name = null + ): void { + $request_payload = []; + + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } + if ($user_identity_key !== null) { + $request_payload["user_identity_key"] = $user_identity_key; + } + if ($email_address !== null) { + $request_payload["email_address"] = $email_address; + } + if ($phone_number !== null) { + $request_payload["phone_number"] = $phone_number; + } + if ($full_name !== null) { + $request_payload["full_name"] = $full_name; + } + + $this->seam->request( + "POST", + "/user_identities/update", + json: $request_payload, + + ); + + + + + + } } @@ -3518,6 +3557,33 @@ public function __construct(SeamClient $seam) } + public function add_to_access_group( + string $acs_user_id, + string $acs_access_group_id + ): void { + $request_payload = []; + + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; + } + if ($acs_access_group_id !== null) { + $request_payload["acs_access_group_id"] = $acs_access_group_id; + } + + $this->seam->request( + "POST", + "/acs/users/add_to_access_group", + json: $request_payload, + + ); + + + + + + + } + public function create( string $acs_system_id, array $acs_access_group_ids = null, @@ -3671,6 +3737,33 @@ public function list_accessible_entrances( + } + + public function remove_from_access_group( + string $acs_user_id, + string $acs_access_group_id + ): void { + $request_payload = []; + + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; + } + if ($acs_access_group_id !== null) { + $request_payload["acs_access_group_id"] = $acs_access_group_id; + } + + $this->seam->request( + "POST", + "/acs/users/remove_from_access_group", + json: $request_payload, + + ); + + + + + + } public function revoke_access_to_all_entrances( @@ -4509,6 +4602,29 @@ public function __construct(SeamClient $seam) } + public function delete( + string $enrollment_automation_id + ): void { + $request_payload = []; + + if ($enrollment_automation_id !== null) { + $request_payload["enrollment_automation_id"] = $enrollment_automation_id; + } + + $this->seam->request( + "POST", + "/user_identities/enrollment_automations/delete", + json: $request_payload, + + ); + + + + + + + } + public function get( string $enrollment_automation_id ): void {