/* * 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 ComputeEndpoint = { host: string; name: string; port: number; protocol: string; url?: string | undefined; }; /** @internal */ export const ComputeEndpoint$inboundSchema: z.ZodType< ComputeEndpoint, z.ZodTypeDef, unknown > = z.object({ host: z.string(), name: z.string(), port: z.number().int(), protocol: z.string(), url: z.string().optional(), }); /** @internal */ export type ComputeEndpoint$Outbound = { host: string; name: string; port: number; protocol: string; url?: string | undefined; }; /** @internal */ export const ComputeEndpoint$outboundSchema: z.ZodType< ComputeEndpoint$Outbound, z.ZodTypeDef, ComputeEndpoint > = z.object({ host: z.string(), name: z.string(), port: z.number().int(), protocol: z.string(), url: z.string().optional(), }); export function computeEndpointToJSON( computeEndpoint: ComputeEndpoint, ): string { return JSON.stringify(ComputeEndpoint$outboundSchema.parse(computeEndpoint)); } export function computeEndpointFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputeEndpoint$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputeEndpoint' from JSON`, ); }