"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.CreateModerationResponseBody$inboundSchema = exports.Results$inboundSchema = exports.Results1$inboundSchema = exports.CategoryAppliedInputTypes$inboundSchema = exports.CategoryScores$inboundSchema = exports.Categories$inboundSchema = exports.Results2$inboundSchema = exports.ResultsCategoryScores$inboundSchema = exports.ResultsCategories$inboundSchema = exports.CreateModerationRequestBody$outboundSchema = exports.Input$outboundSchema = void 0;
exports.inputToJSON = inputToJSON;
exports.createModerationRequestBodyToJSON = createModerationRequestBodyToJSON;
exports.resultsCategoriesFromJSON = resultsCategoriesFromJSON;
exports.resultsCategoryScoresFromJSON = resultsCategoryScoresFromJSON;
exports.results2FromJSON = results2FromJSON;
exports.categoriesFromJSON = categoriesFromJSON;
exports.categoryScoresFromJSON = categoryScoresFromJSON;
exports.categoryAppliedInputTypesFromJSON = categoryAppliedInputTypesFromJSON;
exports.results1FromJSON = results1FromJSON;
exports.resultsFromJSON = resultsFromJSON;
exports.createModerationResponseBodyFromJSON = createModerationResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/** @internal */
exports.Input$outboundSchema = z.union([z.string(), z.array(z.string())]);
function inputToJSON(input) {
    return JSON.stringify(exports.Input$outboundSchema.parse(input));
}
/** @internal */
exports.CreateModerationRequestBody$outboundSchema = z.object({
    input: z.union([z.string(), z.array(z.string())]),
    model: z.string(),
});
function createModerationRequestBodyToJSON(createModerationRequestBody) {
    return JSON.stringify(exports.CreateModerationRequestBody$outboundSchema.parse(createModerationRequestBody));
}
/** @internal */
exports.ResultsCategories$inboundSchema = z.object({
    sexual: z.boolean(),
    hate_and_discrimination: z.boolean(),
    violence_and_threats: z.boolean(),
    dangerous_and_criminal_content: z.boolean(),
    selfharm: z.boolean(),
    health: z.boolean(),
    financial: z.boolean(),
    law: z.boolean(),
    pii: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "hate_and_discrimination": "hateAndDiscrimination",
        "violence_and_threats": "violenceAndThreats",
        "dangerous_and_criminal_content": "dangerousAndCriminalContent",
    });
});
function resultsCategoriesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResultsCategories$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultsCategories' from JSON`);
}
/** @internal */
exports.ResultsCategoryScores$inboundSchema = z.object({
    sexual: z.number(),
    hate_and_discrimination: z.number(),
    violence_and_threats: z.number(),
    dangerous_and_criminal_content: z.number(),
    selfharm: z.number(),
    health: z.number(),
    financial: z.number(),
    law: z.number(),
    pii: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "hate_and_discrimination": "hateAndDiscrimination",
        "violence_and_threats": "violenceAndThreats",
        "dangerous_and_criminal_content": "dangerousAndCriminalContent",
    });
});
function resultsCategoryScoresFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ResultsCategoryScores$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResultsCategoryScores' from JSON`);
}
/** @internal */
exports.Results2$inboundSchema = z.object({
    categories: z.lazy(() => exports.ResultsCategories$inboundSchema),
    category_scores: z.lazy(() => exports.ResultsCategoryScores$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "category_scores": "categoryScores",
    });
});
function results2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Results2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Results2' from JSON`);
}
/** @internal */
exports.Categories$inboundSchema = z.object({
    hate: z.boolean(),
    "hate/threatening": z.boolean(),
    harassment: z.boolean(),
    "harassment/threatening": z.boolean(),
    illicit: z.boolean(),
    "illicit/violent": z.boolean(),
    "self-harm": z.boolean(),
    "self-harm/intent": z.boolean(),
    "self-harm/instructions": z.boolean(),
    sexual: z.boolean(),
    "sexual/minors": z.boolean(),
    violence: z.boolean(),
    "violence/graphic": z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "hate/threatening": "hateThreatening",
        "harassment/threatening": "harassmentThreatening",
        "illicit/violent": "illicitViolent",
        "self-harm": "selfHarm",
        "self-harm/intent": "selfHarmIntent",
        "self-harm/instructions": "selfHarmInstructions",
        "sexual/minors": "sexualMinors",
        "violence/graphic": "violenceGraphic",
    });
});
function categoriesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Categories$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Categories' from JSON`);
}
/** @internal */
exports.CategoryScores$inboundSchema = z.object({
    hate: z.number(),
    "hate/threatening": z.number(),
    harassment: z.number(),
    "harassment/threatening": z.number(),
    illicit: z.number(),
    "illicit/violent": z.number(),
    "self-harm": z.number(),
    "self-harm/intent": z.number(),
    "self-harm/instructions": z.number(),
    sexual: z.number(),
    "sexual/minors": z.number(),
    violence: z.number(),
    "violence/graphic": z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "hate/threatening": "hateThreatening",
        "harassment/threatening": "harassmentThreatening",
        "illicit/violent": "illicitViolent",
        "self-harm": "selfHarm",
        "self-harm/intent": "selfHarmIntent",
        "self-harm/instructions": "selfHarmInstructions",
        "sexual/minors": "sexualMinors",
        "violence/graphic": "violenceGraphic",
    });
});
function categoryScoresFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CategoryScores$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CategoryScores' from JSON`);
}
/** @internal */
exports.CategoryAppliedInputTypes$inboundSchema = z.object({
    hate: z.array(z.string()),
    "hate/threatening": z.array(z.string()),
    harassment: z.array(z.string()),
    "harassment/threatening": z.array(z.string()),
    illicit: z.array(z.string()),
    "illicit/violent": z.array(z.string()),
    "self-harm": z.array(z.string()),
    "self-harm/intent": z.array(z.string()),
    "self-harm/instructions": z.array(z.string()),
    sexual: z.array(z.string()),
    "sexual/minors": z.array(z.string()),
    violence: z.array(z.string()),
    "violence/graphic": z.array(z.string()),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "hate/threatening": "hateThreatening",
        "harassment/threatening": "harassmentThreatening",
        "illicit/violent": "illicitViolent",
        "self-harm": "selfHarm",
        "self-harm/intent": "selfHarmIntent",
        "self-harm/instructions": "selfHarmInstructions",
        "sexual/minors": "sexualMinors",
        "violence/graphic": "violenceGraphic",
    });
});
function categoryAppliedInputTypesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CategoryAppliedInputTypes$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CategoryAppliedInputTypes' from JSON`);
}
/** @internal */
exports.Results1$inboundSchema = z.object({
    flagged: z.boolean(),
    categories: z.lazy(() => exports.Categories$inboundSchema),
    category_scores: z.lazy(() => exports.CategoryScores$inboundSchema),
    category_applied_input_types: z.lazy(() => exports.CategoryAppliedInputTypes$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "category_scores": "categoryScores",
        "category_applied_input_types": "categoryAppliedInputTypes",
    });
});
function results1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Results1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Results1' from JSON`);
}
/** @internal */
exports.Results$inboundSchema = z.union([
    z.lazy(() => exports.Results1$inboundSchema),
    z.lazy(() => exports.Results2$inboundSchema),
]);
function resultsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Results$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Results' from JSON`);
}
/** @internal */
exports.CreateModerationResponseBody$inboundSchema = z.object({
    id: z.string(),
    model: z.string(),
    results: z.array(z.union([
        z.lazy(() => exports.Results1$inboundSchema),
        z.lazy(() => exports.Results2$inboundSchema),
    ])),
});
function createModerationResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateModerationResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateModerationResponseBody' from JSON`);
}
//# sourceMappingURL=createmoderation.js.map