/* * 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 AtsApplicationsAddGlobals = { /** * 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 AtsApplicationsAddRequest = { /** * 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; application: components.ApplicationInput; }; export type AtsApplicationsAddResponse = { httpMeta: components.HTTPMetadata; /** * Applications */ createApplicationResponse?: components.CreateApplicationResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AtsApplicationsAddGlobals$inboundSchema: z.ZodType< AtsApplicationsAddGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AtsApplicationsAddGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AtsApplicationsAddGlobals$outboundSchema: z.ZodType< AtsApplicationsAddGlobals$Outbound, z.ZodTypeDef, AtsApplicationsAddGlobals > = 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 AtsApplicationsAddGlobals$ { /** @deprecated use `AtsApplicationsAddGlobals$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsAddGlobals$inboundSchema; /** @deprecated use `AtsApplicationsAddGlobals$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsAddGlobals$outboundSchema; /** @deprecated use `AtsApplicationsAddGlobals$Outbound` instead. */ export type Outbound = AtsApplicationsAddGlobals$Outbound; } export function atsApplicationsAddGlobalsToJSON( atsApplicationsAddGlobals: AtsApplicationsAddGlobals, ): string { return JSON.stringify( AtsApplicationsAddGlobals$outboundSchema.parse(atsApplicationsAddGlobals), ); } export function atsApplicationsAddGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsAddGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsAddGlobals' from JSON`, ); } /** @internal */ export const AtsApplicationsAddRequest$inboundSchema: z.ZodType< AtsApplicationsAddRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), Application: components.ApplicationInput$inboundSchema, }).transform((v) => { return remap$(v, { "Application": "application", }); }); /** @internal */ export type AtsApplicationsAddRequest$Outbound = { raw: boolean; serviceId?: string | undefined; Application: components.ApplicationInput$Outbound; }; /** @internal */ export const AtsApplicationsAddRequest$outboundSchema: z.ZodType< AtsApplicationsAddRequest$Outbound, z.ZodTypeDef, AtsApplicationsAddRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), application: components.ApplicationInput$outboundSchema, }).transform((v) => { return remap$(v, { application: "Application", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AtsApplicationsAddRequest$ { /** @deprecated use `AtsApplicationsAddRequest$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsAddRequest$inboundSchema; /** @deprecated use `AtsApplicationsAddRequest$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsAddRequest$outboundSchema; /** @deprecated use `AtsApplicationsAddRequest$Outbound` instead. */ export type Outbound = AtsApplicationsAddRequest$Outbound; } export function atsApplicationsAddRequestToJSON( atsApplicationsAddRequest: AtsApplicationsAddRequest, ): string { return JSON.stringify( AtsApplicationsAddRequest$outboundSchema.parse(atsApplicationsAddRequest), ); } export function atsApplicationsAddRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsAddRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsAddRequest' from JSON`, ); } /** @internal */ export const AtsApplicationsAddResponse$inboundSchema: z.ZodType< AtsApplicationsAddResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateApplicationResponse: components.CreateApplicationResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateApplicationResponse": "createApplicationResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AtsApplicationsAddResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateApplicationResponse?: | components.CreateApplicationResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AtsApplicationsAddResponse$outboundSchema: z.ZodType< AtsApplicationsAddResponse$Outbound, z.ZodTypeDef, AtsApplicationsAddResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createApplicationResponse: components.CreateApplicationResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createApplicationResponse: "CreateApplicationResponse", 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 AtsApplicationsAddResponse$ { /** @deprecated use `AtsApplicationsAddResponse$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsAddResponse$inboundSchema; /** @deprecated use `AtsApplicationsAddResponse$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsAddResponse$outboundSchema; /** @deprecated use `AtsApplicationsAddResponse$Outbound` instead. */ export type Outbound = AtsApplicationsAddResponse$Outbound; } export function atsApplicationsAddResponseToJSON( atsApplicationsAddResponse: AtsApplicationsAddResponse, ): string { return JSON.stringify( AtsApplicationsAddResponse$outboundSchema.parse(atsApplicationsAddResponse), ); } export function atsApplicationsAddResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsAddResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsAddResponse' from JSON`, ); }