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