/* * 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"; import { AuthStartRequestSubjectUserAuthenticatorPassive, AuthStartRequestSubjectUserAuthenticatorPassive$inboundSchema, AuthStartRequestSubjectUserAuthenticatorPassive$Outbound, AuthStartRequestSubjectUserAuthenticatorPassive$outboundSchema, } from "./authstartrequestsubjectuserauthenticatorpassive.js"; export type Docv = {}; export type Ppb = {}; export type Present = {}; export type AuthStartRequestSubjectUserAuthenticators = { docv?: Docv | undefined; passive?: AuthStartRequestSubjectUserAuthenticatorPassive | undefined; ppb?: Ppb | undefined; present?: Present | undefined; }; /** @internal */ export const Docv$inboundSchema: z.ZodType = z .object({}); /** @internal */ export type Docv$Outbound = {}; /** @internal */ export const Docv$outboundSchema: z.ZodType = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Docv$ { /** @deprecated use `Docv$inboundSchema` instead. */ export const inboundSchema = Docv$inboundSchema; /** @deprecated use `Docv$outboundSchema` instead. */ export const outboundSchema = Docv$outboundSchema; /** @deprecated use `Docv$Outbound` instead. */ export type Outbound = Docv$Outbound; } export function docvToJSON(docv: Docv): string { return JSON.stringify(Docv$outboundSchema.parse(docv)); } export function docvFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Docv$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Docv' from JSON`, ); } /** @internal */ export const Ppb$inboundSchema: z.ZodType = z .object({}); /** @internal */ export type Ppb$Outbound = {}; /** @internal */ export const Ppb$outboundSchema: z.ZodType = z .object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Ppb$ { /** @deprecated use `Ppb$inboundSchema` instead. */ export const inboundSchema = Ppb$inboundSchema; /** @deprecated use `Ppb$outboundSchema` instead. */ export const outboundSchema = Ppb$outboundSchema; /** @deprecated use `Ppb$Outbound` instead. */ export type Outbound = Ppb$Outbound; } export function ppbToJSON(ppb: Ppb): string { return JSON.stringify(Ppb$outboundSchema.parse(ppb)); } export function ppbFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Ppb$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Ppb' from JSON`, ); } /** @internal */ export const Present$inboundSchema: z.ZodType = z.object({}); /** @internal */ export type Present$Outbound = {}; /** @internal */ export const Present$outboundSchema: z.ZodType< Present$Outbound, z.ZodTypeDef, Present > = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Present$ { /** @deprecated use `Present$inboundSchema` instead. */ export const inboundSchema = Present$inboundSchema; /** @deprecated use `Present$outboundSchema` instead. */ export const outboundSchema = Present$outboundSchema; /** @deprecated use `Present$Outbound` instead. */ export type Outbound = Present$Outbound; } export function presentToJSON(present: Present): string { return JSON.stringify(Present$outboundSchema.parse(present)); } export function presentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Present$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Present' from JSON`, ); } /** @internal */ export const AuthStartRequestSubjectUserAuthenticators$inboundSchema: z.ZodType< AuthStartRequestSubjectUserAuthenticators, z.ZodTypeDef, unknown > = z.object({ docv: z.lazy(() => Docv$inboundSchema).optional(), passive: AuthStartRequestSubjectUserAuthenticatorPassive$inboundSchema .optional(), ppb: z.lazy(() => Ppb$inboundSchema).optional(), present: z.lazy(() => Present$inboundSchema).optional(), }); /** @internal */ export type AuthStartRequestSubjectUserAuthenticators$Outbound = { docv?: Docv$Outbound | undefined; passive?: | AuthStartRequestSubjectUserAuthenticatorPassive$Outbound | undefined; ppb?: Ppb$Outbound | undefined; present?: Present$Outbound | undefined; }; /** @internal */ export const AuthStartRequestSubjectUserAuthenticators$outboundSchema: z.ZodType< AuthStartRequestSubjectUserAuthenticators$Outbound, z.ZodTypeDef, AuthStartRequestSubjectUserAuthenticators > = z.object({ docv: z.lazy(() => Docv$outboundSchema).optional(), passive: AuthStartRequestSubjectUserAuthenticatorPassive$outboundSchema .optional(), ppb: z.lazy(() => Ppb$outboundSchema).optional(), present: z.lazy(() => Present$outboundSchema).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AuthStartRequestSubjectUserAuthenticators$ { /** @deprecated use `AuthStartRequestSubjectUserAuthenticators$inboundSchema` instead. */ export const inboundSchema = AuthStartRequestSubjectUserAuthenticators$inboundSchema; /** @deprecated use `AuthStartRequestSubjectUserAuthenticators$outboundSchema` instead. */ export const outboundSchema = AuthStartRequestSubjectUserAuthenticators$outboundSchema; /** @deprecated use `AuthStartRequestSubjectUserAuthenticators$Outbound` instead. */ export type Outbound = AuthStartRequestSubjectUserAuthenticators$Outbound; } export function authStartRequestSubjectUserAuthenticatorsToJSON( authStartRequestSubjectUserAuthenticators: AuthStartRequestSubjectUserAuthenticators, ): string { return JSON.stringify( AuthStartRequestSubjectUserAuthenticators$outboundSchema.parse( authStartRequestSubjectUserAuthenticators, ), ); } export function authStartRequestSubjectUserAuthenticatorsFromJSON( jsonString: string, ): SafeParseResult< AuthStartRequestSubjectUserAuthenticators, SDKValidationError > { return safeParse( jsonString, (x) => AuthStartRequestSubjectUserAuthenticators$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AuthStartRequestSubjectUserAuthenticators' from JSON`, ); }