/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { ProveapiError } from "./proveapierror.js"; export type Error404Data = { /** * An error code that describes the problem category of the request. */ code?: number | undefined; /** * The error message describing the problem with the request. */ message: string; }; export class Error404 extends ProveapiError { /** * An error code that describes the problem category of the request. */ code?: number | undefined; /** The original data that was passed to this error instance. */ data$: Error404Data; constructor( err: Error404Data, httpMeta: { response: Response; request: Request; body: string }, ) { const message = err.message || `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; if (err.code != null) this.code = err.code; this.name = "Error404"; } } /** @internal */ export const Error404$inboundSchema: z.ZodType< Error404, z.ZodTypeDef, unknown > = z.object({ code: z.number().int().optional(), message: z.string(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new Error404(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export type Error404$Outbound = { code?: number | undefined; message: string; }; /** @internal */ export const Error404$outboundSchema: z.ZodType< Error404$Outbound, z.ZodTypeDef, Error404 > = z.instanceof(Error404) .transform(v => v.data$) .pipe(z.object({ code: z.number().int().optional(), message: z.string(), })); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Error404$ { /** @deprecated use `Error404$inboundSchema` instead. */ export const inboundSchema = Error404$inboundSchema; /** @deprecated use `Error404$outboundSchema` instead. */ export const outboundSchema = Error404$outboundSchema; /** @deprecated use `Error404$Outbound` instead. */ export type Outbound = Error404$Outbound; }