/* * 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 UnifiedId = { /** * The unique identifier of the resource */ id: string; }; /** @internal */ export const UnifiedId$inboundSchema: z.ZodType< UnifiedId, z.ZodTypeDef, unknown > = z.object({ id: z.string(), }); /** @internal */ export type UnifiedId$Outbound = { id: string; }; /** @internal */ export const UnifiedId$outboundSchema: z.ZodType< UnifiedId$Outbound, z.ZodTypeDef, UnifiedId > = z.object({ id: 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 UnifiedId$ { /** @deprecated use `UnifiedId$inboundSchema` instead. */ export const inboundSchema = UnifiedId$inboundSchema; /** @deprecated use `UnifiedId$outboundSchema` instead. */ export const outboundSchema = UnifiedId$outboundSchema; /** @deprecated use `UnifiedId$Outbound` instead. */ export type Outbound = UnifiedId$Outbound; } export function unifiedIdToJSON(unifiedId: UnifiedId): string { return JSON.stringify(UnifiedId$outboundSchema.parse(unifiedId)); } export function unifiedIdFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UnifiedId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnifiedId' from JSON`, ); }