/* * 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 AccountingInvoiceItemsDeleteGlobals = { /** * 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 AccountingInvoiceItemsDeleteRequest = { /** * 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 AccountingInvoiceItemsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * InvoiceItems */ deleteTaxRateResponse?: components.DeleteTaxRateResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingInvoiceItemsDeleteGlobals$inboundSchema: z.ZodType< AccountingInvoiceItemsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingInvoiceItemsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingInvoiceItemsDeleteGlobals$outboundSchema: z.ZodType< AccountingInvoiceItemsDeleteGlobals$Outbound, z.ZodTypeDef, AccountingInvoiceItemsDeleteGlobals > = 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 AccountingInvoiceItemsDeleteGlobals$ { /** @deprecated use `AccountingInvoiceItemsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingInvoiceItemsDeleteGlobals$inboundSchema; /** @deprecated use `AccountingInvoiceItemsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingInvoiceItemsDeleteGlobals$outboundSchema; /** @deprecated use `AccountingInvoiceItemsDeleteGlobals$Outbound` instead. */ export type Outbound = AccountingInvoiceItemsDeleteGlobals$Outbound; } export function accountingInvoiceItemsDeleteGlobalsToJSON( accountingInvoiceItemsDeleteGlobals: AccountingInvoiceItemsDeleteGlobals, ): string { return JSON.stringify( AccountingInvoiceItemsDeleteGlobals$outboundSchema.parse( accountingInvoiceItemsDeleteGlobals, ), ); } export function accountingInvoiceItemsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingInvoiceItemsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingInvoiceItemsDeleteGlobals' from JSON`, ); } /** @internal */ export const AccountingInvoiceItemsDeleteRequest$inboundSchema: z.ZodType< AccountingInvoiceItemsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type AccountingInvoiceItemsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const AccountingInvoiceItemsDeleteRequest$outboundSchema: z.ZodType< AccountingInvoiceItemsDeleteRequest$Outbound, z.ZodTypeDef, AccountingInvoiceItemsDeleteRequest > = 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 AccountingInvoiceItemsDeleteRequest$ { /** @deprecated use `AccountingInvoiceItemsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = AccountingInvoiceItemsDeleteRequest$inboundSchema; /** @deprecated use `AccountingInvoiceItemsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = AccountingInvoiceItemsDeleteRequest$outboundSchema; /** @deprecated use `AccountingInvoiceItemsDeleteRequest$Outbound` instead. */ export type Outbound = AccountingInvoiceItemsDeleteRequest$Outbound; } export function accountingInvoiceItemsDeleteRequestToJSON( accountingInvoiceItemsDeleteRequest: AccountingInvoiceItemsDeleteRequest, ): string { return JSON.stringify( AccountingInvoiceItemsDeleteRequest$outboundSchema.parse( accountingInvoiceItemsDeleteRequest, ), ); } export function accountingInvoiceItemsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingInvoiceItemsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingInvoiceItemsDeleteRequest' from JSON`, ); } /** @internal */ export const AccountingInvoiceItemsDeleteResponse$inboundSchema: z.ZodType< AccountingInvoiceItemsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteTaxRateResponse: components.DeleteTaxRateResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteTaxRateResponse": "deleteTaxRateResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingInvoiceItemsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteTaxRateResponse?: components.DeleteTaxRateResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingInvoiceItemsDeleteResponse$outboundSchema: z.ZodType< AccountingInvoiceItemsDeleteResponse$Outbound, z.ZodTypeDef, AccountingInvoiceItemsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteTaxRateResponse: components.DeleteTaxRateResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteTaxRateResponse: "DeleteTaxRateResponse", 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 AccountingInvoiceItemsDeleteResponse$ { /** @deprecated use `AccountingInvoiceItemsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = AccountingInvoiceItemsDeleteResponse$inboundSchema; /** @deprecated use `AccountingInvoiceItemsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = AccountingInvoiceItemsDeleteResponse$outboundSchema; /** @deprecated use `AccountingInvoiceItemsDeleteResponse$Outbound` instead. */ export type Outbound = AccountingInvoiceItemsDeleteResponse$Outbound; } export function accountingInvoiceItemsDeleteResponseToJSON( accountingInvoiceItemsDeleteResponse: AccountingInvoiceItemsDeleteResponse, ): string { return JSON.stringify( AccountingInvoiceItemsDeleteResponse$outboundSchema.parse( accountingInvoiceItemsDeleteResponse, ), ); } export function accountingInvoiceItemsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingInvoiceItemsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingInvoiceItemsDeleteResponse' from JSON`, ); }