/* * 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"; export type SelectOption = { value?: number | undefined; name?: string | null | undefined; order?: number | undefined; hint?: string | null | undefined; parentValue?: number | null | undefined; }; /** @internal */ export const SelectOption$inboundSchema: z.ZodType< SelectOption, z.ZodTypeDef, unknown > = z.object({ value: z.number().int().optional(), name: z.nullable(z.string()).optional(), order: z.number().int().optional(), hint: z.nullable(z.string()).optional(), parentValue: z.nullable(z.number().int()).optional(), }); /** @internal */ export type SelectOption$Outbound = { value?: number | undefined; name?: string | null | undefined; order?: number | undefined; hint?: string | null | undefined; parentValue?: number | null | undefined; }; /** @internal */ export const SelectOption$outboundSchema: z.ZodType< SelectOption$Outbound, z.ZodTypeDef, SelectOption > = z.object({ value: z.number().int().optional(), name: z.nullable(z.string()).optional(), order: z.number().int().optional(), hint: z.nullable(z.string()).optional(), parentValue: z.nullable(z.number().int()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SelectOption$ { /** @deprecated use `SelectOption$inboundSchema` instead. */ export const inboundSchema = SelectOption$inboundSchema; /** @deprecated use `SelectOption$outboundSchema` instead. */ export const outboundSchema = SelectOption$outboundSchema; /** @deprecated use `SelectOption$Outbound` instead. */ export type Outbound = SelectOption$Outbound; } export function selectOptionToJSON(selectOption: SelectOption): string { return JSON.stringify(SelectOption$outboundSchema.parse(selectOption)); } export function selectOptionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SelectOption$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectOption' from JSON`, ); }