/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AuditControlAssessmentState, AuditControlAssessmentState$inboundSchema, } from "./auditcontrolassessmentstate.js"; /** * An auditor's assessment of a control within one audit segment. Assessments * * @remarks * can be recorded for any segment on the audit, `PROGRAM` or `SYSTEM`, and a * control can carry a distinct assessment per segment. * A segment with no recorded assessment returns `NOT_ASSESSED` with a `null` * justification. */ export type AuditControlAssessment = { /** * The audit segment this assessment belongs to. */ segmentId: string; /** * An auditor's assessment of a control within an audit. This is the full flat * * @remarks * union of every framework's assessment states (the superset); the selected * segment's framework determines which subset applies. `NOT_ASSESSED` is shared * by all frameworks and is the default for a control that has not yet been assessed. * * Which states apply to which framework: * - Most frameworks (e.g. SOC 2): `IN_PLACE`, `NOT_IN_PLACE`, `PARTIAL`, `NOT_ASSESSED` * - ISO 27001: `CONFORMING`, `MINOR_NON_CONFORMITY`, `MAJOR_NON_CONFORMITY`, `NOT_ASSESSED` * - FedRAMP: `SATISFIED`, `NOT_SATISFIED`, `OTHER_THAN_SATISFIED`, `NOT_ASSESSED` * - FedRAMP Key Security Indicators (KSI): `TRUE`, `FALSE`, `PARTIAL`, `NOT_ASSESSED` * * Distinct from `ControlStatus`, which is the computed tests/documents-passing * status — a different concept. */ assessmentState: AuditControlAssessmentState; /** * Free-text reasoning for the assessment; `null` when none has been recorded. */ justification: string | null; }; /** @internal */ export const AuditControlAssessment$inboundSchema: z.ZodType< AuditControlAssessment, z.ZodTypeDef, unknown > = z.object({ segmentId: z.string(), assessmentState: AuditControlAssessmentState$inboundSchema, justification: z.nullable(z.string()), }); export function auditControlAssessmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuditControlAssessment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuditControlAssessment' from JSON`, ); }