/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ScheduleLayerCreatePayloadV2, ScheduleLayerCreatePayloadV2$inboundSchema, ScheduleLayerCreatePayloadV2$Outbound, ScheduleLayerCreatePayloadV2$outboundSchema, } from "./schedulelayercreatepayloadv2.js"; import { ScheduleRotationHandoverV2, ScheduleRotationHandoverV2$inboundSchema, ScheduleRotationHandoverV2$Outbound, ScheduleRotationHandoverV2$outboundSchema, } from "./schedulerotationhandoverv2.js"; import { UserReferencePayloadV1, UserReferencePayloadV1$inboundSchema, UserReferencePayloadV1$Outbound, UserReferencePayloadV1$outboundSchema, } from "./userreferencepayloadv1.js"; import { WeekdayIntervalV2, WeekdayIntervalV2$inboundSchema, WeekdayIntervalV2$Outbound, WeekdayIntervalV2$outboundSchema, } from "./weekdayintervalv2.js"; export type ScheduleRotationCreatePayloadV2 = { effectiveFrom?: Date | undefined; handoverStartAt?: Date | undefined; handovers?: Array | undefined; /** * Unique identifier of the rotation */ id?: string | undefined; layers?: Array | undefined; /** * Name of the rotation */ name: string; users?: Array | undefined; workingInterval?: Array | undefined; }; /** @internal */ export const ScheduleRotationCreatePayloadV2$inboundSchema: z.ZodType< ScheduleRotationCreatePayloadV2, z.ZodTypeDef, unknown > = z.object({ effective_from: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), handover_start_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), handovers: z.array(ScheduleRotationHandoverV2$inboundSchema).optional(), id: z.string().optional(), layers: z.array(ScheduleLayerCreatePayloadV2$inboundSchema).optional(), name: z.string(), users: z.array(UserReferencePayloadV1$inboundSchema).optional(), working_interval: z.array(WeekdayIntervalV2$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "effective_from": "effectiveFrom", "handover_start_at": "handoverStartAt", "working_interval": "workingInterval", }); }); /** @internal */ export type ScheduleRotationCreatePayloadV2$Outbound = { effective_from?: string | undefined; handover_start_at?: string | undefined; handovers?: Array | undefined; id?: string | undefined; layers?: Array | undefined; name: string; users?: Array | undefined; working_interval?: Array | undefined; }; /** @internal */ export const ScheduleRotationCreatePayloadV2$outboundSchema: z.ZodType< ScheduleRotationCreatePayloadV2$Outbound, z.ZodTypeDef, ScheduleRotationCreatePayloadV2 > = z.object({ effectiveFrom: z.date().transform(v => v.toISOString()).optional(), handoverStartAt: z.date().transform(v => v.toISOString()).optional(), handovers: z.array(ScheduleRotationHandoverV2$outboundSchema).optional(), id: z.string().optional(), layers: z.array(ScheduleLayerCreatePayloadV2$outboundSchema).optional(), name: z.string(), users: z.array(UserReferencePayloadV1$outboundSchema).optional(), workingInterval: z.array(WeekdayIntervalV2$outboundSchema).optional(), }).transform((v) => { return remap$(v, { effectiveFrom: "effective_from", handoverStartAt: "handover_start_at", workingInterval: "working_interval", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ScheduleRotationCreatePayloadV2$ { /** @deprecated use `ScheduleRotationCreatePayloadV2$inboundSchema` instead. */ export const inboundSchema = ScheduleRotationCreatePayloadV2$inboundSchema; /** @deprecated use `ScheduleRotationCreatePayloadV2$outboundSchema` instead. */ export const outboundSchema = ScheduleRotationCreatePayloadV2$outboundSchema; /** @deprecated use `ScheduleRotationCreatePayloadV2$Outbound` instead. */ export type Outbound = ScheduleRotationCreatePayloadV2$Outbound; }