/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; /** * Standard error response object */ export type PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponseData = { error: string; code?: string | undefined; details?: any | null | undefined; }; /** * Standard error response object */ export class PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse extends Error { error: string; code?: string | undefined; details?: any | null | undefined; /** The original data that was passed to this error instance. */ data$: PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponseData; constructor( err: PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponseData, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message); this.data$ = err; this.error = err.error; if (err.code != null) this.code = err.code; if (err.details != null) this.details = err.details; this.name = "PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse"; } } /** @internal */ export const PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$inboundSchema: z.ZodType< PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse, z.ZodTypeDef, unknown > = z.object({ error: z.string(), code: z.string().optional(), details: z.nullable(z.any()).optional(), }) .transform((v) => { return new PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse(v); }); /** @internal */ export type PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$Outbound = { error: string; code?: string | undefined; details?: any | null | undefined; }; /** @internal */ export const PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$outboundSchema: z.ZodType< PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$Outbound, z.ZodTypeDef, PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse > = z.instanceof(PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse) .transform(v => v.data$) .pipe(z.object({ error: z.string(), code: z.string().optional(), details: z.nullable(z.any()).optional(), })); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$ { /** @deprecated use `PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$inboundSchema` instead. */ export const inboundSchema = PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$inboundSchema; /** @deprecated use `PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$outboundSchema` instead. */ export const outboundSchema = PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$outboundSchema; /** @deprecated use `PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$Outbound` instead. */ export type Outbound = PostApiLeadScraperMicroserviceApiV1WebhooksErrorResponse$Outbound; }