/* * 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 { AuditControlAssessment, AuditControlAssessment$inboundSchema, } from "./auditcontrolassessment.js"; import { ControlSource, ControlSource$inboundSchema } from "./controlsource.js"; import { CustomField, CustomField$inboundSchema } from "./customfield.js"; import { Section, Section$inboundSchema } from "./section.js"; /** * The control's owner. */ export type AuditorControlOwner = { /** * Unique identifier for the person. */ id: string; /** * Name of the person that is shown in product. */ displayName: string; /** * Email address of the person. */ emailAddress: string; }; export type AuditorControl = { /** * The control's unique ID. */ id: string; /** * The control's external ID. */ externalId: string | null; /** * The control's name. */ name: string; /** * The control's description. */ description: string; source: ControlSource; /** * The security domains that the control belongs to. */ domains: Array; /** * The control's owner. */ owner: AuditorControlOwner | null; /** * The control's GDPR role, if the control is a GDPR control. */ role?: string | null | undefined; /** * The control's custom field values, if control custom fields is included in your Vanta instance. */ customFields: Array; /** * When the control was created. Returns null for Vanta library controls. */ creationDate: Date | null; /** * When the control was last modified. Returns null for Vanta library controls. */ modificationDate: Date | null; /** * The report standard framework fulfilled by the control. * * @remarks * Incomplete once a control is in scope for more than one framework. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ framework: string; /** * Current framework sections this control satisfies within the audit * * @remarks * segments in which it is in scope. */ sections: Array
; /** * Audit segments in which this control is in scope. This can differ from * * @remarks * current framework mappings, and the array can be empty. */ inScopeSegmentIds: Array; /** * The auditor's assessments of this control, with one entry for each segment * * @remarks * in `inScopeSegmentIds`, which can be any segment on the audit, `PROGRAM` or * `SYSTEM`. Populated only for IRL audits when assessment access is allowed; * empty otherwise. A segment with no recorded assessment returns * `NOT_ASSESSED`. */ assessments: Array; }; /** @internal */ export const AuditorControlOwner$inboundSchema: z.ZodType< AuditorControlOwner, z.ZodTypeDef, unknown > = z.object({ id: z.string(), displayName: z.string(), emailAddress: z.string(), }); export function auditorControlOwnerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuditorControlOwner$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuditorControlOwner' from JSON`, ); } /** @internal */ export const AuditorControl$inboundSchema: z.ZodType< AuditorControl, z.ZodTypeDef, unknown > = z.object({ id: z.string(), externalId: z.nullable(z.string()), name: z.string(), description: z.string(), source: ControlSource$inboundSchema, domains: z.array(z.string()), owner: z.nullable(z.lazy(() => AuditorControlOwner$inboundSchema)), role: z.nullable(z.string()).optional(), customFields: z.array(CustomField$inboundSchema), creationDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), modificationDate: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ), framework: z.string(), sections: z.array(Section$inboundSchema), inScopeSegmentIds: z.array(z.string()), assessments: z.array(AuditControlAssessment$inboundSchema), }); export function auditorControlFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuditorControl$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuditorControl' from JSON`, ); }