"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.BadRequestError$ = exports.BadRequestError$outboundSchema = exports.BadRequestError$inboundSchema = exports.DownloadBackupAssetUnauthorizedError$ = exports.DownloadBackupAssetUnauthorizedError$outboundSchema = exports.DownloadBackupAssetUnauthorizedError$inboundSchema = exports.NotFoundError$ = exports.NotFoundError$outboundSchema = exports.NotFoundError$inboundSchema = exports.BadRequestError = exports.DownloadBackupAssetUnauthorizedError = exports.NotFoundError = void 0;
const z = __importStar(require("zod"));
const operations = __importStar(require("../operations/index.js"));
const cloudinaryassetmgmterror_js_1 = require("./cloudinaryassetmgmterror.js");
/**
 * Version not found
 */
class NotFoundError extends cloudinaryassetmgmterror_js_1.CloudinaryAssetMgmtError {
    constructor(err, httpMeta) {
        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 = "NotFoundError";
    }
}
exports.NotFoundError = NotFoundError;
/**
 * Authentication failed
 */
class DownloadBackupAssetUnauthorizedError extends cloudinaryassetmgmterror_js_1.CloudinaryAssetMgmtError {
    constructor(err, httpMeta) {
        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 = "DownloadBackupAssetUnauthorizedError";
    }
}
exports.DownloadBackupAssetUnauthorizedError = DownloadBackupAssetUnauthorizedError;
/**
 * Bad request
 */
class BadRequestError extends cloudinaryassetmgmterror_js_1.CloudinaryAssetMgmtError {
    constructor(err, httpMeta) {
        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 = "BadRequestError";
    }
}
exports.BadRequestError = BadRequestError;
/** @internal */
exports.NotFoundError$inboundSchema = z.object({
    error: z.lazy(() => operations.NotFoundError$inboundSchema).optional(),
    request$: z.instanceof(Request),
    response$: z.instanceof(Response),
    body$: z.string(),
})
    .transform((v) => {
    return new NotFoundError(v, {
        request: v.request$,
        response: v.response$,
        body: v.body$,
    });
});
/** @internal */
exports.NotFoundError$outboundSchema = z.instanceof(NotFoundError)
    .transform(v => v.data$)
    .pipe(z.object({
    error: z.lazy(() => operations.NotFoundError$outboundSchema).optional(),
}));
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var NotFoundError$;
(function (NotFoundError$) {
    /** @deprecated use `NotFoundError$inboundSchema` instead. */
    NotFoundError$.inboundSchema = exports.NotFoundError$inboundSchema;
    /** @deprecated use `NotFoundError$outboundSchema` instead. */
    NotFoundError$.outboundSchema = exports.NotFoundError$outboundSchema;
})(NotFoundError$ || (exports.NotFoundError$ = NotFoundError$ = {}));
/** @internal */
exports.DownloadBackupAssetUnauthorizedError$inboundSchema = z.object({
    error: z.lazy(() => operations.DownloadBackupAssetUnauthorizedError$inboundSchema).optional(),
    request$: z.instanceof(Request),
    response$: z.instanceof(Response),
    body$: z.string(),
})
    .transform((v) => {
    return new DownloadBackupAssetUnauthorizedError(v, {
        request: v.request$,
        response: v.response$,
        body: v.body$,
    });
});
/** @internal */
exports.DownloadBackupAssetUnauthorizedError$outboundSchema = z.instanceof(DownloadBackupAssetUnauthorizedError)
    .transform(v => v.data$)
    .pipe(z.object({
    error: z.lazy(() => operations.DownloadBackupAssetUnauthorizedError$outboundSchema).optional(),
}));
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var DownloadBackupAssetUnauthorizedError$;
(function (DownloadBackupAssetUnauthorizedError$) {
    /** @deprecated use `DownloadBackupAssetUnauthorizedError$inboundSchema` instead. */
    DownloadBackupAssetUnauthorizedError$.inboundSchema = exports.DownloadBackupAssetUnauthorizedError$inboundSchema;
    /** @deprecated use `DownloadBackupAssetUnauthorizedError$outboundSchema` instead. */
    DownloadBackupAssetUnauthorizedError$.outboundSchema = exports.DownloadBackupAssetUnauthorizedError$outboundSchema;
})(DownloadBackupAssetUnauthorizedError$ || (exports.DownloadBackupAssetUnauthorizedError$ = DownloadBackupAssetUnauthorizedError$ = {}));
/** @internal */
exports.BadRequestError$inboundSchema = z.object({
    error: z.lazy(() => operations.BadRequestError$inboundSchema).optional(),
    request$: z.instanceof(Request),
    response$: z.instanceof(Response),
    body$: z.string(),
})
    .transform((v) => {
    return new BadRequestError(v, {
        request: v.request$,
        response: v.response$,
        body: v.body$,
    });
});
/** @internal */
exports.BadRequestError$outboundSchema = z.instanceof(BadRequestError)
    .transform(v => v.data$)
    .pipe(z.object({
    error: z.lazy(() => operations.BadRequestError$outboundSchema).optional(),
}));
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var BadRequestError$;
(function (BadRequestError$) {
    /** @deprecated use `BadRequestError$inboundSchema` instead. */
    BadRequestError$.inboundSchema = exports.BadRequestError$inboundSchema;
    /** @deprecated use `BadRequestError$outboundSchema` instead. */
    BadRequestError$.outboundSchema = exports.BadRequestError$outboundSchema;
})(BadRequestError$ || (exports.BadRequestError$ = BadRequestError$ = {}));
//# sourceMappingURL=downloadbackupasset.js.map