/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Audience for the doc. */ export const Audience = { ApplicationOwner: "application_owner", Consumer: "consumer", } as const; /** * Audience for the doc. */ export type Audience = OpenEnum; /** * Format of the doc. */ export const Format = { Markdown: "markdown", } as const; /** * Format of the doc. */ export type Format = OpenEnum; export type ConnectorDoc = { /** * A unique identifier for an object. */ id?: string | undefined; /** * Name of the doc. */ name?: string | undefined; /** * Audience for the doc. */ audience?: Audience | undefined; /** * Format of the doc. */ format?: Format | undefined; /** * Link to fetch the content of the doc. */ url?: string | undefined; }; /** @internal */ export const Audience$inboundSchema: z.ZodType< Audience, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => openEnums.inboundSchema(Audience)); /** @internal */ export const Format$inboundSchema: z.ZodType = /* @__PURE__ */ lazySchema$(() => openEnums.inboundSchema(Format)); /** @internal */ export const ConnectorDoc$inboundSchema: z.ZodType< ConnectorDoc, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), name: types.optional(types.string()), audience: types.optional(Audience$inboundSchema), format: types.optional(Format$inboundSchema), url: types.optional(types.string()), }) ); export function connectorDocFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorDoc$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorDoc' from JSON`, ); }