/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ActorV2, ActorV2$inboundSchema, ActorV2$Outbound, ActorV2$outboundSchema, } from "./actorv2.js"; import { IncidentStatusV1, IncidentStatusV1$inboundSchema, IncidentStatusV1$Outbound, IncidentStatusV1$outboundSchema, } from "./incidentstatusv1.js"; import { SeverityV2, SeverityV2$inboundSchema, SeverityV2$Outbound, SeverityV2$outboundSchema, } from "./severityv2.js"; export type IncidentUpdateV2 = { /** * When the update was created */ createdAt: Date; /** * Unique identifier for this incident update */ id: string; /** * The incident this update relates to */ incidentId: string; /** * The ID of the incident that this incident was merged into, if it was merged in to another incident */ mergedIntoIncidentId?: string | undefined; /** * Message that explains the context behind the update */ message?: string | undefined; newIncidentStatus: IncidentStatusV1; newSeverity?: SeverityV2 | undefined; updater: ActorV2; }; /** @internal */ export const IncidentUpdateV2$inboundSchema: z.ZodType< IncidentUpdateV2, z.ZodTypeDef, unknown > = z.object({ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), id: z.string(), incident_id: z.string(), merged_into_incident_id: z.string().optional(), message: z.string().optional(), new_incident_status: IncidentStatusV1$inboundSchema, new_severity: SeverityV2$inboundSchema.optional(), updater: ActorV2$inboundSchema, }).transform((v) => { return remap$(v, { "created_at": "createdAt", "incident_id": "incidentId", "merged_into_incident_id": "mergedIntoIncidentId", "new_incident_status": "newIncidentStatus", "new_severity": "newSeverity", }); }); /** @internal */ export type IncidentUpdateV2$Outbound = { created_at: string; id: string; incident_id: string; merged_into_incident_id?: string | undefined; message?: string | undefined; new_incident_status: IncidentStatusV1$Outbound; new_severity?: SeverityV2$Outbound | undefined; updater: ActorV2$Outbound; }; /** @internal */ export const IncidentUpdateV2$outboundSchema: z.ZodType< IncidentUpdateV2$Outbound, z.ZodTypeDef, IncidentUpdateV2 > = z.object({ createdAt: z.date().transform(v => v.toISOString()), id: z.string(), incidentId: z.string(), mergedIntoIncidentId: z.string().optional(), message: z.string().optional(), newIncidentStatus: IncidentStatusV1$outboundSchema, newSeverity: SeverityV2$outboundSchema.optional(), updater: ActorV2$outboundSchema, }).transform((v) => { return remap$(v, { createdAt: "created_at", incidentId: "incident_id", mergedIntoIncidentId: "merged_into_incident_id", newIncidentStatus: "new_incident_status", newSeverity: "new_severity", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IncidentUpdateV2$ { /** @deprecated use `IncidentUpdateV2$inboundSchema` instead. */ export const inboundSchema = IncidentUpdateV2$inboundSchema; /** @deprecated use `IncidentUpdateV2$outboundSchema` instead. */ export const outboundSchema = IncidentUpdateV2$outboundSchema; /** @deprecated use `IncidentUpdateV2$Outbound` instead. */ export type Outbound = IncidentUpdateV2$Outbound; }