/* * 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 ConnectorConnectorsAllGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type ConnectorConnectorsAllRequest = { /** * 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 const ConnectorConnectorsAllGlobals$inboundSchema: z.ZodType< ConnectorConnectorsAllGlobals, z.ZodTypeDef, unknown > = z.object({ appId: z.string().optional(), }); /** @internal */ export type ConnectorConnectorsAllGlobals$Outbound = { appId?: string | undefined; }; /** @internal */ export const ConnectorConnectorsAllGlobals$outboundSchema: z.ZodType< ConnectorConnectorsAllGlobals$Outbound, z.ZodTypeDef, ConnectorConnectorsAllGlobals > = 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 ConnectorConnectorsAllGlobals$ { /** @deprecated use `ConnectorConnectorsAllGlobals$inboundSchema` instead. */ export const inboundSchema = ConnectorConnectorsAllGlobals$inboundSchema; /** @deprecated use `ConnectorConnectorsAllGlobals$outboundSchema` instead. */ export const outboundSchema = ConnectorConnectorsAllGlobals$outboundSchema; /** @deprecated use `ConnectorConnectorsAllGlobals$Outbound` instead. */ export type Outbound = ConnectorConnectorsAllGlobals$Outbound; } export function connectorConnectorsAllGlobalsToJSON( connectorConnectorsAllGlobals: ConnectorConnectorsAllGlobals, ): string { return JSON.stringify( ConnectorConnectorsAllGlobals$outboundSchema.parse( connectorConnectorsAllGlobals, ), ); } export function connectorConnectorsAllGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorConnectorsAllGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorConnectorsAllGlobals' from JSON`, ); } /** @internal */ export const ConnectorConnectorsAllRequest$inboundSchema: z.ZodType< ConnectorConnectorsAllRequest, z.ZodTypeDef, unknown > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.ConnectorsFilter$inboundSchema.optional(), }); /** @internal */ export type ConnectorConnectorsAllRequest$Outbound = { cursor?: string | null | undefined; limit: number; filter?: components.ConnectorsFilter$Outbound | undefined; }; /** @internal */ export const ConnectorConnectorsAllRequest$outboundSchema: z.ZodType< ConnectorConnectorsAllRequest$Outbound, z.ZodTypeDef, ConnectorConnectorsAllRequest > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.ConnectorsFilter$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 ConnectorConnectorsAllRequest$ { /** @deprecated use `ConnectorConnectorsAllRequest$inboundSchema` instead. */ export const inboundSchema = ConnectorConnectorsAllRequest$inboundSchema; /** @deprecated use `ConnectorConnectorsAllRequest$outboundSchema` instead. */ export const outboundSchema = ConnectorConnectorsAllRequest$outboundSchema; /** @deprecated use `ConnectorConnectorsAllRequest$Outbound` instead. */ export type Outbound = ConnectorConnectorsAllRequest$Outbound; } export function connectorConnectorsAllRequestToJSON( connectorConnectorsAllRequest: ConnectorConnectorsAllRequest, ): string { return JSON.stringify( ConnectorConnectorsAllRequest$outboundSchema.parse( connectorConnectorsAllRequest, ), ); } export function connectorConnectorsAllRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorConnectorsAllRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorConnectorsAllRequest' from JSON`, ); } /** @internal */ export const ConnectorConnectorsAllResponse$inboundSchema: z.ZodType< ConnectorConnectorsAllResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetConnectorsResponse: components.GetConnectorsResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetConnectorsResponse": "getConnectorsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type ConnectorConnectorsAllResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetConnectorsResponse?: components.GetConnectorsResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const ConnectorConnectorsAllResponse$outboundSchema: z.ZodType< ConnectorConnectorsAllResponse$Outbound, z.ZodTypeDef, ConnectorConnectorsAllResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getConnectorsResponse: components.GetConnectorsResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getConnectorsResponse: "GetConnectorsResponse", 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 ConnectorConnectorsAllResponse$ { /** @deprecated use `ConnectorConnectorsAllResponse$inboundSchema` instead. */ export const inboundSchema = ConnectorConnectorsAllResponse$inboundSchema; /** @deprecated use `ConnectorConnectorsAllResponse$outboundSchema` instead. */ export const outboundSchema = ConnectorConnectorsAllResponse$outboundSchema; /** @deprecated use `ConnectorConnectorsAllResponse$Outbound` instead. */ export type Outbound = ConnectorConnectorsAllResponse$Outbound; } export function connectorConnectorsAllResponseToJSON( connectorConnectorsAllResponse: ConnectorConnectorsAllResponse, ): string { return JSON.stringify( ConnectorConnectorsAllResponse$outboundSchema.parse( connectorConnectorsAllResponse, ), ); } export function connectorConnectorsAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConnectorConnectorsAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConnectorConnectorsAllResponse' from JSON`, ); }