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