/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { WistiaError } from "./wistiaerror.js"; /** * Not implemented - expiring tokens cannot be created from other expiring tokens */ export type NotImplementedErrorData = { error?: string | undefined; }; /** * Not implemented - expiring tokens cannot be created from other expiring tokens */ export class NotImplementedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: NotImplementedErrorData; constructor( err: NotImplementedErrorData, 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 = "NotImplementedError"; } } /** * Internal server error */ export type PostExpiringTokenInternalServerErrorData = { error?: string | undefined; }; /** * Internal server error */ export class PostExpiringTokenInternalServerError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostExpiringTokenInternalServerErrorData; constructor( err: PostExpiringTokenInternalServerErrorData, 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 = "PostExpiringTokenInternalServerError"; } } /** * Unprocessable entity, the request parameters were invalid. */ export type PostExpiringTokenUnprocessableEntityErrorData = { /** * Array of error messages describing what went wrong. */ errors?: Array | undefined; }; /** * Unprocessable entity, the request parameters were invalid. */ export class PostExpiringTokenUnprocessableEntityError extends WistiaError { /** * Array of error messages describing what went wrong. */ errors?: Array | undefined; /** The original data that was passed to this error instance. */ data$: PostExpiringTokenUnprocessableEntityErrorData; constructor( err: PostExpiringTokenUnprocessableEntityErrorData, 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 = "PostExpiringTokenUnprocessableEntityError"; } } /** * Unauthorized, invalid or missing token */ export type PostExpiringTokenUnauthorizedErrorData = { error?: string | undefined; }; /** * Unauthorized, invalid or missing token */ export class PostExpiringTokenUnauthorizedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostExpiringTokenUnauthorizedErrorData; constructor( err: PostExpiringTokenUnauthorizedErrorData, 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 = "PostExpiringTokenUnauthorizedError"; } } /** @internal */ export const NotImplementedError$inboundSchema: z.ZodType< NotImplementedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new NotImplementedError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostExpiringTokenInternalServerError$inboundSchema: z.ZodType< PostExpiringTokenInternalServerError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostExpiringTokenInternalServerError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostExpiringTokenUnprocessableEntityError$inboundSchema: z.ZodType< PostExpiringTokenUnprocessableEntityError, 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 PostExpiringTokenUnprocessableEntityError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostExpiringTokenUnauthorizedError$inboundSchema: z.ZodType< PostExpiringTokenUnauthorizedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostExpiringTokenUnauthorizedError(v, { request: v.request$, response: v.response$, body: v.body$, }); });