/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import * as openEnums from "../types/enums.js"; import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; /** * `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. */ export const ProjectGlobalFlaggingMode = { DryRun: "DRY_RUN", Active: "ACTIVE", } as const; /** * `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. */ export type ProjectGlobalFlaggingMode = OpenEnum< typeof ProjectGlobalFlaggingMode >; export type Project = { /** * The ID of the project. */ id: string; /** * The project's name. */ name: string; /** * The project's description. */ description: string | null; /** * The website or app the project moderates content for. */ domain: string | null; /** * What the platform is and who uses it. AI moderation reads it to judge content in context. */ context: string | null; /** * `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. */ globalFlaggingMode: ProjectGlobalFlaggingMode; /** * Whether moderated content is stored and shown in the dashboard. */ enableRequestLogging: boolean; /** * Whether decisions made in the review queue are recorded in the project's casebook. */ casebookEnabled: boolean; /** * When the project was created. */ createdAt: string; /** * When the project was last changed. */ updatedAt: string; }; /** @internal */ export const ProjectGlobalFlaggingMode$inboundSchema: z.ZodMiniType< ProjectGlobalFlaggingMode, unknown > = openEnums.inboundSchema(ProjectGlobalFlaggingMode); /** @internal */ export const Project$inboundSchema: z.ZodMiniType = z.object({ id: types.string(), name: types.string(), description: types.nullable(types.string()), domain: types.nullable(types.string()), context: types.nullable(types.string()), globalFlaggingMode: ProjectGlobalFlaggingMode$inboundSchema, enableRequestLogging: types.boolean(), casebookEnabled: types.boolean(), createdAt: types.string(), updatedAt: types.string(), }); export function projectFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Project$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Project' from JSON`, ); }