/* * 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 GetStatsAccountInternalServerErrorData = { error?: string | undefined; }; /** * Internal server error */ export class GetStatsAccountInternalServerError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsAccountInternalServerErrorData; constructor( err: GetStatsAccountInternalServerErrorData, 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 = "GetStatsAccountInternalServerError"; } } /** * Forbidden, token is valid but account does not have access to feature */ export type GetStatsAccountForbiddenErrorData = { error?: string | undefined; }; /** * Forbidden, token is valid but account does not have access to feature */ export class GetStatsAccountForbiddenError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsAccountForbiddenErrorData; constructor( err: GetStatsAccountForbiddenErrorData, 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 = "GetStatsAccountForbiddenError"; } } /** * Unauthorized, invalid or missing token */ export type GetStatsAccountUnauthorizedErrorData = { error?: string | undefined; }; /** * Unauthorized, invalid or missing token */ export class GetStatsAccountUnauthorizedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: GetStatsAccountUnauthorizedErrorData; constructor( err: GetStatsAccountUnauthorizedErrorData, 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 = "GetStatsAccountUnauthorizedError"; } } /** @internal */ export const GetStatsAccountInternalServerError$inboundSchema: z.ZodType< GetStatsAccountInternalServerError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsAccountInternalServerError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const GetStatsAccountForbiddenError$inboundSchema: z.ZodType< GetStatsAccountForbiddenError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsAccountForbiddenError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const GetStatsAccountUnauthorizedError$inboundSchema: z.ZodType< GetStatsAccountUnauthorizedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new GetStatsAccountUnauthorizedError(v, { request: v.request$, response: v.response$, body: v.body$, }); });