/* * 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 AccountingAttachmentsDeleteGlobals = { /** * 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 AccountingAttachmentsDeleteRequest = { /** * The reference type of the document. */ referenceType: components.AttachmentReferenceType; /** * The reference id of the object to retrieve. */ referenceId: string; /** * 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 AccountingAttachmentsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Attachments */ deleteAttachmentResponse?: components.DeleteAttachmentResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingAttachmentsDeleteGlobals$inboundSchema: z.ZodType< AccountingAttachmentsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingAttachmentsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingAttachmentsDeleteGlobals$outboundSchema: z.ZodType< AccountingAttachmentsDeleteGlobals$Outbound, z.ZodTypeDef, AccountingAttachmentsDeleteGlobals > = 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 AccountingAttachmentsDeleteGlobals$ { /** @deprecated use `AccountingAttachmentsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingAttachmentsDeleteGlobals$inboundSchema; /** @deprecated use `AccountingAttachmentsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingAttachmentsDeleteGlobals$outboundSchema; /** @deprecated use `AccountingAttachmentsDeleteGlobals$Outbound` instead. */ export type Outbound = AccountingAttachmentsDeleteGlobals$Outbound; } export function accountingAttachmentsDeleteGlobalsToJSON( accountingAttachmentsDeleteGlobals: AccountingAttachmentsDeleteGlobals, ): string { return JSON.stringify( AccountingAttachmentsDeleteGlobals$outboundSchema.parse( accountingAttachmentsDeleteGlobals, ), ); } export function accountingAttachmentsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingAttachmentsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingAttachmentsDeleteGlobals' from JSON`, ); } /** @internal */ export const AccountingAttachmentsDeleteRequest$inboundSchema: z.ZodType< AccountingAttachmentsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ reference_type: components.AttachmentReferenceType$inboundSchema, reference_id: z.string(), id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }).transform((v) => { return remap$(v, { "reference_type": "referenceType", "reference_id": "referenceId", }); }); /** @internal */ export type AccountingAttachmentsDeleteRequest$Outbound = { reference_type: string; reference_id: string; id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const AccountingAttachmentsDeleteRequest$outboundSchema: z.ZodType< AccountingAttachmentsDeleteRequest$Outbound, z.ZodTypeDef, AccountingAttachmentsDeleteRequest > = z.object({ referenceType: components.AttachmentReferenceType$outboundSchema, referenceId: z.string(), id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }).transform((v) => { return remap$(v, { referenceType: "reference_type", referenceId: "reference_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountingAttachmentsDeleteRequest$ { /** @deprecated use `AccountingAttachmentsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = AccountingAttachmentsDeleteRequest$inboundSchema; /** @deprecated use `AccountingAttachmentsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = AccountingAttachmentsDeleteRequest$outboundSchema; /** @deprecated use `AccountingAttachmentsDeleteRequest$Outbound` instead. */ export type Outbound = AccountingAttachmentsDeleteRequest$Outbound; } export function accountingAttachmentsDeleteRequestToJSON( accountingAttachmentsDeleteRequest: AccountingAttachmentsDeleteRequest, ): string { return JSON.stringify( AccountingAttachmentsDeleteRequest$outboundSchema.parse( accountingAttachmentsDeleteRequest, ), ); } export function accountingAttachmentsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingAttachmentsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingAttachmentsDeleteRequest' from JSON`, ); } /** @internal */ export const AccountingAttachmentsDeleteResponse$inboundSchema: z.ZodType< AccountingAttachmentsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteAttachmentResponse: components.DeleteAttachmentResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteAttachmentResponse": "deleteAttachmentResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingAttachmentsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteAttachmentResponse?: | components.DeleteAttachmentResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingAttachmentsDeleteResponse$outboundSchema: z.ZodType< AccountingAttachmentsDeleteResponse$Outbound, z.ZodTypeDef, AccountingAttachmentsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteAttachmentResponse: components.DeleteAttachmentResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteAttachmentResponse: "DeleteAttachmentResponse", 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 AccountingAttachmentsDeleteResponse$ { /** @deprecated use `AccountingAttachmentsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = AccountingAttachmentsDeleteResponse$inboundSchema; /** @deprecated use `AccountingAttachmentsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = AccountingAttachmentsDeleteResponse$outboundSchema; /** @deprecated use `AccountingAttachmentsDeleteResponse$Outbound` instead. */ export type Outbound = AccountingAttachmentsDeleteResponse$Outbound; } export function accountingAttachmentsDeleteResponseToJSON( accountingAttachmentsDeleteResponse: AccountingAttachmentsDeleteResponse, ): string { return JSON.stringify( AccountingAttachmentsDeleteResponse$outboundSchema.parse( accountingAttachmentsDeleteResponse, ), ); } export function accountingAttachmentsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingAttachmentsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingAttachmentsDeleteResponse' from JSON`, ); }