/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type BaseGetAuthenticator = { provider: string; /** * The unique name of your authenticator, used to identify it and distinguish it from others. This name must be unique. Attempting to reuse the same name will result in an error. */ name: string; id: string; }; /** @internal */ export const BaseGetAuthenticator$inboundSchema: z.ZodType< BaseGetAuthenticator, z.ZodTypeDef, unknown > = z.object({ provider: z.string(), name: z.string(), id: z.string(), }); /** @internal */ export type BaseGetAuthenticator$Outbound = { provider: string; name: string; id: string; }; /** @internal */ export const BaseGetAuthenticator$outboundSchema: z.ZodType< BaseGetAuthenticator$Outbound, z.ZodTypeDef, BaseGetAuthenticator > = z.object({ provider: z.string(), name: z.string(), id: z.string(), }); export function baseGetAuthenticatorToJSON( baseGetAuthenticator: BaseGetAuthenticator, ): string { return JSON.stringify( BaseGetAuthenticator$outboundSchema.parse(baseGetAuthenticator), ); } export function baseGetAuthenticatorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BaseGetAuthenticator$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BaseGetAuthenticator' from JSON`, ); }