/* * 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"; import { UserV1, UserV1$inboundSchema, UserV1$Outbound, UserV1$outboundSchema, } from "./userv1.js"; /** * Status of the action */ export const ActionV2Status = { Outstanding: "outstanding", Completed: "completed", Deleted: "deleted", NotDoing: "not_doing", } as const; /** * Status of the action */ export type ActionV2Status = ClosedEnum; export type ActionV2 = { assignee?: UserV1 | undefined; /** * When the action was completed */ completedAt?: Date | undefined; /** * When the action was created */ createdAt: Date; /** * Description of the action */ description: string; /** * Unique identifier for the action */ id: string; /** * Unique identifier of the incident the action belongs to */ incidentId: string; /** * Status of the action */ status: ActionV2Status; /** * When the action was last updated */ updatedAt: Date; }; /** @internal */ export const ActionV2Status$inboundSchema: z.ZodNativeEnum< typeof ActionV2Status > = z.nativeEnum(ActionV2Status); /** @internal */ export const ActionV2Status$outboundSchema: z.ZodNativeEnum< typeof ActionV2Status > = ActionV2Status$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ActionV2Status$ { /** @deprecated use `ActionV2Status$inboundSchema` instead. */ export const inboundSchema = ActionV2Status$inboundSchema; /** @deprecated use `ActionV2Status$outboundSchema` instead. */ export const outboundSchema = ActionV2Status$outboundSchema; } /** @internal */ export const ActionV2$inboundSchema: z.ZodType< ActionV2, z.ZodTypeDef, unknown > = z.object({ assignee: UserV1$inboundSchema.optional(), completed_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), description: z.string(), id: z.string(), incident_id: z.string(), status: ActionV2Status$inboundSchema, updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "completed_at": "completedAt", "created_at": "createdAt", "incident_id": "incidentId", "updated_at": "updatedAt", }); }); /** @internal */ export type ActionV2$Outbound = { assignee?: UserV1$Outbound | undefined; completed_at?: string | undefined; created_at: string; description: string; id: string; incident_id: string; status: string; updated_at: string; }; /** @internal */ export const ActionV2$outboundSchema: z.ZodType< ActionV2$Outbound, z.ZodTypeDef, ActionV2 > = z.object({ assignee: UserV1$outboundSchema.optional(), completedAt: z.date().transform(v => v.toISOString()).optional(), createdAt: z.date().transform(v => v.toISOString()), description: z.string(), id: z.string(), incidentId: z.string(), status: ActionV2Status$outboundSchema, updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { completedAt: "completed_at", createdAt: "created_at", incidentId: "incident_id", 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 ActionV2$ { /** @deprecated use `ActionV2$inboundSchema` instead. */ export const inboundSchema = ActionV2$inboundSchema; /** @deprecated use `ActionV2$outboundSchema` instead. */ export const outboundSchema = ActionV2$outboundSchema; /** @deprecated use `ActionV2$Outbound` instead. */ export type Outbound = ActionV2$Outbound; }