/* * 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 enum InputCreatorIdType { Unverified = "unverified", } export type InputCreatorId1 = { type: InputCreatorIdType; value: string; }; export type InputCreatorId = InputCreatorId1 | string; /** @internal */ export const InputCreatorIdType$inboundSchema: z.ZodNativeEnum< typeof InputCreatorIdType > = z.nativeEnum(InputCreatorIdType); /** @internal */ export const InputCreatorIdType$outboundSchema: z.ZodNativeEnum< typeof InputCreatorIdType > = InputCreatorIdType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InputCreatorIdType$ { /** @deprecated use `InputCreatorIdType$inboundSchema` instead. */ export const inboundSchema = InputCreatorIdType$inboundSchema; /** @deprecated use `InputCreatorIdType$outboundSchema` instead. */ export const outboundSchema = InputCreatorIdType$outboundSchema; } /** @internal */ export const InputCreatorId1$inboundSchema: z.ZodType< InputCreatorId1, z.ZodTypeDef, unknown > = z.object({ type: InputCreatorIdType$inboundSchema, value: z.string(), }); /** @internal */ export type InputCreatorId1$Outbound = { type: string; value: string; }; /** @internal */ export const InputCreatorId1$outboundSchema: z.ZodType< InputCreatorId1$Outbound, z.ZodTypeDef, InputCreatorId1 > = z.object({ type: InputCreatorIdType$outboundSchema, value: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InputCreatorId1$ { /** @deprecated use `InputCreatorId1$inboundSchema` instead. */ export const inboundSchema = InputCreatorId1$inboundSchema; /** @deprecated use `InputCreatorId1$outboundSchema` instead. */ export const outboundSchema = InputCreatorId1$outboundSchema; /** @deprecated use `InputCreatorId1$Outbound` instead. */ export type Outbound = InputCreatorId1$Outbound; } export function inputCreatorId1ToJSON( inputCreatorId1: InputCreatorId1, ): string { return JSON.stringify(InputCreatorId1$outboundSchema.parse(inputCreatorId1)); } export function inputCreatorId1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InputCreatorId1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InputCreatorId1' from JSON`, ); } /** @internal */ export const InputCreatorId$inboundSchema: z.ZodType< InputCreatorId, z.ZodTypeDef, unknown > = z.union([z.lazy(() => InputCreatorId1$inboundSchema), z.string()]); /** @internal */ export type InputCreatorId$Outbound = InputCreatorId1$Outbound | string; /** @internal */ export const InputCreatorId$outboundSchema: z.ZodType< InputCreatorId$Outbound, z.ZodTypeDef, InputCreatorId > = z.union([z.lazy(() => InputCreatorId1$outboundSchema), z.string()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InputCreatorId$ { /** @deprecated use `InputCreatorId$inboundSchema` instead. */ export const inboundSchema = InputCreatorId$inboundSchema; /** @deprecated use `InputCreatorId$outboundSchema` instead. */ export const outboundSchema = InputCreatorId$outboundSchema; /** @deprecated use `InputCreatorId$Outbound` instead. */ export type Outbound = InputCreatorId$Outbound; } export function inputCreatorIdToJSON(inputCreatorId: InputCreatorId): string { return JSON.stringify(InputCreatorId$outboundSchema.parse(inputCreatorId)); } export function inputCreatorIdFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InputCreatorId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InputCreatorId' from JSON`, ); }