/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const ObjectT = { McpServerDeleted: "mcp.server.deleted", McpCredentialDeleted: "mcp.credential.deleted", } as const; export type ObjectT = ClosedEnum; export type McpDeleted = { id: string; object: ObjectT; deleted: true; }; /** @internal */ export const ObjectT$inboundSchema: z.ZodNativeEnum = z .nativeEnum(ObjectT); /** @internal */ export const ObjectT$outboundSchema: z.ZodNativeEnum = ObjectT$inboundSchema; /** @internal */ export const McpDeleted$inboundSchema: z.ZodType< McpDeleted, z.ZodTypeDef, unknown > = z.object({ id: z.string(), object: ObjectT$inboundSchema, deleted: z.literal(true), }); /** @internal */ export type McpDeleted$Outbound = { id: string; object: string; deleted: true; }; /** @internal */ export const McpDeleted$outboundSchema: z.ZodType< McpDeleted$Outbound, z.ZodTypeDef, McpDeleted > = z.object({ id: z.string(), object: ObjectT$outboundSchema, deleted: z.literal(true), }); export function mcpDeletedToJSON(mcpDeleted: McpDeleted): string { return JSON.stringify(McpDeleted$outboundSchema.parse(mcpDeleted)); } export function mcpDeletedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => McpDeleted$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpDeleted' from JSON`, ); }