/* * 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 PutMediasRestoreInternalServerErrorData = { error?: string | undefined; }; /** * Internal server error */ export class PutMediasRestoreInternalServerError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PutMediasRestoreInternalServerErrorData; constructor( err: PutMediasRestoreInternalServerErrorData, 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 = "PutMediasRestoreInternalServerError"; } } /** * Missing arguments for restoration of media. */ export type PutMediasRestoreUnprocessableEntityErrorData = { /** * An error message that the necessary parameters were not provided. */ error?: string | undefined; }; /** * Missing arguments for restoration of media. */ export class PutMediasRestoreUnprocessableEntityError extends WistiaError { /** * An error message that the necessary parameters were not provided. */ error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PutMediasRestoreUnprocessableEntityErrorData; constructor( err: PutMediasRestoreUnprocessableEntityErrorData, 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 = "PutMediasRestoreUnprocessableEntityError"; } } /** * Resource not found */ export type PutMediasRestoreNotFoundErrorData = { error?: string | undefined; }; /** * Resource not found */ export class PutMediasRestoreNotFoundError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PutMediasRestoreNotFoundErrorData; constructor( err: PutMediasRestoreNotFoundErrorData, 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 = "PutMediasRestoreNotFoundError"; } } /** * Forbidden, e.g. account does not have access to archiving. */ export type PutMediasRestoreForbiddenErrorData = { error?: string | undefined; }; /** * Forbidden, e.g. account does not have access to archiving. */ export class PutMediasRestoreForbiddenError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PutMediasRestoreForbiddenErrorData; constructor( err: PutMediasRestoreForbiddenErrorData, 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 = "PutMediasRestoreForbiddenError"; } } /** * Unauthorized, invalid or missing token */ export type PutMediasRestoreUnauthorizedErrorData = { error?: string | undefined; }; /** * Unauthorized, invalid or missing token */ export class PutMediasRestoreUnauthorizedError extends WistiaError { error?: string | undefined; /** The original data that was passed to this error instance. */ data$: PutMediasRestoreUnauthorizedErrorData; constructor( err: PutMediasRestoreUnauthorizedErrorData, 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 = "PutMediasRestoreUnauthorizedError"; } } /** @internal */ export const PutMediasRestoreInternalServerError$inboundSchema: z.ZodType< PutMediasRestoreInternalServerError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PutMediasRestoreInternalServerError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PutMediasRestoreUnprocessableEntityError$inboundSchema: z.ZodType< PutMediasRestoreUnprocessableEntityError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PutMediasRestoreUnprocessableEntityError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PutMediasRestoreNotFoundError$inboundSchema: z.ZodType< PutMediasRestoreNotFoundError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PutMediasRestoreNotFoundError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PutMediasRestoreForbiddenError$inboundSchema: z.ZodType< PutMediasRestoreForbiddenError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PutMediasRestoreForbiddenError(v, { request: v.request$, response: v.response$, body: v.body$, }); }); /** @internal */ export const PutMediasRestoreUnauthorizedError$inboundSchema: z.ZodType< PutMediasRestoreUnauthorizedError, z.ZodTypeDef, unknown > = z.object({ error: z.string().optional(), request$: z.instanceof(Request), response$: z.instanceof(Response), body$: z.string(), }) .transform((v) => { return new PutMediasRestoreUnauthorizedError(v, { request: v.request$, response: v.response$, body: v.body$, }); });