/* * 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 AccountingSuppliersDeleteGlobals = { /** * 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 AccountingSuppliersDeleteRequest = { /** * 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 AccountingSuppliersDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Supplier deleted */ deleteSupplierResponse?: components.DeleteSupplierResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingSuppliersDeleteGlobals$inboundSchema: z.ZodType< AccountingSuppliersDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingSuppliersDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingSuppliersDeleteGlobals$outboundSchema: z.ZodType< AccountingSuppliersDeleteGlobals$Outbound, z.ZodTypeDef, AccountingSuppliersDeleteGlobals > = 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 AccountingSuppliersDeleteGlobals$ { /** @deprecated use `AccountingSuppliersDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingSuppliersDeleteGlobals$inboundSchema; /** @deprecated use `AccountingSuppliersDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingSuppliersDeleteGlobals$outboundSchema; /** @deprecated use `AccountingSuppliersDeleteGlobals$Outbound` instead. */ export type Outbound = AccountingSuppliersDeleteGlobals$Outbound; } export function accountingSuppliersDeleteGlobalsToJSON( accountingSuppliersDeleteGlobals: AccountingSuppliersDeleteGlobals, ): string { return JSON.stringify( AccountingSuppliersDeleteGlobals$outboundSchema.parse( accountingSuppliersDeleteGlobals, ), ); } export function accountingSuppliersDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSuppliersDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSuppliersDeleteGlobals' from JSON`, ); } /** @internal */ export const AccountingSuppliersDeleteRequest$inboundSchema: z.ZodType< AccountingSuppliersDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type AccountingSuppliersDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const AccountingSuppliersDeleteRequest$outboundSchema: z.ZodType< AccountingSuppliersDeleteRequest$Outbound, z.ZodTypeDef, AccountingSuppliersDeleteRequest > = 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 AccountingSuppliersDeleteRequest$ { /** @deprecated use `AccountingSuppliersDeleteRequest$inboundSchema` instead. */ export const inboundSchema = AccountingSuppliersDeleteRequest$inboundSchema; /** @deprecated use `AccountingSuppliersDeleteRequest$outboundSchema` instead. */ export const outboundSchema = AccountingSuppliersDeleteRequest$outboundSchema; /** @deprecated use `AccountingSuppliersDeleteRequest$Outbound` instead. */ export type Outbound = AccountingSuppliersDeleteRequest$Outbound; } export function accountingSuppliersDeleteRequestToJSON( accountingSuppliersDeleteRequest: AccountingSuppliersDeleteRequest, ): string { return JSON.stringify( AccountingSuppliersDeleteRequest$outboundSchema.parse( accountingSuppliersDeleteRequest, ), ); } export function accountingSuppliersDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSuppliersDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSuppliersDeleteRequest' from JSON`, ); } /** @internal */ export const AccountingSuppliersDeleteResponse$inboundSchema: z.ZodType< AccountingSuppliersDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteSupplierResponse: components.DeleteSupplierResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteSupplierResponse": "deleteSupplierResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingSuppliersDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteSupplierResponse?: | components.DeleteSupplierResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingSuppliersDeleteResponse$outboundSchema: z.ZodType< AccountingSuppliersDeleteResponse$Outbound, z.ZodTypeDef, AccountingSuppliersDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteSupplierResponse: components.DeleteSupplierResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteSupplierResponse: "DeleteSupplierResponse", 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 AccountingSuppliersDeleteResponse$ { /** @deprecated use `AccountingSuppliersDeleteResponse$inboundSchema` instead. */ export const inboundSchema = AccountingSuppliersDeleteResponse$inboundSchema; /** @deprecated use `AccountingSuppliersDeleteResponse$outboundSchema` instead. */ export const outboundSchema = AccountingSuppliersDeleteResponse$outboundSchema; /** @deprecated use `AccountingSuppliersDeleteResponse$Outbound` instead. */ export type Outbound = AccountingSuppliersDeleteResponse$Outbound; } export function accountingSuppliersDeleteResponseToJSON( accountingSuppliersDeleteResponse: AccountingSuppliersDeleteResponse, ): string { return JSON.stringify( AccountingSuppliersDeleteResponse$outboundSchema.parse( accountingSuppliersDeleteResponse, ), ); } export function accountingSuppliersDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingSuppliersDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingSuppliersDeleteResponse' from JSON`, ); }