/* * 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"; /** * What category of status it is. All statuses apart from live (renamed in the app to Active) and learning (renamed in the app to Post-incident) are managed by incident.io and cannot be configured */ export const Category = { Triage: "triage", Declined: "declined", Merged: "merged", Canceled: "canceled", Live: "live", Learning: "learning", Closed: "closed", Paused: "paused", } as const; /** * What category of status it is. All statuses apart from live (renamed in the app to Active) and learning (renamed in the app to Post-incident) are managed by incident.io and cannot be configured */ export type Category = ClosedEnum; export type IncidentStatusV1 = { /** * What category of status it is. All statuses apart from live (renamed in the app to Active) and learning (renamed in the app to Post-incident) are managed by incident.io and cannot be configured */ category: Category; createdAt: Date; /** * Rich text description of the incident status */ description: string; /** * Unique ID of this incident status */ id: string; /** * Unique name of this status */ name: string; /** * Order of this incident status */ rank: number; updatedAt: Date; }; /** @internal */ export const Category$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Category); /** @internal */ export const Category$outboundSchema: z.ZodNativeEnum = Category$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Category$ { /** @deprecated use `Category$inboundSchema` instead. */ export const inboundSchema = Category$inboundSchema; /** @deprecated use `Category$outboundSchema` instead. */ export const outboundSchema = Category$outboundSchema; } /** @internal */ export const IncidentStatusV1$inboundSchema: z.ZodType< IncidentStatusV1, z.ZodTypeDef, unknown > = z.object({ category: Category$inboundSchema, created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), description: z.string(), id: z.string(), name: z.string(), rank: z.number().int(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "updated_at": "updatedAt", }); }); /** @internal */ export type IncidentStatusV1$Outbound = { category: string; created_at: string; description: string; id: string; name: string; rank: number; updated_at: string; }; /** @internal */ export const IncidentStatusV1$outboundSchema: z.ZodType< IncidentStatusV1$Outbound, z.ZodTypeDef, IncidentStatusV1 > = z.object({ category: Category$outboundSchema, createdAt: z.date().transform(v => v.toISOString()), description: z.string(), id: z.string(), name: z.string(), rank: z.number().int(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { createdAt: "created_at", 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 IncidentStatusV1$ { /** @deprecated use `IncidentStatusV1$inboundSchema` instead. */ export const inboundSchema = IncidentStatusV1$inboundSchema; /** @deprecated use `IncidentStatusV1$outboundSchema` instead. */ export const outboundSchema = IncidentStatusV1$outboundSchema; /** @deprecated use `IncidentStatusV1$Outbound` instead. */ export type Outbound = IncidentStatusV1$Outbound; }