"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatModerationRequest$ = exports.ChatModerationRequest$outboundSchema = exports.ChatModerationRequest$inboundSchema = exports.ChatModerationRequestInputs$ = exports.ChatModerationRequestInputs$outboundSchema = exports.ChatModerationRequestInputs$inboundSchema = exports.One$ = exports.One$outboundSchema = exports.One$inboundSchema = exports.Two$ = exports.Two$outboundSchema = exports.Two$inboundSchema = void 0;
exports.twoToJSON = twoToJSON;
exports.twoFromJSON = twoFromJSON;
exports.oneToJSON = oneToJSON;
exports.oneFromJSON = oneFromJSON;
exports.chatModerationRequestInputsToJSON = chatModerationRequestInputsToJSON;
exports.chatModerationRequestInputsFromJSON = chatModerationRequestInputsFromJSON;
exports.chatModerationRequestToJSON = chatModerationRequestToJSON;
exports.chatModerationRequestFromJSON = chatModerationRequestFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const assistantmessage_js_1 = require("./assistantmessage.js");
const systemmessage_js_1 = require("./systemmessage.js");
const toolmessage_js_1 = require("./toolmessage.js");
const usermessage_js_1 = require("./usermessage.js");
/** @internal */
exports.Two$inboundSchema = z.union([
    systemmessage_js_1.SystemMessage$inboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
        role: v.role,
    }))),
    usermessage_js_1.UserMessage$inboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
        role: v.role,
    }))),
    assistantmessage_js_1.AssistantMessage$inboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
        role: v.role,
    }))),
    toolmessage_js_1.ToolMessage$inboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
        role: v.role,
    }))),
]);
/** @internal */
exports.Two$outboundSchema = z
    .union([
    systemmessage_js_1.SystemMessage$outboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
        role: v.role,
    }))),
    usermessage_js_1.UserMessage$outboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
        role: v.role,
    }))),
    assistantmessage_js_1.AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
        role: v.role,
    }))),
    toolmessage_js_1.ToolMessage$outboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
        role: v.role,
    }))),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Two$;
(function (Two$) {
    /** @deprecated use `Two$inboundSchema` instead. */
    Two$.inboundSchema = exports.Two$inboundSchema;
    /** @deprecated use `Two$outboundSchema` instead. */
    Two$.outboundSchema = exports.Two$outboundSchema;
})(Two$ || (exports.Two$ = Two$ = {}));
function twoToJSON(two) {
    return JSON.stringify(exports.Two$outboundSchema.parse(two));
}
function twoFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Two$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Two' from JSON`);
}
/** @internal */
exports.One$inboundSchema = z.union([
    systemmessage_js_1.SystemMessage$inboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
        role: v.role,
    }))),
    usermessage_js_1.UserMessage$inboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
        role: v.role,
    }))),
    assistantmessage_js_1.AssistantMessage$inboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
        role: v.role,
    }))),
    toolmessage_js_1.ToolMessage$inboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
        role: v.role,
    }))),
]);
/** @internal */
exports.One$outboundSchema = z
    .union([
    systemmessage_js_1.SystemMessage$outboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
        role: v.role,
    }))),
    usermessage_js_1.UserMessage$outboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
        role: v.role,
    }))),
    assistantmessage_js_1.AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
        role: v.role,
    }))),
    toolmessage_js_1.ToolMessage$outboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
        role: v.role,
    }))),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var One$;
(function (One$) {
    /** @deprecated use `One$inboundSchema` instead. */
    One$.inboundSchema = exports.One$inboundSchema;
    /** @deprecated use `One$outboundSchema` instead. */
    One$.outboundSchema = exports.One$outboundSchema;
})(One$ || (exports.One$ = One$ = {}));
function oneToJSON(one) {
    return JSON.stringify(exports.One$outboundSchema.parse(one));
}
function oneFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.One$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'One' from JSON`);
}
/** @internal */
exports.ChatModerationRequestInputs$inboundSchema = z.union([
    z.array(z.union([
        systemmessage_js_1.SystemMessage$inboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
            role: v.role,
        }))),
        usermessage_js_1.UserMessage$inboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
            role: v.role,
        }))),
        assistantmessage_js_1.AssistantMessage$inboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
            role: v.role,
        }))),
        toolmessage_js_1.ToolMessage$inboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
            role: v.role,
        }))),
    ])),
    z.array(z.array(z.union([
        systemmessage_js_1.SystemMessage$inboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
            role: v.role,
        }))),
        usermessage_js_1.UserMessage$inboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
            role: v.role,
        }))),
        assistantmessage_js_1.AssistantMessage$inboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
            role: v.role,
        }))),
        toolmessage_js_1.ToolMessage$inboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
            role: v.role,
        }))),
    ]))),
]);
/** @internal */
exports.ChatModerationRequestInputs$outboundSchema = z.union([
    z.array(z.union([
        systemmessage_js_1.SystemMessage$outboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
            role: v.role,
        }))),
        usermessage_js_1.UserMessage$outboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
            role: v.role,
        }))),
        assistantmessage_js_1.AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
            role: v.role,
        }))),
        toolmessage_js_1.ToolMessage$outboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
            role: v.role,
        }))),
    ])),
    z.array(z.array(z.union([
        systemmessage_js_1.SystemMessage$outboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
            role: v.role,
        }))),
        usermessage_js_1.UserMessage$outboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
            role: v.role,
        }))),
        assistantmessage_js_1.AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
            role: v.role,
        }))),
        toolmessage_js_1.ToolMessage$outboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
            role: v.role,
        }))),
    ]))),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ChatModerationRequestInputs$;
(function (ChatModerationRequestInputs$) {
    /** @deprecated use `ChatModerationRequestInputs$inboundSchema` instead. */
    ChatModerationRequestInputs$.inboundSchema = exports.ChatModerationRequestInputs$inboundSchema;
    /** @deprecated use `ChatModerationRequestInputs$outboundSchema` instead. */
    ChatModerationRequestInputs$.outboundSchema = exports.ChatModerationRequestInputs$outboundSchema;
})(ChatModerationRequestInputs$ || (exports.ChatModerationRequestInputs$ = ChatModerationRequestInputs$ = {}));
function chatModerationRequestInputsToJSON(chatModerationRequestInputs) {
    return JSON.stringify(exports.ChatModerationRequestInputs$outboundSchema.parse(chatModerationRequestInputs));
}
function chatModerationRequestInputsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChatModerationRequestInputs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatModerationRequestInputs' from JSON`);
}
/** @internal */
exports.ChatModerationRequest$inboundSchema = z.object({
    input: z.union([
        z.array(z.union([
            systemmessage_js_1.SystemMessage$inboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
                role: v.role,
            }))),
            usermessage_js_1.UserMessage$inboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
                role: v.role,
            }))),
            assistantmessage_js_1.AssistantMessage$inboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
                role: v.role,
            }))),
            toolmessage_js_1.ToolMessage$inboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
                role: v.role,
            }))),
        ])),
        z.array(z.array(z.union([
            systemmessage_js_1.SystemMessage$inboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
                role: v.role,
            }))),
            usermessage_js_1.UserMessage$inboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
                role: v.role,
            }))),
            assistantmessage_js_1.AssistantMessage$inboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
                role: v.role,
            }))),
            toolmessage_js_1.ToolMessage$inboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
                role: v.role,
            }))),
        ]))),
    ]),
    model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "input": "inputs",
    });
});
/** @internal */
exports.ChatModerationRequest$outboundSchema = z.object({
    inputs: z.union([
        z.array(z.union([
            systemmessage_js_1.SystemMessage$outboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
                role: v.role,
            }))),
            usermessage_js_1.UserMessage$outboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
                role: v.role,
            }))),
            assistantmessage_js_1.AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
                role: v.role,
            }))),
            toolmessage_js_1.ToolMessage$outboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
                role: v.role,
            }))),
        ])),
        z.array(z.array(z.union([
            systemmessage_js_1.SystemMessage$outboundSchema.and(z.object({ role: z.literal("system") }).transform((v) => ({
                role: v.role,
            }))),
            usermessage_js_1.UserMessage$outboundSchema.and(z.object({ role: z.literal("user") }).transform((v) => ({
                role: v.role,
            }))),
            assistantmessage_js_1.AssistantMessage$outboundSchema.and(z.object({ role: z.literal("assistant") }).transform((v) => ({
                role: v.role,
            }))),
            toolmessage_js_1.ToolMessage$outboundSchema.and(z.object({ role: z.literal("tool") }).transform((v) => ({
                role: v.role,
            }))),
        ]))),
    ]),
    model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        inputs: "input",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ChatModerationRequest$;
(function (ChatModerationRequest$) {
    /** @deprecated use `ChatModerationRequest$inboundSchema` instead. */
    ChatModerationRequest$.inboundSchema = exports.ChatModerationRequest$inboundSchema;
    /** @deprecated use `ChatModerationRequest$outboundSchema` instead. */
    ChatModerationRequest$.outboundSchema = exports.ChatModerationRequest$outboundSchema;
})(ChatModerationRequest$ || (exports.ChatModerationRequest$ = ChatModerationRequest$ = {}));
function chatModerationRequestToJSON(chatModerationRequest) {
    return JSON.stringify(exports.ChatModerationRequest$outboundSchema.parse(chatModerationRequest));
}
function chatModerationRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChatModerationRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatModerationRequest' from JSON`);
}
//# sourceMappingURL=chatmoderationrequest.js.map