/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.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 = { /** * 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 const ConnectorApisAllGlobals$inboundSchema: z.ZodType< ConnectorApisAllGlobals, z.ZodTypeDef, unknown > = z.object({ appId: z.string().optional(), }); /** @internal */ export type ConnectorApisAllGlobals$Outbound = { appId?: string | undefined; }; /** @internal */ export const ConnectorApisAllGlobals$outboundSchema: z.ZodType< ConnectorApisAllGlobals$Outbound, z.ZodTypeDef, ConnectorApisAllGlobals > = z.object({ appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ConnectorApisAllGlobals$ { /** @deprecated use `ConnectorApisAllGlobals$inboundSchema` instead. */ export const inboundSchema = ConnectorApisAllGlobals$inboundSchema; /** @deprecated use `ConnectorApisAllGlobals$outboundSchema` instead. */ export const outboundSchema = ConnectorApisAllGlobals$outboundSchema; /** @deprecated use `ConnectorApisAllGlobals$Outbound` instead. */ export type Outbound = ConnectorApisAllGlobals$Outbound; } export function connectorApisAllGlobalsToJSON( connectorApisAllGlobals: ConnectorApisAllGlobals, ): string { return JSON.stringify( ConnectorApisAllGlobals$outboundSchema.parse(connectorApisAllGlobals), ); } export function connectorApisAllGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorApisAllGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorApisAllGlobals' from JSON`, ); } /** @internal */ export const ConnectorApisAllRequest$inboundSchema: z.ZodType< ConnectorApisAllRequest, z.ZodTypeDef, unknown > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.ApisFilter$inboundSchema.optional(), }); /** @internal */ export type ConnectorApisAllRequest$Outbound = { cursor?: string | null | undefined; limit: number; filter?: components.ApisFilter$Outbound | undefined; }; /** @internal */ export const ConnectorApisAllRequest$outboundSchema: z.ZodType< ConnectorApisAllRequest$Outbound, z.ZodTypeDef, ConnectorApisAllRequest > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.ApisFilter$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ConnectorApisAllRequest$ { /** @deprecated use `ConnectorApisAllRequest$inboundSchema` instead. */ export const inboundSchema = ConnectorApisAllRequest$inboundSchema; /** @deprecated use `ConnectorApisAllRequest$outboundSchema` instead. */ export const outboundSchema = ConnectorApisAllRequest$outboundSchema; /** @deprecated use `ConnectorApisAllRequest$Outbound` instead. */ export type Outbound = ConnectorApisAllRequest$Outbound; } export function connectorApisAllRequestToJSON( connectorApisAllRequest: ConnectorApisAllRequest, ): string { return JSON.stringify( ConnectorApisAllRequest$outboundSchema.parse(connectorApisAllRequest), ); } export function connectorApisAllRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorApisAllRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorApisAllRequest' from JSON`, ); } /** @internal */ export const ConnectorApisAllResponse$inboundSchema: z.ZodType< ConnectorApisAllResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetApisResponse: components.GetApisResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetApisResponse": "getApisResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type ConnectorApisAllResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetApisResponse?: components.GetApisResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const ConnectorApisAllResponse$outboundSchema: z.ZodType< ConnectorApisAllResponse$Outbound, z.ZodTypeDef, ConnectorApisAllResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getApisResponse: components.GetApisResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getApisResponse: "GetApisResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ConnectorApisAllResponse$ { /** @deprecated use `ConnectorApisAllResponse$inboundSchema` instead. */ export const inboundSchema = ConnectorApisAllResponse$inboundSchema; /** @deprecated use `ConnectorApisAllResponse$outboundSchema` instead. */ export const outboundSchema = ConnectorApisAllResponse$outboundSchema; /** @deprecated use `ConnectorApisAllResponse$Outbound` instead. */ export type Outbound = ConnectorApisAllResponse$Outbound; } export function connectorApisAllResponseToJSON( connectorApisAllResponse: ConnectorApisAllResponse, ): string { return JSON.stringify( ConnectorApisAllResponse$outboundSchema.parse(connectorApisAllResponse), ); } export function connectorApisAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorApisAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorApisAllResponse' from JSON`, ); }