diff --git a/package-lock.json b/package-lock.json index 4111aaed..c26f13cb 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.1", - "@seamapi/types": "1.1137.0", + "@seamapi/types": "1.1142.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" @@ -882,9 +882,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1137.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1137.0.tgz", - "integrity": "sha512-AoIq3IlMsWfq8AKmezpcKydBvL6jKl/aBS0YkrrT6H3+qqksfQO1aXzJIOXGiXZ6RcXLAUwH74hs2uyLxlT2Iw==", + "version": "1.1142.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1142.0.tgz", + "integrity": "sha512-9KjUC6yfz2jzICw8M4Fpb0MsIgTl1MQSU3ifixxY7RM7ALeJy5CVSP1PNceTJiacBraZWi6/Ufyvv8GFizP7Tg==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 0968f7ef..a97c3771 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.1", - "@seamapi/types": "1.1137.0", + "@seamapi/types": "1.1142.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" diff --git a/src/Resources/Space.php b/src/Resources/Space.php index 7dc64e8a..1f18a253 100644 --- a/src/Resources/Space.php +++ b/src/Resources/Space.php @@ -181,6 +181,10 @@ public static function from_json(mixed $json): Warnings|null => \Seam\Resources\Space\Warnings\BeingDeleted::from_json( $json, ), + \Seam\Resources\Space\Warnings\WarningCode::NOISE_SENSOR_CONFIGURATION_MISMATCH + => \Seam\Resources\Space\Warnings\NoiseSensorConfigurationMismatch::from_json( + $json, + ), default => new self( created_at: $json->created_at ?? null, message: $json->message ?? null, @@ -250,8 +254,59 @@ public function __construct( } } + /** + * Indicates that Seam could not apply the noise sensor automation to one or more noise sensors in the space, for example because their settings keep changing back after Seam re-applies it, Seam does not know the sensor's time zone yet, or the sensor is shared with spaces that configure it differently. + */ + final class NoiseSensorConfigurationMismatch extends + \Seam\Resources\Space\Warnings + { + public static function from_json( + mixed $json, + ): NoiseSensorConfigurationMismatch|null { + if (!$json) { + return null; + } + return new self( + created_at: $json->created_at ?? null, + device_ids: $json->device_ids ?? 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, + /** + * IDs of the noise sensors in the space that Seam could not bring in line with the noise sensor automation. + * + * @var list|null + */ + public array|null $device_ids, + /** + * 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\Space\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"; + case NOISE_SENSOR_CONFIGURATION_MISMATCH = "noise_sensor_configuration_mismatch"; } }