/* * 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 ConnectorApisAllGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type ConnectorApisAllRequest = { /** * 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.ApisFilter | undefined; }; export type ConnectorApisAllResponse = { httpMeta: components.HTTPMetadata; /** * Apis */ getApisResponse?: components.GetApisResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type ConnectorApisAllRequest$Outbound = { appId?: string | undefined; cursor?: string | null | undefined; limit: number; filter?: components.ApisFilter$Outbound | undefined; }; /** @internal */ export const ConnectorApisAllRequest$outboundSchema: z.ZodType< ConnectorApisAllRequest$Outbound, z.ZodTypeDef, ConnectorApisAllRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ appId: z.string().optional(), cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.ApisFilter$outboundSchema.optional(), }) ); export function connectorApisAllRequestToJSON( connectorApisAllRequest: ConnectorApisAllRequest, ): string { return JSON.stringify( ConnectorApisAllRequest$outboundSchema.parse(connectorApisAllRequest), ); } /** @internal */ export const ConnectorApisAllResponse$inboundSchema: z.ZodType< ConnectorApisAllResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetApisResponse: types.optional(components.GetApisResponse$inboundSchema), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetApisResponse": "getApisResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function connectorApisAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorApisAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorApisAllResponse' from JSON`, ); }