/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../../lib/schemas.js"; import { Result as SafeParseResult } from "../../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Arbitrary JSON used within your policies by accessing `input` */ export type Input = boolean | string | number | Array | { [k: string]: any; }; /** @internal */ export const Input$inboundSchema: z.ZodType = z .union([ z.boolean(), z.string(), z.number(), z.array(z.any()), z.record(z.any()), ]); /** @internal */ export type Input$Outbound = boolean | string | number | Array | { [k: string]: any; }; /** @internal */ export const Input$outboundSchema: z.ZodType< Input$Outbound, z.ZodTypeDef, Input > = z.union([ z.boolean(), z.string(), z.number(), z.array(z.any()), z.record(z.any()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Input$ { /** @deprecated use `Input$inboundSchema` instead. */ export const inboundSchema = Input$inboundSchema; /** @deprecated use `Input$outboundSchema` instead. */ export const outboundSchema = Input$outboundSchema; /** @deprecated use `Input$Outbound` instead. */ export type Outbound = Input$Outbound; } export function inputToJSON(input: Input): string { return JSON.stringify(Input$outboundSchema.parse(input)); } export function inputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Input$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Input' from JSON`, ); }