/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const DigestRegularMetadataUnit = { Seconds: "seconds", Minutes: "minutes", Hours: "hours", Days: "days", Weeks: "weeks", Months: "months", } as const; export type DigestRegularMetadataUnit = ClosedEnum< typeof DigestRegularMetadataUnit >; export const DigestRegularMetadataType = { Regular: "regular", Backoff: "backoff", } as const; export type DigestRegularMetadataType = ClosedEnum< typeof DigestRegularMetadataType >; export const BackoffUnit = { Seconds: "seconds", Minutes: "minutes", Hours: "hours", Days: "days", Weeks: "weeks", Months: "months", } as const; export type BackoffUnit = ClosedEnum; export type DigestRegularMetadata = { amount?: number | undefined; unit?: DigestRegularMetadataUnit | undefined; digestKey?: string | undefined; type: DigestRegularMetadataType; backoff?: boolean | undefined; backoffAmount?: number | undefined; backoffUnit?: BackoffUnit | undefined; updateMode?: boolean | undefined; }; /** @internal */ export const DigestRegularMetadataUnit$inboundSchema: z.ZodNativeEnum< typeof DigestRegularMetadataUnit > = z.nativeEnum(DigestRegularMetadataUnit); /** @internal */ export const DigestRegularMetadataType$inboundSchema: z.ZodNativeEnum< typeof DigestRegularMetadataType > = z.nativeEnum(DigestRegularMetadataType); /** @internal */ export const BackoffUnit$inboundSchema: z.ZodNativeEnum = z .nativeEnum(BackoffUnit); /** @internal */ export const DigestRegularMetadata$inboundSchema: z.ZodType< DigestRegularMetadata, z.ZodTypeDef, unknown > = z.object({ amount: z.number().optional(), unit: DigestRegularMetadataUnit$inboundSchema.optional(), digestKey: z.string().optional(), type: DigestRegularMetadataType$inboundSchema, backoff: z.boolean().optional(), backoffAmount: z.number().optional(), backoffUnit: BackoffUnit$inboundSchema.optional(), updateMode: z.boolean().optional(), }); export function digestRegularMetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DigestRegularMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DigestRegularMetadata' from JSON`, ); }