/* * 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 ChannelEndpointsControllerGetChannelEndpointRequest = { /** * The unique identifier of the channel endpoint */ identifier: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type ChannelEndpointsControllerGetChannelEndpointResponse = { headers: { [k: string]: Array }; result: components.GetChannelEndpointResponseDto; }; /** @internal */ export type ChannelEndpointsControllerGetChannelEndpointRequest$Outbound = { identifier: string; "idempotency-key"?: string | undefined; }; /** @internal */ export const ChannelEndpointsControllerGetChannelEndpointRequest$outboundSchema: z.ZodType< ChannelEndpointsControllerGetChannelEndpointRequest$Outbound, z.ZodTypeDef, ChannelEndpointsControllerGetChannelEndpointRequest > = z.object({ identifier: z.string(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function channelEndpointsControllerGetChannelEndpointRequestToJSON( channelEndpointsControllerGetChannelEndpointRequest: ChannelEndpointsControllerGetChannelEndpointRequest, ): string { return JSON.stringify( ChannelEndpointsControllerGetChannelEndpointRequest$outboundSchema.parse( channelEndpointsControllerGetChannelEndpointRequest, ), ); } /** @internal */ export const ChannelEndpointsControllerGetChannelEndpointResponse$inboundSchema: z.ZodType< ChannelEndpointsControllerGetChannelEndpointResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.GetChannelEndpointResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function channelEndpointsControllerGetChannelEndpointResponseFromJSON( jsonString: string, ): SafeParseResult< ChannelEndpointsControllerGetChannelEndpointResponse, SDKValidationError > { return safeParse( jsonString, (x) => ChannelEndpointsControllerGetChannelEndpointResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ChannelEndpointsControllerGetChannelEndpointResponse' from JSON`, ); }