Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/lib/seam/connect/models/access-grants/access-grant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,31 @@ const device_does_not_support_access_codes = common_access_grant_warning
'Indicates that a device in the access grant does not support access codes and was excluded from code materialization.',
)

const device_time_constraints_violated_reason = z.enum([
'duration_exceeds_max',
'times_do_not_match_slots',
'ongoing_not_supported',
])

const device_time_constraints_violated = common_access_grant_warning
.extend({
warning_code: z
.literal('device_time_constraints_violated')
.describe(warning_code_description),
device_id: z
.string()
.uuid()
.describe(
'ID of the device whose time constraints the access grant violates.',
),
reason: device_time_constraints_violated_reason.describe(
"Specific reason why the grant's times are not programmable on the device.",
),
})
.describe(
"Indicates that a device in the access grant cannot program an access code for the grant's time range because of device-specific time constraints.",
)

const access_grant_warning = z
.discriminatedUnion('warning_code', [
being_deleted,
Expand All @@ -157,6 +182,7 @@ const access_grant_warning = z
updating_access_times,
requested_code_unavailable,
device_does_not_support_access_codes,
device_time_constraints_violated,
])
.describe(
'Warning associated with the [access grant](https://docs.seam.co/latest/capability-guides/access-grants).',
Expand All @@ -175,6 +201,10 @@ const _access_grant_warning_map = z.object({
.record(z.string().uuid(), device_does_not_support_access_codes)
.optional()
.nullable(),
device_time_constraints_violated: z
.record(z.string().uuid(), device_time_constraints_violated)
.optional()
.nullable(),
})

export type AccessGrantWarningMap = z.infer<typeof _access_grant_warning_map>
Expand Down
239 changes: 239 additions & 0 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2660,6 +2660,53 @@ export default {
],
type: 'object',
},
{
description:
"Indicates that a device in the access grant cannot program an access code for the grant's time range because of device-specific time constraints.",
properties: {
created_at: {
description:
'Date and time at which Seam created the warning.',
format: 'date-time',
type: 'string',
},
device_id: {
description:
'ID of the device whose time constraints the access grant violates.',
format: 'uuid',
type: 'string',
},
message: {
description:
'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
reason: {
description:
"Specific reason why the grant's times are not programmable on the device.",
enum: [
'duration_exceeds_max',
'times_do_not_match_slots',
'ongoing_not_supported',
],
type: 'string',
},
warning_code: {
description:
'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.',
enum: ['device_time_constraints_violated'],
type: 'string',
},
},
required: [
'created_at',
'message',
'warning_code',
'device_id',
'reason',
],
type: 'object',
},
],
},
type: 'array',
Expand Down Expand Up @@ -36323,6 +36370,53 @@ export default {
],
type: 'object',
},
{
description:
"Indicates that a device in the access grant cannot program an access code for the grant's time range because of device-specific time constraints.",
properties: {
created_at: {
description:
'Date and time at which Seam created the warning.',
format: 'date-time',
type: 'string',
},
device_id: {
description:
'ID of the device whose time constraints the access grant violates.',
format: 'uuid',
type: 'string',
},
message: {
description:
'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
reason: {
description:
"Specific reason why the grant's times are not programmable on the device.",
enum: [
'duration_exceeds_max',
'times_do_not_match_slots',
'ongoing_not_supported',
],
type: 'string',
},
warning_code: {
description:
'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.',
enum: ['device_time_constraints_violated'],
type: 'string',
},
},
required: [
'created_at',
'message',
'warning_code',
'device_id',
'reason',
],
type: 'object',
},
],
},
type: 'array',
Expand Down Expand Up @@ -36979,6 +37073,53 @@ export default {
],
type: 'object',
},
{
description:
"Indicates that a device in the access grant cannot program an access code for the grant's time range because of device-specific time constraints.",
properties: {
created_at: {
description:
'Date and time at which Seam created the warning.',
format: 'date-time',
type: 'string',
},
device_id: {
description:
'ID of the device whose time constraints the access grant violates.',
format: 'uuid',
type: 'string',
},
message: {
description:
'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
reason: {
description:
"Specific reason why the grant's times are not programmable on the device.",
enum: [
'duration_exceeds_max',
'times_do_not_match_slots',
'ongoing_not_supported',
],
type: 'string',
},
warning_code: {
description:
'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.',
enum: ['device_time_constraints_violated'],
type: 'string',
},
},
required: [
'created_at',
'message',
'warning_code',
'device_id',
'reason',
],
type: 'object',
},
],
},
type: 'array',
Expand Down Expand Up @@ -37684,6 +37825,55 @@ export default {
],
type: 'object',
},
{
description:
"Indicates that a device in the access grant cannot program an access code for the grant's time range because of device-specific time constraints.",
properties: {
created_at: {
description:
'Date and time at which Seam created the warning.',
format: 'date-time',
type: 'string',
},
device_id: {
description:
'ID of the device whose time constraints the access grant violates.',
format: 'uuid',
type: 'string',
},
message: {
description:
'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
reason: {
description:
"Specific reason why the grant's times are not programmable on the device.",
enum: [
'duration_exceeds_max',
'times_do_not_match_slots',
'ongoing_not_supported',
],
type: 'string',
},
warning_code: {
description:
'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.',
enum: [
'device_time_constraints_violated',
],
type: 'string',
},
},
required: [
'created_at',
'message',
'warning_code',
'device_id',
'reason',
],
type: 'object',
},
],
},
type: 'array',
Expand Down Expand Up @@ -38376,6 +38566,55 @@ export default {
],
type: 'object',
},
{
description:
"Indicates that a device in the access grant cannot program an access code for the grant's time range because of device-specific time constraints.",
properties: {
created_at: {
description:
'Date and time at which Seam created the warning.',
format: 'date-time',
type: 'string',
},
device_id: {
description:
'ID of the device whose time constraints the access grant violates.',
format: 'uuid',
type: 'string',
},
message: {
description:
'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
type: 'string',
},
reason: {
description:
"Specific reason why the grant's times are not programmable on the device.",
enum: [
'duration_exceeds_max',
'times_do_not_match_slots',
'ongoing_not_supported',
],
type: 'string',
},
warning_code: {
description:
'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.',
enum: [
'device_time_constraints_violated',
],
type: 'string',
},
},
required: [
'created_at',
'message',
'warning_code',
'device_id',
'reason',
],
type: 'object',
},
],
},
type: 'array',
Expand Down
Loading
Loading