/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type V3ChallengeRequestResponse = { httpMeta: components.HTTPMetadata; /** * Successful request. */ v3ChallengeResponse?: components.V3ChallengeResponse | undefined; }; /** @internal */ export const V3ChallengeRequestResponse$inboundSchema: z.ZodType< V3ChallengeRequestResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, V3ChallengeResponse: components.V3ChallengeResponse$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "V3ChallengeResponse": "v3ChallengeResponse", }); }); /** @internal */ export type V3ChallengeRequestResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; V3ChallengeResponse?: components.V3ChallengeResponse$Outbound | undefined; }; /** @internal */ export const V3ChallengeRequestResponse$outboundSchema: z.ZodType< V3ChallengeRequestResponse$Outbound, z.ZodTypeDef, V3ChallengeRequestResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, v3ChallengeResponse: components.V3ChallengeResponse$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", v3ChallengeResponse: "V3ChallengeResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3ChallengeRequestResponse$ { /** @deprecated use `V3ChallengeRequestResponse$inboundSchema` instead. */ export const inboundSchema = V3ChallengeRequestResponse$inboundSchema; /** @deprecated use `V3ChallengeRequestResponse$outboundSchema` instead. */ export const outboundSchema = V3ChallengeRequestResponse$outboundSchema; /** @deprecated use `V3ChallengeRequestResponse$Outbound` instead. */ export type Outbound = V3ChallengeRequestResponse$Outbound; } export function v3ChallengeRequestResponseToJSON( v3ChallengeRequestResponse: V3ChallengeRequestResponse, ): string { return JSON.stringify( V3ChallengeRequestResponse$outboundSchema.parse(v3ChallengeRequestResponse), ); } export function v3ChallengeRequestResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3ChallengeRequestResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3ChallengeRequestResponse' from JSON`, ); }