/* * 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 ProjectWithKeyGlobalFlaggingMode = { DryRun: "DRY_RUN", Active: "ACTIVE", } as const; /** * `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. */ export type ProjectWithKeyGlobalFlaggingMode = OpenEnum< typeof ProjectWithKeyGlobalFlaggingMode >; export type ProjectWithKey = { /** * 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: ProjectWithKeyGlobalFlaggingMode; /** * 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; /** * A secret API key for the new project. Use it to moderate content in this project. It is also shown in the project's settings. */ secretKey: string; }; /** @internal */ export const ProjectWithKeyGlobalFlaggingMode$inboundSchema: z.ZodMiniType< ProjectWithKeyGlobalFlaggingMode, unknown > = openEnums.inboundSchema(ProjectWithKeyGlobalFlaggingMode); /** @internal */ export const ProjectWithKey$inboundSchema: z.ZodMiniType< ProjectWithKey, unknown > = z.object({ id: types.string(), name: types.string(), description: types.nullable(types.string()), domain: types.nullable(types.string()), context: types.nullable(types.string()), globalFlaggingMode: ProjectWithKeyGlobalFlaggingMode$inboundSchema, enableRequestLogging: types.boolean(), casebookEnabled: types.boolean(), createdAt: types.string(), updatedAt: types.string(), secretKey: types.string(), }); export function projectWithKeyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectWithKey$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectWithKey' from JSON`, ); }