/*
 * 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";
import { ErrorCategory$inboundSchema, ErrorCategory$outboundSchema, } from "./errorcategory.js";
/** @internal */
export const Details$inboundSchema = z.object({});
/** @internal */
export const Details$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Details$;
(function (Details$) {
    /** @deprecated use `Details$inboundSchema` instead. */
    Details$.inboundSchema = Details$inboundSchema;
    /** @deprecated use `Details$outboundSchema` instead. */
    Details$.outboundSchema = Details$outboundSchema;
})(Details$ || (Details$ = {}));
export function detailsToJSON(details) {
    return JSON.stringify(Details$outboundSchema.parse(details));
}
export function detailsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Details$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Details' from JSON`);
}
/** @internal */
export const ErrorObject$inboundSchema = z.object({
    category: ErrorCategory$inboundSchema.optional(),
    code: z.string().optional(),
    message: z.string().optional(),
    details: z.lazy(() => Details$inboundSchema).optional(),
    request_id: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "request_id": "requestId",
    });
});
/** @internal */
export const ErrorObject$outboundSchema = z.object({
    category: ErrorCategory$outboundSchema.optional(),
    code: z.string().optional(),
    message: z.string().optional(),
    details: z.lazy(() => Details$outboundSchema).optional(),
    requestId: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        requestId: "request_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ErrorObject$;
(function (ErrorObject$) {
    /** @deprecated use `ErrorObject$inboundSchema` instead. */
    ErrorObject$.inboundSchema = ErrorObject$inboundSchema;
    /** @deprecated use `ErrorObject$outboundSchema` instead. */
    ErrorObject$.outboundSchema = ErrorObject$outboundSchema;
})(ErrorObject$ || (ErrorObject$ = {}));
export function errorObjectToJSON(errorObject) {
    return JSON.stringify(ErrorObject$outboundSchema.parse(errorObject));
}
export function errorObjectFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ErrorObject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorObject' from JSON`);
}
//# sourceMappingURL=errorobject.js.map