diff --git a/package-lock.json b/package-lock.json index 434253e3..83f1a103 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.1129.0", + "@seamapi/types": "1.1132.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" @@ -882,9 +882,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1129.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1129.0.tgz", - "integrity": "sha512-TlWoYyag1WXGB3CRjI3utqoDcmEvP4bPqCeUc1SXUW1o7bX3k3y+EGr9ZDPKfmMiQkOd6YaC4QgbP7h4hOSn6A==", + "version": "1.1132.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1132.0.tgz", + "integrity": "sha512-Tezm8KLN1y8mXom5F4K1dIlqICJvAzp5UnwAWupzHuZ4u77ILzEpDItww3qOOmCmFZ5VanUVoUATJ3IEi+vdYw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 0362234f..7f9f3a12 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.1129.0", + "@seamapi/types": "1.1132.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" diff --git a/src/Resources/AccessCode.php b/src/Resources/AccessCode.php index 3853ef7a..b35b320a 100644 --- a/src/Resources/AccessCode.php +++ b/src/Resources/AccessCode.php @@ -940,7 +940,7 @@ public function __construct( } /** - * Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and this error clears automatically if the access code is eventually issued. + * Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. This error clears automatically if the access code is eventually issued. */ final class FailedToIssue extends \Seam\Resources\AccessCode\Errors { diff --git a/src/Resources/AccessGrant.php b/src/Resources/AccessGrant.php index 8a27b46a..e987c76d 100644 --- a/src/Resources/AccessGrant.php +++ b/src/Resources/AccessGrant.php @@ -364,6 +364,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\AccessGrant\Warnings\DeviceTimeConstraintsViolated::from_json( $json, ), + \Seam\Resources\AccessGrant\Warnings\WarningCode::ACCESS_REVOKED + => \Seam\Resources\AccessGrant\Warnings\AccessRevoked::from_json( + $json, + ), default => new self( created_at: $json->created_at ?? null, message: $json->message ?? null, @@ -1104,6 +1108,52 @@ public function __construct( } } + /** + * Indicates that one of this access grant's access methods no longer grants access because of a change outside Seam, for example its card was encoded again for another credential. Seam does not replace the access method; issue a new one if the user still needs it. + */ + final class AccessRevoked extends \Seam\Resources\AccessGrant\Warnings + { + public static function from_json(mixed $json): AccessRevoked|null + { + if (!$json) { + return null; + } + return new self( + access_method_id: $json->access_method_id ?? null, + created_at: $json->created_at ?? null, + message: $json->message ?? null, + warning_code: $json->warning_code ?? null, + ); + } + + public function __construct( + /** + * ID of the access method whose access was revoked. + */ + public string|null $access_method_id, + /** + * 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\AccessGrant\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + enum WarningCode: string { case BEING_DELETED = "being_deleted"; @@ -1113,6 +1163,7 @@ enum WarningCode: string case REQUESTED_CODE_UNAVAILABLE = "requested_code_unavailable"; case DEVICE_DOES_NOT_SUPPORT_ACCESS_CODES = "device_does_not_support_access_codes"; case DEVICE_TIME_CONSTRAINTS_VIOLATED = "device_time_constraints_violated"; + case ACCESS_REVOKED = "access_revoked"; } } diff --git a/src/Resources/UnmanagedAccessCode.php b/src/Resources/UnmanagedAccessCode.php index a15a0339..f4f0f858 100644 --- a/src/Resources/UnmanagedAccessCode.php +++ b/src/Resources/UnmanagedAccessCode.php @@ -829,7 +829,7 @@ public function __construct( } /** - * Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and this error clears automatically if the access code is eventually issued. + * Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. This error clears automatically if the access code is eventually issued. */ final class FailedToIssue extends \Seam\Resources\UnmanagedAccessCode\Errors { diff --git a/src/Resources/UnmanagedAccessGrant.php b/src/Resources/UnmanagedAccessGrant.php index 4806ec37..de27cd9d 100644 --- a/src/Resources/UnmanagedAccessGrant.php +++ b/src/Resources/UnmanagedAccessGrant.php @@ -344,6 +344,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\UnmanagedAccessGrant\Warnings\DeviceTimeConstraintsViolated::from_json( $json, ), + \Seam\Resources\UnmanagedAccessGrant\Warnings\WarningCode::ACCESS_REVOKED + => \Seam\Resources\UnmanagedAccessGrant\Warnings\AccessRevoked::from_json( + $json, + ), default => new self( created_at: $json->created_at ?? null, message: $json->message ?? null, @@ -1087,6 +1091,53 @@ public function __construct( } } + /** + * Indicates that one of this access grant's access methods no longer grants access because of a change outside Seam, for example its card was encoded again for another credential. Seam does not replace the access method; issue a new one if the user still needs it. + */ + final class AccessRevoked extends + \Seam\Resources\UnmanagedAccessGrant\Warnings + { + public static function from_json(mixed $json): AccessRevoked|null + { + if (!$json) { + return null; + } + return new self( + access_method_id: $json->access_method_id ?? null, + created_at: $json->created_at ?? null, + message: $json->message ?? null, + warning_code: $json->warning_code ?? null, + ); + } + + public function __construct( + /** + * ID of the access method whose access was revoked. + */ + public string|null $access_method_id, + /** + * 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\UnmanagedAccessGrant\Warnings\WarningCode>|string|null + */ + string|null $warning_code, + ) { + parent::__construct( + created_at: $created_at, + message: $message, + warning_code: $warning_code, + ); + } + } + enum WarningCode: string { case BEING_DELETED = "being_deleted"; @@ -1096,6 +1147,7 @@ enum WarningCode: string case REQUESTED_CODE_UNAVAILABLE = "requested_code_unavailable"; case DEVICE_DOES_NOT_SUPPORT_ACCESS_CODES = "device_does_not_support_access_codes"; case DEVICE_TIME_CONSTRAINTS_VIOLATED = "device_time_constraints_violated"; + case ACCESS_REVOKED = "access_revoked"; } }