/* * 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"; /** * Represents a single identity item in the response. */ export type PostBatchResultItem = { /** * An error message that is returned if the identity cannot be successfully enrolled. */ error?: string | undefined; /** * A unique Prove-generated identifier for the enrolled identity. This is a UUID that can be used to reference the identity in future requests. */ proveId?: string | undefined; }; /** @internal */ export const PostBatchResultItem$inboundSchema: z.ZodType< PostBatchResultItem, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), proveId: z.string().optional(), }); /** @internal */ export type PostBatchResultItem$Outbound = { error?: string | undefined; proveId?: string | undefined; }; /** @internal */ export const PostBatchResultItem$outboundSchema: z.ZodType< PostBatchResultItem$Outbound, z.ZodTypeDef, PostBatchResultItem > = z.object({ error: z.string().optional(), proveId: 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 PostBatchResultItem$ { /** @deprecated use `PostBatchResultItem$inboundSchema` instead. */ export const inboundSchema = PostBatchResultItem$inboundSchema; /** @deprecated use `PostBatchResultItem$outboundSchema` instead. */ export const outboundSchema = PostBatchResultItem$outboundSchema; /** @deprecated use `PostBatchResultItem$Outbound` instead. */ export type Outbound = PostBatchResultItem$Outbound; } export function postBatchResultItemToJSON( postBatchResultItem: PostBatchResultItem, ): string { return JSON.stringify( PostBatchResultItem$outboundSchema.parse(postBatchResultItem), ); } export function postBatchResultItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostBatchResultItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostBatchResultItem' from JSON`, ); }