/* * 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"; /** * Whether incidents of this must always, or can optionally, be created in triage */ export const CreateInTriage = { Always: "always", Optional: "optional", } as const; /** * Whether incidents of this must always, or can optionally, be created in triage */ export type CreateInTriage = ClosedEnum; export type IncidentTypeV1 = { /** * Whether incidents of this must always, or can optionally, be created in triage */ createInTriage: CreateInTriage; /** * When this resource was created */ createdAt: Date; /** * What is this incident type for? */ description: string; /** * Unique identifier for this Incident Type */ id: string; /** * The default Incident Type is used when no other type is explicitly specified */ isDefault: boolean; /** * The name of this Incident Type */ name: string; /** * Should all incidents created with this Incident Type be private? */ privateIncidentsOnly: boolean; /** * When this resource was last updated */ updatedAt: Date; }; /** @internal */ export const CreateInTriage$inboundSchema: z.ZodNativeEnum< typeof CreateInTriage > = z.nativeEnum(CreateInTriage); /** @internal */ export const CreateInTriage$outboundSchema: z.ZodNativeEnum< typeof CreateInTriage > = CreateInTriage$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateInTriage$ { /** @deprecated use `CreateInTriage$inboundSchema` instead. */ export const inboundSchema = CreateInTriage$inboundSchema; /** @deprecated use `CreateInTriage$outboundSchema` instead. */ export const outboundSchema = CreateInTriage$outboundSchema; } /** @internal */ export const IncidentTypeV1$inboundSchema: z.ZodType< IncidentTypeV1, z.ZodTypeDef, unknown > = z.object({ create_in_triage: CreateInTriage$inboundSchema, created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), description: z.string(), id: z.string(), is_default: z.boolean(), name: z.string(), private_incidents_only: z.boolean(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "create_in_triage": "createInTriage", "created_at": "createdAt", "is_default": "isDefault", "private_incidents_only": "privateIncidentsOnly", "updated_at": "updatedAt", }); }); /** @internal */ export type IncidentTypeV1$Outbound = { create_in_triage: string; created_at: string; description: string; id: string; is_default: boolean; name: string; private_incidents_only: boolean; updated_at: string; }; /** @internal */ export const IncidentTypeV1$outboundSchema: z.ZodType< IncidentTypeV1$Outbound, z.ZodTypeDef, IncidentTypeV1 > = z.object({ createInTriage: CreateInTriage$outboundSchema, createdAt: z.date().transform(v => v.toISOString()), description: z.string(), id: z.string(), isDefault: z.boolean(), name: z.string(), privateIncidentsOnly: z.boolean(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { createInTriage: "create_in_triage", createdAt: "created_at", isDefault: "is_default", privateIncidentsOnly: "private_incidents_only", 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 IncidentTypeV1$ { /** @deprecated use `IncidentTypeV1$inboundSchema` instead. */ export const inboundSchema = IncidentTypeV1$inboundSchema; /** @deprecated use `IncidentTypeV1$outboundSchema` instead. */ export const outboundSchema = IncidentTypeV1$outboundSchema; /** @deprecated use `IncidentTypeV1$Outbound` instead. */ export type Outbound = IncidentTypeV1$Outbound; }