/* * 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 { 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"; /** * At-a-glance implementation difficulty rating. */ export const Difficulty = { Straightforward: "straightforward", Moderate: "moderate", Involved: "involved", HighlyComplex: "highly_complex", } as const; /** * At-a-glance implementation difficulty rating. */ export type Difficulty = OpenEnum; export type SupportedResourceCategories = { /** * Category name. */ name: string; /** * Resource ids belonging to this category. */ resources: Array; }; export type ExternalGuides = { /** * Guide title. */ title: string; /** * Guide URL. */ url: string; /** * Publisher of the guide. */ source: string; }; export type ResponsibilityMatrix = { /** * The responsibility area. */ area: string; /** * Apideck's responsibility for this area. */ apideck?: string | undefined; /** * The consumer's responsibility for this area. */ consumer?: string | undefined; /** * The end customer's responsibility for this area. */ customer?: string | undefined; }; export type EnvironmentNotes = { /** * Environment name. */ environment: string; /** * Description of the environment. */ description: string; }; /** * Editorial overview metadata for the connector, used to render the connector's Overview documentation (implementation difficulty, partnership requirements, sandbox availability, and other at-a-glance facts). */ export type ConnectorOverview = { /** * Whether this connector's overview content is still in beta. */ beta?: boolean | undefined; /** * Whether this connector is demo-only. */ demo?: boolean | undefined; /** * At-a-glance implementation difficulty rating. */ difficulty: Difficulty; /** * Short explanation of why the connector has the given difficulty rating. */ difficultyReason: string; /** * Notes on the connector's authentication flow. */ authenticationNote?: string | undefined; /** * Description of webhook support for this connector. */ webhooks?: string | undefined; /** * Whether a partnership with the downstream provider is required. */ partnershipRequired: boolean; /** * URL to the downstream provider's partnership/developer portal. */ partnershipUrl?: string | undefined; /** * Additional notes about the partnership requirement. */ partnershipNote?: string | undefined; /** * Name of the downstream provider's developer portal. */ partnershipPortalName?: string | undefined; /** * Whether Apideck-managed credentials are available for this connector. */ apideckCredentialsAvailable: boolean; /** * Additional notes about Apideck-managed credentials. */ apideckCredentialsNote?: string | undefined; /** * Notes on costs associated with using this connector. */ costs?: string | undefined; /** * Notes on rate limits enforced by the downstream provider. */ rateLimits?: string | undefined; /** * The type of downstream account required to use this connector. */ accountTypeRequired: string; /** * Whether a sandbox environment is available for this connector. */ sandboxAvailable: boolean; /** * URL to the downstream provider's sandbox environment. */ sandboxUrl?: string | undefined; /** * Additional notes about the sandbox environment. */ sandboxNote?: string | undefined; /** * The access level a consumer's end user needs to authorize the connection. */ consumerAccessLevel: string; /** * Flat list of important facts about this connector. */ importantToKnow?: Array | undefined; /** * Grouping of the connector's supported resources by category. */ supportedResourceCategories?: Array | undefined; /** * Links to external guides relevant to this connector. */ externalGuides?: Array | undefined; /** * Who is responsible for each area of the integration. Cell values are display strings (e.g. "✓", "Docs provided"), not booleans. */ responsibilityMatrix?: Array | undefined; /** * Notes about the different environments (sandbox, production, etc.) available for this connector. */ environmentNotes?: Array | undefined; }; /** @internal */ export const Difficulty$inboundSchema: z.ZodType< Difficulty, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => openEnums.inboundSchema(Difficulty)); /** @internal */ export const SupportedResourceCategories$inboundSchema: z.ZodType< SupportedResourceCategories, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ name: types.string(), resources: z.array(types.string()), }) ); export function supportedResourceCategoriesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SupportedResourceCategories$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportedResourceCategories' from JSON`, ); } /** @internal */ export const ExternalGuides$inboundSchema: z.ZodType< ExternalGuides, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ title: types.string(), url: types.string(), source: types.string(), }) ); export function externalGuidesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ExternalGuides$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ExternalGuides' from JSON`, ); } /** @internal */ export const ResponsibilityMatrix$inboundSchema: z.ZodType< ResponsibilityMatrix, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ area: types.string(), apideck: types.optional(types.string()), consumer: types.optional(types.string()), customer: types.optional(types.string()), }) ); export function responsibilityMatrixFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResponsibilityMatrix$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponsibilityMatrix' from JSON`, ); } /** @internal */ export const EnvironmentNotes$inboundSchema: z.ZodType< EnvironmentNotes, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ environment: types.string(), description: types.string(), }) ); export function environmentNotesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EnvironmentNotes$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnvironmentNotes' from JSON`, ); } /** @internal */ export const ConnectorOverview$inboundSchema: z.ZodType< ConnectorOverview, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ beta: types.optional(types.boolean()), demo: types.optional(types.boolean()), difficulty: Difficulty$inboundSchema, difficulty_reason: types.string(), authentication_note: types.optional(types.string()), webhooks: types.optional(types.string()), partnership_required: types.boolean(), partnership_url: types.optional(types.string()), partnership_note: types.optional(types.string()), partnership_portal_name: types.optional(types.string()), apideck_credentials_available: types.boolean(), apideck_credentials_note: types.optional(types.string()), costs: types.optional(types.string()), rate_limits: types.optional(types.string()), account_type_required: types.string(), sandbox_available: types.boolean(), sandbox_url: types.optional(types.string()), sandbox_note: types.optional(types.string()), consumer_access_level: types.string(), important_to_know: types.optional(z.array(types.string())), supported_resource_categories: types.optional( z.array(z.lazy(() => SupportedResourceCategories$inboundSchema)), ), external_guides: types.optional( z.array(z.lazy(() => ExternalGuides$inboundSchema)), ), responsibility_matrix: types.optional( z.array(z.lazy(() => ResponsibilityMatrix$inboundSchema)), ), environment_notes: types.optional( z.array(z.lazy(() => EnvironmentNotes$inboundSchema)), ), }).transform((v) => { return remap$(v, { "difficulty_reason": "difficultyReason", "authentication_note": "authenticationNote", "partnership_required": "partnershipRequired", "partnership_url": "partnershipUrl", "partnership_note": "partnershipNote", "partnership_portal_name": "partnershipPortalName", "apideck_credentials_available": "apideckCredentialsAvailable", "apideck_credentials_note": "apideckCredentialsNote", "rate_limits": "rateLimits", "account_type_required": "accountTypeRequired", "sandbox_available": "sandboxAvailable", "sandbox_url": "sandboxUrl", "sandbox_note": "sandboxNote", "consumer_access_level": "consumerAccessLevel", "important_to_know": "importantToKnow", "supported_resource_categories": "supportedResourceCategories", "external_guides": "externalGuides", "responsibility_matrix": "responsibilityMatrix", "environment_notes": "environmentNotes", }); }) ); export function connectorOverviewFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorOverview$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorOverview' from JSON`, ); }