/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. */ export type SchemaSupport = { /** * Can a resource schema be retrieved for this connector? */ supported?: boolean | undefined; }; /** @internal */ export const SchemaSupport$inboundSchema: z.ZodType< SchemaSupport, z.ZodTypeDef, unknown > = z.object({ supported: z.boolean().optional(), }); /** @internal */ export type SchemaSupport$Outbound = { supported?: boolean | undefined; }; /** @internal */ export const SchemaSupport$outboundSchema: z.ZodType< SchemaSupport$Outbound, z.ZodTypeDef, SchemaSupport > = z.object({ supported: z.boolean().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SchemaSupport$ { /** @deprecated use `SchemaSupport$inboundSchema` instead. */ export const inboundSchema = SchemaSupport$inboundSchema; /** @deprecated use `SchemaSupport$outboundSchema` instead. */ export const outboundSchema = SchemaSupport$outboundSchema; /** @deprecated use `SchemaSupport$Outbound` instead. */ export type Outbound = SchemaSupport$Outbound; } export function schemaSupportToJSON(schemaSupport: SchemaSupport): string { return JSON.stringify(SchemaSupport$outboundSchema.parse(schemaSupport)); } export function schemaSupportFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SchemaSupport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SchemaSupport' from JSON`, ); }