diff --git a/package-lock.json b/package-lock.json index a06c464..fea2f37 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.423.4", + "@seamapi/types": "1.439.0", "del": "^7.1.0", "prettier": "^3.0.0" } @@ -456,11 +456,10 @@ } }, "node_modules/@seamapi/types": { - "version": "1.423.4", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.423.4.tgz", - "integrity": "sha512-cZX6y4LKeijIpaUUBJEvN6fO9MsEevrUHT4oQ2kJx5sm9pNJqUR1RSuBktcNBA6zO/na8hZtGo0NrAJxK5KYQw==", + "version": "1.439.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.439.0.tgz", + "integrity": "sha512-QFzo0jLtB2CIkm26K0tMhPNbeF+qxyAWGyhRufTUKcbIE5sYoi025f2nAkssBxOWH8uf18pTaH326igBt08Wew==", "dev": true, - "license": "MIT", "engines": { "node": ">=18.12.0", "npm": ">= 9.0.0" diff --git a/package.json b/package.json index b7e0048..be76fdc 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.423.4", + "@seamapi/types": "1.439.0", "del": "^7.1.0", "prettier": "^3.0.0" } diff --git a/src/Objects/AccessGrant.php b/src/Objects/AccessGrant.php index f7c4be7..61d6dc9 100644 --- a/src/Objects/AccessGrant.php +++ b/src/Objects/AccessGrant.php @@ -23,6 +23,7 @@ public static function from_json(mixed $json): AccessGrant|null user_identity_id: $json->user_identity_id, workspace_id: $json->workspace_id, ends_at: $json->ends_at ?? null, + instant_key_url: $json->instant_key_url ?? null, starts_at: $json->starts_at ?? null ); } @@ -38,6 +39,7 @@ public function __construct( public string $user_identity_id, public string $workspace_id, public string|null $ends_at, + public string|null $instant_key_url, public string|null $starts_at ) { } diff --git a/src/Objects/AccessMethod.php b/src/Objects/AccessMethod.php index 7afa91e..9d758c6 100644 --- a/src/Objects/AccessMethod.php +++ b/src/Objects/AccessMethod.php @@ -16,7 +16,7 @@ public static function from_json(mixed $json): AccessMethod|null mode: $json->mode, workspace_id: $json->workspace_id, instant_key_url: $json->instant_key_url ?? null, - is_card_encoding_required: $json->is_card_encoding_required ?? null, + is_encoding_required: $json->is_encoding_required ?? null, issued_at: $json->issued_at ?? null ); } @@ -28,7 +28,7 @@ public function __construct( public string $mode, public string $workspace_id, public string|null $instant_key_url, - public bool|null $is_card_encoding_required, + public bool|null $is_encoding_required, public string|null $issued_at ) { } diff --git a/src/Objects/AcsCredential.php b/src/Objects/AcsCredential.php index 05fdec2..4d5c942 100644 --- a/src/Objects/AcsCredential.php +++ b/src/Objects/AcsCredential.php @@ -13,6 +13,7 @@ public static function from_json(mixed $json): AcsCredential|null access_method: $json->access_method, acs_credential_id: $json->acs_credential_id, acs_system_id: $json->acs_system_id, + connected_account_id: $json->connected_account_id, created_at: $json->created_at, display_name: $json->display_name, errors: array_map( @@ -42,6 +43,7 @@ public static function from_json(mixed $json): AcsCredential|null is_one_time_use: $json->is_one_time_use ?? null, parent_acs_credential_id: $json->parent_acs_credential_id ?? null, starts_at: $json->starts_at ?? null, + user_identity_id: $json->user_identity_id ?? null, visionline_metadata: isset($json->visionline_metadata) ? AcsCredentialVisionlineMetadata::from_json( $json->visionline_metadata @@ -61,6 +63,7 @@ public function __construct( public string $access_method, public string $acs_credential_id, public string $acs_system_id, + public string $connected_account_id, public string $created_at, public string $display_name, public array $errors, @@ -78,6 +81,7 @@ public function __construct( public bool|null $is_one_time_use, public string|null $parent_acs_credential_id, public string|null $starts_at, + public string|null $user_identity_id, public AcsCredentialVisionlineMetadata|null $visionline_metadata, public string|null $card_number, public string|null $code, diff --git a/src/Objects/AcsEntrance.php b/src/Objects/AcsEntrance.php index 3e64452..f5fd47d 100644 --- a/src/Objects/AcsEntrance.php +++ b/src/Objects/AcsEntrance.php @@ -24,6 +24,10 @@ public static function from_json(mixed $json): AcsEntrance|null $json->assa_abloy_vostio_metadata ) : null, + can_unlock_with_card: $json->can_unlock_with_card ?? null, + can_unlock_with_code: $json->can_unlock_with_code ?? null, + can_unlock_with_mobile_key: $json->can_unlock_with_mobile_key ?? + null, dormakaba_community_metadata: isset( $json->dormakaba_community_metadata ) @@ -60,6 +64,9 @@ public function __construct( public string $display_name, public array $errors, public AcsEntranceAssaAbloyVostioMetadata|null $assa_abloy_vostio_metadata, + public bool|null $can_unlock_with_card, + public bool|null $can_unlock_with_code, + public bool|null $can_unlock_with_mobile_key, public AcsEntranceDormakabaCommunityMetadata|null $dormakaba_community_metadata, public AcsEntranceLatchMetadata|null $latch_metadata, public AcsEntranceSaltoKsMetadata|null $salto_ks_metadata, diff --git a/src/Objects/ConnectedAccount.php b/src/Objects/ConnectedAccount.php index 73487bc..6ceaeef 100644 --- a/src/Objects/ConnectedAccount.php +++ b/src/Objects/ConnectedAccount.php @@ -10,6 +10,7 @@ public static function from_json(mixed $json): ConnectedAccount|null return null; } return new self( + accepted_capabilities: $json->accepted_capabilities, account_type_display_name: $json->account_type_display_name, automatically_manage_new_devices: $json->automatically_manage_new_devices, custom_metadata: $json->custom_metadata, @@ -34,6 +35,7 @@ public static function from_json(mixed $json): ConnectedAccount|null } public function __construct( + public array $accepted_capabilities, public string $account_type_display_name, public bool $automatically_manage_new_devices, public mixed $custom_metadata, diff --git a/src/Objects/Device.php b/src/Objects/Device.php index 65621ca..7bbdc47 100644 --- a/src/Objects/Device.php +++ b/src/Objects/Device.php @@ -42,6 +42,7 @@ public static function from_json(mixed $json): Device|null null, can_simulate_removal: $json->can_simulate_removal ?? null, can_turn_off_hvac: $json->can_turn_off_hvac ?? null, + can_unlock_with_code: $json->can_unlock_with_code ?? null, nickname: $json->nickname ?? null, location: isset($json->location) ? DeviceLocation::from_json($json->location) @@ -73,6 +74,7 @@ public function __construct( public bool|null $can_simulate_disconnection, public bool|null $can_simulate_removal, public bool|null $can_turn_off_hvac, + public bool|null $can_unlock_with_code, public string|null $nickname, public DeviceLocation|null $location ) { diff --git a/src/Objects/DeviceAvailableClimatePresets.php b/src/Objects/DeviceAvailableClimatePresets.php index b3bb51e..311943e 100644 --- a/src/Objects/DeviceAvailableClimatePresets.php +++ b/src/Objects/DeviceAvailableClimatePresets.php @@ -17,9 +17,13 @@ public static function from_json( climate_preset_key: $json->climate_preset_key, display_name: $json->display_name, manual_override_allowed: $json->manual_override_allowed, + climate_preset_mode: $json->climate_preset_mode ?? null, cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, + ecobee_metadata: isset($json->ecobee_metadata) + ? DeviceEcobeeMetadata::from_json($json->ecobee_metadata) + : null, fan_mode_setting: $json->fan_mode_setting ?? null, heating_set_point_celsius: $json->heating_set_point_celsius ?? null, heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? @@ -36,8 +40,10 @@ public function __construct( public string $climate_preset_key, public string $display_name, public bool $manual_override_allowed, + public string|null $climate_preset_mode, public float|null $cooling_set_point_celsius, public float|null $cooling_set_point_fahrenheit, + public DeviceEcobeeMetadata|null $ecobee_metadata, public string|null $fan_mode_setting, public float|null $heating_set_point_celsius, public float|null $heating_set_point_fahrenheit, diff --git a/src/Objects/DeviceCurrentClimateSetting.php b/src/Objects/DeviceCurrentClimateSetting.php index 06294b0..ee2bd9b 100644 --- a/src/Objects/DeviceCurrentClimateSetting.php +++ b/src/Objects/DeviceCurrentClimateSetting.php @@ -15,10 +15,14 @@ public static function from_json( can_edit: $json->can_edit ?? null, can_program: $json->can_program ?? null, climate_preset_key: $json->climate_preset_key ?? null, + climate_preset_mode: $json->climate_preset_mode ?? null, cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, display_name: $json->display_name ?? null, + ecobee_metadata: isset($json->ecobee_metadata) + ? DeviceEcobeeMetadata::from_json($json->ecobee_metadata) + : null, fan_mode_setting: $json->fan_mode_setting ?? null, heating_set_point_celsius: $json->heating_set_point_celsius ?? null, heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? @@ -34,9 +38,11 @@ public function __construct( public bool|null $can_edit, public bool|null $can_program, public string|null $climate_preset_key, + public string|null $climate_preset_mode, public float|null $cooling_set_point_celsius, public float|null $cooling_set_point_fahrenheit, public string|null $display_name, + public DeviceEcobeeMetadata|null $ecobee_metadata, public string|null $fan_mode_setting, public float|null $heating_set_point_celsius, public float|null $heating_set_point_fahrenheit, diff --git a/src/Objects/DeviceDefaultClimateSetting.php b/src/Objects/DeviceDefaultClimateSetting.php index a2d2bdc..e8b5613 100644 --- a/src/Objects/DeviceDefaultClimateSetting.php +++ b/src/Objects/DeviceDefaultClimateSetting.php @@ -15,10 +15,14 @@ public static function from_json( can_edit: $json->can_edit ?? null, can_program: $json->can_program ?? null, climate_preset_key: $json->climate_preset_key ?? null, + climate_preset_mode: $json->climate_preset_mode ?? null, cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, display_name: $json->display_name ?? null, + ecobee_metadata: isset($json->ecobee_metadata) + ? DeviceEcobeeMetadata::from_json($json->ecobee_metadata) + : null, fan_mode_setting: $json->fan_mode_setting ?? null, heating_set_point_celsius: $json->heating_set_point_celsius ?? null, heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? @@ -34,9 +38,11 @@ public function __construct( public bool|null $can_edit, public bool|null $can_program, public string|null $climate_preset_key, + public string|null $climate_preset_mode, public float|null $cooling_set_point_celsius, public float|null $cooling_set_point_fahrenheit, public string|null $display_name, + public DeviceEcobeeMetadata|null $ecobee_metadata, public string|null $fan_mode_setting, public float|null $heating_set_point_celsius, public float|null $heating_set_point_fahrenheit, diff --git a/src/Objects/DeviceIgloohomeMetadata.php b/src/Objects/DeviceIgloohomeMetadata.php index de29bb2..9b89508 100644 --- a/src/Objects/DeviceIgloohomeMetadata.php +++ b/src/Objects/DeviceIgloohomeMetadata.php @@ -14,6 +14,8 @@ public static function from_json(mixed $json): DeviceIgloohomeMetadata|null device_name: $json->device_name, bridge_id: $json->bridge_id ?? null, bridge_name: $json->bridge_name ?? null, + is_keypad_linked_to_bridge: $json->is_keypad_linked_to_bridge ?? + null, keypad_id: $json->keypad_id ?? null ); } @@ -23,6 +25,7 @@ public function __construct( public string $device_name, public string|null $bridge_id, public string|null $bridge_name, + public bool|null $is_keypad_linked_to_bridge, public string|null $keypad_id ) { } diff --git a/src/Objects/DeviceProperties.php b/src/Objects/DeviceProperties.php index 5b69a61..a0fe652 100644 --- a/src/Objects/DeviceProperties.php +++ b/src/Objects/DeviceProperties.php @@ -42,6 +42,8 @@ public static function from_json(mixed $json): DeviceProperties|null august_metadata: isset($json->august_metadata) ? DeviceAugustMetadata::from_json($json->august_metadata) : null, + available_climate_preset_modes: $json->available_climate_preset_modes ?? + null, available_climate_presets: array_map( fn($a) => DeviceAvailableClimatePresets::from_json($a), $json->available_climate_presets ?? [] @@ -268,6 +270,7 @@ public function __construct( public DeviceAssaAbloyCredentialServiceMetadata|null $assa_abloy_credential_service_metadata, public DeviceAssaAbloyVostioMetadata|null $assa_abloy_vostio_metadata, public DeviceAugustMetadata|null $august_metadata, + public array|null $available_climate_preset_modes, public array|null $available_climate_presets, public array|null $available_fan_mode_settings, public array|null $available_hvac_mode_settings, diff --git a/src/Objects/DeviceProvider.php b/src/Objects/DeviceProvider.php index 7968647..a15711d 100644 --- a/src/Objects/DeviceProvider.php +++ b/src/Objects/DeviceProvider.php @@ -27,7 +27,8 @@ public static function from_json(mixed $json): DeviceProvider|null can_simulate_disconnection: $json->can_simulate_disconnection ?? null, can_simulate_removal: $json->can_simulate_removal ?? null, - can_turn_off_hvac: $json->can_turn_off_hvac ?? null + can_turn_off_hvac: $json->can_turn_off_hvac ?? null, + can_unlock_with_code: $json->can_unlock_with_code ?? null ); } @@ -46,7 +47,8 @@ public function __construct( public bool|null $can_simulate_connection, public bool|null $can_simulate_disconnection, public bool|null $can_simulate_removal, - public bool|null $can_turn_off_hvac + public bool|null $can_turn_off_hvac, + public bool|null $can_unlock_with_code ) { } } diff --git a/src/Objects/Event.php b/src/Objects/Event.php index 5dc14e8..3a96525 100644 --- a/src/Objects/Event.php +++ b/src/Objects/Event.php @@ -27,6 +27,8 @@ public static function from_json(mixed $json): Event|null client_session_id: $json->client_session_id ?? null, climate_preset_key: $json->climate_preset_key ?? null, connect_webview_id: $json->connect_webview_id ?? null, + connected_account_custom_metadata: $json->connected_account_custom_metadata ?? + null, connected_account_id: $json->connected_account_id ?? null, cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? @@ -36,6 +38,7 @@ public static function from_json(mixed $json): Event|null null, desired_temperature_fahrenheit: $json->desired_temperature_fahrenheit ?? null, + device_custom_metadata: $json->device_custom_metadata ?? null, device_id: $json->device_id ?? null, device_name: $json->device_name ?? null, enrollment_automation_id: $json->enrollment_automation_id ?? null, @@ -88,12 +91,14 @@ public function __construct( public string|null $client_session_id, public string|null $climate_preset_key, public string|null $connect_webview_id, + public mixed $connected_account_custom_metadata, public string|null $connected_account_id, public float|null $cooling_set_point_celsius, public float|null $cooling_set_point_fahrenheit, public string|null $created_at, public float|null $desired_temperature_celsius, public float|null $desired_temperature_fahrenheit, + public mixed $device_custom_metadata, public string|null $device_id, public string|null $device_name, public string|null $enrollment_automation_id, diff --git a/src/Objects/PhoneSessionAcsCredentials.php b/src/Objects/PhoneSessionAcsCredentials.php index 6d8a8f8..8f13151 100644 --- a/src/Objects/PhoneSessionAcsCredentials.php +++ b/src/Objects/PhoneSessionAcsCredentials.php @@ -17,6 +17,7 @@ public static function from_json( $json->acs_entrances ?? [] ), acs_system_id: $json->acs_system_id, + connected_account_id: $json->connected_account_id, created_at: $json->created_at, display_name: $json->display_name, errors: array_map( @@ -46,6 +47,7 @@ public static function from_json( is_one_time_use: $json->is_one_time_use ?? null, parent_acs_credential_id: $json->parent_acs_credential_id ?? null, starts_at: $json->starts_at ?? null, + user_identity_id: $json->user_identity_id ?? null, visionline_metadata: isset($json->visionline_metadata) ? PhoneSessionVisionlineMetadata::from_json( $json->visionline_metadata @@ -66,6 +68,7 @@ public function __construct( public string $access_method, public array $acs_entrances, public string $acs_system_id, + public string $connected_account_id, public string $created_at, public string $display_name, public array $errors, @@ -83,6 +86,7 @@ public function __construct( public bool|null $is_one_time_use, public string|null $parent_acs_credential_id, public string|null $starts_at, + public string|null $user_identity_id, public PhoneSessionVisionlineMetadata|null $visionline_metadata, public string|null $acs_credential_id, public string|null $card_number, diff --git a/src/Objects/PhoneSessionAcsEntrances.php b/src/Objects/PhoneSessionAcsEntrances.php index c66c893..4567461 100644 --- a/src/Objects/PhoneSessionAcsEntrances.php +++ b/src/Objects/PhoneSessionAcsEntrances.php @@ -24,6 +24,10 @@ public static function from_json(mixed $json): PhoneSessionAcsEntrances|null $json->assa_abloy_vostio_metadata ) : null, + can_unlock_with_card: $json->can_unlock_with_card ?? null, + can_unlock_with_code: $json->can_unlock_with_code ?? null, + can_unlock_with_mobile_key: $json->can_unlock_with_mobile_key ?? + null, dormakaba_community_metadata: isset( $json->dormakaba_community_metadata ) @@ -60,6 +64,9 @@ public function __construct( public string $display_name, public array $errors, public PhoneSessionAssaAbloyVostioMetadata|null $assa_abloy_vostio_metadata, + public bool|null $can_unlock_with_card, + public bool|null $can_unlock_with_code, + public bool|null $can_unlock_with_mobile_key, public PhoneSessionDormakabaCommunityMetadata|null $dormakaba_community_metadata, public PhoneSessionLatchMetadata|null $latch_metadata, public PhoneSessionSaltoKsMetadata|null $salto_ks_metadata, diff --git a/src/Objects/UnmanagedAcsCredential.php b/src/Objects/UnmanagedAcsCredential.php index 499d371..956222b 100644 --- a/src/Objects/UnmanagedAcsCredential.php +++ b/src/Objects/UnmanagedAcsCredential.php @@ -13,6 +13,7 @@ public static function from_json(mixed $json): UnmanagedAcsCredential|null access_method: $json->access_method, acs_credential_id: $json->acs_credential_id, acs_system_id: $json->acs_system_id, + connected_account_id: $json->connected_account_id, created_at: $json->created_at, display_name: $json->display_name, errors: array_map( @@ -42,6 +43,7 @@ public static function from_json(mixed $json): UnmanagedAcsCredential|null is_one_time_use: $json->is_one_time_use ?? null, parent_acs_credential_id: $json->parent_acs_credential_id ?? null, starts_at: $json->starts_at ?? null, + user_identity_id: $json->user_identity_id ?? null, visionline_metadata: isset($json->visionline_metadata) ? UnmanagedAcsCredentialVisionlineMetadata::from_json( $json->visionline_metadata @@ -61,6 +63,7 @@ public function __construct( public string $access_method, public string $acs_credential_id, public string $acs_system_id, + public string $connected_account_id, public string $created_at, public string $display_name, public array $errors, @@ -78,6 +81,7 @@ public function __construct( public bool|null $is_one_time_use, public string|null $parent_acs_credential_id, public string|null $starts_at, + public string|null $user_identity_id, public UnmanagedAcsCredentialVisionlineMetadata|null $visionline_metadata, public string|null $card_number, public string|null $code, diff --git a/src/Objects/UnmanagedDevice.php b/src/Objects/UnmanagedDevice.php index 5dbba21..2c40314 100644 --- a/src/Objects/UnmanagedDevice.php +++ b/src/Objects/UnmanagedDevice.php @@ -40,6 +40,7 @@ public static function from_json(mixed $json): UnmanagedDevice|null null, can_simulate_removal: $json->can_simulate_removal ?? null, can_turn_off_hvac: $json->can_turn_off_hvac ?? null, + can_unlock_with_code: $json->can_unlock_with_code ?? null, location: isset($json->location) ? UnmanagedDeviceLocation::from_json($json->location) : null @@ -68,6 +69,7 @@ public function __construct( public bool|null $can_simulate_disconnection, public bool|null $can_simulate_removal, public bool|null $can_turn_off_hvac, + public bool|null $can_unlock_with_code, public UnmanagedDeviceLocation|null $location ) { } diff --git a/src/Objects/UserIdentity.php b/src/Objects/UserIdentity.php index dfcfe10..e9b2ca5 100644 --- a/src/Objects/UserIdentity.php +++ b/src/Objects/UserIdentity.php @@ -10,6 +10,7 @@ public static function from_json(mixed $json): UserIdentity|null return null; } return new self( + acs_user_ids: $json->acs_user_ids, created_at: $json->created_at, display_name: $json->display_name, errors: array_map( @@ -30,6 +31,7 @@ public static function from_json(mixed $json): UserIdentity|null } public function __construct( + public array $acs_user_ids, public string $created_at, public string $display_name, public array $errors, diff --git a/src/Objects/UserIdentityErrors.php b/src/Objects/UserIdentityErrors.php index 5951407..f01b145 100644 --- a/src/Objects/UserIdentityErrors.php +++ b/src/Objects/UserIdentityErrors.php @@ -9,11 +9,20 @@ public static function from_json(mixed $json): UserIdentityErrors|null if (!$json) { return null; } - return new self(created_at: $json->created_at, message: $json->message); + return new self( + acs_system_id: $json->acs_system_id, + acs_user_id: $json->acs_user_id, + created_at: $json->created_at, + error_code: $json->error_code, + message: $json->message + ); } public function __construct( + public string $acs_system_id, + public string $acs_user_id, public string $created_at, + public string $error_code, public string $message ) { } diff --git a/src/SeamClient.php b/src/SeamClient.php index 47f0995..1347485 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -1041,6 +1041,37 @@ public function delete(string $access_method_id): void ); } + public function encode( + string $access_method_id, + string $acs_encoder_id, + bool $wait_for_action_attempt = true + ): ActionAttempt { + $request_payload = []; + + if ($access_method_id !== null) { + $request_payload["access_method_id"] = $access_method_id; + } + if ($acs_encoder_id !== null) { + $request_payload["acs_encoder_id"] = $acs_encoder_id; + } + + $res = $this->seam->request( + "POST", + "/access_methods/encode", + json: (object) $request_payload + ); + + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res->action_attempt); + } + + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt->action_attempt_id + ); + + return $action_attempt; + } + public function get(string $access_method_id): AccessMethod { $request_payload = []; @@ -1502,50 +1533,23 @@ public function __construct(SeamClient $seam) $this->seam = $seam; } - public function encode_access_method( - string $access_method_id, + public function encode_credential( string $acs_encoder_id, + ?string $access_method_id = null, + ?string $acs_credential_id = null, bool $wait_for_action_attempt = true ): ActionAttempt { $request_payload = []; - if ($access_method_id !== null) { - $request_payload["access_method_id"] = $access_method_id; - } if ($acs_encoder_id !== null) { $request_payload["acs_encoder_id"] = $acs_encoder_id; } - - $res = $this->seam->request( - "POST", - "/acs/encoders/encode_access_method", - json: (object) $request_payload - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res->action_attempt); + if ($access_method_id !== null) { + $request_payload["access_method_id"] = $access_method_id; } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt->action_attempt_id - ); - - return $action_attempt; - } - - public function encode_credential( - string $acs_credential_id, - string $acs_encoder_id, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - if ($acs_credential_id !== null) { $request_payload["acs_credential_id"] = $acs_credential_id; } - if ($acs_encoder_id !== null) { - $request_payload["acs_encoder_id"] = $acs_encoder_id; - } $res = $this->seam->request( "POST", @@ -1802,7 +1806,9 @@ public function list( ?string $access_grant_id = null, ?string $access_method_id = null, ?string $acs_credential_id = null, + ?array $acs_entrance_ids = null, ?string $acs_system_id = null, + ?string $connected_account_id = null, ?string $location_id = null, ?string $space_id = null ): array { @@ -1817,9 +1823,15 @@ public function list( if ($acs_credential_id !== null) { $request_payload["acs_credential_id"] = $acs_credential_id; } + if ($acs_entrance_ids !== null) { + $request_payload["acs_entrance_ids"] = $acs_entrance_ids; + } if ($acs_system_id !== null) { $request_payload["acs_system_id"] = $acs_system_id; } + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; + } if ($location_id !== null) { $request_payload["location_id"] = $location_id; } @@ -2775,6 +2787,7 @@ public function list( ?array $customer_ids = null, mixed $limit = null, ?string $page_cursor = null, + ?string $search = null, ?string $user_identifier_key = null, ?callable $on_response = null ): array { @@ -2792,6 +2805,9 @@ public function list( if ($page_cursor !== null) { $request_payload["page_cursor"] = $page_cursor; } + if ($search !== null) { + $request_payload["search"] = $search; + } if ($user_identifier_key !== null) { $request_payload["user_identifier_key"] = $user_identifier_key; } @@ -3021,6 +3037,7 @@ public function list( ?float $limit = null, ?string $manufacturer = null, ?string $page_cursor = null, + ?string $search = null, ?string $space_id = null, ?string $unstable_location_id = null, ?string $user_identifier_key = null, @@ -3070,6 +3087,9 @@ public function list( if ($page_cursor !== null) { $request_payload["page_cursor"] = $page_cursor; } + if ($search !== null) { + $request_payload["search"] = $search; + } if ($space_id !== null) { $request_payload["space_id"] = $space_id; } @@ -3171,6 +3191,21 @@ public function connect(string $device_id): void ); } + public function connect_to_hub(string $device_id): void + { + $request_payload = []; + + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + + $this->seam->request( + "POST", + "/devices/simulate/connect_to_hub", + json: (object) $request_payload + ); + } + public function disconnect(string $device_id): void { $request_payload = []; @@ -3186,6 +3221,21 @@ public function disconnect(string $device_id): void ); } + public function disconnect_from_hub(string $device_id): void + { + $request_payload = []; + + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + + $this->seam->request( + "POST", + "/devices/simulate/disconnect_from_hub", + json: (object) $request_payload + ); + } + public function remove(string $device_id): void { $request_payload = []; @@ -3248,6 +3298,7 @@ public function list( ?float $limit = null, ?string $manufacturer = null, ?string $page_cursor = null, + ?string $search = null, ?string $space_id = null, ?string $unstable_location_id = null, ?string $user_identifier_key = null, @@ -3297,6 +3348,9 @@ public function list( if ($page_cursor !== null) { $request_payload["page_cursor"] = $page_cursor; } + if ($search !== null) { + $request_payload["search"] = $search; + } if ($space_id !== null) { $request_payload["space_id"] = $space_id; } @@ -3459,10 +3513,11 @@ public function list( class LocksClient { private SeamClient $seam; - + public LocksSimulateClient $simulate; public function __construct(SeamClient $seam) { $this->seam = $seam; + $this->simulate = new LocksSimulateClient($seam); } public function get(?string $device_id = null, ?string $name = null): Device @@ -3500,6 +3555,7 @@ public function list( ?float $limit = null, ?string $manufacturer = null, ?string $page_cursor = null, + ?string $search = null, ?string $space_id = null, ?string $unstable_location_id = null, ?string $user_identifier_key = null, @@ -3549,6 +3605,9 @@ public function list( if ($page_cursor !== null) { $request_payload["page_cursor"] = $page_cursor; } + if ($search !== null) { + $request_payload["search"] = $search; + } if ($space_id !== null) { $request_payload["space_id"] = $space_id; } @@ -3635,6 +3694,74 @@ public function unlock_door( } } +class LocksSimulateClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + } + + public function keypad_code_entry( + string $code, + string $device_id, + bool $wait_for_action_attempt = true + ): ActionAttempt { + $request_payload = []; + + if ($code !== null) { + $request_payload["code"] = $code; + } + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + + $res = $this->seam->request( + "POST", + "/locks/simulate/keypad_code_entry", + json: (object) $request_payload + ); + + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res->action_attempt); + } + + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt->action_attempt_id + ); + + return $action_attempt; + } + + public function manual_lock_via_keypad( + string $device_id, + bool $wait_for_action_attempt = true + ): ActionAttempt { + $request_payload = []; + + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + + $res = $this->seam->request( + "POST", + "/locks/simulate/manual_lock_via_keypad", + json: (object) $request_payload + ); + + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res->action_attempt); + } + + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt->action_attempt_id + ); + + return $action_attempt; + } +} + class NoiseSensorsClient { private SeamClient $seam; @@ -3662,6 +3789,7 @@ public function list( ?float $limit = null, ?string $manufacturer = null, ?string $page_cursor = null, + ?string $search = null, ?string $space_id = null, ?string $unstable_location_id = null, ?string $user_identifier_key = null, @@ -3711,6 +3839,9 @@ public function list( if ($page_cursor !== null) { $request_payload["page_cursor"] = $page_cursor; } + if ($search !== null) { + $request_payload["search"] = $search; + } if ($space_id !== null) { $request_payload["space_id"] = $space_id; } @@ -4138,6 +4269,30 @@ public function get(string $space_id): Space return Space::from_json($res->space); } + public function get_related( + array $space_ids, + ?array $exclude = null, + ?array $include = null + ): void { + $request_payload = []; + + if ($space_ids !== null) { + $request_payload["space_ids"] = $space_ids; + } + if ($exclude !== null) { + $request_payload["exclude"] = $exclude; + } + if ($include !== null) { + $request_payload["include"] = $include; + } + + $this->seam->request( + "POST", + "/spaces/get_related", + json: (object) $request_payload + ); + } + public function list(): array { $res = $this->seam->request("POST", "/spaces/list"); @@ -4295,8 +4450,10 @@ public function cool( public function create_climate_preset( string $climate_preset_key, string $device_id, + ?string $climate_preset_mode = null, ?float $cooling_set_point_celsius = null, ?float $cooling_set_point_fahrenheit = null, + mixed $ecobee_metadata = null, ?string $fan_mode_setting = null, ?float $heating_set_point_celsius = null, ?float $heating_set_point_fahrenheit = null, @@ -4312,6 +4469,9 @@ public function create_climate_preset( if ($device_id !== null) { $request_payload["device_id"] = $device_id; } + if ($climate_preset_mode !== null) { + $request_payload["climate_preset_mode"] = $climate_preset_mode; + } if ($cooling_set_point_celsius !== null) { $request_payload[ "cooling_set_point_celsius" @@ -4322,6 +4482,9 @@ public function create_climate_preset( "cooling_set_point_fahrenheit" ] = $cooling_set_point_fahrenheit; } + if ($ecobee_metadata !== null) { + $request_payload["ecobee_metadata"] = $ecobee_metadata; + } if ($fan_mode_setting !== null) { $request_payload["fan_mode_setting"] = $fan_mode_setting; } @@ -4487,6 +4650,7 @@ public function list( ?float $limit = null, ?string $manufacturer = null, ?string $page_cursor = null, + ?string $search = null, ?string $space_id = null, ?string $unstable_location_id = null, ?string $user_identifier_key = null, @@ -4536,6 +4700,9 @@ public function list( if ($page_cursor !== null) { $request_payload["page_cursor"] = $page_cursor; } + if ($search !== null) { + $request_payload["search"] = $search; + } if ($space_id !== null) { $request_payload["space_id"] = $space_id; } @@ -4743,8 +4910,10 @@ public function set_temperature_threshold( public function update_climate_preset( string $climate_preset_key, string $device_id, + ?string $climate_preset_mode = null, ?float $cooling_set_point_celsius = null, ?float $cooling_set_point_fahrenheit = null, + mixed $ecobee_metadata = null, ?string $fan_mode_setting = null, ?float $heating_set_point_celsius = null, ?float $heating_set_point_fahrenheit = null, @@ -4760,6 +4929,9 @@ public function update_climate_preset( if ($device_id !== null) { $request_payload["device_id"] = $device_id; } + if ($climate_preset_mode !== null) { + $request_payload["climate_preset_mode"] = $climate_preset_mode; + } if ($cooling_set_point_celsius !== null) { $request_payload[ "cooling_set_point_celsius" @@ -4770,6 +4942,9 @@ public function update_climate_preset( "cooling_set_point_fahrenheit" ] = $cooling_set_point_fahrenheit; } + if ($ecobee_metadata !== null) { + $request_payload["ecobee_metadata"] = $ecobee_metadata; + } if ($fan_mode_setting !== null) { $request_payload["fan_mode_setting"] = $fan_mode_setting; } @@ -5335,7 +5510,8 @@ public function grant_access_to_device( } public function list( - ?string $credential_manager_acs_system_id = null + ?string $credential_manager_acs_system_id = null, + ?string $search = null ): array { $request_payload = []; @@ -5344,6 +5520,9 @@ public function list( "credential_manager_acs_system_id" ] = $credential_manager_acs_system_id; } + if ($search !== null) { + $request_payload["search"] = $search; + } $res = $this->seam->request( "POST",