/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { SubscriptionPreferenceDto, SubscriptionPreferenceDto$inboundSchema, } from "./subscriptionpreferencedto.js"; export type SubscriptionDetailsResponseDto = { /** * The unique identifier of the subscription */ id: string; /** * The identifier of the subscription */ identifier?: string | undefined; /** * The name of the subscription */ name?: string | undefined; /** * The preferences/rules for the subscription */ preferences?: Array | undefined; /** * Context keys that scope this subscription (e.g., tenant:org-a, project:proj-123) */ contextKeys?: Array | undefined; }; /** @internal */ export const SubscriptionDetailsResponseDto$inboundSchema: z.ZodType< SubscriptionDetailsResponseDto, z.ZodTypeDef, unknown > = z.object({ id: z.string(), identifier: z.string().optional(), name: z.string().optional(), preferences: z.array(SubscriptionPreferenceDto$inboundSchema).optional(), contextKeys: z.array(z.string()).optional(), }); export function subscriptionDetailsResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubscriptionDetailsResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubscriptionDetailsResponseDto' from JSON`, ); }