/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ScheduleConfigV2, ScheduleConfigV2$inboundSchema, ScheduleConfigV2$Outbound, ScheduleConfigV2$outboundSchema, } from "./scheduleconfigv2.js"; import { ScheduleEntryV2, ScheduleEntryV2$inboundSchema, ScheduleEntryV2$Outbound, ScheduleEntryV2$outboundSchema, } from "./scheduleentryv2.js"; import { ScheduleHolidaysPublicConfigV2, ScheduleHolidaysPublicConfigV2$inboundSchema, ScheduleHolidaysPublicConfigV2$Outbound, ScheduleHolidaysPublicConfigV2$outboundSchema, } from "./scheduleholidayspublicconfigv2.js"; export type ScheduleV2 = { /** * Annotations that track metadata about this resource */ annotations: { [k: string]: string }; config?: ScheduleConfigV2 | undefined; createdAt: Date; /** * Shifts that are on-going for this schedule, if a native schedule */ currentShifts?: Array | undefined; holidaysPublicConfig?: ScheduleHolidaysPublicConfigV2 | undefined; /** * Unique internal ID of the schedule */ id: string; /** * Human readable name synced from external provider */ name: string; /** * Timezone of the schedule, as interpreted at the point of generating the report */ timezone: string; updatedAt: Date; }; /** @internal */ export const ScheduleV2$inboundSchema: z.ZodType< ScheduleV2, z.ZodTypeDef, unknown > = z.object({ annotations: z.record(z.string()), config: ScheduleConfigV2$inboundSchema.optional(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), current_shifts: z.array(ScheduleEntryV2$inboundSchema).optional(), holidays_public_config: ScheduleHolidaysPublicConfigV2$inboundSchema .optional(), id: z.string(), name: z.string(), timezone: z.string(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "current_shifts": "currentShifts", "holidays_public_config": "holidaysPublicConfig", "updated_at": "updatedAt", }); }); /** @internal */ export type ScheduleV2$Outbound = { annotations: { [k: string]: string }; config?: ScheduleConfigV2$Outbound | undefined; created_at: string; current_shifts?: Array | undefined; holidays_public_config?: ScheduleHolidaysPublicConfigV2$Outbound | undefined; id: string; name: string; timezone: string; updated_at: string; }; /** @internal */ export const ScheduleV2$outboundSchema: z.ZodType< ScheduleV2$Outbound, z.ZodTypeDef, ScheduleV2 > = z.object({ annotations: z.record(z.string()), config: ScheduleConfigV2$outboundSchema.optional(), createdAt: z.date().transform(v => v.toISOString()), currentShifts: z.array(ScheduleEntryV2$outboundSchema).optional(), holidaysPublicConfig: ScheduleHolidaysPublicConfigV2$outboundSchema .optional(), id: z.string(), name: z.string(), timezone: z.string(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { createdAt: "created_at", currentShifts: "current_shifts", holidaysPublicConfig: "holidays_public_config", 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 ScheduleV2$ { /** @deprecated use `ScheduleV2$inboundSchema` instead. */ export const inboundSchema = ScheduleV2$inboundSchema; /** @deprecated use `ScheduleV2$outboundSchema` instead. */ export const outboundSchema = ScheduleV2$outboundSchema; /** @deprecated use `ScheduleV2$Outbound` instead. */ export type Outbound = ScheduleV2$Outbound; }