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