/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { SubscriberDto, SubscriberDto$inboundSchema } from "./subscriberdto.js"; import { TopicResponseDto, TopicResponseDto$inboundSchema, } from "./topicresponsedto.js"; export type TopicSubscriptionResponseDto = { /** * The identifier of the subscription */ id: string; /** * The identifier of the subscription */ identifier: string; /** * The date and time the subscription was created */ createdAt: string; /** * Topic information */ topic: TopicResponseDto; /** * Subscriber information */ subscriber: SubscriberDto; /** * Context keys that scope this subscription (e.g., tenant:org-a, project:proj-123) */ contextKeys?: Array | undefined; }; /** @internal */ export const TopicSubscriptionResponseDto$inboundSchema: z.ZodType< TopicSubscriptionResponseDto, z.ZodTypeDef, unknown > = z.object({ _id: z.string(), identifier: z.string(), createdAt: z.string(), topic: TopicResponseDto$inboundSchema, subscriber: SubscriberDto$inboundSchema, contextKeys: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "_id": "id", }); }); export function topicSubscriptionResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TopicSubscriptionResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TopicSubscriptionResponseDto' from JSON`, ); }