/* * 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 AtsApplicationsDeleteGlobals = { /** * 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 AtsApplicationsDeleteRequest = { /** * ID of the record you are acting upon. */ id: string; /** * 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; /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; }; export type AtsApplicationsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Applications */ deleteApplicationResponse?: components.DeleteApplicationResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AtsApplicationsDeleteGlobals$inboundSchema: z.ZodType< AtsApplicationsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AtsApplicationsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AtsApplicationsDeleteGlobals$outboundSchema: z.ZodType< AtsApplicationsDeleteGlobals$Outbound, z.ZodTypeDef, AtsApplicationsDeleteGlobals > = 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 AtsApplicationsDeleteGlobals$ { /** @deprecated use `AtsApplicationsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsDeleteGlobals$inboundSchema; /** @deprecated use `AtsApplicationsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsDeleteGlobals$outboundSchema; /** @deprecated use `AtsApplicationsDeleteGlobals$Outbound` instead. */ export type Outbound = AtsApplicationsDeleteGlobals$Outbound; } export function atsApplicationsDeleteGlobalsToJSON( atsApplicationsDeleteGlobals: AtsApplicationsDeleteGlobals, ): string { return JSON.stringify( AtsApplicationsDeleteGlobals$outboundSchema.parse( atsApplicationsDeleteGlobals, ), ); } export function atsApplicationsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsDeleteGlobals' from JSON`, ); } /** @internal */ export const AtsApplicationsDeleteRequest$inboundSchema: z.ZodType< AtsApplicationsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type AtsApplicationsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const AtsApplicationsDeleteRequest$outboundSchema: z.ZodType< AtsApplicationsDeleteRequest$Outbound, z.ZodTypeDef, AtsApplicationsDeleteRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AtsApplicationsDeleteRequest$ { /** @deprecated use `AtsApplicationsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsDeleteRequest$inboundSchema; /** @deprecated use `AtsApplicationsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsDeleteRequest$outboundSchema; /** @deprecated use `AtsApplicationsDeleteRequest$Outbound` instead. */ export type Outbound = AtsApplicationsDeleteRequest$Outbound; } export function atsApplicationsDeleteRequestToJSON( atsApplicationsDeleteRequest: AtsApplicationsDeleteRequest, ): string { return JSON.stringify( AtsApplicationsDeleteRequest$outboundSchema.parse( atsApplicationsDeleteRequest, ), ); } export function atsApplicationsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsDeleteRequest' from JSON`, ); } /** @internal */ export const AtsApplicationsDeleteResponse$inboundSchema: z.ZodType< AtsApplicationsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteApplicationResponse: components.DeleteApplicationResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteApplicationResponse": "deleteApplicationResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AtsApplicationsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteApplicationResponse?: | components.DeleteApplicationResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AtsApplicationsDeleteResponse$outboundSchema: z.ZodType< AtsApplicationsDeleteResponse$Outbound, z.ZodTypeDef, AtsApplicationsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteApplicationResponse: components.DeleteApplicationResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteApplicationResponse: "DeleteApplicationResponse", 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 AtsApplicationsDeleteResponse$ { /** @deprecated use `AtsApplicationsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = AtsApplicationsDeleteResponse$inboundSchema; /** @deprecated use `AtsApplicationsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = AtsApplicationsDeleteResponse$outboundSchema; /** @deprecated use `AtsApplicationsDeleteResponse$Outbound` instead. */ export type Outbound = AtsApplicationsDeleteResponse$Outbound; } export function atsApplicationsDeleteResponseToJSON( atsApplicationsDeleteResponse: AtsApplicationsDeleteResponse, ): string { return JSON.stringify( AtsApplicationsDeleteResponse$outboundSchema.parse( atsApplicationsDeleteResponse, ), ); } export function atsApplicationsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AtsApplicationsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsApplicationsDeleteResponse' from JSON`, ); }