diff --git a/package-lock.json b/package-lock.json index 0a3173fb..9f7cbff7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@seamapi/blueprint": "^1.12.0", "@seamapi/fake-seam-connect": "2.0.6", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1100.0", + "@seamapi/types": "1.1110.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" @@ -882,9 +882,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1100.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1100.0.tgz", - "integrity": "sha512-syQWT7HOR5T24hzSAXpcFvWzRUrn+PuObNhiN2xvfxGJUseUvhB0LQGfI7mJY0lxWdBazYJEXLf8M3cqYW7K8g==", + "version": "1.1110.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1110.0.tgz", + "integrity": "sha512-+nUcDE58Siv1rnuK0okVjPCBE4CvrUjEhuz+hGxWz49l+vyPm9ls6DzwLzLQMxn8Orpy2QFgAbpe741rDh3atw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 5d192106..6d54897f 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@seamapi/blueprint": "^1.12.0", "@seamapi/fake-seam-connect": "2.0.6", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1100.0", + "@seamapi/types": "1.1110.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" diff --git a/src/Resources/AccessGrant.php b/src/Resources/AccessGrant.php index 6bdd1152..983d4a8f 100644 --- a/src/Resources/AccessGrant.php +++ b/src/Resources/AccessGrant.php @@ -1135,7 +1135,9 @@ public function __construct( */ public string|null $device_id, /** - * Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). + * Reason the access code could not be revoked. + * + * @var value-of<\Seam\Resources\AccessGrant\Warnings\OverprovisionedAccess\FailedDevices\ErrorCode>|string|null */ public string|null $error_code, /** @@ -1146,6 +1148,13 @@ public function __construct( } } +namespace Seam\Resources\AccessGrant\Warnings\OverprovisionedAccess\FailedDevices { + enum ErrorCode: string + { + case OFFLINE_ACCESS_CODE_NOT_REVOCABLE = "offline_access_code_not_revocable"; + } +} + namespace Seam\Resources\AccessGrant\Warnings\DeviceTimeConstraintsViolated { enum Reason: string { diff --git a/src/Resources/AccessMethod.php b/src/Resources/AccessMethod.php index 86e1325c..a7c18cff 100644 --- a/src/Resources/AccessMethod.php +++ b/src/Resources/AccessMethod.php @@ -134,7 +134,7 @@ public function __construct( */ public bool|null $is_ready_for_assignment = null, /** - * Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. + * Indicates whether the access method is ready to be encoded. This is true when the card has not yet been issued and the access system has received all the access the card needs. While it is false, `pending_mutations` contains `waiting_for_access_on_acs_system`. */ public bool|null $is_ready_for_encoding = null, ) {} @@ -222,6 +222,10 @@ public static function from_json(mixed $json): PendingMutations|null => \Seam\Resources\AccessMethod\PendingMutations\UpdatingAccessTimes::from_json( $json, ), + \Seam\Resources\AccessMethod\PendingMutations\MutationCode::WAITING_FOR_ACCESS_ON_ACS_SYSTEM + => \Seam\Resources\AccessMethod\PendingMutations\WaitingForAccessOnAcsSystem::from_json( + $json, + ), default => new self( created_at: $json->created_at ?? null, message: $json->message ?? null, @@ -595,11 +599,55 @@ public function __construct( } } + /** + * The access system has not yet received all the access this card needs. A card encoded now would carry only the access the system already has, so wait until this clears before encoding. + */ + final class WaitingForAccessOnAcsSystem extends + \Seam\Resources\AccessMethod\PendingMutations + { + public static function from_json( + mixed $json, + ): WaitingForAccessOnAcsSystem|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + message: $json->message ?? null, + mutation_code: $json->mutation_code ?? null, + ); + } + + public function __construct( + /** + * Date and time at which the mutation was created. + */ + string|null $created_at, + /** + * Detailed description of the mutation. + */ + string|null $message, + /** + * Mutation code to indicate that Seam is in the process of provisioning access for this access method on new devices. + * + * @var value-of<\Seam\Resources\AccessMethod\PendingMutations\MutationCode>|string|null + */ + string|null $mutation_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + mutation_code: $mutation_code, + ); + } + } + enum MutationCode: string { case PROVISIONING_ACCESS = "provisioning_access"; case REVOKING_ACCESS = "revoking_access"; case UPDATING_ACCESS_TIMES = "updating_access_times"; + case WAITING_FOR_ACCESS_ON_ACS_SYSTEM = "waiting_for_access_on_acs_system"; } } diff --git a/src/Resources/AcsEntrance.php b/src/Resources/AcsEntrance.php index 35b5716e..c5255217 100644 --- a/src/Resources/AcsEntrance.php +++ b/src/Resources/AcsEntrance.php @@ -444,7 +444,7 @@ public function __construct( } /** - * Errors associated with the [entrance](https://www.seam.co/docs/low-level-apis/access-systems/retrieving-entrance-details). + * Errors associated with the [entrance](https://www.seam.co/docs/low-level-apis/access-systems/retrieving-entrance-details). Known error_code values use subclasses; unknown values use this base class and retain their raw discriminator. */ class Errors { @@ -453,11 +453,23 @@ public static function from_json(mixed $json): Errors|null if (!$json) { return null; } - return new self( - created_at: $json->created_at ?? null, - error_code: $json->error_code ?? null, - message: $json->message ?? null, - ); + $discriminant = is_string($json->error_code ?? null) + ? \Seam\Resources\AcsEntrance\Errors\ErrorCode::tryFrom( + $json->error_code, + ) + : null; + + return match ($discriminant) { + \Seam\Resources\AcsEntrance\Errors\ErrorCode::ENTRANCE_REMOVED + => \Seam\Resources\AcsEntrance\Errors\EntranceRemoved::from_json( + $json, + ), + default => new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + message: $json->message ?? null, + ), + }; } public function __construct( @@ -467,6 +479,8 @@ public function __construct( public string|null $created_at, /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\AcsEntrance\Errors\ErrorCode>|string|null */ public string|null $error_code, /** @@ -798,6 +812,54 @@ enum DoorType: string } } +namespace Seam\Resources\AcsEntrance\Errors { + /** + * Indicates that the [entrance](https://www.seam.co/docs/low-level-apis/access-systems/retrieving-entrance-details) was removed from the connected account, so Seam can no longer sync it. + */ + final class EntranceRemoved extends \Seam\Resources\AcsEntrance\Errors + { + public static function from_json(mixed $json): EntranceRemoved|null + { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\AcsEntrance\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + enum ErrorCode: string + { + case ENTRANCE_REMOVED = "entrance_removed"; + } +} + namespace Seam\Resources\AcsEntrance\VisionlineMetadata { /** * Profile for the door in the Visionline access system. diff --git a/src/Resources/ActionAttempt.php b/src/Resources/ActionAttempt.php index bab12133..c87683ff 100644 --- a/src/Resources/ActionAttempt.php +++ b/src/Resources/ActionAttempt.php @@ -80,6 +80,26 @@ public static function from_json(mixed $json): ActionAttempt|null => \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged::from_json( $json, ), + \Seam\Resources\ActionAttempt\ActionType::SET_SPEAKER_VOLUME + => \Seam\Resources\ActionAttempt\SetSpeakerVolume::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\ActionType::SET_SPEAKER_MUTE + => \Seam\Resources\ActionAttempt\SetSpeakerMute::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\ActionType::PAUSE_SPEAKER_PLAYBACK + => \Seam\Resources\ActionAttempt\PauseSpeakerPlayback::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\ActionType::RESUME_SPEAKER_PLAYBACK + => \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\ActionType::PLAY_SPEAKER_CHIME + => \Seam\Resources\ActionAttempt\PlaySpeakerChime::from_json( + $json, + ), \Seam\Resources\ActionAttempt\ActionType::SYNC_ACCESS_CODES => \Seam\Resources\ActionAttempt\SyncAccessCodes::from_json( $json, @@ -1089,11 +1109,11 @@ public function __construct( } /** - * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. + * Setting the speaker volume is pending. Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class SyncAccessCodes extends \Seam\Resources\ActionAttempt + class SetSpeakerVolume extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): SyncAccessCodes|null + public static function from_json(mixed $json): SetSpeakerVolume|null { if (!$json) { return null; @@ -1104,15 +1124,15 @@ public static function from_json(mixed $json): SyncAccessCodes|null return match ($discriminant) { \Seam\Resources\ActionAttempt\Status::SUCCESS - => \Seam\Resources\ActionAttempt\SyncAccessCodes\Success::from_json( + => \Seam\Resources\ActionAttempt\SetSpeakerVolume\Success::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::PENDING - => \Seam\Resources\ActionAttempt\SyncAccessCodes\Pending::from_json( + => \Seam\Resources\ActionAttempt\SetSpeakerVolume\Pending::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::ERROR - => \Seam\Resources\ActionAttempt\SyncAccessCodes\Error::from_json( + => \Seam\Resources\ActionAttempt\SetSpeakerVolume\Error::from_json( $json, ), default => new self( @@ -1148,11 +1168,11 @@ public function __construct( } /** - * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. + * Muting or unmuting the speaker is pending. Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class CreateAccessCode extends \Seam\Resources\ActionAttempt + class SetSpeakerMute extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): CreateAccessCode|null + public static function from_json(mixed $json): SetSpeakerMute|null { if (!$json) { return null; @@ -1163,15 +1183,15 @@ public static function from_json(mixed $json): CreateAccessCode|null return match ($discriminant) { \Seam\Resources\ActionAttempt\Status::SUCCESS - => \Seam\Resources\ActionAttempt\CreateAccessCode\Success::from_json( + => \Seam\Resources\ActionAttempt\SetSpeakerMute\Success::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::PENDING - => \Seam\Resources\ActionAttempt\CreateAccessCode\Pending::from_json( + => \Seam\Resources\ActionAttempt\SetSpeakerMute\Pending::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::ERROR - => \Seam\Resources\ActionAttempt\CreateAccessCode\Error::from_json( + => \Seam\Resources\ActionAttempt\SetSpeakerMute\Error::from_json( $json, ), default => new self( @@ -1207,11 +1227,11 @@ public function __construct( } /** - * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. + * Pausing playback on the speaker is pending. Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class DeleteAccessCode extends \Seam\Resources\ActionAttempt + class PauseSpeakerPlayback extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): DeleteAccessCode|null + public static function from_json(mixed $json): PauseSpeakerPlayback|null { if (!$json) { return null; @@ -1222,15 +1242,15 @@ public static function from_json(mixed $json): DeleteAccessCode|null return match ($discriminant) { \Seam\Resources\ActionAttempt\Status::SUCCESS - => \Seam\Resources\ActionAttempt\DeleteAccessCode\Success::from_json( + => \Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Success::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::PENDING - => \Seam\Resources\ActionAttempt\DeleteAccessCode\Pending::from_json( + => \Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Pending::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::ERROR - => \Seam\Resources\ActionAttempt\DeleteAccessCode\Error::from_json( + => \Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Error::from_json( $json, ), default => new self( @@ -1266,12 +1286,13 @@ public function __construct( } /** - * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. + * Resuming playback on the speaker is pending. Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class UpdateAccessCode extends \Seam\Resources\ActionAttempt + class ResumeSpeakerPlayback extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): UpdateAccessCode|null - { + public static function from_json( + mixed $json, + ): ResumeSpeakerPlayback|null { if (!$json) { return null; } @@ -1281,15 +1302,15 @@ public static function from_json(mixed $json): UpdateAccessCode|null return match ($discriminant) { \Seam\Resources\ActionAttempt\Status::SUCCESS - => \Seam\Resources\ActionAttempt\UpdateAccessCode\Success::from_json( + => \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Success::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::PENDING - => \Seam\Resources\ActionAttempt\UpdateAccessCode\Pending::from_json( + => \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Pending::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::ERROR - => \Seam\Resources\ActionAttempt\UpdateAccessCode\Error::from_json( + => \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Error::from_json( $json, ), default => new self( @@ -1325,11 +1346,11 @@ public function __construct( } /** - * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. + * Playing a chime on the speaker is pending. Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class CreateNoiseThreshold extends \Seam\Resources\ActionAttempt + class PlaySpeakerChime extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): CreateNoiseThreshold|null + public static function from_json(mixed $json): PlaySpeakerChime|null { if (!$json) { return null; @@ -1340,15 +1361,15 @@ public static function from_json(mixed $json): CreateNoiseThreshold|null return match ($discriminant) { \Seam\Resources\ActionAttempt\Status::SUCCESS - => \Seam\Resources\ActionAttempt\CreateNoiseThreshold\Success::from_json( + => \Seam\Resources\ActionAttempt\PlaySpeakerChime\Success::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::PENDING - => \Seam\Resources\ActionAttempt\CreateNoiseThreshold\Pending::from_json( + => \Seam\Resources\ActionAttempt\PlaySpeakerChime\Pending::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::ERROR - => \Seam\Resources\ActionAttempt\CreateNoiseThreshold\Error::from_json( + => \Seam\Resources\ActionAttempt\PlaySpeakerChime\Error::from_json( $json, ), default => new self( @@ -1386,9 +1407,9 @@ public function __construct( /** * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class DeleteNoiseThreshold extends \Seam\Resources\ActionAttempt + class SyncAccessCodes extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): DeleteNoiseThreshold|null + public static function from_json(mixed $json): SyncAccessCodes|null { if (!$json) { return null; @@ -1399,15 +1420,15 @@ public static function from_json(mixed $json): DeleteNoiseThreshold|null return match ($discriminant) { \Seam\Resources\ActionAttempt\Status::SUCCESS - => \Seam\Resources\ActionAttempt\DeleteNoiseThreshold\Success::from_json( + => \Seam\Resources\ActionAttempt\SyncAccessCodes\Success::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::PENDING - => \Seam\Resources\ActionAttempt\DeleteNoiseThreshold\Pending::from_json( + => \Seam\Resources\ActionAttempt\SyncAccessCodes\Pending::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::ERROR - => \Seam\Resources\ActionAttempt\DeleteNoiseThreshold\Error::from_json( + => \Seam\Resources\ActionAttempt\SyncAccessCodes\Error::from_json( $json, ), default => new self( @@ -1445,9 +1466,9 @@ public function __construct( /** * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class UpdateNoiseThreshold extends \Seam\Resources\ActionAttempt + class CreateAccessCode extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): UpdateNoiseThreshold|null + public static function from_json(mixed $json): CreateAccessCode|null { if (!$json) { return null; @@ -1458,15 +1479,15 @@ public static function from_json(mixed $json): UpdateNoiseThreshold|null return match ($discriminant) { \Seam\Resources\ActionAttempt\Status::SUCCESS - => \Seam\Resources\ActionAttempt\UpdateNoiseThreshold\Success::from_json( + => \Seam\Resources\ActionAttempt\CreateAccessCode\Success::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::PENDING - => \Seam\Resources\ActionAttempt\UpdateNoiseThreshold\Pending::from_json( + => \Seam\Resources\ActionAttempt\CreateAccessCode\Pending::from_json( $json, ), \Seam\Resources\ActionAttempt\Status::ERROR - => \Seam\Resources\ActionAttempt\UpdateNoiseThreshold\Error::from_json( + => \Seam\Resources\ActionAttempt\CreateAccessCode\Error::from_json( $json, ), default => new self( @@ -1501,63 +1522,39 @@ public function __construct( } } - enum ActionType: string - { - case LOCK_DOOR = "LOCK_DOOR"; - case UNLOCK_DOOR = "UNLOCK_DOOR"; - case SCAN_CREDENTIAL = "SCAN_CREDENTIAL"; - case ENCODE_CREDENTIAL = "ENCODE_CREDENTIAL"; - case SCAN_TO_ASSIGN_CREDENTIAL = "SCAN_TO_ASSIGN_CREDENTIAL"; - case ASSIGN_CREDENTIAL = "ASSIGN_CREDENTIAL"; - case RESET_SANDBOX_WORKSPACE = "RESET_SANDBOX_WORKSPACE"; - case SET_FAN_MODE = "SET_FAN_MODE"; - case SET_HVAC_MODE = "SET_HVAC_MODE"; - case ACTIVATE_CLIMATE_PRESET = "ACTIVATE_CLIMATE_PRESET"; - case ACTIVATE_WEEKLY_PROGRAM = "ACTIVATE_WEEKLY_PROGRAM"; - case SIMULATE_KEYPAD_CODE_ENTRY = "SIMULATE_KEYPAD_CODE_ENTRY"; - case SIMULATE_MANUAL_LOCK_VIA_KEYPAD = "SIMULATE_MANUAL_LOCK_VIA_KEYPAD"; - case PUSH_THERMOSTAT_PROGRAMS = "PUSH_THERMOSTAT_PROGRAMS"; - case CONFIGURE_AUTO_LOCK = "CONFIGURE_AUTO_LOCK"; - case CONVERT_ACCESS_CODE_TO_MANAGED = "CONVERT_ACCESS_CODE_TO_MANAGED"; - case SYNC_ACCESS_CODES = "SYNC_ACCESS_CODES"; - case CREATE_ACCESS_CODE = "CREATE_ACCESS_CODE"; - case DELETE_ACCESS_CODE = "DELETE_ACCESS_CODE"; - case UPDATE_ACCESS_CODE = "UPDATE_ACCESS_CODE"; - case CREATE_NOISE_THRESHOLD = "CREATE_NOISE_THRESHOLD"; - case DELETE_NOISE_THRESHOLD = "DELETE_NOISE_THRESHOLD"; - case UPDATE_NOISE_THRESHOLD = "UPDATE_NOISE_THRESHOLD"; - } - - enum Status: string - { - case SUCCESS = "success"; - case PENDING = "pending"; - case ERROR = "error"; - } -} - -namespace Seam\Resources\ActionAttempt\LockDoor { /** - * Locking a door is pending. + * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - final class Success extends \Seam\Resources\ActionAttempt\LockDoor + class DeleteAccessCode extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): Success|null + public static function from_json(mixed $json): DeleteAccessCode|null { if (!$json) { return null; } - return new self( - action_attempt_id: $json->action_attempt_id ?? null, - action_type: $json->action_type ?? null, - error: null, - result: isset($json->result) - ? \Seam\Resources\ActionAttempt\LockDoor\Success\Result::from_json( - $json->result, - ) - : null, - status: $json->status ?? null, - ); + $discriminant = is_string($json->status ?? null) + ? \Seam\Resources\ActionAttempt\Status::tryFrom($json->status) + : null; + + return match ($discriminant) { + \Seam\Resources\ActionAttempt\Status::SUCCESS + => \Seam\Resources\ActionAttempt\DeleteAccessCode\Success::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::PENDING + => \Seam\Resources\ActionAttempt\DeleteAccessCode\Pending::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::ERROR + => \Seam\Resources\ActionAttempt\DeleteAccessCode\Error::from_json( + $json, + ), + default => new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + status: $json->status ?? null, + ), + }; } public function __construct( @@ -1571,14 +1568,6 @@ public function __construct( * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null */ string|null $action_type, - /** - * Error associated with the action. - */ - public null $error, - /** - * Result of the action. - */ - public \Seam\Resources\ActionAttempt\LockDoor\Success\Result|null $result, /** * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null */ @@ -1593,22 +1582,38 @@ public function __construct( } /** - * Locking a door is pending. + * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - final class Pending extends \Seam\Resources\ActionAttempt\LockDoor + class UpdateAccessCode extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): Pending|null + public static function from_json(mixed $json): UpdateAccessCode|null { if (!$json) { return null; } - return new self( - action_attempt_id: $json->action_attempt_id ?? null, - action_type: $json->action_type ?? null, - error: null, - result: null, - status: $json->status ?? null, - ); + $discriminant = is_string($json->status ?? null) + ? \Seam\Resources\ActionAttempt\Status::tryFrom($json->status) + : null; + + return match ($discriminant) { + \Seam\Resources\ActionAttempt\Status::SUCCESS + => \Seam\Resources\ActionAttempt\UpdateAccessCode\Success::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::PENDING + => \Seam\Resources\ActionAttempt\UpdateAccessCode\Pending::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::ERROR + => \Seam\Resources\ActionAttempt\UpdateAccessCode\Error::from_json( + $json, + ), + default => new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + status: $json->status ?? null, + ), + }; } public function __construct( @@ -1622,14 +1627,6 @@ public function __construct( * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null */ string|null $action_type, - /** - * Error associated with the action. - */ - public null $error, - /** - * Result of the action. - */ - public null $result, /** * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null */ @@ -1644,26 +1641,38 @@ public function __construct( } /** - * Locking a door is pending. + * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - final class Error extends \Seam\Resources\ActionAttempt\LockDoor + class CreateNoiseThreshold extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): Error|null + public static function from_json(mixed $json): CreateNoiseThreshold|null { if (!$json) { return null; } - return new self( - action_attempt_id: $json->action_attempt_id ?? null, - action_type: $json->action_type ?? null, - error: isset($json->error) - ? \Seam\Resources\ActionAttempt\LockDoor\Error\Error::from_json( - $json->error, - ) - : null, - result: null, - status: $json->status ?? null, - ); + $discriminant = is_string($json->status ?? null) + ? \Seam\Resources\ActionAttempt\Status::tryFrom($json->status) + : null; + + return match ($discriminant) { + \Seam\Resources\ActionAttempt\Status::SUCCESS + => \Seam\Resources\ActionAttempt\CreateNoiseThreshold\Success::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::PENDING + => \Seam\Resources\ActionAttempt\CreateNoiseThreshold\Pending::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::ERROR + => \Seam\Resources\ActionAttempt\CreateNoiseThreshold\Error::from_json( + $json, + ), + default => new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + status: $json->status ?? null, + ), + }; } public function __construct( @@ -1677,14 +1686,6 @@ public function __construct( * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null */ string|null $action_type, - /** - * Error associated with the action. - */ - public \Seam\Resources\ActionAttempt\LockDoor\Error\Error|null $error, - /** - * Result of the action. - */ - public null $result, /** * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null */ @@ -1697,68 +1698,170 @@ public function __construct( ); } } -} -namespace Seam\Resources\ActionAttempt\LockDoor\Success { /** - * Result of the action. + * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class Result + class DeleteNoiseThreshold extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): Result|null + public static function from_json(mixed $json): DeleteNoiseThreshold|null { if (!$json) { return null; } - return new self( - was_confirmed_by_device: $json->was_confirmed_by_device ?? null, - ); - } + $discriminant = is_string($json->status ?? null) + ? \Seam\Resources\ActionAttempt\Status::tryFrom($json->status) + : null; - public function __construct( - /** - * Indicates whether the device confirmed that the lock action occurred. + return match ($discriminant) { + \Seam\Resources\ActionAttempt\Status::SUCCESS + => \Seam\Resources\ActionAttempt\DeleteNoiseThreshold\Success::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::PENDING + => \Seam\Resources\ActionAttempt\DeleteNoiseThreshold\Pending::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::ERROR + => \Seam\Resources\ActionAttempt\DeleteNoiseThreshold\Error::from_json( + $json, + ), + default => new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + status: $json->status ?? null, + ), + }; + } + + public function __construct( + /** + * ID of the action attempt. */ - public bool|null $was_confirmed_by_device = null, - ) {} + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } } -} -namespace Seam\Resources\ActionAttempt\LockDoor\Error { /** - * Error associated with the action. + * Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ - class Error + class UpdateNoiseThreshold extends \Seam\Resources\ActionAttempt { - public static function from_json(mixed $json): Error|null + public static function from_json(mixed $json): UpdateNoiseThreshold|null { if (!$json) { return null; } - return new self( - message: $json->message ?? null, - type: $json->type ?? null, - ); + $discriminant = is_string($json->status ?? null) + ? \Seam\Resources\ActionAttempt\Status::tryFrom($json->status) + : null; + + return match ($discriminant) { + \Seam\Resources\ActionAttempt\Status::SUCCESS + => \Seam\Resources\ActionAttempt\UpdateNoiseThreshold\Success::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::PENDING + => \Seam\Resources\ActionAttempt\UpdateNoiseThreshold\Pending::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::ERROR + => \Seam\Resources\ActionAttempt\UpdateNoiseThreshold\Error::from_json( + $json, + ), + default => new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + status: $json->status ?? null, + ), + }; } public function __construct( /** - * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + * ID of the action attempt. */ - public string|null $message, + string|null $action_attempt_id, /** - * Type of the error. + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null */ - public string|null $type, - ) {} + string|null $action_type, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + enum ActionType: string + { + case LOCK_DOOR = "LOCK_DOOR"; + case UNLOCK_DOOR = "UNLOCK_DOOR"; + case SCAN_CREDENTIAL = "SCAN_CREDENTIAL"; + case ENCODE_CREDENTIAL = "ENCODE_CREDENTIAL"; + case SCAN_TO_ASSIGN_CREDENTIAL = "SCAN_TO_ASSIGN_CREDENTIAL"; + case ASSIGN_CREDENTIAL = "ASSIGN_CREDENTIAL"; + case RESET_SANDBOX_WORKSPACE = "RESET_SANDBOX_WORKSPACE"; + case SET_FAN_MODE = "SET_FAN_MODE"; + case SET_HVAC_MODE = "SET_HVAC_MODE"; + case ACTIVATE_CLIMATE_PRESET = "ACTIVATE_CLIMATE_PRESET"; + case ACTIVATE_WEEKLY_PROGRAM = "ACTIVATE_WEEKLY_PROGRAM"; + case SIMULATE_KEYPAD_CODE_ENTRY = "SIMULATE_KEYPAD_CODE_ENTRY"; + case SIMULATE_MANUAL_LOCK_VIA_KEYPAD = "SIMULATE_MANUAL_LOCK_VIA_KEYPAD"; + case PUSH_THERMOSTAT_PROGRAMS = "PUSH_THERMOSTAT_PROGRAMS"; + case CONFIGURE_AUTO_LOCK = "CONFIGURE_AUTO_LOCK"; + case CONVERT_ACCESS_CODE_TO_MANAGED = "CONVERT_ACCESS_CODE_TO_MANAGED"; + case SET_SPEAKER_VOLUME = "SET_SPEAKER_VOLUME"; + case SET_SPEAKER_MUTE = "SET_SPEAKER_MUTE"; + case PAUSE_SPEAKER_PLAYBACK = "PAUSE_SPEAKER_PLAYBACK"; + case RESUME_SPEAKER_PLAYBACK = "RESUME_SPEAKER_PLAYBACK"; + case PLAY_SPEAKER_CHIME = "PLAY_SPEAKER_CHIME"; + case SYNC_ACCESS_CODES = "SYNC_ACCESS_CODES"; + case CREATE_ACCESS_CODE = "CREATE_ACCESS_CODE"; + case DELETE_ACCESS_CODE = "DELETE_ACCESS_CODE"; + case UPDATE_ACCESS_CODE = "UPDATE_ACCESS_CODE"; + case CREATE_NOISE_THRESHOLD = "CREATE_NOISE_THRESHOLD"; + case DELETE_NOISE_THRESHOLD = "DELETE_NOISE_THRESHOLD"; + case UPDATE_NOISE_THRESHOLD = "UPDATE_NOISE_THRESHOLD"; + } + + enum Status: string + { + case SUCCESS = "success"; + case PENDING = "pending"; + case ERROR = "error"; } } -namespace Seam\Resources\ActionAttempt\UnlockDoor { +namespace Seam\Resources\ActionAttempt\LockDoor { /** - * Unlocking a door is pending. + * Locking a door is pending. */ - final class Success extends \Seam\Resources\ActionAttempt\UnlockDoor + final class Success extends \Seam\Resources\ActionAttempt\LockDoor { public static function from_json(mixed $json): Success|null { @@ -1770,7 +1873,7 @@ public static function from_json(mixed $json): Success|null action_type: $json->action_type ?? null, error: null, result: isset($json->result) - ? \Seam\Resources\ActionAttempt\UnlockDoor\Success\Result::from_json( + ? \Seam\Resources\ActionAttempt\LockDoor\Success\Result::from_json( $json->result, ) : null, @@ -1796,7 +1899,7 @@ public function __construct( /** * Result of the action. */ - public \Seam\Resources\ActionAttempt\UnlockDoor\Success\Result|null $result, + public \Seam\Resources\ActionAttempt\LockDoor\Success\Result|null $result, /** * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null */ @@ -1811,9 +1914,9 @@ public function __construct( } /** - * Unlocking a door is pending. + * Locking a door is pending. */ - final class Pending extends \Seam\Resources\ActionAttempt\UnlockDoor + final class Pending extends \Seam\Resources\ActionAttempt\LockDoor { public static function from_json(mixed $json): Pending|null { @@ -1862,9 +1965,9 @@ public function __construct( } /** - * Unlocking a door is pending. + * Locking a door is pending. */ - final class Error extends \Seam\Resources\ActionAttempt\UnlockDoor + final class Error extends \Seam\Resources\ActionAttempt\LockDoor { public static function from_json(mixed $json): Error|null { @@ -1875,7 +1978,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\UnlockDoor\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\LockDoor\Error\Error::from_json( $json->error, ) : null, @@ -1898,7 +2001,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\UnlockDoor\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\LockDoor\Error\Error|null $error, /** * Result of the action. */ @@ -1917,7 +2020,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\UnlockDoor\Success { +namespace Seam\Resources\ActionAttempt\LockDoor\Success { /** * Result of the action. */ @@ -1935,14 +2038,14 @@ public static function from_json(mixed $json): Result|null public function __construct( /** - * Indicates whether the device confirmed that the unlock action occurred. + * Indicates whether the device confirmed that the lock action occurred. */ public bool|null $was_confirmed_by_device = null, ) {} } } -namespace Seam\Resources\ActionAttempt\UnlockDoor\Error { +namespace Seam\Resources\ActionAttempt\LockDoor\Error { /** * Error associated with the action. */ @@ -1972,11 +2075,11 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ScanCredential { +namespace Seam\Resources\ActionAttempt\UnlockDoor { /** - * Reading credential data from the physical encoder is pending. + * Unlocking a door is pending. */ - final class Success extends \Seam\Resources\ActionAttempt\ScanCredential + final class Success extends \Seam\Resources\ActionAttempt\UnlockDoor { public static function from_json(mixed $json): Success|null { @@ -1988,7 +2091,7 @@ public static function from_json(mixed $json): Success|null action_type: $json->action_type ?? null, error: null, result: isset($json->result) - ? \Seam\Resources\ActionAttempt\ScanCredential\Success\Result::from_json( + ? \Seam\Resources\ActionAttempt\UnlockDoor\Success\Result::from_json( $json->result, ) : null, @@ -2007,11 +2110,14 @@ public function __construct( * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null */ string|null $action_type, + /** + * Error associated with the action. + */ public null $error, /** - * Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + * Result of the action. */ - public \Seam\Resources\ActionAttempt\ScanCredential\Success\Result|null $result, + public \Seam\Resources\ActionAttempt\UnlockDoor\Success\Result|null $result, /** * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null */ @@ -2026,9 +2132,9 @@ public function __construct( } /** - * Reading credential data from the physical encoder is pending. + * Unlocking a door is pending. */ - final class Pending extends \Seam\Resources\ActionAttempt\ScanCredential + final class Pending extends \Seam\Resources\ActionAttempt\UnlockDoor { public static function from_json(mixed $json): Pending|null { @@ -2055,9 +2161,12 @@ public function __construct( * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null */ string|null $action_type, + /** + * Error associated with the action. + */ public null $error, /** - * Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + * Result of the action. */ public null $result, /** @@ -2074,9 +2183,9 @@ public function __construct( } /** - * Reading credential data from the physical encoder is pending. + * Unlocking a door is pending. */ - final class Error extends \Seam\Resources\ActionAttempt\ScanCredential + final class Error extends \Seam\Resources\ActionAttempt\UnlockDoor { public static function from_json(mixed $json): Error|null { @@ -2087,7 +2196,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\ScanCredential\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\UnlockDoor\Error\Error::from_json( $json->error, ) : null, @@ -2107,9 +2216,12 @@ public function __construct( * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null */ string|null $action_type, - public \Seam\Resources\ActionAttempt\ScanCredential\Error\Error|null $error, /** - * Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + * Error associated with the action. + */ + public \Seam\Resources\ActionAttempt\UnlockDoor\Error\Error|null $error, + /** + * Result of the action. */ public null $result, /** @@ -2126,9 +2238,9 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ScanCredential\Success { +namespace Seam\Resources\ActionAttempt\UnlockDoor\Success { /** - * Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + * Result of the action. */ class Result { @@ -2138,66 +2250,275 @@ public static function from_json(mixed $json): Result|null return null; } return new self( - acs_credential_on_encoder: isset( - $json->acs_credential_on_encoder, - ) - ? \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnEncoder::from_json( - $json->acs_credential_on_encoder, - ) - : null, - acs_credential_on_seam: isset($json->acs_credential_on_seam) - ? \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnSeam::from_json( - $json->acs_credential_on_seam, - ) - : null, - warnings: array_map( - fn( - $w, - ) => \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\Warnings::from_json( - $w, - ), - $json->warnings ?? [], - ), + was_confirmed_by_device: $json->was_confirmed_by_device ?? null, ); } public function __construct( /** - * Snapshot of credential data read from the physical encoder. - */ - public \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnEncoder|null $acs_credential_on_encoder, - /** - * Corresponding credential data as stored on Seam and the access system. - */ - public \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnSeam|null $acs_credential_on_seam, - /** - * Warnings related to scanning the credential, such as mismatches between the credential data currently encoded on the card and the corresponding data stored on Seam and the access system. - * - * @var list<\Seam\Resources\ActionAttempt\ScanCredential\Success\Result\Warnings> + * Indicates whether the device confirmed that the unlock action occurred. */ - public array $warnings, + public bool|null $was_confirmed_by_device = null, ) {} } } -namespace Seam\Resources\ActionAttempt\ScanCredential\Success\Result { +namespace Seam\Resources\ActionAttempt\UnlockDoor\Error { /** - * Snapshot of credential data read from the physical encoder. + * Error associated with the action. */ - class AcsCredentialOnEncoder + class Error { - public static function from_json( - mixed $json, - ): AcsCredentialOnEncoder|null { + public static function from_json(mixed $json): Error|null + { if (!$json) { return null; } return new self( - card_number: $json->card_number ?? null, - created_at: $json->created_at ?? null, - ends_at: $json->ends_at ?? null, - is_issued: $json->is_issued ?? null, - starts_at: $json->starts_at ?? null, + message: $json->message ?? null, + type: $json->type ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + public string|null $message, + /** + * Type of the error. + */ + public string|null $type, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\ScanCredential { + /** + * Reading credential data from the physical encoder is pending. + */ + final class Success extends \Seam\Resources\ActionAttempt\ScanCredential + { + public static function from_json(mixed $json): Success|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: isset($json->result) + ? \Seam\Resources\ActionAttempt\ScanCredential\Success\Result::from_json( + $json->result, + ) + : null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + public null $error, + /** + * Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + */ + public \Seam\Resources\ActionAttempt\ScanCredential\Success\Result|null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Reading credential data from the physical encoder is pending. + */ + final class Pending extends \Seam\Resources\ActionAttempt\ScanCredential + { + public static function from_json(mixed $json): Pending|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + public null $error, + /** + * Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Reading credential data from the physical encoder is pending. + */ + final class Error extends \Seam\Resources\ActionAttempt\ScanCredential + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: isset($json->error) + ? \Seam\Resources\ActionAttempt\ScanCredential\Error\Error::from_json( + $json->error, + ) + : null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + public \Seam\Resources\ActionAttempt\ScanCredential\Error\Error|null $error, + /** + * Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } +} + +namespace Seam\Resources\ActionAttempt\ScanCredential\Success { + /** + * Result of scanning a card. If the attempt was successful, includes a snapshot of credential data read from the physical encoder, the corresponding data stored on Seam and the access system, and any associated warnings. + */ + class Result + { + public static function from_json(mixed $json): Result|null + { + if (!$json) { + return null; + } + return new self( + acs_credential_on_encoder: isset( + $json->acs_credential_on_encoder, + ) + ? \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnEncoder::from_json( + $json->acs_credential_on_encoder, + ) + : null, + acs_credential_on_seam: isset($json->acs_credential_on_seam) + ? \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnSeam::from_json( + $json->acs_credential_on_seam, + ) + : null, + warnings: array_map( + fn( + $w, + ) => \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\Warnings::from_json( + $w, + ), + $json->warnings ?? [], + ), + ); + } + + public function __construct( + /** + * Snapshot of credential data read from the physical encoder. + */ + public \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnEncoder|null $acs_credential_on_encoder, + /** + * Corresponding credential data as stored on Seam and the access system. + */ + public \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnSeam|null $acs_credential_on_seam, + /** + * Warnings related to scanning the credential, such as mismatches between the credential data currently encoded on the card and the corresponding data stored on Seam and the access system. + * + * @var list<\Seam\Resources\ActionAttempt\ScanCredential\Success\Result\Warnings> + */ + public array $warnings, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\ScanCredential\Success\Result { + /** + * Snapshot of credential data read from the physical encoder. + */ + class AcsCredentialOnEncoder + { + public static function from_json( + mixed $json, + ): AcsCredentialOnEncoder|null { + if (!$json) { + return null; + } + return new self( + card_number: $json->card_number ?? null, + created_at: $json->created_at ?? null, + ends_at: $json->ends_at ?? null, + is_issued: $json->is_issued ?? null, + starts_at: $json->starts_at ?? null, visionline_metadata: isset($json->visionline_metadata) ? \Seam\Resources\ActionAttempt\ScanCredential\Success\Result\AcsCredentialOnEncoder\VisionlineMetadata::from_json( $json->visionline_metadata, @@ -4493,7 +4814,7 @@ public function __construct( */ public bool|null $is_ready_for_assignment = null, /** - * Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. + * Indicates whether the access method is ready to be encoded. This is true when the card has not yet been issued and the access system has received all the access the card needs. While it is false, `pending_mutations` contains `waiting_for_access_on_acs_system`. */ public bool|null $is_ready_for_encoding = null, ) {} @@ -4548,13 +4869,13 @@ public static function from_json(mixed $json): PendingMutations|null } return new self( created_at: $json->created_at ?? null, + message: $json->message ?? null, + mutation_code: $json->mutation_code ?? null, from: isset($json->from) ? \Seam\Resources\ActionAttempt\AssignCredential\Success\Result\PendingMutations\From::from_json( $json->from, ) : null, - message: $json->message ?? null, - mutation_code: $json->mutation_code ?? null, to: isset($json->to) ? \Seam\Resources\ActionAttempt\AssignCredential\Success\Result\PendingMutations\To::from_json( $json->to, @@ -4568,24 +4889,24 @@ public function __construct( * Date and time at which the mutation was created. */ public string|null $created_at, - /** - * Previous access time configuration. - */ - public \Seam\Resources\ActionAttempt\AssignCredential\Success\Result\PendingMutations\From|null $from, /** * Detailed description of the mutation. */ public string|null $message, /** - * Mutation code to indicate that Seam is in the process of updating the access times for this access method. + * Mutation code to indicate that the access system has not yet received all the access this card needs, so the card is not ready to be encoded. * * @var value-of<\Seam\Resources\ActionAttempt\AssignCredential\Success\Result\PendingMutations\MutationCode>|string|null */ public string|null $mutation_code, + /** + * Previous access time configuration. + */ + public \Seam\Resources\ActionAttempt\AssignCredential\Success\Result\PendingMutations\From|null $from = null, /** * New access time configuration. */ - public \Seam\Resources\ActionAttempt\AssignCredential\Success\Result\PendingMutations\To|null $to, + public \Seam\Resources\ActionAttempt\AssignCredential\Success\Result\PendingMutations\To|null $to = null, ) {} } @@ -4709,6 +5030,7 @@ enum MutationCode: string case PROVISIONING_ACCESS = "provisioning_access"; case REVOKING_ACCESS = "revoking_access"; case UPDATING_ACCESS_TIMES = "updating_access_times"; + case WAITING_FOR_ACCESS_ON_ACS_SYSTEM = "waiting_for_access_on_acs_system"; } } @@ -4724,7 +5046,972 @@ enum WarningCode: string } } -namespace Seam\Resources\ActionAttempt\AssignCredential\Error { +namespace Seam\Resources\ActionAttempt\AssignCredential\Error { + class Error + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + message: $json->message ?? null, + type: $json->type ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + public string|null $message, + /** + * Error type to indicate that no matching credential was found. + * + * @var value-of<\Seam\Resources\ActionAttempt\AssignCredential\Error\Error\Type>|string|null + */ + public string|null $type, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\AssignCredential\Error\Error { + enum Type: string + { + case UNCATEGORIZED_ERROR = "uncategorized_error"; + case ACTION_ATTEMPT_EXPIRED = "action_attempt_expired"; + case CREDENTIAL_NOT_FOUND = "credential_not_found"; + } +} + +namespace Seam\Resources\ActionAttempt\ResetSandboxWorkspace { + /** + * Resetting a sandbox workspace is pending. + */ + final class Success extends + \Seam\Resources\ActionAttempt\ResetSandboxWorkspace + { + public static function from_json(mixed $json): Success|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: $json->result ?? null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public mixed $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Resetting a sandbox workspace is pending. + */ + final class Pending extends + \Seam\Resources\ActionAttempt\ResetSandboxWorkspace + { + public static function from_json(mixed $json): Pending|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Resetting a sandbox workspace is pending. + */ + final class Error extends + \Seam\Resources\ActionAttempt\ResetSandboxWorkspace + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: isset($json->error) + ? \Seam\Resources\ActionAttempt\ResetSandboxWorkspace\Error\Error::from_json( + $json->error, + ) + : null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public \Seam\Resources\ActionAttempt\ResetSandboxWorkspace\Error\Error|null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } +} + +namespace Seam\Resources\ActionAttempt\ResetSandboxWorkspace\Error { + /** + * Error associated with the action. + */ + class Error + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + message: $json->message ?? null, + type: $json->type ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + public string|null $message, + /** + * Type of the error. + */ + public string|null $type, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\SetFanMode { + /** + * Setting the fan mode is pending. + */ + final class Success extends \Seam\Resources\ActionAttempt\SetFanMode + { + public static function from_json(mixed $json): Success|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: $json->result ?? null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public mixed $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Setting the fan mode is pending. + */ + final class Pending extends \Seam\Resources\ActionAttempt\SetFanMode + { + public static function from_json(mixed $json): Pending|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Setting the fan mode is pending. + */ + final class Error extends \Seam\Resources\ActionAttempt\SetFanMode + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: isset($json->error) + ? \Seam\Resources\ActionAttempt\SetFanMode\Error\Error::from_json( + $json->error, + ) + : null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public \Seam\Resources\ActionAttempt\SetFanMode\Error\Error|null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } +} + +namespace Seam\Resources\ActionAttempt\SetFanMode\Error { + /** + * Error associated with the action. + */ + class Error + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + message: $json->message ?? null, + type: $json->type ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + public string|null $message, + /** + * Type of the error. + */ + public string|null $type, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\SetHvacMode { + /** + * Setting the HVAC mode is pending. + */ + final class Success extends \Seam\Resources\ActionAttempt\SetHvacMode + { + public static function from_json(mixed $json): Success|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: $json->result ?? null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public mixed $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Setting the HVAC mode is pending. + */ + final class Pending extends \Seam\Resources\ActionAttempt\SetHvacMode + { + public static function from_json(mixed $json): Pending|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Setting the HVAC mode is pending. + */ + final class Error extends \Seam\Resources\ActionAttempt\SetHvacMode + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: isset($json->error) + ? \Seam\Resources\ActionAttempt\SetHvacMode\Error\Error::from_json( + $json->error, + ) + : null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public \Seam\Resources\ActionAttempt\SetHvacMode\Error\Error|null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } +} + +namespace Seam\Resources\ActionAttempt\SetHvacMode\Error { + /** + * Error associated with the action. + */ + class Error + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + message: $json->message ?? null, + type: $json->type ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + public string|null $message, + /** + * Type of the error. + */ + public string|null $type, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\ActivateClimatePreset { + /** + * Activating a climate preset is pending. + */ + final class Success extends + \Seam\Resources\ActionAttempt\ActivateClimatePreset + { + public static function from_json(mixed $json): Success|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: $json->result ?? null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public mixed $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Activating a climate preset is pending. + */ + final class Pending extends + \Seam\Resources\ActionAttempt\ActivateClimatePreset + { + public static function from_json(mixed $json): Pending|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Activating a climate preset is pending. + */ + final class Error extends + \Seam\Resources\ActionAttempt\ActivateClimatePreset + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: isset($json->error) + ? \Seam\Resources\ActionAttempt\ActivateClimatePreset\Error\Error::from_json( + $json->error, + ) + : null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public \Seam\Resources\ActionAttempt\ActivateClimatePreset\Error\Error|null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } +} + +namespace Seam\Resources\ActionAttempt\ActivateClimatePreset\Error { + /** + * Error associated with the action. + */ + class Error + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + message: $json->message ?? null, + type: $json->type ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + public string|null $message, + /** + * Type of the error. + */ + public string|null $type, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\ActivateWeeklyProgram { + /** + * Activating the weekly program is pending. + */ + final class Success extends + \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + { + public static function from_json(mixed $json): Success|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: $json->result ?? null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public mixed $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Activating the weekly program is pending. + */ + final class Pending extends + \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + { + public static function from_json(mixed $json): Pending|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Activating the weekly program is pending. + */ + final class Error extends + \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: isset($json->error) + ? \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error\Error::from_json( + $json->error, + ) + : null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error\Error|null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } +} + +namespace Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error { + /** + * Error associated with the action. + */ class Error { public static function from_json(mixed $json): Error|null @@ -4744,30 +6031,19 @@ public function __construct( */ public string|null $message, /** - * Error type to indicate that no matching credential was found. - * - * @var value-of<\Seam\Resources\ActionAttempt\AssignCredential\Error\Error\Type>|string|null + * Type of the error. */ public string|null $type, ) {} } } -namespace Seam\Resources\ActionAttempt\AssignCredential\Error\Error { - enum Type: string - { - case UNCATEGORIZED_ERROR = "uncategorized_error"; - case ACTION_ATTEMPT_EXPIRED = "action_attempt_expired"; - case CREDENTIAL_NOT_FOUND = "credential_not_found"; - } -} - -namespace Seam\Resources\ActionAttempt\ResetSandboxWorkspace { +namespace Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry { /** - * Resetting a sandbox workspace is pending. + * Simulating a keypad code entry is pending. */ final class Success extends - \Seam\Resources\ActionAttempt\ResetSandboxWorkspace + \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry { public static function from_json(mixed $json): Success|null { @@ -4816,10 +6092,10 @@ public function __construct( } /** - * Resetting a sandbox workspace is pending. + * Simulating a keypad code entry is pending. */ final class Pending extends - \Seam\Resources\ActionAttempt\ResetSandboxWorkspace + \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry { public static function from_json(mixed $json): Pending|null { @@ -4868,10 +6144,10 @@ public function __construct( } /** - * Resetting a sandbox workspace is pending. + * Simulating a keypad code entry is pending. */ final class Error extends - \Seam\Resources\ActionAttempt\ResetSandboxWorkspace + \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry { public static function from_json(mixed $json): Error|null { @@ -4882,7 +6158,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\ResetSandboxWorkspace\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry\Error\Error::from_json( $json->error, ) : null, @@ -4905,7 +6181,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\ResetSandboxWorkspace\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry\Error\Error|null $error, /** * Result of the action. */ @@ -4924,7 +6200,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ResetSandboxWorkspace\Error { +namespace Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry\Error { /** * Error associated with the action. */ @@ -4954,11 +6230,12 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\SetFanMode { +namespace Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad { /** - * Setting the fan mode is pending. + * Simulating a manual lock action using a keypad is pending. */ - final class Success extends \Seam\Resources\ActionAttempt\SetFanMode + final class Success extends + \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad { public static function from_json(mixed $json): Success|null { @@ -5007,9 +6284,10 @@ public function __construct( } /** - * Setting the fan mode is pending. + * Simulating a manual lock action using a keypad is pending. */ - final class Pending extends \Seam\Resources\ActionAttempt\SetFanMode + final class Pending extends + \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad { public static function from_json(mixed $json): Pending|null { @@ -5058,9 +6336,10 @@ public function __construct( } /** - * Setting the fan mode is pending. + * Simulating a manual lock action using a keypad is pending. */ - final class Error extends \Seam\Resources\ActionAttempt\SetFanMode + final class Error extends + \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad { public static function from_json(mixed $json): Error|null { @@ -5071,7 +6350,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\SetFanMode\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad\Error\Error::from_json( $json->error, ) : null, @@ -5094,7 +6373,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\SetFanMode\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad\Error\Error|null $error, /** * Result of the action. */ @@ -5113,7 +6392,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\SetFanMode\Error { +namespace Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad\Error { /** * Error associated with the action. */ @@ -5143,11 +6422,12 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\SetHvacMode { +namespace Seam\Resources\ActionAttempt\PushThermostatPrograms { /** - * Setting the HVAC mode is pending. + * Pushing thermostat weekly programs is pending. */ - final class Success extends \Seam\Resources\ActionAttempt\SetHvacMode + final class Success extends + \Seam\Resources\ActionAttempt\PushThermostatPrograms { public static function from_json(mixed $json): Success|null { @@ -5196,9 +6476,10 @@ public function __construct( } /** - * Setting the HVAC mode is pending. + * Pushing thermostat weekly programs is pending. */ - final class Pending extends \Seam\Resources\ActionAttempt\SetHvacMode + final class Pending extends + \Seam\Resources\ActionAttempt\PushThermostatPrograms { public static function from_json(mixed $json): Pending|null { @@ -5247,9 +6528,10 @@ public function __construct( } /** - * Setting the HVAC mode is pending. + * Pushing thermostat weekly programs is pending. */ - final class Error extends \Seam\Resources\ActionAttempt\SetHvacMode + final class Error extends + \Seam\Resources\ActionAttempt\PushThermostatPrograms { public static function from_json(mixed $json): Error|null { @@ -5260,7 +6542,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\SetHvacMode\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\PushThermostatPrograms\Error\Error::from_json( $json->error, ) : null, @@ -5283,7 +6565,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\SetHvacMode\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\PushThermostatPrograms\Error\Error|null $error, /** * Result of the action. */ @@ -5302,7 +6584,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\SetHvacMode\Error { +namespace Seam\Resources\ActionAttempt\PushThermostatPrograms\Error { /** * Error associated with the action. */ @@ -5332,12 +6614,11 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ActivateClimatePreset { +namespace Seam\Resources\ActionAttempt\ConfigureAutoLock { /** - * Activating a climate preset is pending. + * Configuring the auto-lock is pending. */ - final class Success extends - \Seam\Resources\ActionAttempt\ActivateClimatePreset + final class Success extends \Seam\Resources\ActionAttempt\ConfigureAutoLock { public static function from_json(mixed $json): Success|null { @@ -5386,10 +6667,9 @@ public function __construct( } /** - * Activating a climate preset is pending. + * Configuring the auto-lock is pending. */ - final class Pending extends - \Seam\Resources\ActionAttempt\ActivateClimatePreset + final class Pending extends \Seam\Resources\ActionAttempt\ConfigureAutoLock { public static function from_json(mixed $json): Pending|null { @@ -5438,10 +6718,9 @@ public function __construct( } /** - * Activating a climate preset is pending. + * Configuring the auto-lock is pending. */ - final class Error extends - \Seam\Resources\ActionAttempt\ActivateClimatePreset + final class Error extends \Seam\Resources\ActionAttempt\ConfigureAutoLock { public static function from_json(mixed $json): Error|null { @@ -5452,7 +6731,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\ActivateClimatePreset\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\ConfigureAutoLock\Error\Error::from_json( $json->error, ) : null, @@ -5475,7 +6754,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\ActivateClimatePreset\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\ConfigureAutoLock\Error\Error|null $error, /** * Result of the action. */ @@ -5494,7 +6773,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ActivateClimatePreset\Error { +namespace Seam\Resources\ActionAttempt\ConfigureAutoLock\Error { /** * Error associated with the action. */ @@ -5524,12 +6803,12 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ActivateWeeklyProgram { +namespace Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged { /** - * Activating the weekly program is pending. + * Converting an unmanaged access code to managed is pending. */ final class Success extends - \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged { public static function from_json(mixed $json): Success|null { @@ -5578,10 +6857,10 @@ public function __construct( } /** - * Activating the weekly program is pending. + * Converting an unmanaged access code to managed is pending. */ final class Pending extends - \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged { public static function from_json(mixed $json): Pending|null { @@ -5630,10 +6909,10 @@ public function __construct( } /** - * Activating the weekly program is pending. + * Converting an unmanaged access code to managed is pending. */ final class Error extends - \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged { public static function from_json(mixed $json): Error|null { @@ -5644,7 +6923,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged\Error\Error::from_json( $json->error, ) : null, @@ -5667,7 +6946,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged\Error\Error|null $error, /** * Result of the action. */ @@ -5686,7 +6965,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error { +namespace Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged\Error { /** * Error associated with the action. */ @@ -5716,12 +6995,11 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry { +namespace Seam\Resources\ActionAttempt\SetSpeakerVolume { /** - * Simulating a keypad code entry is pending. + * Setting the speaker volume is pending. */ - final class Success extends - \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry + final class Success extends \Seam\Resources\ActionAttempt\SetSpeakerVolume { public static function from_json(mixed $json): Success|null { @@ -5770,10 +7048,9 @@ public function __construct( } /** - * Simulating a keypad code entry is pending. + * Setting the speaker volume is pending. */ - final class Pending extends - \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry + final class Pending extends \Seam\Resources\ActionAttempt\SetSpeakerVolume { public static function from_json(mixed $json): Pending|null { @@ -5822,10 +7099,9 @@ public function __construct( } /** - * Simulating a keypad code entry is pending. + * Setting the speaker volume is pending. */ - final class Error extends - \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry + final class Error extends \Seam\Resources\ActionAttempt\SetSpeakerVolume { public static function from_json(mixed $json): Error|null { @@ -5836,7 +7112,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\SetSpeakerVolume\Error\Error::from_json( $json->error, ) : null, @@ -5859,7 +7135,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\SetSpeakerVolume\Error\Error|null $error, /** * Result of the action. */ @@ -5878,7 +7154,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry\Error { +namespace Seam\Resources\ActionAttempt\SetSpeakerVolume\Error { /** * Error associated with the action. */ @@ -5908,12 +7184,11 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad { +namespace Seam\Resources\ActionAttempt\SetSpeakerMute { /** - * Simulating a manual lock action using a keypad is pending. + * Muting or unmuting the speaker is pending. */ - final class Success extends - \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad + final class Success extends \Seam\Resources\ActionAttempt\SetSpeakerMute { public static function from_json(mixed $json): Success|null { @@ -5962,10 +7237,9 @@ public function __construct( } /** - * Simulating a manual lock action using a keypad is pending. + * Muting or unmuting the speaker is pending. */ - final class Pending extends - \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad + final class Pending extends \Seam\Resources\ActionAttempt\SetSpeakerMute { public static function from_json(mixed $json): Pending|null { @@ -6014,10 +7288,9 @@ public function __construct( } /** - * Simulating a manual lock action using a keypad is pending. + * Muting or unmuting the speaker is pending. */ - final class Error extends - \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad + final class Error extends \Seam\Resources\ActionAttempt\SetSpeakerMute { public static function from_json(mixed $json): Error|null { @@ -6028,7 +7301,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\SetSpeakerMute\Error\Error::from_json( $json->error, ) : null, @@ -6051,7 +7324,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\SetSpeakerMute\Error\Error|null $error, /** * Result of the action. */ @@ -6070,7 +7343,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\SimulateManualLockViaKeypad\Error { +namespace Seam\Resources\ActionAttempt\SetSpeakerMute\Error { /** * Error associated with the action. */ @@ -6100,12 +7373,12 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\PushThermostatPrograms { +namespace Seam\Resources\ActionAttempt\PauseSpeakerPlayback { /** - * Pushing thermostat weekly programs is pending. + * Pausing playback on the speaker is pending. */ final class Success extends - \Seam\Resources\ActionAttempt\PushThermostatPrograms + \Seam\Resources\ActionAttempt\PauseSpeakerPlayback { public static function from_json(mixed $json): Success|null { @@ -6116,7 +7389,11 @@ public static function from_json(mixed $json): Success|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: null, - result: $json->result ?? null, + result: isset($json->result) + ? \Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Success\Result::from_json( + $json->result, + ) + : null, status: $json->status ?? null, ); } @@ -6139,7 +7416,7 @@ public function __construct( /** * Result of the action. */ - public mixed $result, + public \Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Success\Result|null $result, /** * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null */ @@ -6154,10 +7431,10 @@ public function __construct( } /** - * Pushing thermostat weekly programs is pending. + * Pausing playback on the speaker is pending. */ final class Pending extends - \Seam\Resources\ActionAttempt\PushThermostatPrograms + \Seam\Resources\ActionAttempt\PauseSpeakerPlayback { public static function from_json(mixed $json): Pending|null { @@ -6206,10 +7483,9 @@ public function __construct( } /** - * Pushing thermostat weekly programs is pending. + * Pausing playback on the speaker is pending. */ - final class Error extends - \Seam\Resources\ActionAttempt\PushThermostatPrograms + final class Error extends \Seam\Resources\ActionAttempt\PauseSpeakerPlayback { public static function from_json(mixed $json): Error|null { @@ -6220,7 +7496,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\PushThermostatPrograms\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Error\Error::from_json( $json->error, ) : null, @@ -6243,7 +7519,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\PushThermostatPrograms\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Error\Error|null $error, /** * Result of the action. */ @@ -6262,7 +7538,34 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\PushThermostatPrograms\Error { +namespace Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Success { + /** + * Result of the action. + */ + class Result + { + public static function from_json(mixed $json): Result|null + { + if (!$json) { + return null; + } + return new self( + affected_device_ids: $json->affected_device_ids ?? null, + ); + } + + public function __construct( + /** + * IDs of the speakers whose playback was paused, including speakers grouped with the requested speaker. + * + * @var list|null + */ + public array|null $affected_device_ids, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\PauseSpeakerPlayback\Error { /** * Error associated with the action. */ @@ -6292,11 +7595,12 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ConfigureAutoLock { +namespace Seam\Resources\ActionAttempt\ResumeSpeakerPlayback { /** - * Configuring the auto-lock is pending. + * Resuming playback on the speaker is pending. */ - final class Success extends \Seam\Resources\ActionAttempt\ConfigureAutoLock + final class Success extends + \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback { public static function from_json(mixed $json): Success|null { @@ -6307,7 +7611,11 @@ public static function from_json(mixed $json): Success|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: null, - result: $json->result ?? null, + result: isset($json->result) + ? \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Success\Result::from_json( + $json->result, + ) + : null, status: $json->status ?? null, ); } @@ -6330,7 +7638,7 @@ public function __construct( /** * Result of the action. */ - public mixed $result, + public \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Success\Result|null $result, /** * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null */ @@ -6345,9 +7653,10 @@ public function __construct( } /** - * Configuring the auto-lock is pending. + * Resuming playback on the speaker is pending. */ - final class Pending extends \Seam\Resources\ActionAttempt\ConfigureAutoLock + final class Pending extends + \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback { public static function from_json(mixed $json): Pending|null { @@ -6396,9 +7705,10 @@ public function __construct( } /** - * Configuring the auto-lock is pending. + * Resuming playback on the speaker is pending. */ - final class Error extends \Seam\Resources\ActionAttempt\ConfigureAutoLock + final class Error extends + \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback { public static function from_json(mixed $json): Error|null { @@ -6409,7 +7719,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\ConfigureAutoLock\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Error\Error::from_json( $json->error, ) : null, @@ -6432,7 +7742,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\ConfigureAutoLock\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Error\Error|null $error, /** * Result of the action. */ @@ -6451,7 +7761,34 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ConfigureAutoLock\Error { +namespace Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Success { + /** + * Result of the action. + */ + class Result + { + public static function from_json(mixed $json): Result|null + { + if (!$json) { + return null; + } + return new self( + affected_device_ids: $json->affected_device_ids ?? null, + ); + } + + public function __construct( + /** + * IDs of the speakers whose playback was resumed, including speakers grouped with the requested speaker. + * + * @var list|null + */ + public array|null $affected_device_ids, + ) {} + } +} + +namespace Seam\Resources\ActionAttempt\ResumeSpeakerPlayback\Error { /** * Error associated with the action. */ @@ -6481,12 +7818,11 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged { +namespace Seam\Resources\ActionAttempt\PlaySpeakerChime { /** - * Converting an unmanaged access code to managed is pending. + * Playing a chime on the speaker is pending. */ - final class Success extends - \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged + final class Success extends \Seam\Resources\ActionAttempt\PlaySpeakerChime { public static function from_json(mixed $json): Success|null { @@ -6535,10 +7871,9 @@ public function __construct( } /** - * Converting an unmanaged access code to managed is pending. + * Playing a chime on the speaker is pending. */ - final class Pending extends - \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged + final class Pending extends \Seam\Resources\ActionAttempt\PlaySpeakerChime { public static function from_json(mixed $json): Pending|null { @@ -6587,10 +7922,9 @@ public function __construct( } /** - * Converting an unmanaged access code to managed is pending. + * Playing a chime on the speaker is pending. */ - final class Error extends - \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged + final class Error extends \Seam\Resources\ActionAttempt\PlaySpeakerChime { public static function from_json(mixed $json): Error|null { @@ -6601,7 +7935,7 @@ public static function from_json(mixed $json): Error|null action_attempt_id: $json->action_attempt_id ?? null, action_type: $json->action_type ?? null, error: isset($json->error) - ? \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged\Error\Error::from_json( + ? \Seam\Resources\ActionAttempt\PlaySpeakerChime\Error\Error::from_json( $json->error, ) : null, @@ -6624,7 +7958,7 @@ public function __construct( /** * Error associated with the action. */ - public \Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged\Error\Error|null $error, + public \Seam\Resources\ActionAttempt\PlaySpeakerChime\Error\Error|null $error, /** * Result of the action. */ @@ -6643,7 +7977,7 @@ public function __construct( } } -namespace Seam\Resources\ActionAttempt\ConvertAccessCodeToManaged\Error { +namespace Seam\Resources\ActionAttempt\PlaySpeakerChime\Error { /** * Error associated with the action. */ diff --git a/src/Resources/Device.php b/src/Resources/Device.php index 26e0dd66..8e341341 100644 --- a/src/Resources/Device.php +++ b/src/Resources/Device.php @@ -41,6 +41,10 @@ public static function from_json(mixed $json): Device|null can_hvac_cool: $json->can_hvac_cool ?? null, can_hvac_heat: $json->can_hvac_heat ?? null, can_hvac_heat_cool: $json->can_hvac_heat_cool ?? null, + can_mute_speaker: $json->can_mute_speaker ?? null, + can_pause_speaker_playback: $json->can_pause_speaker_playback ?? + null, + can_play_speaker_chime: $json->can_play_speaker_chime ?? null, can_program_offline_access_codes: $json->can_program_offline_access_codes ?? null, can_program_online_access_codes: $json->can_program_online_access_codes ?? @@ -55,6 +59,7 @@ public static function from_json(mixed $json): Device|null can_remotely_unlock: $json->can_remotely_unlock ?? null, can_run_thermostat_programs: $json->can_run_thermostat_programs ?? null, + can_set_speaker_volume: $json->can_set_speaker_volume ?? null, can_simulate_connection: $json->can_simulate_connection ?? null, can_simulate_disconnection: $json->can_simulate_disconnection ?? null, @@ -172,6 +177,18 @@ public function __construct( * Indicates whether the thermostat supports simultaneous heating and cooling. */ public bool|null $can_hvac_heat_cool = null, + /** + * Indicates whether the speaker supports muting and unmuting. + */ + public bool|null $can_mute_speaker = null, + /** + * Indicates whether the speaker supports pausing and resuming playback. + */ + public bool|null $can_pause_speaker_playback = null, + /** + * Indicates whether the speaker supports playing a chime. + */ + public bool|null $can_play_speaker_chime = null, /** * Indicates whether the device supports programming offline access codes. */ @@ -204,6 +221,10 @@ public function __construct( * Indicates whether the thermostat supports running climate programs. */ public bool|null $can_run_thermostat_programs = null, + /** + * Indicates whether the speaker supports setting its volume. + */ + public bool|null $can_set_speaker_volume = null, /** * Indicates whether the device supports simulating connection in a sandbox. */ @@ -813,6 +834,16 @@ public static function from_json(mixed $json): Properties|null $json->smartthings_metadata, ) : null, + sonos_metadata: isset($json->sonos_metadata) + ? \Seam\Resources\Device\Properties\SonosMetadata::from_json( + $json->sonos_metadata, + ) + : null, + speaker: isset($json->speaker) + ? \Seam\Resources\Device\Properties\Speaker::from_json( + $json->speaker, + ) + : null, supported_code_lengths: $json->supported_code_lengths ?? null, supports_accessory_keypad: $json->supports_accessory_keypad ?? null, @@ -1280,6 +1311,14 @@ public function __construct( * Metadata for a SmartThings device. */ public \Seam\Resources\Device\Properties\SmartthingsMetadata|null $smartthings_metadata = null, + /** + * Metadata for a Sonos speaker. + */ + public \Seam\Resources\Device\Properties\SonosMetadata|null $sonos_metadata = null, + /** + * Audio state and capabilities of the speaker. + */ + public \Seam\Resources\Device\Properties\Speaker|null $speaker = null, /** * Supported code lengths for access codes. * @@ -1566,6 +1605,7 @@ enum DeviceType: string case TAPO_CAMERA = "tapo_camera"; case ARLO_CAMERA = "arlo_camera"; case REOLINK_CAMERA = "reolink_camera"; + case SONOS_SPEAKER = "sonos_speaker"; } } @@ -3954,6 +3994,56 @@ public function __construct( ) {} } + /** + * Metadata for a Sonos speaker. + */ + class SonosMetadata + { + public static function from_json(mixed $json): SonosMetadata|null + { + if (!$json) { + return null; + } + return new self( + bonded_member_models: $json->bonded_member_models ?? null, + household_id: $json->household_id ?? null, + model_display_name: $json->model_display_name ?? null, + player_id: $json->player_id ?? null, + player_name: $json->player_name ?? null, + software_version: $json->software_version ?? null, + ); + } + + public function __construct( + /** + * Models of the speakers bonded to this speaker, such as surrounds or a subwoofer. + * + * @var list|null + */ + public array|null $bonded_member_models = null, + /** + * ID of the Sonos household that the speaker belongs to. + */ + public string|null $household_id = null, + /** + * Model name of the speaker, as reported by Sonos. + */ + public string|null $model_display_name = null, + /** + * ID of the Sonos player for the speaker. + */ + public string|null $player_id = null, + /** + * Name of the speaker, as set in the Sonos app. + */ + public string|null $player_name = null, + /** + * Software version running on the speaker. + */ + public string|null $software_version = null, + ) {} + } + /** * Metadata for a tado° device. */ @@ -4511,6 +4601,87 @@ public function __construct( ) {} } + /** + * Audio state and capabilities of the speaker. + */ + class Speaker + { + public static function from_json(mixed $json): Speaker|null + { + if (!$json) { + return null; + } + return new self( + grouped_with_device_ids: $json->grouped_with_device_ids ?? null, + has_fixed_volume: $json->has_fixed_volume ?? null, + is_muted: $json->is_muted ?? null, + max_volume: $json->max_volume ?? null, + min_volume: $json->min_volume ?? null, + playback_state: $json->playback_state ?? null, + supports_chime: $json->supports_chime ?? null, + volume: $json->volume ?? null, + volume_step: $json->volume_step ?? null, + now_playing: isset($json->now_playing) + ? \Seam\Resources\Device\Properties\Speaker\NowPlaying::from_json( + $json->now_playing, + ) + : null, + volume_reported_at: $json->volume_reported_at ?? null, + ); + } + + public function __construct( + /** + * IDs of the other speakers that are currently grouped with this speaker. Pausing or resuming playback on a speaker also affects the speakers in its group. + * + * @var list|null + */ + public array|null $grouped_with_device_ids, + /** + * Indicates whether the speaker's volume is fixed, for example, because the speaker's line-out level is controlled by an external amplifier. A speaker with a fixed volume cannot have its volume set through Seam. + */ + public bool|null $has_fixed_volume, + /** + * Indicates whether the speaker is muted. + */ + public bool|null $is_muted, + /** + * Maximum volume that you can set on the speaker. This is the ceiling of the speaker's native volume scale, not a limit configured for guests. + */ + public float|null $max_volume, + /** + * Minimum volume that you can set on the speaker. + */ + public float|null $min_volume, + /** + * Playback state of the speaker. + * + * @var value-of<\Seam\Resources\Device\Properties\Speaker\PlaybackState>|string|null + */ + public string|null $playback_state, + /** + * Indicates whether the speaker can play a chime. + */ + public bool|null $supports_chime, + /** + * Current volume of the speaker, on the speaker's native volume scale from `min_volume` to `max_volume`. This is the native volume setting, not a decibel level. + */ + public float|null $volume, + /** + * Increment between the volume values that you can set on the speaker. + */ + public float|null $volume_step, + /** + * Content that is currently playing on the speaker. + */ + public \Seam\Resources\Device\Properties\Speaker\NowPlaying|null $now_playing = null, + /** + * Date and time at which the speaker first reported its current volume. + */ + public string|null $volume_reported_at = null, + ) {} + } + /** * Active [thermostat schedule](https://www.seam.co/docs/capability-guides/thermostats/creating-and-managing-thermostat-schedules). * @@ -5653,6 +5824,50 @@ public function __construct( } } +namespace Seam\Resources\Device\Properties\Speaker { + /** + * Content that is currently playing on the speaker. + */ + class NowPlaying + { + public static function from_json(mixed $json): NowPlaying|null + { + if (!$json) { + return null; + } + return new self( + album: $json->album ?? null, + artist: $json->artist ?? null, + title: $json->title ?? null, + ); + } + + public function __construct( + /** + * Album of the content that is currently playing. + */ + public string|null $album = null, + /** + * Artist of the content that is currently playing. + */ + public string|null $artist = null, + /** + * Title of the content that is currently playing. + */ + public string|null $title = null, + ) {} + } + + enum PlaybackState: string + { + case PLAYING = "playing"; + case PAUSED = "paused"; + case IDLE = "idle"; + case BUFFERING = "buffering"; + case UNKNOWN = "unknown"; + } +} + namespace Seam\Resources\Device\Properties\ActiveThermostatSchedule { /** * Errors associated with the [thermostat schedule](https://www.seam.co/docs/capability-guides/thermostats/creating-and-managing-thermostat-schedules). diff --git a/src/Resources/DeviceProvider.php b/src/Resources/DeviceProvider.php index 091c4cb0..325c4dbf 100644 --- a/src/Resources/DeviceProvider.php +++ b/src/Resources/DeviceProvider.php @@ -19,6 +19,10 @@ public static function from_json(mixed $json): DeviceProvider|null can_hvac_cool: $json->can_hvac_cool ?? null, can_hvac_heat: $json->can_hvac_heat ?? null, can_hvac_heat_cool: $json->can_hvac_heat_cool ?? null, + can_mute_speaker: $json->can_mute_speaker ?? null, + can_pause_speaker_playback: $json->can_pause_speaker_playback ?? + null, + can_play_speaker_chime: $json->can_play_speaker_chime ?? null, can_program_offline_access_codes: $json->can_program_offline_access_codes ?? null, can_program_online_access_codes: $json->can_program_online_access_codes ?? @@ -33,6 +37,7 @@ public static function from_json(mixed $json): DeviceProvider|null can_remotely_unlock: $json->can_remotely_unlock ?? null, can_run_thermostat_programs: $json->can_run_thermostat_programs ?? null, + can_set_speaker_volume: $json->can_set_speaker_volume ?? null, can_simulate_connection: $json->can_simulate_connection ?? null, can_simulate_disconnection: $json->can_simulate_disconnection ?? null, @@ -90,6 +95,18 @@ public function __construct( * Indicates whether the thermostat supports simultaneous heating and cooling. */ public bool|null $can_hvac_heat_cool = null, + /** + * Indicates whether the speaker supports muting and unmuting. + */ + public bool|null $can_mute_speaker = null, + /** + * Indicates whether the speaker supports pausing and resuming playback. + */ + public bool|null $can_pause_speaker_playback = null, + /** + * Indicates whether the speaker supports playing a chime. + */ + public bool|null $can_play_speaker_chime = null, /** * Indicates whether the device supports programming offline access codes. */ @@ -122,6 +139,10 @@ public function __construct( * Indicates whether the thermostat supports running climate programs. */ public bool|null $can_run_thermostat_programs = null, + /** + * Indicates whether the speaker supports setting its volume. + */ + public bool|null $can_set_speaker_volume = null, /** * Indicates whether the device supports simulating connection in a sandbox. */ @@ -233,5 +254,6 @@ enum DeviceProviderName: string case OMNITEC = "omnitec"; case KISI = "kisi"; case AQARA = "aqara"; + case SONOS = "sonos"; } } diff --git a/src/Resources/Phone.php b/src/Resources/Phone.php index 16e5033e..b51436e8 100644 --- a/src/Resources/Phone.php +++ b/src/Resources/Phone.php @@ -61,7 +61,7 @@ public function __construct( */ public string|null $display_name, /** - * Errors associated with the phone. + * 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. * * @var list<\Seam\Resources\Phone\Errors> */ @@ -71,7 +71,7 @@ public function __construct( */ public \Seam\Resources\Phone\Properties|null $properties, /** - * Warnings associated with the phone. + * Array of warnings associated with the device. Each warning object within the array contains two fields: `warning_code` and `message`. `warning_code` is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. * * @var list<\Seam\Resources\Phone\Warnings> */ @@ -90,7 +90,7 @@ public function __construct( namespace Seam\Resources\Phone { /** - * Errors associated with the phone. + * 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. Known error_code values use subclasses; unknown values use this base class and retain their raw discriminator. */ class Errors { @@ -99,11 +99,75 @@ public static function from_json(mixed $json): Errors|null if (!$json) { return null; } - return new self( - created_at: $json->created_at ?? null, - error_code: $json->error_code ?? null, - message: $json->message ?? null, - ); + $discriminant = is_string($json->error_code ?? null) + ? \Seam\Resources\Phone\Errors\ErrorCode::tryFrom( + $json->error_code, + ) + : null; + + return match ($discriminant) { + \Seam\Resources\Phone\Errors\ErrorCode::ACCOUNT_DISCONNECTED + => \Seam\Resources\Phone\Errors\AccountDisconnected::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::SALTO_KS_SUBSCRIPTION_LIMIT_EXCEEDED + => \Seam\Resources\Phone\Errors\SaltoKsSubscriptionLimitExceeded::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::INSUFFICIENT_PERMISSIONS + => \Seam\Resources\Phone\Errors\InsufficientPermissions::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::DORMAKABA_SITES_DISCONNECTED + => \Seam\Resources\Phone\Errors\DormakabaSitesDisconnected::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::DEVICE_OFFLINE + => \Seam\Resources\Phone\Errors\DeviceOffline::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::DEVICE_REMOVED + => \Seam\Resources\Phone\Errors\DeviceRemoved::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::HUB_DISCONNECTED + => \Seam\Resources\Phone\Errors\HubDisconnected::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::DEVICE_DISCONNECTED + => \Seam\Resources\Phone\Errors\DeviceDisconnected::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::EMPTY_BACKUP_ACCESS_CODE_POOL + => \Seam\Resources\Phone\Errors\EmptyBackupAccessCodePool::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::AUGUST_LOCK_NOT_AUTHORIZED + => \Seam\Resources\Phone\Errors\AugustLockNotAuthorized::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::MISSING_DEVICE_CREDENTIALS + => \Seam\Resources\Phone\Errors\MissingDeviceCredentials::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::AUXILIARY_HEAT_RUNNING + => \Seam\Resources\Phone\Errors\AuxiliaryHeatRunning::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::SUBSCRIPTION_REQUIRED + => \Seam\Resources\Phone\Errors\SubscriptionRequired::from_json( + $json, + ), + \Seam\Resources\Phone\Errors\ErrorCode::BRIDGE_DISCONNECTED + => \Seam\Resources\Phone\Errors\BridgeDisconnected::from_json( + $json, + ), + default => new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + message: $json->message ?? null, + ), + }; } public function __construct( @@ -112,11 +176,13 @@ public function __construct( */ public string|null $created_at, /** - * Unique identifier of the type of error. + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null */ public string|null $error_code, /** - * Detailed description of the error. + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ public string|null $message, ) {} @@ -163,7 +229,7 @@ public function __construct( } /** - * Warnings associated with the phone. + * Array of warnings associated with the device. Each warning object within the array contains two fields: `warning_code` and `message`. `warning_code` is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. Known warning_code values use subclasses; unknown values use this base class and retain their raw discriminator. */ class Warnings { @@ -172,11 +238,131 @@ public static function from_json(mixed $json): Warnings|null if (!$json) { return null; } - return new self( - created_at: $json->created_at ?? null, - message: $json->message ?? null, - warning_code: $json->warning_code ?? null, - ); + $discriminant = is_string($json->warning_code ?? null) + ? \Seam\Resources\Phone\Warnings\WarningCode::tryFrom( + $json->warning_code, + ) + : null; + + return match ($discriminant) { + \Seam\Resources\Phone\Warnings\WarningCode::PARTIAL_BACKUP_ACCESS_CODE_POOL + => \Seam\Resources\Phone\Warnings\PartialBackupAccessCodePool::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::MANY_ACTIVE_BACKUP_CODES + => \Seam\Resources\Phone\Warnings\ManyActiveBackupCodes::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::THIRD_PARTY_INTEGRATION_DETECTED + => \Seam\Resources\Phone\Warnings\ThirdPartyIntegrationDetected::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::TTLOCK_LOCK_GATEWAY_UNLOCKING_NOT_ENABLED + => \Seam\Resources\Phone\Warnings\TtlockLockGatewayUnlockingNotEnabled::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::TTLOCK_WEAK_GATEWAY_SIGNAL + => \Seam\Resources\Phone\Warnings\TtlockWeakGatewaySignal::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::POWER_SAVING_MODE + => \Seam\Resources\Phone\Warnings\PowerSavingMode::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::TEMPERATURE_THRESHOLD_EXCEEDED + => \Seam\Resources\Phone\Warnings\TemperatureThresholdExceeded::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::DEVICE_COMMUNICATION_DEGRADED + => \Seam\Resources\Phone\Warnings\DeviceCommunicationDegraded::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::SCHEDULED_MAINTENANCE_WINDOW + => \Seam\Resources\Phone\Warnings\ScheduledMaintenanceWindow::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::DEVICE_HAS_FLAKY_CONNECTION + => \Seam\Resources\Phone\Warnings\DeviceHasFlakyConnection::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::SALTO_KS_OFFICE_MODE + => \Seam\Resources\Phone\Warnings\SaltoKsOfficeMode::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::SALTO_KS_PRIVACY_MODE + => \Seam\Resources\Phone\Warnings\SaltoKsPrivacyMode::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::PRIVACY_MODE + => \Seam\Resources\Phone\Warnings\PrivacyMode::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::SALTO_KS_SUBSCRIPTION_LIMIT_ALMOST_REACHED + => \Seam\Resources\Phone\Warnings\SaltoKsSubscriptionLimitAlmostReached::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::SALTO_KS_LOCK_ACCESS_CODE_SUPPORT_REMOVED + => \Seam\Resources\Phone\Warnings\SaltoKsLockAccessCodeSupportRemoved::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::UNKNOWN_ISSUE_WITH_PHONE + => \Seam\Resources\Phone\Warnings\UnknownIssueWithPhone::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::LOCKLY_TIME_ZONE_NOT_CONFIGURED + => \Seam\Resources\Phone\Warnings\LocklyTimeZoneNotConfigured::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::ULTRALOQ_TIME_ZONE_UNKNOWN + => \Seam\Resources\Phone\Warnings\UltraloqTimeZoneUnknown::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::TIME_ZONE_UNKNOWN + => \Seam\Resources\Phone\Warnings\TimeZoneUnknown::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::TIME_ZONE_MISMATCH + => \Seam\Resources\Phone\Warnings\TimeZoneMismatch::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::TWO_N_DEVICE_MISSING_TIMEZONE + => \Seam\Resources\Phone\Warnings\TwoNDeviceMissingTimezone::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::HUB_REQUIRED_FOR_ADDITIONAL_CAPABILITIES + => \Seam\Resources\Phone\Warnings\HubRequiredForAdditionalCapabilities::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::PROVIDER_ISSUE + => \Seam\Resources\Phone\Warnings\ProviderIssue::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::KEYNEST_UNSUPPORTED_LOCKER + => \Seam\Resources\Phone\Warnings\KeynestUnsupportedLocker::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::ACCESSORY_KEYPAD_SETUP_REQUIRED + => \Seam\Resources\Phone\Warnings\AccessoryKeypadSetupRequired::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::ACCESSORY_KEYPAD_LOW_BATTERY + => \Seam\Resources\Phone\Warnings\AccessoryKeypadLowBattery::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::UNRELIABLE_ONLINE_STATUS + => \Seam\Resources\Phone\Warnings\UnreliableOnlineStatus::from_json( + $json, + ), + \Seam\Resources\Phone\Warnings\WarningCode::MAX_ACCESS_CODES_REACHED + => \Seam\Resources\Phone\Warnings\MaxAccessCodesReached::from_json( + $json, + ), + default => new self( + created_at: $json->created_at ?? null, + message: $json->message ?? null, + warning_code: $json->warning_code ?? null, + ), + }; } public function __construct( @@ -185,11 +371,13 @@ public function __construct( */ public string|null $created_at, /** - * Detailed description of the warning. + * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ public string|null $message, /** - * Unique identifier of the type of warning. + * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Warnings\WarningCode>|string|null */ public string|null $warning_code, ) {} @@ -202,94 +390,2021 @@ enum DeviceType: string } } -namespace Seam\Resources\Phone\Properties { +namespace Seam\Resources\Phone\Errors { /** - * ASSA ABLOY Credential Service metadata for the phone. + * Indicates that the account is disconnected. */ - class AssaAbloyCredentialServiceMetadata + final class AccountDisconnected extends \Seam\Resources\Phone\Errors + { + public static function from_json(mixed $json): AccountDisconnected|null + { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_connected_account_error: $json->is_connected_account_error ?? + null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a [connected account](https://www.seam.co/docs/api/connected_accounts/object) error. + */ + public true|null $is_connected_account_error, + /** + * Indicates that the error is not a device error. + */ + public false|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the Salto site user limit has been reached. + */ + final class SaltoKsSubscriptionLimitExceeded extends + \Seam\Resources\Phone\Errors { public static function from_json( mixed $json, - ): AssaAbloyCredentialServiceMetadata|null { + ): SaltoKsSubscriptionLimitExceeded|null { if (!$json) { return null; } return new self( - endpoints: array_map( - fn( - $e, - ) => \Seam\Resources\Phone\Properties\AssaAbloyCredentialServiceMetadata\Endpoints::from_json( - $e, - ), - $json->endpoints ?? [], - ), - has_active_endpoint: $json->has_active_endpoint ?? null, + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_connected_account_error: $json->is_connected_account_error ?? + null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, ); } public function __construct( /** - * Endpoints associated with the phone. + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. * - * @var list<\Seam\Resources\Phone\Properties\AssaAbloyCredentialServiceMetadata\Endpoints>|null + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null */ - public array|null $endpoints = null, + string|null $error_code, /** - * Indicates whether the credential service has active endpoints associated with the phone. + * Indicates that the error is a [connected account](https://www.seam.co/docs/api/connected_accounts/object) error. */ - public bool|null $has_active_endpoint = null, - ) {} + public true|null $is_connected_account_error, + /** + * Indicates that the error is not a device error. + */ + public false|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } } /** - * Salto Space credential service metadata for the phone. + * Indicates that the provider's system to which this device belongs is not letting Seam act on it, so Seam cannot manage access codes or unlock the device. The error message says which of three causes applies. Seam's integration user may not have sufficient permissions on the provider's system, or may have been suspended there: grant the integration user the required permissions in the provider's system, or reauthorize the connected account in Seam. The provider account or site may not have a valid subscription with the provider: set up or renew that subscription with the provider. Or the provider may have rejected the credential Seam uses to operate the device's hub: contact Seam support to re-activate it. */ - class SaltoSpaceCredentialServiceMetadata + final class InsufficientPermissions extends \Seam\Resources\Phone\Errors { public static function from_json( mixed $json, - ): SaltoSpaceCredentialServiceMetadata|null { + ): InsufficientPermissions|null { if (!$json) { return null; } - return new self(has_active_phone: $json->has_active_phone ?? null); + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_connected_account_error: $json->is_connected_account_error ?? + null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); } public function __construct( /** - * Indicates whether the credential service has an active associated phone. + * Date and time at which Seam created the error. */ - public bool|null $has_active_phone = null, - ) {} + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a [connected account](https://www.seam.co/docs/api/connected_accounts/object) error. + */ + public true|null $is_connected_account_error, + /** + * Indicates that the error is not a device error. + */ + public false|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } } -} -namespace Seam\Resources\Phone\Properties\AssaAbloyCredentialServiceMetadata { /** - * Endpoints associated with the phone. + * Indicates that one or more dormakaba sites associated with the connected account could not be connected. Contact dormakaba support. */ - class Endpoints + final class DormakabaSitesDisconnected extends \Seam\Resources\Phone\Errors { - public static function from_json(mixed $json): Endpoints|null + public static function from_json( + mixed $json, + ): DormakabaSitesDisconnected|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_connected_account_error: $json->is_connected_account_error ?? + null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a [connected account](https://www.seam.co/docs/api/connected_accounts/object) error. + */ + public true|null $is_connected_account_error, + /** + * Indicates that the error is not a device error. + */ + public false|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the device is offline. + */ + final class DeviceOffline extends \Seam\Resources\Phone\Errors + { + public static function from_json(mixed $json): DeviceOffline|null { if (!$json) { return null; } return new self( - endpoint_id: $json->endpoint_id ?? null, - is_active: $json->is_active ?? null, + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, ); } public function __construct( /** - * ID of the associated endpoint. + * Date and time at which Seam created the error. */ - public string|null $endpoint_id = null, + string|null $created_at, /** - * Indicated whether the endpoint is active. + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null */ - public bool|null $is_active = null, - ) {} + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the device has been removed. + */ + final class DeviceRemoved extends \Seam\Resources\Phone\Errors + { + public static function from_json(mixed $json): DeviceRemoved|null + { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the hub is disconnected. + */ + final class HubDisconnected extends \Seam\Resources\Phone\Errors + { + public static function from_json(mixed $json): HubDisconnected|null + { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the device is disconnected. + */ + final class DeviceDisconnected extends \Seam\Resources\Phone\Errors + { + public static function from_json(mixed $json): DeviceDisconnected|null + { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the [backup access code pool](https://www.seam.co/docs/low-level-apis/smart-locks/access-codes/backup-access-codes) is empty. + */ + final class EmptyBackupAccessCodePool extends \Seam\Resources\Phone\Errors + { + public static function from_json( + mixed $json, + ): EmptyBackupAccessCodePool|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the user is not authorized to use the August lock. + */ + final class AugustLockNotAuthorized extends \Seam\Resources\Phone\Errors + { + public static function from_json( + mixed $json, + ): AugustLockNotAuthorized|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that device credentials are missing. + */ + final class MissingDeviceCredentials extends \Seam\Resources\Phone\Errors + { + public static function from_json( + mixed $json, + ): MissingDeviceCredentials|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the auxiliary heat is running. + */ + final class AuxiliaryHeatRunning extends \Seam\Resources\Phone\Errors + { + public static function from_json(mixed $json): AuxiliaryHeatRunning|null + { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that a subscription is required to connect. + */ + final class SubscriptionRequired extends \Seam\Resources\Phone\Errors + { + public static function from_json(mixed $json): SubscriptionRequired|null + { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + is_device_error: $json->is_device_error ?? null, + message: $json->message ?? null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Indicates that the error is a device error. + */ + public true|null $is_device_error, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + /** + * Indicates that the Seam API cannot communicate with [Seam Bridge](https://www.seam.co/docs/capability-guides/seam-bridge), for example, if the Seam Bridge executable has stopped or if the computer running the Seam Bridge executable is offline. See also [Troubleshooting Your Access Control System](https://www.seam.co/docs/low-level-apis/access-systems/troubleshooting-your-access-control-system#acs_system-errors-seam_bridge_disconnected). + */ + final class BridgeDisconnected extends \Seam\Resources\Phone\Errors + { + public static function from_json(mixed $json): BridgeDisconnected|null + { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + error_code: $json->error_code ?? null, + message: $json->message ?? null, + is_bridge_error: $json->is_bridge_error ?? null, + is_connected_account_error: $json->is_connected_account_error ?? + null, + ); + } + + public function __construct( + /** + * Date and time at which Seam created the error. + */ + string|null $created_at, + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\Phone\Errors\ErrorCode>|string|null + */ + string|null $error_code, + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + string|null $message, + /** + * Indicates whether the error is related to [Seam Bridge](https://www.seam.co/docs/capability-guides/seam-bridge). + */ + public bool|null $is_bridge_error = null, + /** + * Indicates whether the error is related specifically to the connected account. + */ + public bool|null $is_connected_account_error = null, + ) { + parent::__construct( + created_at: $created_at, + error_code: $error_code, + message: $message, + ); + } + } + + enum ErrorCode: string + { + case ACCOUNT_DISCONNECTED = "account_disconnected"; + case SALTO_KS_SUBSCRIPTION_LIMIT_EXCEEDED = "salto_ks_subscription_limit_exceeded"; + case INSUFFICIENT_PERMISSIONS = "insufficient_permissions"; + case DORMAKABA_SITES_DISCONNECTED = "dormakaba_sites_disconnected"; + case DEVICE_OFFLINE = "device_offline"; + case DEVICE_REMOVED = "device_removed"; + case HUB_DISCONNECTED = "hub_disconnected"; + case DEVICE_DISCONNECTED = "device_disconnected"; + case EMPTY_BACKUP_ACCESS_CODE_POOL = "empty_backup_access_code_pool"; + case AUGUST_LOCK_NOT_AUTHORIZED = "august_lock_not_authorized"; + case MISSING_DEVICE_CREDENTIALS = "missing_device_credentials"; + case AUXILIARY_HEAT_RUNNING = "auxiliary_heat_running"; + case SUBSCRIPTION_REQUIRED = "subscription_required"; + case BRIDGE_DISCONNECTED = "bridge_disconnected"; + } +} + +namespace Seam\Resources\Phone\Properties { + /** + * ASSA ABLOY Credential Service metadata for the phone. + */ + class AssaAbloyCredentialServiceMetadata + { + public static function from_json( + mixed $json, + ): AssaAbloyCredentialServiceMetadata|null { + if (!$json) { + return null; + } + return new self( + endpoints: array_map( + fn( + $e, + ) => \Seam\Resources\Phone\Properties\AssaAbloyCredentialServiceMetadata\Endpoints::from_json( + $e, + ), + $json->endpoints ?? [], + ), + has_active_endpoint: $json->has_active_endpoint ?? null, + ); + } + + public function __construct( + /** + * Endpoints associated with the phone. + * + * @var list<\Seam\Resources\Phone\Properties\AssaAbloyCredentialServiceMetadata\Endpoints>|null + */ + public array|null $endpoints = null, + /** + * Indicates whether the credential service has active endpoints associated with the phone. + */ + public bool|null $has_active_endpoint = null, + ) {} + } + + /** + * Salto Space credential service metadata for the phone. + */ + class SaltoSpaceCredentialServiceMetadata + { + public static function from_json( + mixed $json, + ): SaltoSpaceCredentialServiceMetadata|null { + if (!$json) { + return null; + } + return new self(has_active_phone: $json->has_active_phone ?? null); + } + + public function __construct( + /** + * Indicates whether the credential service has an active associated phone. + */ + public bool|null $has_active_phone = null, + ) {} + } +} + +namespace Seam\Resources\Phone\Properties\AssaAbloyCredentialServiceMetadata { + /** + * Endpoints associated with the phone. + */ + class Endpoints + { + public static function from_json(mixed $json): Endpoints|null + { + if (!$json) { + return null; + } + return new self( + endpoint_id: $json->endpoint_id ?? null, + is_active: $json->is_active ?? null, + ); + } + + public function __construct( + /** + * ID of the associated endpoint. + */ + public string|null $endpoint_id = null, + /** + * Indicated whether the endpoint is active. + */ + public bool|null $is_active = null, + ) {} + } +} + +namespace Seam\Resources\Phone\Warnings { + /** + * Indicates that the backup access code is unhealthy. + */ + final class PartialBackupAccessCodePool extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): PartialBackupAccessCodePool|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that there are too many backup codes. + */ + final class ManyActiveBackupCodes extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): ManyActiveBackupCodes|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that a third-party integration has been detected. + */ + final class ThirdPartyIntegrationDetected extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): ThirdPartyIntegrationDetected|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the Remote Unlock feature is not enabled in the settings." + */ + final class TtlockLockGatewayUnlockingNotEnabled extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): TtlockLockGatewayUnlockingNotEnabled|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the gateway signal is weak. + */ + final class TtlockWeakGatewaySignal extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): TtlockWeakGatewaySignal|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the device is in power saving mode and may have limited functionality. + */ + final class PowerSavingMode extends \Seam\Resources\Phone\Warnings + { + public static function from_json(mixed $json): PowerSavingMode|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the temperature threshold has been exceeded. + */ + final class TemperatureThresholdExceeded extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): TemperatureThresholdExceeded|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the device appears to be unresponsive. + */ + final class DeviceCommunicationDegraded extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): DeviceCommunicationDegraded|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that a scheduled maintenance window has been detected. + */ + final class ScheduledMaintenanceWindow extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): ScheduledMaintenanceWindow|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the device has a flaky connection. + */ + final class DeviceHasFlakyConnection extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): DeviceHasFlakyConnection|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the Salto KS lock is in Office Mode. Access Codes will not unlock doors. + */ + final class SaltoKsOfficeMode extends \Seam\Resources\Phone\Warnings + { + public static function from_json(mixed $json): SaltoKsOfficeMode|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the Salto KS lock is in Privacy Mode. Access Codes will not unlock doors. + */ + final class SaltoKsPrivacyMode extends \Seam\Resources\Phone\Warnings + { + public static function from_json(mixed $json): SaltoKsPrivacyMode|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the lock is in Privacy Mode. Access codes and remote unlock are blocked until Privacy Mode is disabled. + */ + final class PrivacyMode extends \Seam\Resources\Phone\Warnings + { + public static function from_json(mixed $json): PrivacyMode|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the Salto KS site has exceeded 80% of the maximum number of allowed users. Increase your subscription limit or delete some users from your site. + */ + final class SaltoKsSubscriptionLimitAlmostReached extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): SaltoKsSubscriptionLimitAlmostReached|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that a change in the reported device model has been detected for this Salto KS lock, which may occur after an IQ hub reset. Access code support may be affected. See https://help.getseam.com/articles/5098842588-salto-ks-lock-loses-access-code-support for troubleshooting steps. + */ + final class SaltoKsLockAccessCodeSupportRemoved extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): SaltoKsLockAccessCodeSupportRemoved|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that an unknown issue occurred while syncing the state of the phone with the provider. This issue may affect the proper functioning of the phone. + */ + final class UnknownIssueWithPhone extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): UnknownIssueWithPhone|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that Seam detected that the Lockly device does not have a time zone configured. Time-bound codes may not work as expected. + */ + final class LocklyTimeZoneNotConfigured extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): LocklyTimeZoneNotConfigured|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that Seam does not know the time zone of the Ultraloq device. Set a time zone to enable time-bound access codes. + */ + final class UltraloqTimeZoneUnknown extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): UltraloqTimeZoneUnknown|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that Seam does not know the device's time zone. Set a time zone to enable time-bound access codes. + */ + final class TimeZoneUnknown extends \Seam\Resources\Phone\Warnings + { + public static function from_json(mixed $json): TimeZoneUnknown|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the device's configured time zone does not match its hardware UTC offset. Time-bound access codes may activate at the wrong local time. + */ + final class TimeZoneMismatch extends \Seam\Resources\Phone\Warnings + { + public static function from_json(mixed $json): TimeZoneMismatch|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the 2N device does not have a time zone configured. Configure a time zone on the device to enable access codes. + */ + final class TwoNDeviceMissingTimezone extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): TwoNDeviceMissingTimezone|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that a hub or relay must be connected to unlock additional capabilities such as remote unlock. + */ + final class HubRequiredForAdditionalCapabilities extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): HubRequiredForAdditionalCapabilities|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates a provider-specific issue that may affect device functionality. + */ + final class ProviderIssue extends \Seam\Resources\Phone\Warnings + { + public static function from_json(mixed $json): ProviderIssue|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the key is in a locker that does not support the access codes API. + */ + final class KeynestUnsupportedLocker extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): KeynestUnsupportedLocker|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the accessory keypad exists, but is not linked to the Igloohome Bridge. Online access code programming will fail until the keypad is linked to the Igloohome Bridge in the Igloohome app. + */ + final class AccessoryKeypadSetupRequired extends + \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): AccessoryKeypadSetupRequired|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * 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\Phone\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\Phone\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. + */ + final class UnreliableOnlineStatus extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): UnreliableOnlineStatus|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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + /** + * Indicates that the device has reached its maximum number of active access codes. Delete existing codes before creating new ones. + */ + final class MaxAccessCodesReached extends \Seam\Resources\Phone\Warnings + { + public static function from_json( + mixed $json, + ): MaxAccessCodesReached|null { + if (!$json) { + return null; + } + return new self( + active_access_code_count: $json->active_access_code_count ?? + null, + created_at: $json->created_at ?? null, + max_active_access_code_count: $json->max_active_access_code_count ?? + null, + message: $json->message ?? null, + warning_code: $json->warning_code ?? null, + ); + } + + public function __construct( + /** + * Number of active access codes on the device when the warning was set. + */ + public int|null $active_access_code_count, + /** + * Date and time at which Seam created the warning. + */ + string|null $created_at, + /** + * Maximum number of active access codes supported by the device. + */ + public int|null $max_active_access_code_count, + /** + * 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\Phone\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + + enum WarningCode: string + { + case PARTIAL_BACKUP_ACCESS_CODE_POOL = "partial_backup_access_code_pool"; + case MANY_ACTIVE_BACKUP_CODES = "many_active_backup_codes"; + case THIRD_PARTY_INTEGRATION_DETECTED = "third_party_integration_detected"; + case TTLOCK_LOCK_GATEWAY_UNLOCKING_NOT_ENABLED = "ttlock_lock_gateway_unlocking_not_enabled"; + case TTLOCK_WEAK_GATEWAY_SIGNAL = "ttlock_weak_gateway_signal"; + case POWER_SAVING_MODE = "power_saving_mode"; + case TEMPERATURE_THRESHOLD_EXCEEDED = "temperature_threshold_exceeded"; + case DEVICE_COMMUNICATION_DEGRADED = "device_communication_degraded"; + case SCHEDULED_MAINTENANCE_WINDOW = "scheduled_maintenance_window"; + case DEVICE_HAS_FLAKY_CONNECTION = "device_has_flaky_connection"; + case SALTO_KS_OFFICE_MODE = "salto_ks_office_mode"; + case SALTO_KS_PRIVACY_MODE = "salto_ks_privacy_mode"; + case PRIVACY_MODE = "privacy_mode"; + case SALTO_KS_SUBSCRIPTION_LIMIT_ALMOST_REACHED = "salto_ks_subscription_limit_almost_reached"; + case SALTO_KS_LOCK_ACCESS_CODE_SUPPORT_REMOVED = "salto_ks_lock_access_code_support_removed"; + case UNKNOWN_ISSUE_WITH_PHONE = "unknown_issue_with_phone"; + case LOCKLY_TIME_ZONE_NOT_CONFIGURED = "lockly_time_zone_not_configured"; + case ULTRALOQ_TIME_ZONE_UNKNOWN = "ultraloq_time_zone_unknown"; + case TIME_ZONE_UNKNOWN = "time_zone_unknown"; + case TIME_ZONE_MISMATCH = "time_zone_mismatch"; + case TWO_N_DEVICE_MISSING_TIMEZONE = "two_n_device_missing_timezone"; + case HUB_REQUIRED_FOR_ADDITIONAL_CAPABILITIES = "hub_required_for_additional_capabilities"; + 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/UnmanagedAccessGrant.php b/src/Resources/UnmanagedAccessGrant.php index 1900bee7..3d0525b1 100644 --- a/src/Resources/UnmanagedAccessGrant.php +++ b/src/Resources/UnmanagedAccessGrant.php @@ -1118,7 +1118,9 @@ public function __construct( */ public string|null $device_id, /** - * Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`). + * Reason the access code could not be revoked. + * + * @var value-of<\Seam\Resources\UnmanagedAccessGrant\Warnings\OverprovisionedAccess\FailedDevices\ErrorCode>|string|null */ public string|null $error_code, /** @@ -1129,6 +1131,13 @@ public function __construct( } } +namespace Seam\Resources\UnmanagedAccessGrant\Warnings\OverprovisionedAccess\FailedDevices { + enum ErrorCode: string + { + case OFFLINE_ACCESS_CODE_NOT_REVOCABLE = "offline_access_code_not_revocable"; + } +} + namespace Seam\Resources\UnmanagedAccessGrant\Warnings\DeviceTimeConstraintsViolated { enum Reason: string { diff --git a/src/Resources/UnmanagedAccessMethod.php b/src/Resources/UnmanagedAccessMethod.php index 43829285..6ed73bcb 100644 --- a/src/Resources/UnmanagedAccessMethod.php +++ b/src/Resources/UnmanagedAccessMethod.php @@ -123,7 +123,7 @@ public function __construct( */ public bool|null $is_ready_for_assignment = null, /** - * Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. + * Indicates whether the access method is ready to be encoded. This is true when the card has not yet been issued and the access system has received all the access the card needs. While it is false, `pending_mutations` contains `waiting_for_access_on_acs_system`. */ public bool|null $is_ready_for_encoding = null, ) {} @@ -211,6 +211,10 @@ public static function from_json(mixed $json): PendingMutations|null => \Seam\Resources\UnmanagedAccessMethod\PendingMutations\UpdatingAccessTimes::from_json( $json, ), + \Seam\Resources\UnmanagedAccessMethod\PendingMutations\MutationCode::WAITING_FOR_ACCESS_ON_ACS_SYSTEM + => \Seam\Resources\UnmanagedAccessMethod\PendingMutations\WaitingForAccessOnAcsSystem::from_json( + $json, + ), default => new self( created_at: $json->created_at ?? null, message: $json->message ?? null, @@ -586,11 +590,55 @@ public function __construct( } } + /** + * The access system has not yet received all the access this card needs. A card encoded now would carry only the access the system already has, so wait until this clears before encoding. + */ + final class WaitingForAccessOnAcsSystem extends + \Seam\Resources\UnmanagedAccessMethod\PendingMutations + { + public static function from_json( + mixed $json, + ): WaitingForAccessOnAcsSystem|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + message: $json->message ?? null, + mutation_code: $json->mutation_code ?? null, + ); + } + + public function __construct( + /** + * Date and time at which the mutation was created. + */ + string|null $created_at, + /** + * Detailed description of the mutation. + */ + string|null $message, + /** + * Mutation code to indicate that Seam is in the process of provisioning access for this access method on new devices. + * + * @var value-of<\Seam\Resources\UnmanagedAccessMethod\PendingMutations\MutationCode>|string|null + */ + string|null $mutation_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + mutation_code: $mutation_code, + ); + } + } + enum MutationCode: string { case PROVISIONING_ACCESS = "provisioning_access"; case REVOKING_ACCESS = "revoking_access"; case UPDATING_ACCESS_TIMES = "updating_access_times"; + case WAITING_FOR_ACCESS_ON_ACS_SYSTEM = "waiting_for_access_on_acs_system"; } } diff --git a/src/Resources/UnmanagedDevice.php b/src/Resources/UnmanagedDevice.php index f58a66cc..94a2ffa7 100644 --- a/src/Resources/UnmanagedDevice.php +++ b/src/Resources/UnmanagedDevice.php @@ -46,6 +46,10 @@ public static function from_json(mixed $json): UnmanagedDevice|null can_hvac_cool: $json->can_hvac_cool ?? null, can_hvac_heat: $json->can_hvac_heat ?? null, can_hvac_heat_cool: $json->can_hvac_heat_cool ?? null, + can_mute_speaker: $json->can_mute_speaker ?? null, + can_pause_speaker_playback: $json->can_pause_speaker_playback ?? + null, + can_play_speaker_chime: $json->can_play_speaker_chime ?? null, can_program_offline_access_codes: $json->can_program_offline_access_codes ?? null, can_program_online_access_codes: $json->can_program_online_access_codes ?? @@ -60,6 +64,7 @@ public static function from_json(mixed $json): UnmanagedDevice|null can_remotely_unlock: $json->can_remotely_unlock ?? null, can_run_thermostat_programs: $json->can_run_thermostat_programs ?? null, + can_set_speaker_volume: $json->can_set_speaker_volume ?? null, can_simulate_connection: $json->can_simulate_connection ?? null, can_simulate_disconnection: $json->can_simulate_disconnection ?? null, @@ -160,6 +165,18 @@ public function __construct( * Indicates whether the thermostat supports simultaneous heating and cooling. */ public bool|null $can_hvac_heat_cool = null, + /** + * Indicates whether the speaker supports muting and unmuting. + */ + public bool|null $can_mute_speaker = null, + /** + * Indicates whether the speaker supports pausing and resuming playback. + */ + public bool|null $can_pause_speaker_playback = null, + /** + * Indicates whether the speaker supports playing a chime. + */ + public bool|null $can_play_speaker_chime = null, /** * Indicates whether the device supports programming offline access codes. */ @@ -192,6 +209,10 @@ public function __construct( * Indicates whether the thermostat supports running climate programs. */ public bool|null $can_run_thermostat_programs = null, + /** + * Indicates whether the speaker supports setting its volume. + */ + public bool|null $can_set_speaker_volume = null, /** * Indicates whether the device supports simulating connection in a sandbox. */ @@ -672,6 +693,7 @@ enum DeviceType: string case TAPO_CAMERA = "tapo_camera"; case ARLO_CAMERA = "arlo_camera"; case REOLINK_CAMERA = "reolink_camera"; + case SONOS_SPEAKER = "sonos_speaker"; } } diff --git a/src/Routes/CustomersClient.php b/src/Routes/CustomersClient.php index c9d13956..ac2e6939 100644 --- a/src/Routes/CustomersClient.php +++ b/src/Routes/CustomersClient.php @@ -108,6 +108,7 @@ public function create_portal( /** * Deletes customer data including resources like spaces, properties, rooms, users, etc. * This will delete the partner resources and any related Seam resources (user identities, access grants, spaces). + * Space keys also match spaces created directly with a `space_key` (for example, through `/spaces/create`). * * @param list $access_grant_keys List of access grant keys to delete. * @param list $booking_keys List of booking keys to delete. @@ -228,6 +229,7 @@ public function delete_data( * @param list|\stdClass> $facilities List of gym or fitness facilities. * @param list|\stdClass> $guests List of guests. * @param list|\stdClass> $listings List of property listings. + * @param float|NullValue $low_battery_alert_threshold Battery level, from 0 to 1, at or below which `device.low_battery` events fire for this customer's devices. Overrides the workspace and device defaults. Pass `null` to remove the customer's override. * @param list|\stdClass> $properties List of short-term rental properties. * @param list|\stdClass> $property_listings List of property listings. * @param list|\stdClass> $reservations List of reservations. @@ -252,6 +254,7 @@ public function push_data( ?array $facilities = null, ?array $guests = null, ?array $listings = null, + float|NullValue|null $low_battery_alert_threshold = null, ?array $properties = null, ?array $property_listings = null, ?array $reservations = null, @@ -294,6 +297,11 @@ public function push_data( if ($listings !== null) { $request_payload["listings"] = $listings; } + if ($low_battery_alert_threshold !== null) { + $request_payload[ + "low_battery_alert_threshold" + ] = $low_battery_alert_threshold; + } if ($properties !== null) { $request_payload["properties"] = $properties; }