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