/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { WistiaError } from "./wistiaerror.js"; /** * Internal server error */ export type GetStatsVisitorsInternalServerErrorData = { error?: string | undefined; }; /** * Internal server error */ export class GetStatsVisitorsInternalServerError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsVisitorsInternalServerErrorData; constructor( err: GetStatsVisitorsInternalServerErrorData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; if (err.error != null) this.error = err.error; this.name = "GetStatsVisitorsInternalServerError"; } } /** * Forbidden, token is valid but account does not have access to feature */ export type GetStatsVisitorsForbiddenErrorData = { error?: string | undefined; }; /** * Forbidden, token is valid but account does not have access to feature */ export class GetStatsVisitorsForbiddenError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsVisitorsForbiddenErrorData; constructor( err: GetStatsVisitorsForbiddenErrorData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; if (err.error != null) this.error = err.error; this.name = "GetStatsVisitorsForbiddenError"; } } /** * Unauthorized, invalid or missing token */ export type GetStatsVisitorsUnauthorizedErrorData = { error?: string | undefined; }; /** * Unauthorized, invalid or missing token */ export class GetStatsVisitorsUnauthorizedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsVisitorsUnauthorizedErrorData; constructor( err: GetStatsVisitorsUnauthorizedErrorData, httpMeta: { response: Response; request: Request; body: string }, ) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; super(message, httpMeta); this.data$ = err; if (err.error != null) this.error = err.error; this.name = "GetStatsVisitorsUnauthorizedError"; } } /** @internal */ export const GetStatsVisitorsInternalServerError$inboundSchema: z.ZodType< GetStatsVisitorsInternalServerError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsVisitorsInternalServerError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const GetStatsVisitorsForbiddenError$inboundSchema: z.ZodType< GetStatsVisitorsForbiddenError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsVisitorsForbiddenError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const GetStatsVisitorsUnauthorizedError$inboundSchema: z.ZodType< GetStatsVisitorsUnauthorizedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsVisitorsUnauthorizedError(v, { request: v.request$, response: v.response$, body: v.body$, }); });