/* * 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 { PersonnelGroupTask, PersonnelGroupTask$inboundSchema, } from "./personnelgrouptask.js"; /** * A group record from the personnel population. * * @remarks * * `id` and `name` are required. All other fields are optional to support customizable field visibility. * * Omitted keys mean the column is not in the response; `null` means the column is present but empty. */ export type PersonnelGroup = { /** * Unique identifier for the group. */ id: string; /** * Display name of the group. */ name: string; /** * IDs of the audit segments this group is in scope for. * * @remarks * Omitted when segment scoping is disabled. */ segmentIds?: Array | undefined; /** * Number of people in this group within the audit scope. */ members?: number | undefined; /** * The source of this group. * * @remarks * For IDP-synced groups, this is the provider name (e.g., "Okta", "Azure AD"). * For manually created groups, this is "Vanta". */ source?: string | undefined; /** * Security tasks enabled for this group, or empty array if not available. */ tasks?: Array | undefined; /** * When the group's task configuration was last updated, or null if never updated. * * @remarks * ISO 8601 format. */ tasksLastUpdated?: string | null | undefined; /** * Display name of the group's designated point of contact, or null if not set. */ pointOfContact?: string | null | undefined; }; /** @internal */ export const PersonnelGroup$inboundSchema: z.ZodType< PersonnelGroup, z.ZodTypeDef, unknown > = z.object({ id: z.string(), name: z.string(), segmentIds: z.array(z.string()).optional(), members: z.number().optional(), source: z.string().optional(), tasks: z.array(PersonnelGroupTask$inboundSchema).optional(), tasksLastUpdated: z.nullable(z.string()).optional(), pointOfContact: z.nullable(z.string()).optional(), }); export function personnelGroupFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PersonnelGroup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PersonnelGroup' from JSON`, ); }