/* * 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 ConnectorConnectorsAllGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type ConnectorConnectorsAllRequest = { /** * The ID of your Unify application */ appId?: string | undefined; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ cursor?: string | null | undefined; /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ limit?: number | undefined; /** * Apply filters */ filter?: components.ConnectorsFilter | undefined; }; export type ConnectorConnectorsAllResponse = { httpMeta: components.HTTPMetadata; /** * Connectors */ getConnectorsResponse?: components.GetConnectorsResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type ConnectorConnectorsAllRequest$Outbound = { appId?: string | undefined; cursor?: string | null | undefined; limit: number; filter?: components.ConnectorsFilter$Outbound | undefined; }; /** @internal */ export const ConnectorConnectorsAllRequest$outboundSchema: z.ZodType< ConnectorConnectorsAllRequest$Outbound, z.ZodTypeDef, ConnectorConnectorsAllRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ appId: z.string().optional(), cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.ConnectorsFilter$outboundSchema.optional(), }) ); export function connectorConnectorsAllRequestToJSON( connectorConnectorsAllRequest: ConnectorConnectorsAllRequest, ): string { return JSON.stringify( ConnectorConnectorsAllRequest$outboundSchema.parse( connectorConnectorsAllRequest, ), ); } /** @internal */ export const ConnectorConnectorsAllResponse$inboundSchema: z.ZodType< ConnectorConnectorsAllResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetConnectorsResponse: types.optional( components.GetConnectorsResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetConnectorsResponse": "getConnectorsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function connectorConnectorsAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorConnectorsAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorConnectorsAllResponse' from JSON`, ); }