/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import * as operations from "../operations/index.js";
import { CloudinaryAssetMgmtError } from "./cloudinaryassetmgmterror.js";
/**
 * Authentication failed.
 */
export class ListResourceTypesUnauthorizedError extends 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;
        this.error = err.error;
        this.name = "ListResourceTypesUnauthorizedError";
    }
}
/** @internal */
export const ListResourceTypesUnauthorizedError$inboundSchema = z.object({
    error: z.lazy(() => operations.ListResourceTypesError$inboundSchema),
    request$: z.instanceof(Request),
    response$: z.instanceof(Response),
    body$: z.string(),
})
    .transform((v) => {
    return new ListResourceTypesUnauthorizedError(v, {
        request: v.request$,
        response: v.response$,
        body: v.body$,
    });
});
/** @internal */
export const ListResourceTypesUnauthorizedError$outboundSchema = z.instanceof(ListResourceTypesUnauthorizedError)
    .transform(v => v.data$)
    .pipe(z.object({
    error: z.lazy(() => operations.ListResourceTypesError$outboundSchema),
}));
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ListResourceTypesUnauthorizedError$;
(function (ListResourceTypesUnauthorizedError$) {
    /** @deprecated use `ListResourceTypesUnauthorizedError$inboundSchema` instead. */
    ListResourceTypesUnauthorizedError$.inboundSchema = ListResourceTypesUnauthorizedError$inboundSchema;
    /** @deprecated use `ListResourceTypesUnauthorizedError$outboundSchema` instead. */
    ListResourceTypesUnauthorizedError$.outboundSchema = ListResourceTypesUnauthorizedError$outboundSchema;
})(ListResourceTypesUnauthorizedError$ || (ListResourceTypesUnauthorizedError$ = {}));
//# sourceMappingURL=listresourcetypes.js.map