/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ConnectorApisOneGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type ConnectorApisOneRequest = { /** * The ID of your Unify application */ appId?: string | undefined; /** * ID of the record you are acting upon. */ id: string; }; export type ConnectorApisOneResponse = { httpMeta: components.HTTPMetadata; /** * Apis */ getApiResponse?: components.GetApiResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type ConnectorApisOneRequest$Outbound = { appId?: string | undefined; id: string; }; /** @internal */ export const ConnectorApisOneRequest$outboundSchema: z.ZodType< ConnectorApisOneRequest$Outbound, z.ZodTypeDef, ConnectorApisOneRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ appId: z.string().optional(), id: z.string(), }) ); export function connectorApisOneRequestToJSON( connectorApisOneRequest: ConnectorApisOneRequest, ): string { return JSON.stringify( ConnectorApisOneRequest$outboundSchema.parse(connectorApisOneRequest), ); } /** @internal */ export const ConnectorApisOneResponse$inboundSchema: z.ZodType< ConnectorApisOneResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetApiResponse: types.optional(components.GetApiResponse$inboundSchema), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetApiResponse": "getApiResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function connectorApisOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorApisOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorApisOneResponse' from JSON`, ); }