diff --git a/lib/seam/resources/space.rb b/lib/seam/resources/space.rb index e573182..5625125 100644 --- a/lib/seam/resources/space.rb +++ b/lib/seam/resources/space.rb @@ -28,12 +28,49 @@ class Geolocation < BaseResource attr_accessor :longitude end + # Known `warning_code` values load as subclasses; unknown values remain Warnings instances for forward compatibility. + class Warnings < BaseResource + # Indicates that the space is being deleted. Seam removes it, revokes its access grants, and detaches its devices and entrances shortly. + class BeingDeleted < Warnings + # Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + # @return [String] + attr_accessor :message + # Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + # @return [String] + # Known values: + # - `being_deleted` + attr_accessor :warning_code + # Date and time at which Seam created the warning. + # @return [Time] + date_accessor :created_at + end + + # Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + # @return [String] + attr_accessor :message + # Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + # @return [String] + # Known values: + # - `being_deleted` + attr_accessor :warning_code + # Date and time at which Seam created the warning. + # @return [Time] + date_accessor :created_at + + discriminated_by :warning_code, { + "being_deleted" => BeingDeleted + }.freeze + end + # Reservation/stay-related defaults for the space. Also carries the provider/PMS-supplied name under a `_name` key (e.g. `guesty_name`), which Seam preserves when you rename the space (read-only — managed by Seam). # @return [CustomerData, nil] resource_accessor :customer_data, CustomerData # Geographic coordinates (latitude and longitude) of the space. # @return [Geolocation, nil] resource_accessor :geolocation, Geolocation + # Warnings associated with the space. + # @return [Array] + resource_list_accessor :warnings, Warnings # Number of entrances in the space. # @return [Float] attr_accessor :acs_entrance_count diff --git a/package-lock.json b/package-lock.json index c80013f..7ccecf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "@seamapi/blueprint": "^1.12.0", "@seamapi/fake-seam-connect": "2.0.6", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1096.0", + "@seamapi/types": "1.1098.0", "change-case": "^5.4.4", "markdown-toc": "^1.2.0", "prettier": "^3.2.5" @@ -864,9 +864,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1096.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1096.0.tgz", - "integrity": "sha512-JMfk6KOq/U7l3InqXZRKLDrZ+OM/5Vfc+kaeZfkWwXPchBKn7nKBiJgEHQJ6V1BIycelFX+qsUXDju3XHoVN+g==", + "version": "1.1098.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1098.0.tgz", + "integrity": "sha512-pxGJrkuDd62oNiGnKHKnx3LaNvylrWfj5T6IEKlE/njVrp4K/khVmiSqjt4wh3EcgU3R27Zk8pOqivhB8fwKkA==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 51c76f6..d38d901 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@seamapi/blueprint": "^1.12.0", "@seamapi/fake-seam-connect": "2.0.6", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1096.0", + "@seamapi/types": "1.1098.0", "change-case": "^5.4.4", "markdown-toc": "^1.2.0", "prettier": "^3.2.5"