/* * 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 AccountingBillsDeleteGlobals = { /** * 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 AccountingBillsDeleteRequest = { /** * 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 AccountingBillsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Bill deleted */ deleteBillResponse?: components.DeleteBillResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const AccountingBillsDeleteGlobals$inboundSchema: z.ZodType< AccountingBillsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type AccountingBillsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const AccountingBillsDeleteGlobals$outboundSchema: z.ZodType< AccountingBillsDeleteGlobals$Outbound, z.ZodTypeDef, AccountingBillsDeleteGlobals > = 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 AccountingBillsDeleteGlobals$ { /** @deprecated use `AccountingBillsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = AccountingBillsDeleteGlobals$inboundSchema; /** @deprecated use `AccountingBillsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = AccountingBillsDeleteGlobals$outboundSchema; /** @deprecated use `AccountingBillsDeleteGlobals$Outbound` instead. */ export type Outbound = AccountingBillsDeleteGlobals$Outbound; } export function accountingBillsDeleteGlobalsToJSON( accountingBillsDeleteGlobals: AccountingBillsDeleteGlobals, ): string { return JSON.stringify( AccountingBillsDeleteGlobals$outboundSchema.parse( accountingBillsDeleteGlobals, ), ); } export function accountingBillsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillsDeleteGlobals' from JSON`, ); } /** @internal */ export const AccountingBillsDeleteRequest$inboundSchema: z.ZodType< AccountingBillsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type AccountingBillsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const AccountingBillsDeleteRequest$outboundSchema: z.ZodType< AccountingBillsDeleteRequest$Outbound, z.ZodTypeDef, AccountingBillsDeleteRequest > = 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 AccountingBillsDeleteRequest$ { /** @deprecated use `AccountingBillsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = AccountingBillsDeleteRequest$inboundSchema; /** @deprecated use `AccountingBillsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = AccountingBillsDeleteRequest$outboundSchema; /** @deprecated use `AccountingBillsDeleteRequest$Outbound` instead. */ export type Outbound = AccountingBillsDeleteRequest$Outbound; } export function accountingBillsDeleteRequestToJSON( accountingBillsDeleteRequest: AccountingBillsDeleteRequest, ): string { return JSON.stringify( AccountingBillsDeleteRequest$outboundSchema.parse( accountingBillsDeleteRequest, ), ); } export function accountingBillsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillsDeleteRequest' from JSON`, ); } /** @internal */ export const AccountingBillsDeleteResponse$inboundSchema: z.ZodType< AccountingBillsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteBillResponse: components.DeleteBillResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteBillResponse": "deleteBillResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type AccountingBillsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteBillResponse?: components.DeleteBillResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const AccountingBillsDeleteResponse$outboundSchema: z.ZodType< AccountingBillsDeleteResponse$Outbound, z.ZodTypeDef, AccountingBillsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteBillResponse: components.DeleteBillResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteBillResponse: "DeleteBillResponse", 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 AccountingBillsDeleteResponse$ { /** @deprecated use `AccountingBillsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = AccountingBillsDeleteResponse$inboundSchema; /** @deprecated use `AccountingBillsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = AccountingBillsDeleteResponse$outboundSchema; /** @deprecated use `AccountingBillsDeleteResponse$Outbound` instead. */ export type Outbound = AccountingBillsDeleteResponse$Outbound; } export function accountingBillsDeleteResponseToJSON( accountingBillsDeleteResponse: AccountingBillsDeleteResponse, ): string { return JSON.stringify( AccountingBillsDeleteResponse$outboundSchema.parse( accountingBillsDeleteResponse, ), ); } export function accountingBillsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountingBillsDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountingBillsDeleteResponse' from JSON`, ); }