/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 7f32717f7231 */ 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 { DlpIssueStatus, DlpIssueStatus$inboundSchema, DlpIssueStatus$outboundSchema, } from "./dlpissuestatus.js"; import { DlpSeverity, DlpSeverity$inboundSchema, DlpSeverity$outboundSchema, } from "./dlpseverity.js"; import { TimeRangeFilter, TimeRangeFilter$inboundSchema, TimeRangeFilter$Outbound, TimeRangeFilter$outboundSchema, } from "./timerangefilter.js"; export type DlpFindingFilter = { infoType?: string | undefined; regexId?: string | undefined; reportId?: string | undefined; datasource?: string | undefined; visibility?: string | undefined; documentIds?: Array | undefined; /** * Severity levels for DLP findings and analyses. */ severity?: DlpSeverity | undefined; documentSeverity?: Array | undefined; statuses?: Array | undefined; timeRange?: TimeRangeFilter | undefined; archived?: boolean | undefined; }; /** @internal */ export const DlpFindingFilter$inboundSchema: z.ZodType< DlpFindingFilter, z.ZodTypeDef, unknown > = z.object({ infoType: z.string().optional(), regexId: z.string().optional(), reportId: z.string().optional(), datasource: z.string().optional(), visibility: z.string().optional(), documentIds: z.array(z.string()).optional(), severity: DlpSeverity$inboundSchema.optional(), documentSeverity: z.array(DlpSeverity$inboundSchema).optional(), statuses: z.array(DlpIssueStatus$inboundSchema).optional(), timeRange: TimeRangeFilter$inboundSchema.optional(), archived: z.boolean().optional(), }); /** @internal */ export type DlpFindingFilter$Outbound = { infoType?: string | undefined; regexId?: string | undefined; reportId?: string | undefined; datasource?: string | undefined; visibility?: string | undefined; documentIds?: Array | undefined; severity?: string | undefined; documentSeverity?: Array | undefined; statuses?: Array | undefined; timeRange?: TimeRangeFilter$Outbound | undefined; archived?: boolean | undefined; }; /** @internal */ export const DlpFindingFilter$outboundSchema: z.ZodType< DlpFindingFilter$Outbound, z.ZodTypeDef, DlpFindingFilter > = z.object({ infoType: z.string().optional(), regexId: z.string().optional(), reportId: z.string().optional(), datasource: z.string().optional(), visibility: z.string().optional(), documentIds: z.array(z.string()).optional(), severity: DlpSeverity$outboundSchema.optional(), documentSeverity: z.array(DlpSeverity$outboundSchema).optional(), statuses: z.array(DlpIssueStatus$outboundSchema).optional(), timeRange: TimeRangeFilter$outboundSchema.optional(), archived: z.boolean().optional(), }); export function dlpFindingFilterToJSON( dlpFindingFilter: DlpFindingFilter, ): string { return JSON.stringify( DlpFindingFilter$outboundSchema.parse(dlpFindingFilter), ); } export function dlpFindingFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DlpFindingFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DlpFindingFilter' from JSON`, ); }