/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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 CreateAuthenticatorConnectionRequest = { authenticatorId: string; createAuthenticatorConnection: components.CreateAuthenticatorConnection; }; /** @internal */ export const CreateAuthenticatorConnectionRequest$inboundSchema: z.ZodType< CreateAuthenticatorConnectionRequest, z.ZodTypeDef, unknown > = z.object({ authenticator_id: z.string(), CreateAuthenticatorConnection: z.lazy(() => components.CreateAuthenticatorConnection$inboundSchema ), }).transform((v) => { return remap$(v, { "authenticator_id": "authenticatorId", "CreateAuthenticatorConnection": "createAuthenticatorConnection", }); }); /** @internal */ export type CreateAuthenticatorConnectionRequest$Outbound = { authenticator_id: string; CreateAuthenticatorConnection: components.CreateAuthenticatorConnection$Outbound; }; /** @internal */ export const CreateAuthenticatorConnectionRequest$outboundSchema: z.ZodType< CreateAuthenticatorConnectionRequest$Outbound, z.ZodTypeDef, CreateAuthenticatorConnectionRequest > = z.object({ authenticatorId: z.string(), createAuthenticatorConnection: z.lazy(() => components.CreateAuthenticatorConnection$outboundSchema ), }).transform((v) => { return remap$(v, { authenticatorId: "authenticator_id", createAuthenticatorConnection: "CreateAuthenticatorConnection", }); }); export function createAuthenticatorConnectionRequestToJSON( createAuthenticatorConnectionRequest: CreateAuthenticatorConnectionRequest, ): string { return JSON.stringify( CreateAuthenticatorConnectionRequest$outboundSchema.parse( createAuthenticatorConnectionRequest, ), ); } export function createAuthenticatorConnectionRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateAuthenticatorConnectionRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAuthenticatorConnectionRequest' from JSON`, ); }