/* * 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 AccountingCreditNotesDeleteGlobals = { /** * 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 AccountingCreditNotesDeleteRequest = { /** * 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 AccountingCreditNotesDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Credit Note deleted */ deleteCreditNoteResponse?: components.DeleteCreditNoteResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingCreditNotesDeleteGlobals$inboundSchema: z.ZodType< AccountingCreditNotesDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingCreditNotesDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingCreditNotesDeleteGlobals$outboundSchema: z.ZodType< AccountingCreditNotesDeleteGlobals$Outbound, z.ZodTypeDef, AccountingCreditNotesDeleteGlobals > = 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 AccountingCreditNotesDeleteGlobals$ { /** @deprecated use `AccountingCreditNotesDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingCreditNotesDeleteGlobals$inboundSchema; /** @deprecated use `AccountingCreditNotesDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingCreditNotesDeleteGlobals$outboundSchema; /** @deprecated use `AccountingCreditNotesDeleteGlobals$Outbound` instead. */ export type Outbound = AccountingCreditNotesDeleteGlobals$Outbound; } export function accountingCreditNotesDeleteGlobalsToJSON( accountingCreditNotesDeleteGlobals: AccountingCreditNotesDeleteGlobals, ): string { return JSON.stringify( AccountingCreditNotesDeleteGlobals$outboundSchema.parse( accountingCreditNotesDeleteGlobals, ), ); } export function accountingCreditNotesDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCreditNotesDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCreditNotesDeleteGlobals' from JSON`, ); } /** @internal */ export const AccountingCreditNotesDeleteRequest$inboundSchema: z.ZodType< AccountingCreditNotesDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type AccountingCreditNotesDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const AccountingCreditNotesDeleteRequest$outboundSchema: z.ZodType< AccountingCreditNotesDeleteRequest$Outbound, z.ZodTypeDef, AccountingCreditNotesDeleteRequest > = 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 AccountingCreditNotesDeleteRequest$ { /** @deprecated use `AccountingCreditNotesDeleteRequest$inboundSchema` instead. */ export const inboundSchema = AccountingCreditNotesDeleteRequest$inboundSchema; /** @deprecated use `AccountingCreditNotesDeleteRequest$outboundSchema` instead. */ export const outboundSchema = AccountingCreditNotesDeleteRequest$outboundSchema; /** @deprecated use `AccountingCreditNotesDeleteRequest$Outbound` instead. */ export type Outbound = AccountingCreditNotesDeleteRequest$Outbound; } export function accountingCreditNotesDeleteRequestToJSON( accountingCreditNotesDeleteRequest: AccountingCreditNotesDeleteRequest, ): string { return JSON.stringify( AccountingCreditNotesDeleteRequest$outboundSchema.parse( accountingCreditNotesDeleteRequest, ), ); } export function accountingCreditNotesDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCreditNotesDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCreditNotesDeleteRequest' from JSON`, ); } /** @internal */ export const AccountingCreditNotesDeleteResponse$inboundSchema: z.ZodType< AccountingCreditNotesDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteCreditNoteResponse: components.DeleteCreditNoteResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteCreditNoteResponse": "deleteCreditNoteResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingCreditNotesDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteCreditNoteResponse?: | components.DeleteCreditNoteResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingCreditNotesDeleteResponse$outboundSchema: z.ZodType< AccountingCreditNotesDeleteResponse$Outbound, z.ZodTypeDef, AccountingCreditNotesDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteCreditNoteResponse: components.DeleteCreditNoteResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteCreditNoteResponse: "DeleteCreditNoteResponse", 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 AccountingCreditNotesDeleteResponse$ { /** @deprecated use `AccountingCreditNotesDeleteResponse$inboundSchema` instead. */ export const inboundSchema = AccountingCreditNotesDeleteResponse$inboundSchema; /** @deprecated use `AccountingCreditNotesDeleteResponse$outboundSchema` instead. */ export const outboundSchema = AccountingCreditNotesDeleteResponse$outboundSchema; /** @deprecated use `AccountingCreditNotesDeleteResponse$Outbound` instead. */ export type Outbound = AccountingCreditNotesDeleteResponse$Outbound; } export function accountingCreditNotesDeleteResponseToJSON( accountingCreditNotesDeleteResponse: AccountingCreditNotesDeleteResponse, ): string { return JSON.stringify( AccountingCreditNotesDeleteResponse$outboundSchema.parse( accountingCreditNotesDeleteResponse, ), ); } export function accountingCreditNotesDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingCreditNotesDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingCreditNotesDeleteResponse' from JSON`, ); }