"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.NotFoundResponseError2$ = exports.NotFoundResponseError2$outboundSchema = exports.NotFoundResponseError2$inboundSchema = exports.NotFoundResponseError1$ = exports.NotFoundResponseError1$outboundSchema = exports.NotFoundResponseError1$inboundSchema = exports.NotFoundResponseImsxCodeMinor$ = exports.NotFoundResponseImsxCodeMinor$outboundSchema = exports.NotFoundResponseImsxCodeMinor$inboundSchema = exports.NotFoundResponseImsxCodeMinorField1$ = exports.NotFoundResponseImsxCodeMinorField1$outboundSchema = exports.NotFoundResponseImsxCodeMinorField1$inboundSchema = exports.NotFoundResponseError2 = exports.NotFoundResponseError1 = void 0;
exports.notFoundResponseImsxCodeMinorField1ToJSON = notFoundResponseImsxCodeMinorField1ToJSON;
exports.notFoundResponseImsxCodeMinorField1FromJSON = notFoundResponseImsxCodeMinorField1FromJSON;
exports.notFoundResponseImsxCodeMinorToJSON = notFoundResponseImsxCodeMinorToJSON;
exports.notFoundResponseImsxCodeMinorFromJSON = notFoundResponseImsxCodeMinorFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
class NotFoundResponseError1 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 = "NotFoundResponseError1";
    }
}
exports.NotFoundResponseError1 = NotFoundResponseError1;
class NotFoundResponseError2 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 = "NotFoundResponseError2";
    }
}
exports.NotFoundResponseError2 = NotFoundResponseError2;
/** @internal */
exports.NotFoundResponseImsxCodeMinorField1$inboundSchema = z.object({
    imsx_codeMinorFieldName: z.literal("TargetEndSystem").optional(),
    imsx_codeMinorFieldValue: z.literal("unknownobject").optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "imsx_codeMinorFieldName": "imsxCodeMinorFieldName",
        "imsx_codeMinorFieldValue": "imsxCodeMinorFieldValue",
    });
});
/** @internal */
exports.NotFoundResponseImsxCodeMinorField1$outboundSchema = z.object({
    imsxCodeMinorFieldName: z.literal("TargetEndSystem").default("TargetEndSystem"),
    imsxCodeMinorFieldValue: z.literal("unknownobject").default("unknownobject"),
}).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 NotFoundResponseImsxCodeMinorField1$;
(function (NotFoundResponseImsxCodeMinorField1$) {
    /** @deprecated use `NotFoundResponseImsxCodeMinorField1$inboundSchema` instead. */
    NotFoundResponseImsxCodeMinorField1$.inboundSchema = exports.NotFoundResponseImsxCodeMinorField1$inboundSchema;
    /** @deprecated use `NotFoundResponseImsxCodeMinorField1$outboundSchema` instead. */
    NotFoundResponseImsxCodeMinorField1$.outboundSchema = exports.NotFoundResponseImsxCodeMinorField1$outboundSchema;
})(NotFoundResponseImsxCodeMinorField1$ || (exports.NotFoundResponseImsxCodeMinorField1$ = NotFoundResponseImsxCodeMinorField1$ = {}));
function notFoundResponseImsxCodeMinorField1ToJSON(notFoundResponseImsxCodeMinorField1) {
    return JSON.stringify(exports.NotFoundResponseImsxCodeMinorField1$outboundSchema.parse(notFoundResponseImsxCodeMinorField1));
}
function notFoundResponseImsxCodeMinorField1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.NotFoundResponseImsxCodeMinorField1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NotFoundResponseImsxCodeMinorField1' from JSON`);
}
/** @internal */
exports.NotFoundResponseImsxCodeMinor$inboundSchema = z.object({
    imsx_codeMinorField: z.array(z.lazy(() => exports.NotFoundResponseImsxCodeMinorField1$inboundSchema)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "imsx_codeMinorField": "imsxCodeMinorField",
    });
});
/** @internal */
exports.NotFoundResponseImsxCodeMinor$outboundSchema = z.object({
    imsxCodeMinorField: z.array(z.lazy(() => exports.NotFoundResponseImsxCodeMinorField1$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 NotFoundResponseImsxCodeMinor$;
(function (NotFoundResponseImsxCodeMinor$) {
    /** @deprecated use `NotFoundResponseImsxCodeMinor$inboundSchema` instead. */
    NotFoundResponseImsxCodeMinor$.inboundSchema = exports.NotFoundResponseImsxCodeMinor$inboundSchema;
    /** @deprecated use `NotFoundResponseImsxCodeMinor$outboundSchema` instead. */
    NotFoundResponseImsxCodeMinor$.outboundSchema = exports.NotFoundResponseImsxCodeMinor$outboundSchema;
})(NotFoundResponseImsxCodeMinor$ || (exports.NotFoundResponseImsxCodeMinor$ = NotFoundResponseImsxCodeMinor$ = {}));
function notFoundResponseImsxCodeMinorToJSON(notFoundResponseImsxCodeMinor) {
    return JSON.stringify(exports.NotFoundResponseImsxCodeMinor$outboundSchema.parse(notFoundResponseImsxCodeMinor));
}
function notFoundResponseImsxCodeMinorFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.NotFoundResponseImsxCodeMinor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NotFoundResponseImsxCodeMinor' from JSON`);
}
/** @internal */
exports.NotFoundResponseError1$inboundSchema = z.object({
    imsx_codeMajor: z.literal("failure"),
    imsx_severity: z.literal("error"),
    imsx_description: z.string(),
    imsx_CodeMinor: z.lazy(() => exports.NotFoundResponseImsxCodeMinor$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 NotFoundResponseError1(remapped);
});
/** @internal */
exports.NotFoundResponseError1$outboundSchema = z.instanceof(NotFoundResponseError1)
    .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.NotFoundResponseImsxCodeMinor$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 NotFoundResponseError1$;
(function (NotFoundResponseError1$) {
    /** @deprecated use `NotFoundResponseError1$inboundSchema` instead. */
    NotFoundResponseError1$.inboundSchema = exports.NotFoundResponseError1$inboundSchema;
    /** @deprecated use `NotFoundResponseError1$outboundSchema` instead. */
    NotFoundResponseError1$.outboundSchema = exports.NotFoundResponseError1$outboundSchema;
})(NotFoundResponseError1$ || (exports.NotFoundResponseError1$ = NotFoundResponseError1$ = {}));
/** @internal */
exports.NotFoundResponseError2$inboundSchema = z.object({
    imsx_codeMajor: z.literal("failure"),
    imsx_severity: z.literal("error"),
    imsx_description: z.string(),
    imsx_CodeMinor: z.lazy(() => exports.NotFoundResponseImsxCodeMinor$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 NotFoundResponseError2(remapped);
});
/** @internal */
exports.NotFoundResponseError2$outboundSchema = z.instanceof(NotFoundResponseError2)
    .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.NotFoundResponseImsxCodeMinor$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 NotFoundResponseError2$;
(function (NotFoundResponseError2$) {
    /** @deprecated use `NotFoundResponseError2$inboundSchema` instead. */
    NotFoundResponseError2$.inboundSchema = exports.NotFoundResponseError2$inboundSchema;
    /** @deprecated use `NotFoundResponseError2$outboundSchema` instead. */
    NotFoundResponseError2$.outboundSchema = exports.NotFoundResponseError2$outboundSchema;
})(NotFoundResponseError2$ || (exports.NotFoundResponseError2$ = NotFoundResponseError2$ = {}));
//# sourceMappingURL=notfoundresponseerror1.js.map