/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; /** * Type of incident role */ export const RoleType = { Lead: "lead", Reporter: "reporter", Custom: "custom", } as const; /** * Type of incident role */ export type RoleType = ClosedEnum; export type IncidentRoleV1 = { /** * When the role was created */ createdAt: Date; /** * Describes the purpose of the role */ description: string; /** * Unique identifier for the role */ id: string; /** * Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role. */ instructions: string; /** * Human readable name of the incident role */ name: string; /** * DEPRECATED: this will always be false. */ required?: boolean | undefined; /** * Type of incident role */ roleType: RoleType; /** * Short human readable name for Slack. Note that this will be empty for the 'reporter' role. */ shortform: string; /** * When the role was last updated */ updatedAt: Date; }; /** @internal */ export const RoleType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(RoleType); /** @internal */ export const RoleType$outboundSchema: z.ZodNativeEnum = RoleType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RoleType$ { /** @deprecated use `RoleType$inboundSchema` instead. */ export const inboundSchema = RoleType$inboundSchema; /** @deprecated use `RoleType$outboundSchema` instead. */ export const outboundSchema = RoleType$outboundSchema; } /** @internal */ export const IncidentRoleV1$inboundSchema: z.ZodType< IncidentRoleV1, z.ZodTypeDef, unknown > = z.object({ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), description: z.string(), id: z.string(), instructions: z.string(), name: z.string(), required: z.boolean().optional(), role_type: RoleType$inboundSchema, shortform: z.string(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "role_type": "roleType", "updated_at": "updatedAt", }); }); /** @internal */ export type IncidentRoleV1$Outbound = { created_at: string; description: string; id: string; instructions: string; name: string; required?: boolean | undefined; role_type: string; shortform: string; updated_at: string; }; /** @internal */ export const IncidentRoleV1$outboundSchema: z.ZodType< IncidentRoleV1$Outbound, z.ZodTypeDef, IncidentRoleV1 > = z.object({ createdAt: z.date().transform(v => v.toISOString()), description: z.string(), id: z.string(), instructions: z.string(), name: z.string(), required: z.boolean().optional(), roleType: RoleType$outboundSchema, shortform: z.string(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { createdAt: "created_at", roleType: "role_type", updatedAt: "updated_at", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IncidentRoleV1$ { /** @deprecated use `IncidentRoleV1$inboundSchema` instead. */ export const inboundSchema = IncidentRoleV1$inboundSchema; /** @deprecated use `IncidentRoleV1$outboundSchema` instead. */ export const outboundSchema = IncidentRoleV1$outboundSchema; /** @deprecated use `IncidentRoleV1$Outbound` instead. */ export type Outbound = IncidentRoleV1$Outbound; }