/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { ClosedEnum } from "../../types/enums.js"; export const State = { Playing: "playing", Paused: "paused", Stopped: "stopped", } as const; export type State = ClosedEnum; export const MediaType = { Movie: "movie", Episode: "episode", Track: "track", Live: "live", Photo: "photo", Unknown: "unknown", } as const; export type MediaType = ClosedEnum; export type GetApiV1PublicHistoryRequest = { page?: number | undefined; pageSize?: number | undefined; /** * Filter by server */ serverId?: string | undefined; state?: State | undefined; mediaType?: MediaType | undefined; /** * Sessions on or after this date (start of day in timezone) */ startDate?: Date | null | undefined; /** * Sessions on or before this date (end of day in timezone) */ endDate?: Date | null | undefined; /** * IANA timezone for date interpretation */ timezone?: string | undefined; }; /** @internal */ export const State$outboundSchema: z.ZodMiniEnum = z.enum(State); /** @internal */ export const MediaType$outboundSchema: z.ZodMiniEnum = z.enum( MediaType, ); /** @internal */ export type GetApiV1PublicHistoryRequest$Outbound = { page: number; pageSize: number; serverId?: string | undefined; state?: string | undefined; mediaType?: string | undefined; startDate?: string | null | undefined; endDate?: string | null | undefined; timezone: string; }; /** @internal */ export const GetApiV1PublicHistoryRequest$outboundSchema: z.ZodMiniType< GetApiV1PublicHistoryRequest$Outbound, GetApiV1PublicHistoryRequest > = z.object({ page: z._default(z.int(), 1), pageSize: z._default(z.int(), 25), serverId: z.optional(z.string()), state: z.optional(State$outboundSchema), mediaType: z.optional(MediaType$outboundSchema), startDate: z.optional( z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))), ), endDate: z.optional( z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))), ), timezone: z._default(z.string(), "UTC"), }); export function getApiV1PublicHistoryRequestToJSON( getApiV1PublicHistoryRequest: GetApiV1PublicHistoryRequest, ): string { return JSON.stringify( GetApiV1PublicHistoryRequest$outboundSchema.parse( getApiV1PublicHistoryRequest, ), ); }