/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type Bucket = { hour?: number | undefined; minute?: number | undefined; }; /** @internal */ export const Bucket$inboundSchema: z.ZodMiniType = z.object({ hour: types.optional(types.number()), minute: types.optional(types.number()), }); /** @internal */ export type Bucket$Outbound = { hour?: number | undefined; minute?: number | undefined; }; /** @internal */ export const Bucket$outboundSchema: z.ZodMiniType = z .object({ hour: z.optional(z.int()), minute: z.optional(z.int()), }); export function bucketToJSON(bucket: Bucket): string { return JSON.stringify(Bucket$outboundSchema.parse(bucket)); } export function bucketFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Bucket$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Bucket' from JSON`, ); }