/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 628059533e5a */ import * as z from "zod/v3"; 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { DlpConfig, DlpConfig$inboundSchema } from "./dlpconfig.js"; import { DlpFrequency, DlpFrequency$inboundSchema } from "./dlpfrequency.js"; import { DlpPerson, DlpPerson$inboundSchema } from "./dlpperson.js"; import { DlpReportStatus, DlpReportStatus$inboundSchema, } from "./dlpreportstatus.js"; export const LastScanStatus = { Pending: "PENDING", Success: "SUCCESS", Failure: "FAILURE", Cancelled: "CANCELLED", Cancelling: "CANCELLING", Active: "ACTIVE", } as const; export type LastScanStatus = OpenEnum; /** * Full policy information that will be used for scans. */ export type DlpReport = { id?: string | undefined; name?: string | undefined; /** * Detailed configuration of what documents and sensitive content will be scanned. */ config?: DlpConfig | undefined; /** * Interval between scans. DAILY is deprecated. */ frequency?: DlpFrequency | undefined; /** * The status of the policy/report. Only ACTIVE status will be picked for scans. */ status?: DlpReportStatus | undefined; /** * Details about the person who created this report/policy. */ createdBy?: DlpPerson | undefined; /** * Timestamp at which the policy was created. */ createdAt?: string | undefined; /** * Timestamp at which the policy was last updated. */ lastUpdatedAt?: string | undefined; /** * Auto hide documents with findings in the policy. */ autoHideDocs?: boolean | undefined; lastScanStatus?: LastScanStatus | undefined; /** * The timestamp at which the report's last run/scan began. */ lastScanStartTime?: string | undefined; /** * Details about the person who created this report/policy. */ updatedBy?: DlpPerson | undefined; }; /** @internal */ export const LastScanStatus$inboundSchema: z.ZodType< LastScanStatus, z.ZodTypeDef, unknown > = openEnums.inboundSchema(LastScanStatus); /** @internal */ export const DlpReport$inboundSchema: z.ZodType< DlpReport, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), name: z.string().optional(), config: DlpConfig$inboundSchema.optional(), frequency: DlpFrequency$inboundSchema.optional(), status: DlpReportStatus$inboundSchema.optional(), createdBy: DlpPerson$inboundSchema.optional(), createdAt: z.string().optional(), lastUpdatedAt: z.string().optional(), autoHideDocs: z.boolean().optional(), lastScanStatus: LastScanStatus$inboundSchema.optional(), lastScanStartTime: z.string().optional(), updatedBy: DlpPerson$inboundSchema.optional(), }); export function dlpReportFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DlpReport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DlpReport' from JSON`, ); }