/* * 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"; export type TopicDto = { /** * The internal unique identifier of the topic */ id: string; /** * The key identifier of the topic used in your application. Should be unique on the environment level. */ key: string; /** * The name of the topic */ name?: string | undefined; }; /** @internal */ export const TopicDto$inboundSchema: z.ZodType< TopicDto, z.ZodTypeDef, unknown > = z.object({ _id: z.string(), key: z.string(), name: z.string().optional(), }).transform((v) => { return remap$(v, { "_id": "id", }); }); export function topicDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TopicDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TopicDto' from JSON`, ); }