/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 9bb0d9158454 */ 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"; /** * Filter for DLP issues. Includes document-level filters and issue-specific filters. */ export type DlpIssueFilter = { /** * Text to search for in issue fields. */ searchText?: string | undefined; /** * Filter by one or more issue statuses. */ statuses?: Array | undefined; /** * Filter by assignee user ID. */ assigneeId?: string | undefined; infoType?: string | undefined; regexId?: string | undefined; /** * Filter by one or more report/policy IDs. */ reportIds?: Array | undefined; docId?: string | undefined; datasource?: string | undefined; visibility?: string | undefined; /** * Filter by one or more severity levels. */ severities?: Array | undefined; timeRange?: TimeRangeFilter | undefined; }; /** @internal */ export const DlpIssueFilter$inboundSchema: z.ZodType< DlpIssueFilter, z.ZodTypeDef, unknown > = z.object({ searchText: z.string().optional(), statuses: z.array(DlpIssueStatus$inboundSchema).optional(), assigneeId: z.string().optional(), infoType: z.string().optional(), regexId: z.string().optional(), reportIds: z.array(z.string()).optional(), docId: z.string().optional(), datasource: z.string().optional(), visibility: z.string().optional(), severities: z.array(DlpSeverity$inboundSchema).optional(), timeRange: TimeRangeFilter$inboundSchema.optional(), }); /** @internal */ export type DlpIssueFilter$Outbound = { searchText?: string | undefined; statuses?: Array | undefined; assigneeId?: string | undefined; infoType?: string | undefined; regexId?: string | undefined; reportIds?: Array | undefined; docId?: string | undefined; datasource?: string | undefined; visibility?: string | undefined; severities?: Array | undefined; timeRange?: TimeRangeFilter$Outbound | undefined; }; /** @internal */ export const DlpIssueFilter$outboundSchema: z.ZodType< DlpIssueFilter$Outbound, z.ZodTypeDef, DlpIssueFilter > = z.object({ searchText: z.string().optional(), statuses: z.array(DlpIssueStatus$outboundSchema).optional(), assigneeId: z.string().optional(), infoType: z.string().optional(), regexId: z.string().optional(), reportIds: z.array(z.string()).optional(), docId: z.string().optional(), datasource: z.string().optional(), visibility: z.string().optional(), severities: z.array(DlpSeverity$outboundSchema).optional(), timeRange: TimeRangeFilter$outboundSchema.optional(), }); export function dlpIssueFilterToJSON(dlpIssueFilter: DlpIssueFilter): string { return JSON.stringify(DlpIssueFilter$outboundSchema.parse(dlpIssueFilter)); } export function dlpIssueFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DlpIssueFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DlpIssueFilter' from JSON`, ); }