/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
export 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";
    }
}
export 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";
    }
}
/** @internal */
export const NotFoundResponseImsxCodeMinorField1$inboundSchema = z.object({
    imsx_codeMinorFieldName: z.literal("TargetEndSystem").optional(),
    imsx_codeMinorFieldValue: z.literal("unknownobject").optional(),
}).transform((v) => {
    return remap$(v, {
        "imsx_codeMinorFieldName": "imsxCodeMinorFieldName",
        "imsx_codeMinorFieldValue": "imsxCodeMinorFieldValue",
    });
});
/** @internal */
export const NotFoundResponseImsxCodeMinorField1$outboundSchema = z.object({
    imsxCodeMinorFieldName: z.literal("TargetEndSystem").default("TargetEndSystem"),
    imsxCodeMinorFieldValue: z.literal("unknownobject").default("unknownobject"),
}).transform((v) => {
    return 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.
 */
export var NotFoundResponseImsxCodeMinorField1$;
(function (NotFoundResponseImsxCodeMinorField1$) {
    /** @deprecated use `NotFoundResponseImsxCodeMinorField1$inboundSchema` instead. */
    NotFoundResponseImsxCodeMinorField1$.inboundSchema = NotFoundResponseImsxCodeMinorField1$inboundSchema;
    /** @deprecated use `NotFoundResponseImsxCodeMinorField1$outboundSchema` instead. */
    NotFoundResponseImsxCodeMinorField1$.outboundSchema = NotFoundResponseImsxCodeMinorField1$outboundSchema;
})(NotFoundResponseImsxCodeMinorField1$ || (NotFoundResponseImsxCodeMinorField1$ = {}));
export function notFoundResponseImsxCodeMinorField1ToJSON(notFoundResponseImsxCodeMinorField1) {
    return JSON.stringify(NotFoundResponseImsxCodeMinorField1$outboundSchema.parse(notFoundResponseImsxCodeMinorField1));
}
export function notFoundResponseImsxCodeMinorField1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => NotFoundResponseImsxCodeMinorField1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NotFoundResponseImsxCodeMinorField1' from JSON`);
}
/** @internal */
export const NotFoundResponseImsxCodeMinor$inboundSchema = z.object({
    imsx_codeMinorField: z.array(z.lazy(() => NotFoundResponseImsxCodeMinorField1$inboundSchema)),
}).transform((v) => {
    return remap$(v, {
        "imsx_codeMinorField": "imsxCodeMinorField",
    });
});
/** @internal */
export const NotFoundResponseImsxCodeMinor$outboundSchema = z.object({
    imsxCodeMinorField: z.array(z.lazy(() => NotFoundResponseImsxCodeMinorField1$outboundSchema)),
}).transform((v) => {
    return 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.
 */
export var NotFoundResponseImsxCodeMinor$;
(function (NotFoundResponseImsxCodeMinor$) {
    /** @deprecated use `NotFoundResponseImsxCodeMinor$inboundSchema` instead. */
    NotFoundResponseImsxCodeMinor$.inboundSchema = NotFoundResponseImsxCodeMinor$inboundSchema;
    /** @deprecated use `NotFoundResponseImsxCodeMinor$outboundSchema` instead. */
    NotFoundResponseImsxCodeMinor$.outboundSchema = NotFoundResponseImsxCodeMinor$outboundSchema;
})(NotFoundResponseImsxCodeMinor$ || (NotFoundResponseImsxCodeMinor$ = {}));
export function notFoundResponseImsxCodeMinorToJSON(notFoundResponseImsxCodeMinor) {
    return JSON.stringify(NotFoundResponseImsxCodeMinor$outboundSchema.parse(notFoundResponseImsxCodeMinor));
}
export function notFoundResponseImsxCodeMinorFromJSON(jsonString) {
    return safeParse(jsonString, (x) => NotFoundResponseImsxCodeMinor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NotFoundResponseImsxCodeMinor' from JSON`);
}
/** @internal */
export const NotFoundResponseError1$inboundSchema = z.object({
    imsx_codeMajor: z.literal("failure"),
    imsx_severity: z.literal("error"),
    imsx_description: z.string(),
    imsx_CodeMinor: z.lazy(() => NotFoundResponseImsxCodeMinor$inboundSchema),
})
    .transform((v) => {
    const remapped = remap$(v, {
        "imsx_codeMajor": "imsxCodeMajor",
        "imsx_severity": "imsxSeverity",
        "imsx_description": "imsxDescription",
        "imsx_CodeMinor": "imsxCodeMinor",
    });
    return new NotFoundResponseError1(remapped);
});
/** @internal */
export const 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(() => NotFoundResponseImsxCodeMinor$outboundSchema),
}).transform((v) => {
    return 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.
 */
export var NotFoundResponseError1$;
(function (NotFoundResponseError1$) {
    /** @deprecated use `NotFoundResponseError1$inboundSchema` instead. */
    NotFoundResponseError1$.inboundSchema = NotFoundResponseError1$inboundSchema;
    /** @deprecated use `NotFoundResponseError1$outboundSchema` instead. */
    NotFoundResponseError1$.outboundSchema = NotFoundResponseError1$outboundSchema;
})(NotFoundResponseError1$ || (NotFoundResponseError1$ = {}));
/** @internal */
export const NotFoundResponseError2$inboundSchema = z.object({
    imsx_codeMajor: z.literal("failure"),
    imsx_severity: z.literal("error"),
    imsx_description: z.string(),
    imsx_CodeMinor: z.lazy(() => NotFoundResponseImsxCodeMinor$inboundSchema),
})
    .transform((v) => {
    const remapped = remap$(v, {
        "imsx_codeMajor": "imsxCodeMajor",
        "imsx_severity": "imsxSeverity",
        "imsx_description": "imsxDescription",
        "imsx_CodeMinor": "imsxCodeMinor",
    });
    return new NotFoundResponseError2(remapped);
});
/** @internal */
export const 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(() => NotFoundResponseImsxCodeMinor$outboundSchema),
}).transform((v) => {
    return 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.
 */
export var NotFoundResponseError2$;
(function (NotFoundResponseError2$) {
    /** @deprecated use `NotFoundResponseError2$inboundSchema` instead. */
    NotFoundResponseError2$.inboundSchema = NotFoundResponseError2$inboundSchema;
    /** @deprecated use `NotFoundResponseError2$outboundSchema` instead. */
    NotFoundResponseError2$.outboundSchema = NotFoundResponseError2$outboundSchema;
})(NotFoundResponseError2$ || (NotFoundResponseError2$ = {}));
//# sourceMappingURL=notfoundresponseerror1.js.map