/* * 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 PostMediasMediaHashedIdCopyInternalServerErrorData = { error?: string | undefined; }; /** * Internal server error */ export class PostMediasMediaHashedIdCopyInternalServerError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasMediaHashedIdCopyInternalServerErrorData; constructor( err: PostMediasMediaHashedIdCopyInternalServerErrorData, 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 = "PostMediasMediaHashedIdCopyInternalServerError"; } } /** * Method not allowed, e.g. trying to copy archived media. */ export type MethodNotAllowedErrorData = { error?: string | undefined; }; /** * Method not allowed, e.g. trying to copy archived media. */ export class MethodNotAllowedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: MethodNotAllowedErrorData; constructor( err: MethodNotAllowedErrorData, 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 = "MethodNotAllowedError"; } } /** * Resource not found */ export type PostMediasMediaHashedIdCopyNotFoundErrorData = { error?: string | undefined; }; /** * Resource not found */ export class PostMediasMediaHashedIdCopyNotFoundError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasMediaHashedIdCopyNotFoundErrorData; constructor( err: PostMediasMediaHashedIdCopyNotFoundErrorData, 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 = "PostMediasMediaHashedIdCopyNotFoundError"; } } /** * Forbidden, token is valid but account does not have access to feature */ export type PostMediasMediaHashedIdCopyForbiddenErrorData = { error?: string | undefined; }; /** * Forbidden, token is valid but account does not have access to feature */ export class PostMediasMediaHashedIdCopyForbiddenError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasMediaHashedIdCopyForbiddenErrorData; constructor( err: PostMediasMediaHashedIdCopyForbiddenErrorData, 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 = "PostMediasMediaHashedIdCopyForbiddenError"; } } /** * Unauthorized, invalid or missing token */ export type PostMediasMediaHashedIdCopyUnauthorizedErrorData = { error?: string | undefined; }; /** * Unauthorized, invalid or missing token */ export class PostMediasMediaHashedIdCopyUnauthorizedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasMediaHashedIdCopyUnauthorizedErrorData; constructor( err: PostMediasMediaHashedIdCopyUnauthorizedErrorData, 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 = "PostMediasMediaHashedIdCopyUnauthorizedError"; } } /** * Bad request, e.g. copy failure. */ export type PostMediasMediaHashedIdCopyBadRequestErrorData = { error?: string | undefined; }; /** * Bad request, e.g. copy failure. */ export class PostMediasMediaHashedIdCopyBadRequestError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PostMediasMediaHashedIdCopyBadRequestErrorData; constructor( err: PostMediasMediaHashedIdCopyBadRequestErrorData, 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 = "PostMediasMediaHashedIdCopyBadRequestError"; } } /** @internal */ export const PostMediasMediaHashedIdCopyInternalServerError$inboundSchema: z.ZodType< PostMediasMediaHashedIdCopyInternalServerError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasMediaHashedIdCopyInternalServerError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const MethodNotAllowedError$inboundSchema: z.ZodType< MethodNotAllowedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new MethodNotAllowedError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasMediaHashedIdCopyNotFoundError$inboundSchema: z.ZodType< PostMediasMediaHashedIdCopyNotFoundError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasMediaHashedIdCopyNotFoundError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasMediaHashedIdCopyForbiddenError$inboundSchema: z.ZodType< PostMediasMediaHashedIdCopyForbiddenError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasMediaHashedIdCopyForbiddenError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasMediaHashedIdCopyUnauthorizedError$inboundSchema: z.ZodType< PostMediasMediaHashedIdCopyUnauthorizedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasMediaHashedIdCopyUnauthorizedError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PostMediasMediaHashedIdCopyBadRequestError$inboundSchema: z.ZodType = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PostMediasMediaHashedIdCopyBadRequestError(v, { request: v.request$, response: v.response$, body: v.body$, }); });