/* * 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 AtsApplicationsAllGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type AtsApplicationsAllRequest = { /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ serviceId?: 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; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ passThrough?: { [k: string]: any } | undefined; /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ limit?: number | undefined; }; export type AtsApplicationsAllResponse = { httpMeta: components.HTTPMetadata; /** * Applications */ getApplicationsResponse?: components.GetApplicationsResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AtsApplicationsAllGlobals$inboundSchema: z.ZodType< AtsApplicationsAllGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AtsApplicationsAllGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AtsApplicationsAllGlobals$outboundSchema: z.ZodType< AtsApplicationsAllGlobals$Outbound, z.ZodTypeDef, AtsApplicationsAllGlobals > = z.object({ consumerId: z.string().optional(), 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 AtsApplicationsAllGlobals$ { /** @deprecated use `AtsApplicationsAllGlobals$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsAllGlobals$inboundSchema; /** @deprecated use `AtsApplicationsAllGlobals$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsAllGlobals$outboundSchema; /** @deprecated use `AtsApplicationsAllGlobals$Outbound` instead. */ export type Outbound = AtsApplicationsAllGlobals$Outbound; } export function atsApplicationsAllGlobalsToJSON( atsApplicationsAllGlobals: AtsApplicationsAllGlobals, ): string { return JSON.stringify( AtsApplicationsAllGlobals$outboundSchema.parse(atsApplicationsAllGlobals), ); } export function atsApplicationsAllGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsAllGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsAllGlobals' from JSON`, ); } /** @internal */ export const AtsApplicationsAllRequest$inboundSchema: z.ZodType< AtsApplicationsAllRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), cursor: z.nullable(z.string()).optional(), pass_through: z.record(z.any()).optional(), limit: z.number().int().default(20), }).transform((v) => { return remap$(v, { "pass_through": "passThrough", }); }); /** @internal */ export type AtsApplicationsAllRequest$Outbound = { raw: boolean; serviceId?: string | undefined; cursor?: string | null | undefined; pass_through?: { [k: string]: any } | undefined; limit: number; }; /** @internal */ export const AtsApplicationsAllRequest$outboundSchema: z.ZodType< AtsApplicationsAllRequest$Outbound, z.ZodTypeDef, AtsApplicationsAllRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), cursor: z.nullable(z.string()).optional(), passThrough: z.record(z.any()).optional(), limit: z.number().int().default(20), }).transform((v) => { return remap$(v, { passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AtsApplicationsAllRequest$ { /** @deprecated use `AtsApplicationsAllRequest$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsAllRequest$inboundSchema; /** @deprecated use `AtsApplicationsAllRequest$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsAllRequest$outboundSchema; /** @deprecated use `AtsApplicationsAllRequest$Outbound` instead. */ export type Outbound = AtsApplicationsAllRequest$Outbound; } export function atsApplicationsAllRequestToJSON( atsApplicationsAllRequest: AtsApplicationsAllRequest, ): string { return JSON.stringify( AtsApplicationsAllRequest$outboundSchema.parse(atsApplicationsAllRequest), ); } export function atsApplicationsAllRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsAllRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsAllRequest' from JSON`, ); } /** @internal */ export const AtsApplicationsAllResponse$inboundSchema: z.ZodType< AtsApplicationsAllResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetApplicationsResponse: components.GetApplicationsResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetApplicationsResponse": "getApplicationsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AtsApplicationsAllResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetApplicationsResponse?: | components.GetApplicationsResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AtsApplicationsAllResponse$outboundSchema: z.ZodType< AtsApplicationsAllResponse$Outbound, z.ZodTypeDef, AtsApplicationsAllResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getApplicationsResponse: components.GetApplicationsResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getApplicationsResponse: "GetApplicationsResponse", 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 AtsApplicationsAllResponse$ { /** @deprecated use `AtsApplicationsAllResponse$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsAllResponse$inboundSchema; /** @deprecated use `AtsApplicationsAllResponse$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsAllResponse$outboundSchema; /** @deprecated use `AtsApplicationsAllResponse$Outbound` instead. */ export type Outbound = AtsApplicationsAllResponse$Outbound; } export function atsApplicationsAllResponseToJSON( atsApplicationsAllResponse: AtsApplicationsAllResponse, ): string { return JSON.stringify( AtsApplicationsAllResponse$outboundSchema.parse(atsApplicationsAllResponse), ); } export function atsApplicationsAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsAllResponse' from JSON`, ); }