/* * 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 GetStatsEventsInternalServerErrorData = { error?: string | undefined; }; /** * Internal server error */ export class GetStatsEventsInternalServerError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsEventsInternalServerErrorData; constructor( err: GetStatsEventsInternalServerErrorData, 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 = "GetStatsEventsInternalServerError"; } } /** * Unprocessable entity, the request parameters were invalid. */ export type GetStatsEventsUnprocessableEntityErrorData = { /** * Error message describing why the request could not be processed. */ error?: string | undefined; }; /** * Unprocessable entity, the request parameters were invalid. */ export class GetStatsEventsUnprocessableEntityError extends WistiaError { /** * Error message describing why the request could not be processed. */ error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsEventsUnprocessableEntityErrorData; constructor( err: GetStatsEventsUnprocessableEntityErrorData, 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 = "GetStatsEventsUnprocessableEntityError"; } } /** * Forbidden, token is valid but account does not have access to feature */ export type GetStatsEventsForbiddenErrorData = { error?: string | undefined; }; /** * Forbidden, token is valid but account does not have access to feature */ export class GetStatsEventsForbiddenError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsEventsForbiddenErrorData; constructor( err: GetStatsEventsForbiddenErrorData, 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 = "GetStatsEventsForbiddenError"; } } /** * Unauthorized, invalid or missing token */ export type GetStatsEventsUnauthorizedErrorData = { error?: string | undefined; }; /** * Unauthorized, invalid or missing token */ export class GetStatsEventsUnauthorizedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsEventsUnauthorizedErrorData; constructor( err: GetStatsEventsUnauthorizedErrorData, 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 = "GetStatsEventsUnauthorizedError"; } } /** @internal */ export const GetStatsEventsInternalServerError$inboundSchema: z.ZodType< GetStatsEventsInternalServerError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsEventsInternalServerError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const GetStatsEventsUnprocessableEntityError$inboundSchema: z.ZodType< GetStatsEventsUnprocessableEntityError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsEventsUnprocessableEntityError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const GetStatsEventsForbiddenError$inboundSchema: z.ZodType< GetStatsEventsForbiddenError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsEventsForbiddenError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const GetStatsEventsUnauthorizedError$inboundSchema: z.ZodType< GetStatsEventsUnauthorizedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsEventsUnauthorizedError(v, { request: v.request$, response: v.response$, body: v.body$, }); });