/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ResourceStatus, ResourceStatus$inboundSchema, } from "./resourcestatus.js"; export type LinkedConnectorResource = { /** * ID of the resource, typically a lowercased version of name. */ id?: string | undefined; /** * Name of the resource (plural) */ name?: string | undefined; /** * Status of the resource. Resources with status live or beta are callable. */ status?: ResourceStatus | undefined; /** * ID of the resource in the Connector's API (downstream) */ downstreamId?: string | undefined; /** * Name of the resource in the Connector's API (downstream) */ downstreamName?: string | undefined; }; /** @internal */ export const LinkedConnectorResource$inboundSchema: z.ZodType< LinkedConnectorResource, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), name: types.optional(types.string()), status: types.optional(ResourceStatus$inboundSchema), downstream_id: types.optional(types.string()), downstream_name: types.optional(types.string()), }).transform((v) => { return remap$(v, { "downstream_id": "downstreamId", "downstream_name": "downstreamName", }); }) ); export function linkedConnectorResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedConnectorResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedConnectorResource' from JSON`, ); }