/* * 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 PostMediasImportUrlInternalServerErrorData = { error?: string | undefined; }; /** * Internal server error */ export class PostMediasImportUrlInternalServerError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasImportUrlInternalServerErrorData; constructor( err: PostMediasImportUrlInternalServerErrorData, 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 = "PostMediasImportUrlInternalServerError"; } } /** * Unprocessable entity, the URL domain is not permitted for import. */ export type PostMediasImportUrlUnprocessableEntityErrorData = { /** * Error message detailing why the request failed. */ error?: string | undefined; }; /** * Unprocessable entity, the URL domain is not permitted for import. */ export class PostMediasImportUrlUnprocessableEntityError extends WistiaError { /** * Error message detailing why the request failed. */ error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasImportUrlUnprocessableEntityErrorData; constructor( err: PostMediasImportUrlUnprocessableEntityErrorData, 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 = "PostMediasImportUrlUnprocessableEntityError"; } } /** * Resource not found */ export type PostMediasImportUrlNotFoundErrorData = { error?: string | undefined; }; /** * Resource not found */ export class PostMediasImportUrlNotFoundError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasImportUrlNotFoundErrorData; constructor( err: PostMediasImportUrlNotFoundErrorData, 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 = "PostMediasImportUrlNotFoundError"; } } /** * Forbidden, token is valid but account does not have access to feature */ export type PostMediasImportUrlForbiddenErrorData = { error?: string | undefined; }; /** * Forbidden, token is valid but account does not have access to feature */ export class PostMediasImportUrlForbiddenError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasImportUrlForbiddenErrorData; constructor( err: PostMediasImportUrlForbiddenErrorData, 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 = "PostMediasImportUrlForbiddenError"; } } /** * Unauthorized, invalid or missing token */ export type PostMediasImportUrlUnauthorizedErrorData = { error?: string | undefined; }; /** * Unauthorized, invalid or missing token */ export class PostMediasImportUrlUnauthorizedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasImportUrlUnauthorizedErrorData; constructor( err: PostMediasImportUrlUnauthorizedErrorData, 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 = "PostMediasImportUrlUnauthorizedError"; } } /** * Bad request */ export type PostMediasImportUrlBadRequestErrorData = { /** * Error message detailing the reason for the bad request. */ error?: string | undefined; }; /** * Bad request */ export class PostMediasImportUrlBadRequestError extends WistiaError { /** * Error message detailing the reason for the bad request. */ error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasImportUrlBadRequestErrorData; constructor( err: PostMediasImportUrlBadRequestErrorData, 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 = "PostMediasImportUrlBadRequestError"; } } /** @internal */ export const PostMediasImportUrlInternalServerError$inboundSchema: z.ZodType< PostMediasImportUrlInternalServerError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasImportUrlInternalServerError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasImportUrlUnprocessableEntityError$inboundSchema: z.ZodType< PostMediasImportUrlUnprocessableEntityError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasImportUrlUnprocessableEntityError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasImportUrlNotFoundError$inboundSchema: z.ZodType< PostMediasImportUrlNotFoundError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasImportUrlNotFoundError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasImportUrlForbiddenError$inboundSchema: z.ZodType< PostMediasImportUrlForbiddenError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasImportUrlForbiddenError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasImportUrlUnauthorizedError$inboundSchema: z.ZodType< PostMediasImportUrlUnauthorizedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasImportUrlUnauthorizedError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasImportUrlBadRequestError$inboundSchema: z.ZodType< PostMediasImportUrlBadRequestError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasImportUrlBadRequestError(v, { request: v.request$, response: v.response$, body: v.body$, }); });