/* * 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 * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const HttpRedirectChainLinkTransportProtocol = { Unknown: "", Tcp: "tcp", Udp: "udp", Icmp: "icmp", Quic: "quic", } as const; export type HttpRedirectChainLinkTransportProtocol = OpenEnum< typeof HttpRedirectChainLinkTransportProtocol >; export type HttpRedirectChainLink = { hostname?: string | undefined; path?: string | undefined; port?: number | undefined; reason?: string | undefined; scheme?: string | undefined; transportProtocol?: HttpRedirectChainLinkTransportProtocol | undefined; }; /** @internal */ export const HttpRedirectChainLinkTransportProtocol$inboundSchema: z.ZodType< HttpRedirectChainLinkTransportProtocol, z.ZodTypeDef, unknown > = openEnums.inboundSchema(HttpRedirectChainLinkTransportProtocol); /** @internal */ export const HttpRedirectChainLink$inboundSchema: z.ZodType< HttpRedirectChainLink, z.ZodTypeDef, unknown > = z.object({ hostname: z.string().optional(), path: z.string().optional(), port: z.number().int().optional(), reason: z.string().optional(), scheme: z.string().optional(), transport_protocol: HttpRedirectChainLinkTransportProtocol$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "transport_protocol": "transportProtocol", }); }); export function httpRedirectChainLinkFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HttpRedirectChainLink$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HttpRedirectChainLink' from JSON`, ); }