/* * 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 SubscribersV1ControllerUpdateSubscriberChannelRequest = { subscriberId: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto; }; export type SubscribersV1ControllerUpdateSubscriberChannelResponse = { headers: { [k: string]: Array }; result: components.SubscriberResponseDto; }; /** @internal */ export type SubscribersV1ControllerUpdateSubscriberChannelRequest$Outbound = { subscriberId: string; "idempotency-key"?: string | undefined; UpdateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto$Outbound; }; /** @internal */ export const SubscribersV1ControllerUpdateSubscriberChannelRequest$outboundSchema: z.ZodType< SubscribersV1ControllerUpdateSubscriberChannelRequest$Outbound, z.ZodTypeDef, SubscribersV1ControllerUpdateSubscriberChannelRequest > = z.object({ subscriberId: z.string(), idempotencyKey: z.string().optional(), updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto$outboundSchema, }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", updateSubscriberChannelRequestDto: "UpdateSubscriberChannelRequestDto", }); }); export function subscribersV1ControllerUpdateSubscriberChannelRequestToJSON( subscribersV1ControllerUpdateSubscriberChannelRequest: SubscribersV1ControllerUpdateSubscriberChannelRequest, ): string { return JSON.stringify( SubscribersV1ControllerUpdateSubscriberChannelRequest$outboundSchema.parse( subscribersV1ControllerUpdateSubscriberChannelRequest, ), ); } /** @internal */ export const SubscribersV1ControllerUpdateSubscriberChannelResponse$inboundSchema: z.ZodType< SubscribersV1ControllerUpdateSubscriberChannelResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.SubscriberResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function subscribersV1ControllerUpdateSubscriberChannelResponseFromJSON( jsonString: string, ): SafeParseResult< SubscribersV1ControllerUpdateSubscriberChannelResponse, SDKValidationError > { return safeParse( jsonString, (x) => SubscribersV1ControllerUpdateSubscriberChannelResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'SubscribersV1ControllerUpdateSubscriberChannelResponse' from JSON`, ); }