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