/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { WistiaError } from "./wistiaerror.js"; /** * Internal server error during webinar creation */ export type PostWebinarsInternalServerErrorData = { errors?: Array | undefined; }; /** * Internal server error during webinar creation */ export class PostWebinarsInternalServerError extends WistiaError { errors?: Array | undefined; /** The original data that was passed to this error instance. */ data$: PostWebinarsInternalServerErrorData; constructor( err: PostWebinarsInternalServerErrorData, 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.errors != null) this.errors = err.errors; this.name = "PostWebinarsInternalServerError"; } } /** * Validation errors */ export type PostWebinarsUnprocessableEntityErrorData = { errors?: Array | undefined; }; /** * Validation errors */ export class PostWebinarsUnprocessableEntityError extends WistiaError { errors?: Array | undefined; /** The original data that was passed to this error instance. */ data$: PostWebinarsUnprocessableEntityErrorData; constructor( err: PostWebinarsUnprocessableEntityErrorData, 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.errors != null) this.errors = err.errors; this.name = "PostWebinarsUnprocessableEntityError"; } } /** * Webinar feature not available */ export type PostWebinarsForbiddenErrorData = { error?: string | undefined; }; /** * Webinar feature not available */ export class PostWebinarsForbiddenError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostWebinarsForbiddenErrorData; constructor( err: PostWebinarsForbiddenErrorData, 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 = "PostWebinarsForbiddenError"; } } /** * Unauthorized, invalid or missing token */ export type PostWebinarsUnauthorizedErrorData = { error?: string | undefined; }; /** * Unauthorized, invalid or missing token */ export class PostWebinarsUnauthorizedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostWebinarsUnauthorizedErrorData; constructor( err: PostWebinarsUnauthorizedErrorData, 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 = "PostWebinarsUnauthorizedError"; } } /** @internal */ export const PostWebinarsInternalServerError$inboundSchema: z.ZodType< PostWebinarsInternalServerError, z.ZodTypeDef, unknown > = z.object({ errors: z.array(z.string()).optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostWebinarsInternalServerError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostWebinarsUnprocessableEntityError$inboundSchema: z.ZodType< PostWebinarsUnprocessableEntityError, z.ZodTypeDef, unknown > = z.object({ errors: z.array(z.string()).optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostWebinarsUnprocessableEntityError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostWebinarsForbiddenError$inboundSchema: z.ZodType< PostWebinarsForbiddenError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostWebinarsForbiddenError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostWebinarsUnauthorizedError$inboundSchema: z.ZodType< PostWebinarsUnauthorizedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostWebinarsUnauthorizedError(v, { request: v.request$, response: v.response$, body: v.body$, }); });