"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.UnprocessableEntityResponseError2$ = exports.UnprocessableEntityResponseError2$outboundSchema = exports.UnprocessableEntityResponseError2$inboundSchema = exports.UnprocessableEntityResponseError1$ = exports.UnprocessableEntityResponseError1$outboundSchema = exports.UnprocessableEntityResponseError1$inboundSchema = exports.UnprocessableEntityResponseImsxCodeMinor$ = exports.UnprocessableEntityResponseImsxCodeMinor$outboundSchema = exports.UnprocessableEntityResponseImsxCodeMinor$inboundSchema = exports.UnprocessableEntityResponseImsxCodeMinorField1$ = exports.UnprocessableEntityResponseImsxCodeMinorField1$outboundSchema = exports.UnprocessableEntityResponseImsxCodeMinorField1$inboundSchema = exports.UnprocessableEntityResponseError2 = exports.UnprocessableEntityResponseError1 = void 0;
exports.unprocessableEntityResponseImsxCodeMinorField1ToJSON = unprocessableEntityResponseImsxCodeMinorField1ToJSON;
exports.unprocessableEntityResponseImsxCodeMinorField1FromJSON = unprocessableEntityResponseImsxCodeMinorField1FromJSON;
exports.unprocessableEntityResponseImsxCodeMinorToJSON = unprocessableEntityResponseImsxCodeMinorToJSON;
exports.unprocessableEntityResponseImsxCodeMinorFromJSON = unprocessableEntityResponseImsxCodeMinorFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
class UnprocessableEntityResponseError1 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 = "UnprocessableEntityResponseError1";
    }
}
exports.UnprocessableEntityResponseError1 = UnprocessableEntityResponseError1;
class UnprocessableEntityResponseError2 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 = "UnprocessableEntityResponseError2";
    }
}
exports.UnprocessableEntityResponseError2 = UnprocessableEntityResponseError2;
/** @internal */
exports.UnprocessableEntityResponseImsxCodeMinorField1$inboundSchema = z.object({
    imsx_codeMinorFieldName: z.literal("TargetEndSystem").optional(),
    imsx_codeMinorFieldValue: z.literal("invaliddata").optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "imsx_codeMinorFieldName": "imsxCodeMinorFieldName",
        "imsx_codeMinorFieldValue": "imsxCodeMinorFieldValue",
    });
});
/** @internal */
exports.UnprocessableEntityResponseImsxCodeMinorField1$outboundSchema = z.object({
    imsxCodeMinorFieldName: z.literal("TargetEndSystem").default("TargetEndSystem"),
    imsxCodeMinorFieldValue: z.literal("invaliddata").default("invaliddata"),
}).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 UnprocessableEntityResponseImsxCodeMinorField1$;
(function (UnprocessableEntityResponseImsxCodeMinorField1$) {
    /** @deprecated use `UnprocessableEntityResponseImsxCodeMinorField1$inboundSchema` instead. */
    UnprocessableEntityResponseImsxCodeMinorField1$.inboundSchema = exports.UnprocessableEntityResponseImsxCodeMinorField1$inboundSchema;
    /** @deprecated use `UnprocessableEntityResponseImsxCodeMinorField1$outboundSchema` instead. */
    UnprocessableEntityResponseImsxCodeMinorField1$.outboundSchema = exports.UnprocessableEntityResponseImsxCodeMinorField1$outboundSchema;
})(UnprocessableEntityResponseImsxCodeMinorField1$ || (exports.UnprocessableEntityResponseImsxCodeMinorField1$ = UnprocessableEntityResponseImsxCodeMinorField1$ = {}));
function unprocessableEntityResponseImsxCodeMinorField1ToJSON(unprocessableEntityResponseImsxCodeMinorField1) {
    return JSON.stringify(exports.UnprocessableEntityResponseImsxCodeMinorField1$outboundSchema.parse(unprocessableEntityResponseImsxCodeMinorField1));
}
function unprocessableEntityResponseImsxCodeMinorField1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UnprocessableEntityResponseImsxCodeMinorField1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnprocessableEntityResponseImsxCodeMinorField1' from JSON`);
}
/** @internal */
exports.UnprocessableEntityResponseImsxCodeMinor$inboundSchema = z.object({
    imsx_codeMinorField: z.array(z.lazy(() => exports.UnprocessableEntityResponseImsxCodeMinorField1$inboundSchema)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "imsx_codeMinorField": "imsxCodeMinorField",
    });
});
/** @internal */
exports.UnprocessableEntityResponseImsxCodeMinor$outboundSchema = z.object({
    imsxCodeMinorField: z.array(z.lazy(() => exports.UnprocessableEntityResponseImsxCodeMinorField1$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 UnprocessableEntityResponseImsxCodeMinor$;
(function (UnprocessableEntityResponseImsxCodeMinor$) {
    /** @deprecated use `UnprocessableEntityResponseImsxCodeMinor$inboundSchema` instead. */
    UnprocessableEntityResponseImsxCodeMinor$.inboundSchema = exports.UnprocessableEntityResponseImsxCodeMinor$inboundSchema;
    /** @deprecated use `UnprocessableEntityResponseImsxCodeMinor$outboundSchema` instead. */
    UnprocessableEntityResponseImsxCodeMinor$.outboundSchema = exports.UnprocessableEntityResponseImsxCodeMinor$outboundSchema;
})(UnprocessableEntityResponseImsxCodeMinor$ || (exports.UnprocessableEntityResponseImsxCodeMinor$ = UnprocessableEntityResponseImsxCodeMinor$ = {}));
function unprocessableEntityResponseImsxCodeMinorToJSON(unprocessableEntityResponseImsxCodeMinor) {
    return JSON.stringify(exports.UnprocessableEntityResponseImsxCodeMinor$outboundSchema.parse(unprocessableEntityResponseImsxCodeMinor));
}
function unprocessableEntityResponseImsxCodeMinorFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UnprocessableEntityResponseImsxCodeMinor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UnprocessableEntityResponseImsxCodeMinor' from JSON`);
}
/** @internal */
exports.UnprocessableEntityResponseError1$inboundSchema = z.object({
    imsx_codeMajor: z.literal("failure"),
    imsx_severity: z.literal("error"),
    imsx_description: z.string(),
    imsx_CodeMinor: z.lazy(() => exports.UnprocessableEntityResponseImsxCodeMinor$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 UnprocessableEntityResponseError1(remapped);
});
/** @internal */
exports.UnprocessableEntityResponseError1$outboundSchema = z.instanceof(UnprocessableEntityResponseError1)
    .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.UnprocessableEntityResponseImsxCodeMinor$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 UnprocessableEntityResponseError1$;
(function (UnprocessableEntityResponseError1$) {
    /** @deprecated use `UnprocessableEntityResponseError1$inboundSchema` instead. */
    UnprocessableEntityResponseError1$.inboundSchema = exports.UnprocessableEntityResponseError1$inboundSchema;
    /** @deprecated use `UnprocessableEntityResponseError1$outboundSchema` instead. */
    UnprocessableEntityResponseError1$.outboundSchema = exports.UnprocessableEntityResponseError1$outboundSchema;
})(UnprocessableEntityResponseError1$ || (exports.UnprocessableEntityResponseError1$ = UnprocessableEntityResponseError1$ = {}));
/** @internal */
exports.UnprocessableEntityResponseError2$inboundSchema = z.object({
    imsx_codeMajor: z.literal("failure"),
    imsx_severity: z.literal("error"),
    imsx_description: z.string(),
    imsx_CodeMinor: z.lazy(() => exports.UnprocessableEntityResponseImsxCodeMinor$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 UnprocessableEntityResponseError2(remapped);
});
/** @internal */
exports.UnprocessableEntityResponseError2$outboundSchema = z.instanceof(UnprocessableEntityResponseError2)
    .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.UnprocessableEntityResponseImsxCodeMinor$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 UnprocessableEntityResponseError2$;
(function (UnprocessableEntityResponseError2$) {
    /** @deprecated use `UnprocessableEntityResponseError2$inboundSchema` instead. */
    UnprocessableEntityResponseError2$.inboundSchema = exports.UnprocessableEntityResponseError2$inboundSchema;
    /** @deprecated use `UnprocessableEntityResponseError2$outboundSchema` instead. */
    UnprocessableEntityResponseError2$.outboundSchema = exports.UnprocessableEntityResponseError2$outboundSchema;
})(UnprocessableEntityResponseError2$ || (exports.UnprocessableEntityResponseError2$ = UnprocessableEntityResponseError2$ = {}));
//# sourceMappingURL=unprocessableentityresponseerror1.js.map