/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { UserV1, UserV1$inboundSchema, UserV1$Outbound, UserV1$outboundSchema, } from "./userv1.js"; export type ScheduleEntryV2 = { endAt: Date; /** * Unique identifier of the schedule entry */ entryId?: string | undefined; /** * A unique identifier for this entry, used to determine a unique shift */ fingerprint?: string | undefined; /** * If present, the layer this entry applies to on the rota */ layerId?: string | undefined; /** * If present, the rotation this entry applies to on the schedule */ rotationId?: string | undefined; startAt: Date; user?: UserV1 | undefined; }; /** @internal */ export const ScheduleEntryV2$inboundSchema: z.ZodType< ScheduleEntryV2, z.ZodTypeDef, unknown > = z.object({ end_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), entry_id: z.string().optional(), fingerprint: z.string().optional(), layer_id: z.string().optional(), rotation_id: z.string().optional(), start_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), user: UserV1$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "end_at": "endAt", "entry_id": "entryId", "layer_id": "layerId", "rotation_id": "rotationId", "start_at": "startAt", }); }); /** @internal */ export type ScheduleEntryV2$Outbound = { end_at: string; entry_id?: string | undefined; fingerprint?: string | undefined; layer_id?: string | undefined; rotation_id?: string | undefined; start_at: string; user?: UserV1$Outbound | undefined; }; /** @internal */ export const ScheduleEntryV2$outboundSchema: z.ZodType< ScheduleEntryV2$Outbound, z.ZodTypeDef, ScheduleEntryV2 > = z.object({ endAt: z.date().transform(v => v.toISOString()), entryId: z.string().optional(), fingerprint: z.string().optional(), layerId: z.string().optional(), rotationId: z.string().optional(), startAt: z.date().transform(v => v.toISOString()), user: UserV1$outboundSchema.optional(), }).transform((v) => { return remap$(v, { endAt: "end_at", entryId: "entry_id", layerId: "layer_id", rotationId: "rotation_id", startAt: "start_at", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ScheduleEntryV2$ { /** @deprecated use `ScheduleEntryV2$inboundSchema` instead. */ export const inboundSchema = ScheduleEntryV2$inboundSchema; /** @deprecated use `ScheduleEntryV2$outboundSchema` instead. */ export const outboundSchema = ScheduleEntryV2$outboundSchema; /** @deprecated use `ScheduleEntryV2$Outbound` instead. */ export type Outbound = ScheduleEntryV2$Outbound; }