/* * 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 AuthFinishResponseError = { /** * 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; }; /** @internal */ export const AuthFinishResponseError$inboundSchema: z.ZodType< AuthFinishResponseError, z.ZodTypeDef, unknown > = z.object({ code: z.number().int().optional(), message: z.string(), }); /** @internal */ export type AuthFinishResponseError$Outbound = { code?: number | undefined; message: string; }; /** @internal */ export const AuthFinishResponseError$outboundSchema: z.ZodType< AuthFinishResponseError$Outbound, z.ZodTypeDef, AuthFinishResponseError > = z.object({ code: z.number().int().optional(), message: 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 AuthFinishResponseError$ { /** @deprecated use `AuthFinishResponseError$inboundSchema` instead. */ export const inboundSchema = AuthFinishResponseError$inboundSchema; /** @deprecated use `AuthFinishResponseError$outboundSchema` instead. */ export const outboundSchema = AuthFinishResponseError$outboundSchema; /** @deprecated use `AuthFinishResponseError$Outbound` instead. */ export type Outbound = AuthFinishResponseError$Outbound; } export function authFinishResponseErrorToJSON( authFinishResponseError: AuthFinishResponseError, ): string { return JSON.stringify( AuthFinishResponseError$outboundSchema.parse(authFinishResponseError), ); } export function authFinishResponseErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuthFinishResponseError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthFinishResponseError' from JSON`, ); }