"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.ForbiddenResponseError2$ = exports.ForbiddenResponseError2$outboundSchema = exports.ForbiddenResponseError2$inboundSchema = exports.ForbiddenResponseError1$ = exports.ForbiddenResponseError1$outboundSchema = exports.ForbiddenResponseError1$inboundSchema = exports.ForbiddenResponseImsxCodeMinor$ = exports.ForbiddenResponseImsxCodeMinor$outboundSchema = exports.ForbiddenResponseImsxCodeMinor$inboundSchema = exports.ForbiddenResponseImsxCodeMinorField1$ = exports.ForbiddenResponseImsxCodeMinorField1$outboundSchema = exports.ForbiddenResponseImsxCodeMinorField1$inboundSchema = exports.ForbiddenResponseError2 = exports.ForbiddenResponseError1 = void 0;
exports.forbiddenResponseImsxCodeMinorField1ToJSON = forbiddenResponseImsxCodeMinorField1ToJSON;
exports.forbiddenResponseImsxCodeMinorField1FromJSON = forbiddenResponseImsxCodeMinorField1FromJSON;
exports.forbiddenResponseImsxCodeMinorToJSON = forbiddenResponseImsxCodeMinorToJSON;
exports.forbiddenResponseImsxCodeMinorFromJSON = forbiddenResponseImsxCodeMinorFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
class ForbiddenResponseError1 extends Error {
    constructor(err) {
        const message = "message" in err && typeof err.message === "string"
            ? err.message
            : `API error occurred: ${JSON.stringify(err)}`;
        super(message);
        this.data$ = err;
        this.imsxCodeMajor = err.imsxCodeMajor;
        this.imsxSeverity = err.imsxSeverity;
        this.imsxDescription = err.imsxDescription;
        this.imsxCodeMinor = err.imsxCodeMinor;
        this.name = "ForbiddenResponseError1";
    }
}
exports.ForbiddenResponseError1 = ForbiddenResponseError1;
class ForbiddenResponseError2 extends Error {
    constructor(err) {
        const message = "message" in err && typeof err.message === "string"
            ? err.message
            : `API error occurred: ${JSON.stringify(err)}`;
        super(message);
        this.data$ = err;
        this.imsxCodeMajor = err.imsxCodeMajor;
        this.imsxSeverity = err.imsxSeverity;
        this.imsxDescription = err.imsxDescription;
        this.imsxCodeMinor = err.imsxCodeMinor;
        this.name = "ForbiddenResponseError2";
    }
}
exports.ForbiddenResponseError2 = ForbiddenResponseError2;
/** @internal */
exports.ForbiddenResponseImsxCodeMinorField1$inboundSchema = z.object({
    imsx_codeMinorFieldName: z.literal("TargetEndSystem").optional(),
    imsx_codeMinorFieldValue: z.literal("forbidden").optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "imsx_codeMinorFieldName": "imsxCodeMinorFieldName",
        "imsx_codeMinorFieldValue": "imsxCodeMinorFieldValue",
    });
});
/** @internal */
exports.ForbiddenResponseImsxCodeMinorField1$outboundSchema = z.object({
    imsxCodeMinorFieldName: z.literal("TargetEndSystem").default("TargetEndSystem"),
    imsxCodeMinorFieldValue: z.literal("forbidden").default("forbidden"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        imsxCodeMinorFieldName: "imsx_codeMinorFieldName",
        imsxCodeMinorFieldValue: "imsx_codeMinorFieldValue",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ForbiddenResponseImsxCodeMinorField1$;
(function (ForbiddenResponseImsxCodeMinorField1$) {
    /** @deprecated use `ForbiddenResponseImsxCodeMinorField1$inboundSchema` instead. */
    ForbiddenResponseImsxCodeMinorField1$.inboundSchema = exports.ForbiddenResponseImsxCodeMinorField1$inboundSchema;
    /** @deprecated use `ForbiddenResponseImsxCodeMinorField1$outboundSchema` instead. */
    ForbiddenResponseImsxCodeMinorField1$.outboundSchema = exports.ForbiddenResponseImsxCodeMinorField1$outboundSchema;
})(ForbiddenResponseImsxCodeMinorField1$ || (exports.ForbiddenResponseImsxCodeMinorField1$ = ForbiddenResponseImsxCodeMinorField1$ = {}));
function forbiddenResponseImsxCodeMinorField1ToJSON(forbiddenResponseImsxCodeMinorField1) {
    return JSON.stringify(exports.ForbiddenResponseImsxCodeMinorField1$outboundSchema.parse(forbiddenResponseImsxCodeMinorField1));
}
function forbiddenResponseImsxCodeMinorField1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ForbiddenResponseImsxCodeMinorField1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ForbiddenResponseImsxCodeMinorField1' from JSON`);
}
/** @internal */
exports.ForbiddenResponseImsxCodeMinor$inboundSchema = z.object({
    imsx_codeMinorField: z.array(z.lazy(() => exports.ForbiddenResponseImsxCodeMinorField1$inboundSchema)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "imsx_codeMinorField": "imsxCodeMinorField",
    });
});
/** @internal */
exports.ForbiddenResponseImsxCodeMinor$outboundSchema = z.object({
    imsxCodeMinorField: z.array(z.lazy(() => exports.ForbiddenResponseImsxCodeMinorField1$outboundSchema)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        imsxCodeMinorField: "imsx_codeMinorField",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ForbiddenResponseImsxCodeMinor$;
(function (ForbiddenResponseImsxCodeMinor$) {
    /** @deprecated use `ForbiddenResponseImsxCodeMinor$inboundSchema` instead. */
    ForbiddenResponseImsxCodeMinor$.inboundSchema = exports.ForbiddenResponseImsxCodeMinor$inboundSchema;
    /** @deprecated use `ForbiddenResponseImsxCodeMinor$outboundSchema` instead. */
    ForbiddenResponseImsxCodeMinor$.outboundSchema = exports.ForbiddenResponseImsxCodeMinor$outboundSchema;
})(ForbiddenResponseImsxCodeMinor$ || (exports.ForbiddenResponseImsxCodeMinor$ = ForbiddenResponseImsxCodeMinor$ = {}));
function forbiddenResponseImsxCodeMinorToJSON(forbiddenResponseImsxCodeMinor) {
    return JSON.stringify(exports.ForbiddenResponseImsxCodeMinor$outboundSchema.parse(forbiddenResponseImsxCodeMinor));
}
function forbiddenResponseImsxCodeMinorFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ForbiddenResponseImsxCodeMinor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ForbiddenResponseImsxCodeMinor' from JSON`);
}
/** @internal */
exports.ForbiddenResponseError1$inboundSchema = z.object({
    imsx_codeMajor: z.literal("failure"),
    imsx_severity: z.literal("error"),
    imsx_description: z.string(),
    imsx_CodeMinor: z.lazy(() => exports.ForbiddenResponseImsxCodeMinor$inboundSchema),
})
    .transform((v) => {
    const remapped = (0, primitives_js_1.remap)(v, {
        "imsx_codeMajor": "imsxCodeMajor",
        "imsx_severity": "imsxSeverity",
        "imsx_description": "imsxDescription",
        "imsx_CodeMinor": "imsxCodeMinor",
    });
    return new ForbiddenResponseError1(remapped);
});
/** @internal */
exports.ForbiddenResponseError1$outboundSchema = z.instanceof(ForbiddenResponseError1)
    .transform(v => v.data$)
    .pipe(z.object({
    imsxCodeMajor: z.literal("failure").default("failure"),
    imsxSeverity: z.literal("error").default("error"),
    imsxDescription: z.string(),
    imsxCodeMinor: z.lazy(() => exports.ForbiddenResponseImsxCodeMinor$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        imsxCodeMajor: "imsx_codeMajor",
        imsxSeverity: "imsx_severity",
        imsxDescription: "imsx_description",
        imsxCodeMinor: "imsx_CodeMinor",
    });
}));
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ForbiddenResponseError1$;
(function (ForbiddenResponseError1$) {
    /** @deprecated use `ForbiddenResponseError1$inboundSchema` instead. */
    ForbiddenResponseError1$.inboundSchema = exports.ForbiddenResponseError1$inboundSchema;
    /** @deprecated use `ForbiddenResponseError1$outboundSchema` instead. */
    ForbiddenResponseError1$.outboundSchema = exports.ForbiddenResponseError1$outboundSchema;
})(ForbiddenResponseError1$ || (exports.ForbiddenResponseError1$ = ForbiddenResponseError1$ = {}));
/** @internal */
exports.ForbiddenResponseError2$inboundSchema = z.object({
    imsx_codeMajor: z.literal("failure"),
    imsx_severity: z.literal("error"),
    imsx_description: z.string(),
    imsx_CodeMinor: z.lazy(() => exports.ForbiddenResponseImsxCodeMinor$inboundSchema),
})
    .transform((v) => {
    const remapped = (0, primitives_js_1.remap)(v, {
        "imsx_codeMajor": "imsxCodeMajor",
        "imsx_severity": "imsxSeverity",
        "imsx_description": "imsxDescription",
        "imsx_CodeMinor": "imsxCodeMinor",
    });
    return new ForbiddenResponseError2(remapped);
});
/** @internal */
exports.ForbiddenResponseError2$outboundSchema = z.instanceof(ForbiddenResponseError2)
    .transform(v => v.data$)
    .pipe(z.object({
    imsxCodeMajor: z.literal("failure").default("failure"),
    imsxSeverity: z.literal("error").default("error"),
    imsxDescription: z.string(),
    imsxCodeMinor: z.lazy(() => exports.ForbiddenResponseImsxCodeMinor$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        imsxCodeMajor: "imsx_codeMajor",
        imsxSeverity: "imsx_severity",
        imsxDescription: "imsx_description",
        imsxCodeMinor: "imsx_CodeMinor",
    });
}));
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ForbiddenResponseError2$;
(function (ForbiddenResponseError2$) {
    /** @deprecated use `ForbiddenResponseError2$inboundSchema` instead. */
    ForbiddenResponseError2$.inboundSchema = exports.ForbiddenResponseError2$inboundSchema;
    /** @deprecated use `ForbiddenResponseError2$outboundSchema` instead. */
    ForbiddenResponseError2$.outboundSchema = exports.ForbiddenResponseError2$outboundSchema;
})(ForbiddenResponseError2$ || (exports.ForbiddenResponseError2$ = ForbiddenResponseError2$ = {}));
//# sourceMappingURL=forbiddenresponseerror1.js.map