/* * 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 IncidentRoleV2RoleType = { Lead: "lead", Reporter: "reporter", Custom: "custom", } as const; /** * Type of incident role */ export type IncidentRoleV2RoleType = ClosedEnum; export type IncidentRoleV2 = { /** * 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; /** * Type of incident role */ roleType: IncidentRoleV2RoleType; /** * 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 IncidentRoleV2RoleType$inboundSchema: z.ZodNativeEnum< typeof IncidentRoleV2RoleType > = z.nativeEnum(IncidentRoleV2RoleType); /** @internal */ export const IncidentRoleV2RoleType$outboundSchema: z.ZodNativeEnum< typeof IncidentRoleV2RoleType > = IncidentRoleV2RoleType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IncidentRoleV2RoleType$ { /** @deprecated use `IncidentRoleV2RoleType$inboundSchema` instead. */ export const inboundSchema = IncidentRoleV2RoleType$inboundSchema; /** @deprecated use `IncidentRoleV2RoleType$outboundSchema` instead. */ export const outboundSchema = IncidentRoleV2RoleType$outboundSchema; } /** @internal */ export const IncidentRoleV2$inboundSchema: z.ZodType< IncidentRoleV2, 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(), role_type: IncidentRoleV2RoleType$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 IncidentRoleV2$Outbound = { created_at: string; description: string; id: string; instructions: string; name: string; role_type: string; shortform: string; updated_at: string; }; /** @internal */ export const IncidentRoleV2$outboundSchema: z.ZodType< IncidentRoleV2$Outbound, z.ZodTypeDef, IncidentRoleV2 > = z.object({ createdAt: z.date().transform(v => v.toISOString()), description: z.string(), id: z.string(), instructions: z.string(), name: z.string(), roleType: IncidentRoleV2RoleType$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 IncidentRoleV2$ { /** @deprecated use `IncidentRoleV2$inboundSchema` instead. */ export const inboundSchema = IncidentRoleV2$inboundSchema; /** @deprecated use `IncidentRoleV2$outboundSchema` instead. */ export const outboundSchema = IncidentRoleV2$outboundSchema; /** @deprecated use `IncidentRoleV2$Outbound` instead. */ export type Outbound = IncidentRoleV2$Outbound; }