/* * 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 Three = string | number; export type UserTags = string | number | Array; /** @internal */ export const Three$inboundSchema: z.ZodType = z .union([z.string(), z.number()]); /** @internal */ export type Three$Outbound = string | number; /** @internal */ export const Three$outboundSchema: z.ZodType< Three$Outbound, z.ZodTypeDef, Three > = z.union([z.string(), z.number()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Three$ { /** @deprecated use `Three$inboundSchema` instead. */ export const inboundSchema = Three$inboundSchema; /** @deprecated use `Three$outboundSchema` instead. */ export const outboundSchema = Three$outboundSchema; /** @deprecated use `Three$Outbound` instead. */ export type Outbound = Three$Outbound; } export function threeToJSON(three: Three): string { return JSON.stringify(Three$outboundSchema.parse(three)); } export function threeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Three$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Three' from JSON`, ); } /** @internal */ export const UserTags$inboundSchema: z.ZodType< UserTags, z.ZodTypeDef, unknown > = z.union([ z.string(), z.number(), z.array(z.union([z.string(), z.number()])), ]); /** @internal */ export type UserTags$Outbound = string | number | Array; /** @internal */ export const UserTags$outboundSchema: z.ZodType< UserTags$Outbound, z.ZodTypeDef, UserTags > = z.union([ z.string(), z.number(), z.array(z.union([z.string(), z.number()])), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UserTags$ { /** @deprecated use `UserTags$inboundSchema` instead. */ export const inboundSchema = UserTags$inboundSchema; /** @deprecated use `UserTags$outboundSchema` instead. */ export const outboundSchema = UserTags$outboundSchema; /** @deprecated use `UserTags$Outbound` instead. */ export type Outbound = UserTags$Outbound; } export function userTagsToJSON(userTags: UserTags): string { return JSON.stringify(UserTags$outboundSchema.parse(userTags)); } export function userTagsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UserTags$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserTags' from JSON`, ); }