/* * 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 TopicsV1ControllerGetTopicSubscriberRequest = { /** * The external subscriber id */ externalSubscriberId: string; /** * The topic key */ topicKey: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type TopicsV1ControllerGetTopicSubscriberResponse = { headers: { [k: string]: Array }; result: components.TopicSubscriberDto; }; /** @internal */ export type TopicsV1ControllerGetTopicSubscriberRequest$Outbound = { externalSubscriberId: string; topicKey: string; "idempotency-key"?: string | undefined; }; /** @internal */ export const TopicsV1ControllerGetTopicSubscriberRequest$outboundSchema: z.ZodType< TopicsV1ControllerGetTopicSubscriberRequest$Outbound, z.ZodTypeDef, TopicsV1ControllerGetTopicSubscriberRequest > = z.object({ externalSubscriberId: z.string(), topicKey: z.string(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function topicsV1ControllerGetTopicSubscriberRequestToJSON( topicsV1ControllerGetTopicSubscriberRequest: TopicsV1ControllerGetTopicSubscriberRequest, ): string { return JSON.stringify( TopicsV1ControllerGetTopicSubscriberRequest$outboundSchema.parse( topicsV1ControllerGetTopicSubscriberRequest, ), ); } /** @internal */ export const TopicsV1ControllerGetTopicSubscriberResponse$inboundSchema: z.ZodType< TopicsV1ControllerGetTopicSubscriberResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.TopicSubscriberDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function topicsV1ControllerGetTopicSubscriberResponseFromJSON( jsonString: string, ): SafeParseResult< TopicsV1ControllerGetTopicSubscriberResponse, SDKValidationError > { return safeParse( jsonString, (x) => TopicsV1ControllerGetTopicSubscriberResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'TopicsV1ControllerGetTopicSubscriberResponse' from JSON`, ); }