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