/* * 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"; import { CreateTokenAuthentication, CreateTokenAuthentication$inboundSchema, } from "./createtokenauthentication.js"; import { RefreshTokenAuthentication, RefreshTokenAuthentication$inboundSchema, } from "./refreshtokenauthentication.js"; export type Authentication = | CreateTokenAuthentication | RefreshTokenAuthentication; /** @internal */ export const Authentication$inboundSchema: z.ZodType< Authentication, z.ZodTypeDef, unknown > = z.union([ CreateTokenAuthentication$inboundSchema, RefreshTokenAuthentication$inboundSchema, ]); export function authenticationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Authentication$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Authentication' from JSON`, ); }