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