diff --git a/package-lock.json b/package-lock.json index 069d546..98c2634 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,9 @@ "devDependencies": { "@prettier/plugin-php": "^0.25.0", "@seamapi/blueprint": "^1.8.0", - "@seamapi/fake-seam-connect": "2.0.4", + "@seamapi/fake-seam-connect": "2.0.5", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1014.0", + "@seamapi/types": "1.1037.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" @@ -821,9 +821,9 @@ } }, "node_modules/@seamapi/fake-seam-connect": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@seamapi/fake-seam-connect/-/fake-seam-connect-2.0.4.tgz", - "integrity": "sha512-pgPUhIMW462B3jIWTuhH/aK2wUxRuOLjhsjB7YxdXw2g+hTVRJ5w4t01spETu1g2bch3Rzffd0whUVLeC4vjwQ==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@seamapi/fake-seam-connect/-/fake-seam-connect-2.0.5.tgz", + "integrity": "sha512-dnHoZtHUHyQP9yqduEqE8dfmOJGMMt0MuqviwgOZo8ElAaPoZk/G+QM5MDg2LJ6q0t54kARYjSngp+IfTme6TQ==", "dev": true, "license": "MIT", "bin": { @@ -872,9 +872,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1014.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1014.0.tgz", - "integrity": "sha512-PjgO79X+ug/cpHp5EJ8S6PqccV+Vr8rNGdZGDuc8WhufoksX3k+6FlJg1IkTe3wXnpCUqyc9n9DREg2hYkTnGw==", + "version": "1.1037.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1037.0.tgz", + "integrity": "sha512-3HbkUbACvkQsybIOdmDslMHRXPePrPgZ6WwX6pXO8MyO8o3hMsxy5qTr+HJZbG6tTSqMHQ8HP1uVLZIk+WrN5A==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index fa528c0..5896258 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,9 @@ "devDependencies": { "@prettier/plugin-php": "^0.25.0", "@seamapi/blueprint": "^1.8.0", - "@seamapi/fake-seam-connect": "2.0.4", + "@seamapi/fake-seam-connect": "2.0.5", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1014.0", + "@seamapi/types": "1.1037.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" diff --git a/src/Resources/AccessCode.php b/src/Resources/AccessCode.php index fc8f020..a6ed128 100644 --- a/src/Resources/AccessCode.php +++ b/src/Resources/AccessCode.php @@ -292,6 +292,18 @@ public static function from_json(mixed $json): Errors|null => \Seam\Resources\AccessCode\Errors\CodeConstraintsViolated::from_json( $json, ), + \Seam\Resources\AccessCode\Errors\ErrorCode::FAILED_TO_ISSUE + => \Seam\Resources\AccessCode\Errors\FailedToIssue::from_json( + $json, + ), + \Seam\Resources\AccessCode\Errors\ErrorCode::FAILED_TO_UPDATE + => \Seam\Resources\AccessCode\Errors\FailedToUpdate::from_json( + $json, + ), + \Seam\Resources\AccessCode\Errors\ErrorCode::FAILED_TO_EXPIRE + => \Seam\Resources\AccessCode\Errors\FailedToExpire::from_json( + $json, + ), \Seam\Resources\AccessCode\Errors\ErrorCode::ACCOUNT_DISCONNECTED => \Seam\Resources\AccessCode\Errors\AccountDisconnected::from_json( $json, @@ -473,6 +485,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\AccessCode\Warnings\DelayInRemovingFromDevice::from_json( $json, ), + \Seam\Resources\AccessCode\Warnings\WarningCode::DELAY_IN_ISSUING + => \Seam\Resources\AccessCode\Warnings\DelayInIssuing::from_json( + $json, + ), \Seam\Resources\AccessCode\Warnings\WarningCode::THIRD_PARTY_INTEGRATION_DETECTED => \Seam\Resources\AccessCode\Warnings\ThirdPartyIntegrationDetected::from_json( $json, @@ -917,6 +933,132 @@ public function __construct( } } + /** + * Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and this error clears automatically if the access code is eventually issued. + */ + final class FailedToIssue extends \Seam\Resources\AccessCode\Errors + { + public static function from_json(mixed $json): FailedToIssue|null + { + if (!$json) { + return null; + } + return new self( + error_code: $json->error_code ?? null, + is_access_code_error: $json->is_access_code_error ?? null, + message: $json->message ?? null, + created_at: $json->created_at ?? null, + ); + } + + public function __construct( + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\AccessCode\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that this is an access code error. + */ + public true|null $is_access_code_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Date and time at which Seam created the error. + */ + public string|null $created_at = null, + ) { + parent::__construct(error_code: $error_code, message: $message); + } + } + + /** + * Seam was unable to apply this access code's requested update to the device, so the code on the device does not match its requested state. Seam keeps retrying, and this error clears automatically once the update is applied. + */ + final class FailedToUpdate extends \Seam\Resources\AccessCode\Errors + { + public static function from_json(mixed $json): FailedToUpdate|null + { + if (!$json) { + return null; + } + return new self( + error_code: $json->error_code ?? null, + is_access_code_error: $json->is_access_code_error ?? null, + message: $json->message ?? null, + created_at: $json->created_at ?? null, + ); + } + + public function __construct( + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\AccessCode\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that this is an access code error. + */ + public true|null $is_access_code_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Date and time at which Seam created the error. + */ + public string|null $created_at = null, + ) { + parent::__construct(error_code: $error_code, message: $message); + } + } + + /** + * This access code is still active on the device even though its `ends_at` has passed, so the recipient may still be able to unlock the device after their access window ended. Seam is attempting to remove it, and this error clears automatically once the access code is no longer active. + */ + final class FailedToExpire extends \Seam\Resources\AccessCode\Errors + { + public static function from_json(mixed $json): FailedToExpire|null + { + if (!$json) { + return null; + } + return new self( + error_code: $json->error_code ?? null, + is_access_code_error: $json->is_access_code_error ?? null, + message: $json->message ?? null, + created_at: $json->created_at ?? null, + ); + } + + public function __construct( + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\AccessCode\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that this is an access code error. + */ + public true|null $is_access_code_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Date and time at which Seam created the error. + */ + public string|null $created_at = null, + ) { + parent::__construct(error_code: $error_code, message: $message); + } + } + /** * Indicates that the account is disconnected. */ @@ -1557,6 +1699,9 @@ enum ErrorCode: string case CONFLICTING_EXTERNAL_MODIFICATION = "conflicting_external_modification"; case ACCESS_CODE_INACTIVE = "access_code_inactive"; case CODE_CONSTRAINTS_VIOLATED = "code_constraints_violated"; + case FAILED_TO_ISSUE = "failed_to_issue"; + case FAILED_TO_UPDATE = "failed_to_update"; + case FAILED_TO_EXPIRE = "failed_to_expire"; case ACCOUNT_DISCONNECTED = "account_disconnected"; case SALTO_KS_SUBSCRIPTION_LIMIT_EXCEEDED = "salto_ks_subscription_limit_exceeded"; case INSUFFICIENT_PERMISSIONS = "insufficient_permissions"; @@ -2317,6 +2462,47 @@ public function __construct( } } + /** + * Seam has not yet issued this access code, even though its start time is approaching, so access may not be ready when the recipient arrives. Seam is still attempting to issue it, and this warning clears automatically once issuance succeeds. + */ + final class DelayInIssuing extends \Seam\Resources\AccessCode\Warnings + { + public static function from_json(mixed $json): DelayInIssuing|null + { + if (!$json) { + return null; + } + return new self( + message: $json->message ?? null, + warning_code: $json->warning_code ?? null, + created_at: $json->created_at ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\AccessCode\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + /** + * Date and time at which Seam created the warning. + */ + string|null $created_at = null, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + /** * Third-party integration detected that may cause access codes to fail. */ @@ -2580,6 +2766,7 @@ enum WarningCode: string case EXTERNAL_MODIFICATION_IN_EFFECT = "external_modification_in_effect"; case DELAY_IN_SETTING_ON_DEVICE = "delay_in_setting_on_device"; case DELAY_IN_REMOVING_FROM_DEVICE = "delay_in_removing_from_device"; + case DELAY_IN_ISSUING = "delay_in_issuing"; case THIRD_PARTY_INTEGRATION_DETECTED = "third_party_integration_detected"; case IGLOO_ALGOPIN_MUST_BE_USED_WITHIN_24_HOURS = "igloo_algopin_must_be_used_within_24_hours"; case MANAGEMENT_TRANSFERRED = "management_transferred"; diff --git a/src/Resources/ConnectWebview.php b/src/Resources/ConnectWebview.php index 82db314..4cfcd0c 100644 --- a/src/Resources/ConnectWebview.php +++ b/src/Resources/ConnectWebview.php @@ -85,7 +85,7 @@ public function __construct( */ public string|null $created_at, /** - * Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. + * Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. * * @var array|\stdClass|null */ diff --git a/src/Resources/ConnectedAccount.php b/src/Resources/ConnectedAccount.php index db0ceaf..04da53c 100644 --- a/src/Resources/ConnectedAccount.php +++ b/src/Resources/ConnectedAccount.php @@ -71,7 +71,7 @@ public function __construct( */ public string|null $connected_account_id, /** - * Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. + * Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. * * @var array|\stdClass|null */ diff --git a/src/Resources/Device.php b/src/Resources/Device.php index 8e8da76..bf618ca 100644 --- a/src/Resources/Device.php +++ b/src/Resources/Device.php @@ -100,7 +100,7 @@ public function __construct( */ public string|null $created_at, /** - * Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. + * Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. * * @var array|\stdClass|null */ @@ -1431,6 +1431,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\Device\Warnings\AccessoryKeypadSetupRequired::from_json( $json, ), + \Seam\Resources\Device\Warnings\WarningCode::ACCESSORY_KEYPAD_LOW_BATTERY + => \Seam\Resources\Device\Warnings\AccessoryKeypadLowBattery::from_json( + $json, + ), \Seam\Resources\Device\Warnings\WarningCode::UNRELIABLE_ONLINE_STATUS => \Seam\Resources\Device\Warnings\UnreliableOnlineStatus::from_json( $json, @@ -3717,8 +3721,6 @@ public static function from_json(mixed $json): SensiMetadata|null device_name: $json->device_name ?? null, dual_setpoints_not_supported: $json->dual_setpoints_not_supported ?? null, - enforced_setpoint_range_celsius: $json->enforced_setpoint_range_celsius ?? - null, product_type: $json->product_type ?? null, ); } @@ -3736,12 +3738,6 @@ public function __construct( * Set to true when the device does not support the /dual-setpoints API endpoint. */ public bool|null $dual_setpoints_not_supported = null, - /** - * Enforced setpoint range in Celsius for a Sensi device, derived from an OutOfRange API error. - * - * @var list|null - */ - public array|null $enforced_setpoint_range_celsius = null, /** * Product type for a Sensi device. */ @@ -6755,6 +6751,49 @@ public function __construct( } } + /** + * Indicates that the accessory keypad paired with this lock has a low or critically low battery. Replace its batteries so guests can keep entering their access codes. + */ + final class AccessoryKeypadLowBattery extends + \Seam\Resources\Device\Warnings + { + public static function from_json( + mixed $json, + ): AccessoryKeypadLowBattery|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + message: $json->message ?? null, + warning_code: $json->warning_code ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the warning. + */ + string|null $created_at, + /** + * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Device\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + /** * Indicates that the device may optimistically be reported as online because the provider does not reliably report its online status. */ @@ -6878,6 +6917,7 @@ enum WarningCode: string case PROVIDER_ISSUE = "provider_issue"; case KEYNEST_UNSUPPORTED_LOCKER = "keynest_unsupported_locker"; case ACCESSORY_KEYPAD_SETUP_REQUIRED = "accessory_keypad_setup_required"; + case ACCESSORY_KEYPAD_LOW_BATTERY = "accessory_keypad_low_battery"; case UNRELIABLE_ONLINE_STATUS = "unreliable_online_status"; case MAX_ACCESS_CODES_REACHED = "max_access_codes_reached"; } diff --git a/src/Resources/Event.php b/src/Resources/Event.php index 24816fc..65ac5f5 100644 --- a/src/Resources/Event.php +++ b/src/Resources/Event.php @@ -7374,6 +7374,7 @@ public static function from_json(mixed $json): DeviceLowBattery|null event_type: $json->event_type ?? null, occurred_at: $json->occurred_at ?? null, workspace_id: $json->workspace_id ?? null, + battery_source: $json->battery_source ?? null, connected_account_custom_metadata: $json->connected_account_custom_metadata ?? null, customer_key: $json->customer_key ?? null, @@ -7415,6 +7416,12 @@ public function __construct( * ID of the workspace associated with the event. */ string|null $workspace_id, + /** + * Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. + * + * @var value-of<\Seam\Resources\Event\DeviceLowBattery\BatterySource>|string|null + */ + public string|null $battery_source = null, /** * Custom metadata of the connected account, present when connected_account_id is provided. * @@ -12464,6 +12471,14 @@ enum ErrorCode: string } } +namespace Seam\Resources\Event\DeviceLowBattery { + enum BatterySource: string + { + case LOCK = "lock"; + case ACCESSORY_KEYPAD = "accessory_keypad"; + } +} + namespace Seam\Resources\Event\DeviceBatteryStatusChanged { enum BatteryStatus: string { diff --git a/src/Resources/UnmanagedAccessCode.php b/src/Resources/UnmanagedAccessCode.php index 8ae1d4c..89e0fd6 100644 --- a/src/Resources/UnmanagedAccessCode.php +++ b/src/Resources/UnmanagedAccessCode.php @@ -248,6 +248,18 @@ public static function from_json(mixed $json): Errors|null => \Seam\Resources\UnmanagedAccessCode\Errors\CodeConstraintsViolated::from_json( $json, ), + \Seam\Resources\UnmanagedAccessCode\Errors\ErrorCode::FAILED_TO_ISSUE + => \Seam\Resources\UnmanagedAccessCode\Errors\FailedToIssue::from_json( + $json, + ), + \Seam\Resources\UnmanagedAccessCode\Errors\ErrorCode::FAILED_TO_UPDATE + => \Seam\Resources\UnmanagedAccessCode\Errors\FailedToUpdate::from_json( + $json, + ), + \Seam\Resources\UnmanagedAccessCode\Errors\ErrorCode::FAILED_TO_EXPIRE + => \Seam\Resources\UnmanagedAccessCode\Errors\FailedToExpire::from_json( + $json, + ), \Seam\Resources\UnmanagedAccessCode\Errors\ErrorCode::ACCOUNT_DISCONNECTED => \Seam\Resources\UnmanagedAccessCode\Errors\AccountDisconnected::from_json( $json, @@ -362,6 +374,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\UnmanagedAccessCode\Warnings\DelayInRemovingFromDevice::from_json( $json, ), + \Seam\Resources\UnmanagedAccessCode\Warnings\WarningCode::DELAY_IN_ISSUING + => \Seam\Resources\UnmanagedAccessCode\Warnings\DelayInIssuing::from_json( + $json, + ), \Seam\Resources\UnmanagedAccessCode\Warnings\WarningCode::THIRD_PARTY_INTEGRATION_DETECTED => \Seam\Resources\UnmanagedAccessCode\Warnings\ThirdPartyIntegrationDetected::from_json( $json, @@ -806,6 +822,134 @@ public function __construct( } } + /** + * Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and this error clears automatically if the access code is eventually issued. + */ + final class FailedToIssue extends \Seam\Resources\UnmanagedAccessCode\Errors + { + public static function from_json(mixed $json): FailedToIssue|null + { + if (!$json) { + return null; + } + return new self( + error_code: $json->error_code ?? null, + is_access_code_error: $json->is_access_code_error ?? null, + message: $json->message ?? null, + created_at: $json->created_at ?? null, + ); + } + + public function __construct( + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\UnmanagedAccessCode\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that this is an access code error. + */ + public true|null $is_access_code_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Date and time at which Seam created the error. + */ + public string|null $created_at = null, + ) { + parent::__construct(error_code: $error_code, message: $message); + } + } + + /** + * Seam was unable to apply this access code's requested update to the device, so the code on the device does not match its requested state. Seam keeps retrying, and this error clears automatically once the update is applied. + */ + final class FailedToUpdate extends + \Seam\Resources\UnmanagedAccessCode\Errors + { + public static function from_json(mixed $json): FailedToUpdate|null + { + if (!$json) { + return null; + } + return new self( + error_code: $json->error_code ?? null, + is_access_code_error: $json->is_access_code_error ?? null, + message: $json->message ?? null, + created_at: $json->created_at ?? null, + ); + } + + public function __construct( + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\UnmanagedAccessCode\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that this is an access code error. + */ + public true|null $is_access_code_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Date and time at which Seam created the error. + */ + public string|null $created_at = null, + ) { + parent::__construct(error_code: $error_code, message: $message); + } + } + + /** + * This access code is still active on the device even though its `ends_at` has passed, so the recipient may still be able to unlock the device after their access window ended. Seam is attempting to remove it, and this error clears automatically once the access code is no longer active. + */ + final class FailedToExpire extends + \Seam\Resources\UnmanagedAccessCode\Errors + { + public static function from_json(mixed $json): FailedToExpire|null + { + if (!$json) { + return null; + } + return new self( + error_code: $json->error_code ?? null, + is_access_code_error: $json->is_access_code_error ?? null, + message: $json->message ?? null, + created_at: $json->created_at ?? null, + ); + } + + public function __construct( + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\UnmanagedAccessCode\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that this is an access code error. + */ + public true|null $is_access_code_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Date and time at which Seam created the error. + */ + public string|null $created_at = null, + ) { + parent::__construct(error_code: $error_code, message: $message); + } + } + /** * Indicates that the account is disconnected. */ @@ -1452,6 +1596,9 @@ enum ErrorCode: string case CONFLICTING_EXTERNAL_MODIFICATION = "conflicting_external_modification"; case ACCESS_CODE_INACTIVE = "access_code_inactive"; case CODE_CONSTRAINTS_VIOLATED = "code_constraints_violated"; + case FAILED_TO_ISSUE = "failed_to_issue"; + case FAILED_TO_UPDATE = "failed_to_update"; + case FAILED_TO_EXPIRE = "failed_to_expire"; case ACCOUNT_DISCONNECTED = "account_disconnected"; case SALTO_KS_SUBSCRIPTION_LIMIT_EXCEEDED = "salto_ks_subscription_limit_exceeded"; case INSUFFICIENT_PERMISSIONS = "insufficient_permissions"; @@ -1747,6 +1894,48 @@ public function __construct( } } + /** + * Seam has not yet issued this access code, even though its start time is approaching, so access may not be ready when the recipient arrives. Seam is still attempting to issue it, and this warning clears automatically once issuance succeeds. + */ + final class DelayInIssuing extends + \Seam\Resources\UnmanagedAccessCode\Warnings + { + public static function from_json(mixed $json): DelayInIssuing|null + { + if (!$json) { + return null; + } + return new self( + message: $json->message ?? null, + warning_code: $json->warning_code ?? null, + created_at: $json->created_at ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\UnmanagedAccessCode\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + /** + * Date and time at which Seam created the warning. + */ + string|null $created_at = null, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + /** * Third-party integration detected that may cause access codes to fail. */ @@ -2011,6 +2200,7 @@ enum WarningCode: string case EXTERNAL_MODIFICATION_IN_EFFECT = "external_modification_in_effect"; case DELAY_IN_SETTING_ON_DEVICE = "delay_in_setting_on_device"; case DELAY_IN_REMOVING_FROM_DEVICE = "delay_in_removing_from_device"; + case DELAY_IN_ISSUING = "delay_in_issuing"; case THIRD_PARTY_INTEGRATION_DETECTED = "third_party_integration_detected"; case IGLOO_ALGOPIN_MUST_BE_USED_WITHIN_24_HOURS = "igloo_algopin_must_be_used_within_24_hours"; case MANAGEMENT_TRANSFERRED = "management_transferred"; diff --git a/src/Resources/UnmanagedDevice.php b/src/Resources/UnmanagedDevice.php index 615542e..003218e 100644 --- a/src/Resources/UnmanagedDevice.php +++ b/src/Resources/UnmanagedDevice.php @@ -18,6 +18,7 @@ public static function from_json(mixed $json): UnmanagedDevice|null custom_metadata: $json->custom_metadata ?? null, device_id: $json->device_id ?? null, device_type: $json->device_type ?? null, + display_name: $json->display_name ?? null, errors: array_map( fn($e) => \Seam\Resources\UnmanagedDevice\Errors::from_json( $e, @@ -93,7 +94,7 @@ public function __construct( */ public string|null $created_at, /** - * Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. + * Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Keys set to `null` or to an empty string are omitted. * * @var array|\stdClass|null */ @@ -108,6 +109,10 @@ public function __construct( * @var value-of<\Seam\Resources\UnmanagedDevice\DeviceType>|string|null */ public string|null $device_type, + /** + * Display name of the device, defaults to nickname (if it is set) or `properties.appearance.name`, otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. + */ + public string|null $display_name, /** * Array of errors associated with the device. Each error object within the array contains two fields: `error_code` and `message`. `error_code` is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. * @@ -570,6 +575,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\UnmanagedDevice\Warnings\AccessoryKeypadSetupRequired::from_json( $json, ), + \Seam\Resources\UnmanagedDevice\Warnings\WarningCode::ACCESSORY_KEYPAD_LOW_BATTERY + => \Seam\Resources\UnmanagedDevice\Warnings\AccessoryKeypadLowBattery::from_json( + $json, + ), \Seam\Resources\UnmanagedDevice\Warnings\WarningCode::UNRELIABLE_ONLINE_STATUS => \Seam\Resources\UnmanagedDevice\Warnings\UnreliableOnlineStatus::from_json( $json, @@ -2578,6 +2587,49 @@ public function __construct( } } + /** + * Indicates that the accessory keypad paired with this lock has a low or critically low battery. Replace its batteries so guests can keep entering their access codes. + */ + final class AccessoryKeypadLowBattery extends + \Seam\Resources\UnmanagedDevice\Warnings + { + public static function from_json( + mixed $json, + ): AccessoryKeypadLowBattery|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + message: $json->message ?? null, + warning_code: $json->warning_code ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the warning. + */ + string|null $created_at, + /** + * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\UnmanagedDevice\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + /** * Indicates that the device may optimistically be reported as online because the provider does not reliably report its online status. */ @@ -2703,6 +2755,7 @@ enum WarningCode: string case PROVIDER_ISSUE = "provider_issue"; case KEYNEST_UNSUPPORTED_LOCKER = "keynest_unsupported_locker"; case ACCESSORY_KEYPAD_SETUP_REQUIRED = "accessory_keypad_setup_required"; + case ACCESSORY_KEYPAD_LOW_BATTERY = "accessory_keypad_low_battery"; case UNRELIABLE_ONLINE_STATUS = "unreliable_online_status"; case MAX_ACCESS_CODES_REACHED = "max_access_codes_reached"; } diff --git a/src/Resources/Workspace.php b/src/Resources/Workspace.php index e68dbcd..4939015 100644 --- a/src/Resources/Workspace.php +++ b/src/Resources/Workspace.php @@ -35,10 +35,12 @@ public static function from_json(mixed $json): Workspace|null public function __construct( /** * Company name associated with the [workspace](https://docs.seam.co/core-concepts/workspaces). + * + * @deprecated Use `connect_partner_name` instead. */ public string|null $company_name, /** - * @deprecated Use `company_name` instead. + * Seam Connect partner name associated with the [workspace](https://docs.seam.co/core-concepts/workspaces). */ public string|null $connect_partner_name, public \Seam\Resources\Workspace\ConnectWebviewCustomization|null $connect_webview_customization, diff --git a/src/Routes/AcsUsersClient.php b/src/Routes/AcsUsersClient.php index 3355142..d995fe5 100644 --- a/src/Routes/AcsUsersClient.php +++ b/src/Routes/AcsUsersClient.php @@ -196,9 +196,9 @@ public function get( * @param int $limit Maximum number of records to return per page. * @param string|NullValue $page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. * @param string $search String for which to search. Filters returned access system users to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address`, `acs_user_id`, `user_identity_id`, `user_identity_full_name` or `user_identity_phone_number`. - * @param string $user_identity_email_address Email address of the user identity for which you want to retrieve all access system users. + * @param string|NullValue $user_identity_email_address Email address of the user identity for which you want to retrieve all access system users. Specify `null` to retrieve access system users whose user identity has no email address. * @param string $user_identity_id ID of the user identity for which you want to retrieve all access system users. - * @param string $user_identity_phone_number Phone number of the user identity for which you want to retrieve all access system users, in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, `+15555550100`). + * @param string|NullValue $user_identity_phone_number Phone number of the user identity for which you want to retrieve all access system users, in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, `+15555550100`). Specify `null` to retrieve access system users whose user identity has no phone number. * @param callable|null $on_response Called with the raw response envelope, used by the paginator to read the pagination metadata. * @return array OK */ @@ -208,9 +208,9 @@ public function list( ?int $limit = null, string|NullValue|null $page_cursor = null, ?string $search = null, - ?string $user_identity_email_address = null, + string|NullValue|null $user_identity_email_address = null, ?string $user_identity_id = null, - ?string $user_identity_phone_number = null, + string|NullValue|null $user_identity_phone_number = null, ?callable $on_response = null, ): array { $request_payload = []; diff --git a/src/Routes/ClientSessionsClient.php b/src/Routes/ClientSessionsClient.php index cefeec0..c013729 100644 --- a/src/Routes/ClientSessionsClient.php +++ b/src/Routes/ClientSessionsClient.php @@ -4,6 +4,7 @@ use GuzzleHttp\ClientInterface; use Seam\Http\Body; +use Seam\NullValue; use Seam\Resources\ClientSession; class ClientSessionsClient @@ -249,17 +250,17 @@ public function grant_access( * Returns a list of all [client sessions](https://docs.seam.co/core-concepts/authentication/client-session-tokens). * * @param string $client_session_id ID of the client session that you want to retrieve. - * @param string $connect_webview_id ID of the [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) for which you want to retrieve client sessions. + * @param string|NullValue $connect_webview_id ID of the [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) for which you want to retrieve client sessions. Specify `null` to retrieve client sessions that are not associated with a Connect Webview. * @param string $user_identifier_key Your user ID for the user by which you want to filter client sessions. - * @param string $user_identity_id ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to retrieve client sessions. + * @param string|NullValue $user_identity_id ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to retrieve client sessions. Specify `null` to retrieve client sessions that are not associated with a user identity. * @param bool $without_user_identifier_key Indicates whether to retrieve only client sessions without associated user identifier keys. * @return array OK */ public function list( ?string $client_session_id = null, - ?string $connect_webview_id = null, + string|NullValue|null $connect_webview_id = null, ?string $user_identifier_key = null, - ?string $user_identity_id = null, + string|NullValue|null $user_identity_id = null, ?bool $without_user_identifier_key = null, ): array { $request_payload = []; diff --git a/src/Routes/ConnectWebviewsClient.php b/src/Routes/ConnectWebviewsClient.php index adacfc8..bc0c128 100644 --- a/src/Routes/ConnectWebviewsClient.php +++ b/src/Routes/ConnectWebviewsClient.php @@ -37,7 +37,7 @@ public function __construct(ClientInterface $client, array $defaults) * @param list $accepted_capabilities List of accepted device capabilities that restrict the types of devices that can be connected through the Connect Webview. If not provided, defaults will be determined based on the accepted providers. * @param list $accepted_providers Accepted device provider keys as an alternative to `provider_category`. Use this parameter to specify accepted providers explicitly. See [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). To list all provider keys, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with no filters. * @param bool $automatically_manage_new_devices Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). See also: [Customize the Behavior Settings of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-behavior-settings-of-your-connect-webviews). - * @param array|\stdClass $custom_metadata Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs. [Adding custom metadata to a Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview) enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that were connected using the Connect Webview, making it easy to find and filter these resources in your [workspace](https://docs.seam.co/core-concepts/workspaces). You can also [filter Connect Webviews by custom metadata](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). + * @param array|\stdClass $custom_metadata Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview) enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that were connected using the Connect Webview, making it easy to find and filter these resources in your [workspace](https://docs.seam.co/core-concepts/workspaces). You can also [filter Connect Webviews by custom metadata](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata. * @param string $custom_redirect_failure_url Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the `custom_redirect_url`. * @param string $custom_redirect_url URL that you want to redirect the user to after the provider login is complete. * @param string $customer_key Associate the Connect Webview, the connected account, and all resources under the connected account with a customer. If the connected account already exists, it will be associated with the customer. If the connected account already exists, but is already associated with a customer, the Connect Webview will show an error. @@ -155,7 +155,7 @@ public function get(string $connect_webview_id): ConnectWebview /** * Returns a list of all [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews). * - * @param array|\stdClass $custom_metadata_has Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. + * @param array|\stdClass $custom_metadata_has Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. * @param string $customer_key Customer key for which you want to list connect webviews. * @param float $limit Maximum number of records to return per page. * @param string|NullValue $page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. diff --git a/src/Routes/ConnectedAccountsClient.php b/src/Routes/ConnectedAccountsClient.php index 1b31138..e538ba2 100644 --- a/src/Routes/ConnectedAccountsClient.php +++ b/src/Routes/ConnectedAccountsClient.php @@ -89,7 +89,7 @@ public function get( /** * Returns a list of all [connected accounts](https://docs.seam.co/core-concepts/connected-accounts). * - * @param array|\stdClass $custom_metadata_has Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. + * @param array|\stdClass $custom_metadata_has Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. * @param string $customer_key Customer key by which you want to filter connected accounts. * @param int $limit Maximum number of records to return per page. * @param string|NullValue $page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. @@ -176,7 +176,7 @@ public function sync(string $connected_account_id): void * @param string $connected_account_id ID of the connected account that you want to update. * @param list $accepted_capabilities List of accepted device capabilities that restrict the types of devices that can be connected through this connected account. Valid values are `lock`, `thermostat`, `noise_sensor`, and `access_control`. * @param bool $automatically_manage_new_devices Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). - * @param array|\stdClass $custom_metadata Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs. [Adding custom metadata to a connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter connected accounts by the desired metadata](https://docs.seam.co/core-concepts/connected-accounts/filtering-connected-accounts-by-custom-metadata). + * @param array|\stdClass $custom_metadata Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter connected accounts by the desired metadata](https://docs.seam.co/core-concepts/connected-accounts/filtering-connected-accounts-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata. * @param string $customer_key The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer. * @param string $display_name Human-readable name for the connected account, shown in the dashboard. For example, `Booking from Airbnb House 1`. * @return void OK diff --git a/src/Routes/DevicesClient.php b/src/Routes/DevicesClient.php index ab41c02..fdfd295 100644 --- a/src/Routes/DevicesClient.php +++ b/src/Routes/DevicesClient.php @@ -70,7 +70,7 @@ public function get(?string $device_id = null, ?string $name = null): Device * @param string $connected_account_id ID of the connected account for which you want to list devices. * @param list $connected_account_ids Array of IDs of the connected accounts for which you want to list devices. * @param string $created_before Timestamp by which to limit returned devices. Returns devices created before this timestamp. - * @param array|\stdClass $custom_metadata_has Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. + * @param array|\stdClass $custom_metadata_has Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. * @param string $customer_key Customer key for which you want to list devices. * @param list $device_ids Array of device IDs for which you want to list devices. * @param string $device_type Device type for which you want to list devices. @@ -230,7 +230,7 @@ public function report_provider_metadata(array $devices): void * * @param string $device_id ID of the device that you want to update. * @param bool $backup_access_code_pool_enabled Indicates whether the device's [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) is enabled. Set to `false` to disable the pool: Seam stops refilling it and removes any backup codes that have not yet been pulled into active use. - * @param array|\stdClass $custom_metadata Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. [Adding custom metadata to a device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter devices by the desired metadata](https://docs.seam.co/core-concepts/devices/filtering-devices-by-custom-metadata). + * @param array|\stdClass $custom_metadata Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). [Adding custom metadata to a device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter devices by the desired metadata](https://docs.seam.co/core-concepts/devices/filtering-devices-by-custom-metadata). Set a key to `null` or to an empty string to remove that key from the custom metadata. * @param bool $is_managed Indicates whether the device is managed. To unmanage a device, set `is_managed` to `false`. * @param string|NullValue $name Name for the device. * @param mixed $properties diff --git a/src/Routes/DevicesUnmanagedClient.php b/src/Routes/DevicesUnmanagedClient.php index 2f70c9b..bd454db 100644 --- a/src/Routes/DevicesUnmanagedClient.php +++ b/src/Routes/DevicesUnmanagedClient.php @@ -161,7 +161,7 @@ public function list( * An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). * * @param string $device_id ID of the unmanaged device that you want to update. - * @param array|\stdClass $custom_metadata Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. + * @param array|\stdClass $custom_metadata Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Set a key to `null` or to an empty string to remove that key from the custom metadata. * @param true $is_managed Indicates whether the device is managed. Set this parameter to `true` to convert an unmanaged device to managed. * @return void OK */