/* * 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 AuthFinishResponseCardError = { /** * Code is an internal error code that describes the problem category of the request. */ code?: number | undefined; /** * Message is an error message describing the problem with the request. */ message: string; /** * PUID is the unique ID associated with an AirKey card that was extracted from the AirKey message. */ puid?: string | undefined; }; /** @internal */ export const AuthFinishResponseCardError$inboundSchema: z.ZodType< AuthFinishResponseCardError, z.ZodTypeDef, unknown > = z.object({ code: z.number().int().optional(), message: z.string(), puid: z.string().optional(), }); /** @internal */ export type AuthFinishResponseCardError$Outbound = { code?: number | undefined; message: string; puid?: string | undefined; }; /** @internal */ export const AuthFinishResponseCardError$outboundSchema: z.ZodType< AuthFinishResponseCardError$Outbound, z.ZodTypeDef, AuthFinishResponseCardError > = z.object({ code: z.number().int().optional(), message: z.string(), puid: 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 AuthFinishResponseCardError$ { /** @deprecated use `AuthFinishResponseCardError$inboundSchema` instead. */ export const inboundSchema = AuthFinishResponseCardError$inboundSchema; /** @deprecated use `AuthFinishResponseCardError$outboundSchema` instead. */ export const outboundSchema = AuthFinishResponseCardError$outboundSchema; /** @deprecated use `AuthFinishResponseCardError$Outbound` instead. */ export type Outbound = AuthFinishResponseCardError$Outbound; } export function authFinishResponseCardErrorToJSON( authFinishResponseCardError: AuthFinishResponseCardError, ): string { return JSON.stringify( AuthFinishResponseCardError$outboundSchema.parse( authFinishResponseCardError, ), ); } export function authFinishResponseCardErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuthFinishResponseCardError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthFinishResponseCardError' from JSON`, ); }