diff --git a/package-lock.json b/package-lock.json index 64f4dbad..a916f97e 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.1113.0", + "@seamapi/types": "1.1123.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" @@ -882,9 +882,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1113.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1113.0.tgz", - "integrity": "sha512-lkOl4x/2kPppPp5p2PoT2ohAI3pnKziv1przlDZscNnkVed0sDu7DZa+B4kyJ6YFmrPrbLNsf8i1c0D+Aw8byQ==", + "version": "1.1123.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1123.0.tgz", + "integrity": "sha512-hPm/CZuvw4HzvahhAMFe+krDUkJub9z1QOtLXWm0FqTn2i7J8FiH2y8I7dFBjIa4LUURY0Kc5uWB3hF7CVbMNQ==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 9c08274d..b5571395 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.1113.0", + "@seamapi/types": "1.1123.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 983d4a8f..8a27b46a 100644 --- a/src/Resources/AccessGrant.php +++ b/src/Resources/AccessGrant.php @@ -939,7 +939,7 @@ public function __construct( } /** - * Indicates that the requested PIN code was already in use on a device, so a different code was assigned. + * Indicates that the requested PIN code could not be used, so a different code was assigned. For example, the code was already in use on a device, or the access system rejected it because it did not meet its PIN rules. */ final class RequestedCodeUnavailable extends \Seam\Resources\AccessGrant\Warnings @@ -952,11 +952,12 @@ public static function from_json( } return new self( created_at: $json->created_at ?? null, - device_id: $json->device_id ?? null, message: $json->message ?? null, new_code: $json->new_code ?? null, original_code: $json->original_code ?? null, warning_code: $json->warning_code ?? null, + access_method_id: $json->access_method_id ?? null, + device_id: $json->device_id ?? null, ); } @@ -965,10 +966,6 @@ public function __construct( * Date and time at which Seam created the warning. */ string|null $created_at, - /** - * ID of the device where the requested code was unavailable. - */ - public string|null $device_id, /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ @@ -987,6 +984,14 @@ public function __construct( * @var value-of<\Seam\Resources\AccessGrant\Warnings\WarningCode>|string|null */ string|null $warning_code, + /** + * ID of the access method whose requested code was unavailable. Present when an access system, such as Salto KS, assigned a different code. + */ + public string|null $access_method_id = null, + /** + * ID of the device where the requested code was unavailable. Present when the code was set directly on a device. + */ + public string|null $device_id = null, ) { parent::__construct( created_at: $created_at, diff --git a/src/Resources/AccessMethod.php b/src/Resources/AccessMethod.php index a7c18cff..61889abf 100644 --- a/src/Resources/AccessMethod.php +++ b/src/Resources/AccessMethod.php @@ -293,6 +293,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\AccessMethod\Warnings\UserIdentityMissingPhoneNumber::from_json( $json, ), + \Seam\Resources\AccessMethod\Warnings\WarningCode::REQUESTED_CODE_UNAVAILABLE + => \Seam\Resources\AccessMethod\Warnings\RequestedCodeUnavailable::from_json( + $json, + ), default => new self( created_at: $json->created_at ?? null, message: $json->message ?? null, @@ -1065,6 +1069,59 @@ public function __construct( } } + /** + * Indicates that the access system could not use the PIN code requested for this [access method](https://www.seam.co/docs/use-cases/granting-access/creating-an-access-grant), for example because it did not meet the access system's PIN rules, so the access system assigned a different code. Give the recipient the assigned code. + */ + final class RequestedCodeUnavailable extends + \Seam\Resources\AccessMethod\Warnings + { + public static function from_json( + mixed $json, + ): RequestedCodeUnavailable|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + message: $json->message ?? null, + new_code: $json->new_code ?? null, + original_code: $json->original_code ?? 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, + /** + * The PIN code that was assigned instead. + */ + public string|null $new_code, + /** + * The originally requested PIN code that could not be used. + */ + public string|null $original_code, + /** + * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\AccessMethod\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"; @@ -1073,5 +1130,6 @@ enum WarningCode: string case DELAY_IN_ISSUING = "delay_in_issuing"; case USER_IDENTITY_MISSING_EMAIL_ADDRESS = "user_identity_missing_email_address"; case USER_IDENTITY_MISSING_PHONE_NUMBER = "user_identity_missing_phone_number"; + case REQUESTED_CODE_UNAVAILABLE = "requested_code_unavailable"; } } diff --git a/src/Resources/ActionAttempt.php b/src/Resources/ActionAttempt.php index c87683ff..3de1ed35 100644 --- a/src/Resources/ActionAttempt.php +++ b/src/Resources/ActionAttempt.php @@ -4924,8 +4924,10 @@ public static function from_json(mixed $json): Warnings|null created_at: $json->created_at ?? null, message: $json->message ?? null, warning_code: $json->warning_code ?? null, + new_code: $json->new_code ?? null, original_access_method_id: $json->original_access_method_id ?? null, + original_code: $json->original_code ?? null, ); } @@ -4944,10 +4946,18 @@ public function __construct( * @var value-of<\Seam\Resources\ActionAttempt\AssignCredential\Success\Result\Warnings\WarningCode>|string|null */ public string|null $warning_code, + /** + * The PIN code that was assigned instead. + */ + public string|null $new_code = null, /** * ID of the original access method from which this backup access method was split, if applicable. */ public string|null $original_access_method_id = null, + /** + * The originally requested PIN code that could not be used. + */ + public string|null $original_code = null, ) {} } @@ -5043,6 +5053,7 @@ enum WarningCode: string case DELAY_IN_ISSUING = "delay_in_issuing"; case USER_IDENTITY_MISSING_EMAIL_ADDRESS = "user_identity_missing_email_address"; case USER_IDENTITY_MISSING_PHONE_NUMBER = "user_identity_missing_phone_number"; + case REQUESTED_CODE_UNAVAILABLE = "requested_code_unavailable"; } } diff --git a/src/Resources/Device.php b/src/Resources/Device.php index e5d286f1..cd1debad 100644 --- a/src/Resources/Device.php +++ b/src/Resources/Device.php @@ -3946,7 +3946,7 @@ public function __construct( */ public string|null $device_name = null, /** - * Set to true when the device does not support the /dual-setpoints API endpoint. + * Deprecated. Seam no longer sets this field. */ public bool|null $dual_setpoints_not_supported = null, /** diff --git a/src/Resources/Event.php b/src/Resources/Event.php index eaec085c..cecc2577 100644 --- a/src/Resources/Event.php +++ b/src/Resources/Event.php @@ -12976,6 +12976,7 @@ enum ReasonCode: string case TOO_MANY_ATTEMPTS = "too_many_attempts"; case BLOCKED_BY_PRIVACY_MODE = "blocked_by_privacy_mode"; case CREDENTIAL_ERROR = "credential_error"; + case CONNECTION_ERROR = "connection_error"; } } diff --git a/src/Resources/UnmanagedAccessGrant.php b/src/Resources/UnmanagedAccessGrant.php index 3d0525b1..4806ec37 100644 --- a/src/Resources/UnmanagedAccessGrant.php +++ b/src/Resources/UnmanagedAccessGrant.php @@ -922,7 +922,7 @@ public function __construct( } /** - * Indicates that the requested PIN code was already in use on a device, so a different code was assigned. + * Indicates that the requested PIN code could not be used, so a different code was assigned. For example, the code was already in use on a device, or the access system rejected it because it did not meet its PIN rules. */ final class RequestedCodeUnavailable extends \Seam\Resources\UnmanagedAccessGrant\Warnings @@ -935,11 +935,12 @@ public static function from_json( } return new self( created_at: $json->created_at ?? null, - device_id: $json->device_id ?? null, message: $json->message ?? null, new_code: $json->new_code ?? null, original_code: $json->original_code ?? null, warning_code: $json->warning_code ?? null, + access_method_id: $json->access_method_id ?? null, + device_id: $json->device_id ?? null, ); } @@ -948,10 +949,6 @@ public function __construct( * Date and time at which Seam created the warning. */ string|null $created_at, - /** - * ID of the device where the requested code was unavailable. - */ - public string|null $device_id, /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ @@ -970,6 +967,14 @@ public function __construct( * @var value-of<\Seam\Resources\UnmanagedAccessGrant\Warnings\WarningCode>|string|null */ string|null $warning_code, + /** + * ID of the access method whose requested code was unavailable. Present when an access system, such as Salto KS, assigned a different code. + */ + public string|null $access_method_id = null, + /** + * ID of the device where the requested code was unavailable. Present when the code was set directly on a device. + */ + public string|null $device_id = null, ) { parent::__construct( created_at: $created_at, diff --git a/src/Resources/UnmanagedAccessMethod.php b/src/Resources/UnmanagedAccessMethod.php index 6ed73bcb..8f4f2e72 100644 --- a/src/Resources/UnmanagedAccessMethod.php +++ b/src/Resources/UnmanagedAccessMethod.php @@ -282,6 +282,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\UnmanagedAccessMethod\Warnings\UserIdentityMissingPhoneNumber::from_json( $json, ), + \Seam\Resources\UnmanagedAccessMethod\Warnings\WarningCode::REQUESTED_CODE_UNAVAILABLE + => \Seam\Resources\UnmanagedAccessMethod\Warnings\RequestedCodeUnavailable::from_json( + $json, + ), default => new self( created_at: $json->created_at ?? null, message: $json->message ?? null, @@ -1058,6 +1062,59 @@ public function __construct( } } + /** + * Indicates that the access system could not use the PIN code requested for this [access method](https://www.seam.co/docs/use-cases/granting-access/creating-an-access-grant), for example because it did not meet the access system's PIN rules, so the access system assigned a different code. Give the recipient the assigned code. + */ + final class RequestedCodeUnavailable extends + \Seam\Resources\UnmanagedAccessMethod\Warnings + { + public static function from_json( + mixed $json, + ): RequestedCodeUnavailable|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + message: $json->message ?? null, + new_code: $json->new_code ?? null, + original_code: $json->original_code ?? 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, + /** + * The PIN code that was assigned instead. + */ + public string|null $new_code, + /** + * The originally requested PIN code that could not be used. + */ + public string|null $original_code, + /** + * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + * + * @var value-of<\Seam\Resources\UnmanagedAccessMethod\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"; @@ -1066,5 +1123,6 @@ enum WarningCode: string case DELAY_IN_ISSUING = "delay_in_issuing"; case USER_IDENTITY_MISSING_EMAIL_ADDRESS = "user_identity_missing_email_address"; case USER_IDENTITY_MISSING_PHONE_NUMBER = "user_identity_missing_phone_number"; + case REQUESTED_CODE_UNAVAILABLE = "requested_code_unavailable"; } }