/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { SshAlgorithmSelection, SshAlgorithmSelection$inboundSchema, } from "./sshalgorithmselection.js"; import { SshEndpointId, SshEndpointId$inboundSchema } from "./sshendpointid.js"; import { SshKexInitMessage, SshKexInitMessage$inboundSchema, } from "./sshkexinitmessage.js"; import { SshServerHostKey, SshServerHostKey$inboundSchema, } from "./sshserverhostkey.js"; export type Ssh = { algorithmSelection?: SshAlgorithmSelection | undefined; endpointId?: SshEndpointId | undefined; hasshFingerprint?: string | undefined; kexInitMessage?: SshKexInitMessage | undefined; serverHostKey?: SshServerHostKey | undefined; }; /** @internal */ export const Ssh$inboundSchema: z.ZodType = z .object({ algorithm_selection: SshAlgorithmSelection$inboundSchema.optional(), endpoint_id: SshEndpointId$inboundSchema.optional(), hassh_fingerprint: z.string().optional(), kex_init_message: SshKexInitMessage$inboundSchema.optional(), server_host_key: SshServerHostKey$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "algorithm_selection": "algorithmSelection", "endpoint_id": "endpointId", "hassh_fingerprint": "hasshFingerprint", "kex_init_message": "kexInitMessage", "server_host_key": "serverHostKey", }); }); export function sshFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Ssh$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Ssh' from JSON`, ); }