/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 2e9623674768 */ 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 { AllowlistOptions, AllowlistOptions$inboundSchema, AllowlistOptions$Outbound, AllowlistOptions$outboundSchema, } from "./allowlistoptions.js"; import { DlpPerson, DlpPerson$inboundSchema, DlpPerson$Outbound, DlpPerson$outboundSchema, } from "./dlpperson.js"; import { ExternalSharingOptions, ExternalSharingOptions$inboundSchema, ExternalSharingOptions$Outbound, ExternalSharingOptions$outboundSchema, } from "./externalsharingoptions.js"; import { InputOptions, InputOptions$inboundSchema, InputOptions$Outbound, InputOptions$outboundSchema, } from "./inputoptions.js"; import { SensitiveContentOptions, SensitiveContentOptions$inboundSchema, SensitiveContentOptions$Outbound, SensitiveContentOptions$outboundSchema, } from "./sensitivecontentoptions.js"; import { SensitiveInfoType, SensitiveInfoType$inboundSchema, SensitiveInfoType$Outbound, SensitiveInfoType$outboundSchema, } from "./sensitiveinfotype.js"; import { SharingOptions, SharingOptions$inboundSchema, SharingOptions$Outbound, SharingOptions$outboundSchema, } from "./sharingoptions.js"; /** * Detailed configuration of what documents and sensitive content will be scanned. */ export type DlpConfig = { /** * Synonymous with report/policy id. */ version?: number | undefined; /** * DEPRECATED - use `sensitiveContentOptions` instead. * * @deprecated field: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use sensitiveContentOptions instead. */ sensitiveInfoTypes?: Array | undefined; /** * Controls which data-sources and what time-range to include in scans. */ inputOptions?: InputOptions | undefined; /** * @deprecated field: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use broadSharingOptions instead. */ externalSharingOptions?: ExternalSharingOptions | undefined; /** * Controls how "shared" a document must be to get picked for scans. */ broadSharingOptions?: SharingOptions | undefined; /** * Options for defining sensitive content within scanned documents. */ sensitiveContentOptions?: SensitiveContentOptions | undefined; reportName?: string | undefined; /** * Interval between scans. */ frequency?: string | undefined; /** * Details about the person who created this report/policy. */ createdBy?: DlpPerson | undefined; /** * Timestamp at which this configuration was created. */ createdAt?: string | undefined; /** * redact quote in findings of the report */ redactQuote?: boolean | undefined; /** * auto hide documents with findings in the report */ autoHideDocs?: boolean | undefined; /** * Terms that are allow-listed during the scans. If any finding picked up by a rule exactly matches a term in the allow-list, it will not be counted as a violation. */ allowlistOptions?: AllowlistOptions | undefined; }; /** @internal */ export const DlpConfig$inboundSchema: z.ZodType< DlpConfig, z.ZodTypeDef, unknown > = z.object({ version: z.number().int().optional(), sensitiveInfoTypes: z.array(SensitiveInfoType$inboundSchema).optional(), inputOptions: InputOptions$inboundSchema.optional(), externalSharingOptions: ExternalSharingOptions$inboundSchema.optional(), broadSharingOptions: SharingOptions$inboundSchema.optional(), sensitiveContentOptions: SensitiveContentOptions$inboundSchema.optional(), reportName: z.string().optional(), frequency: z.string().optional(), createdBy: DlpPerson$inboundSchema.optional(), createdAt: z.string().optional(), redactQuote: z.boolean().optional(), autoHideDocs: z.boolean().optional(), allowlistOptions: AllowlistOptions$inboundSchema.optional(), }); /** @internal */ export type DlpConfig$Outbound = { version?: number | undefined; sensitiveInfoTypes?: Array | undefined; inputOptions?: InputOptions$Outbound | undefined; externalSharingOptions?: ExternalSharingOptions$Outbound | undefined; broadSharingOptions?: SharingOptions$Outbound | undefined; sensitiveContentOptions?: SensitiveContentOptions$Outbound | undefined; reportName?: string | undefined; frequency?: string | undefined; createdBy?: DlpPerson$Outbound | undefined; createdAt?: string | undefined; redactQuote?: boolean | undefined; autoHideDocs?: boolean | undefined; allowlistOptions?: AllowlistOptions$Outbound | undefined; }; /** @internal */ export const DlpConfig$outboundSchema: z.ZodType< DlpConfig$Outbound, z.ZodTypeDef, DlpConfig > = z.object({ version: z.number().int().optional(), sensitiveInfoTypes: z.array(SensitiveInfoType$outboundSchema).optional(), inputOptions: InputOptions$outboundSchema.optional(), externalSharingOptions: ExternalSharingOptions$outboundSchema.optional(), broadSharingOptions: SharingOptions$outboundSchema.optional(), sensitiveContentOptions: SensitiveContentOptions$outboundSchema.optional(), reportName: z.string().optional(), frequency: z.string().optional(), createdBy: DlpPerson$outboundSchema.optional(), createdAt: z.string().optional(), redactQuote: z.boolean().optional(), autoHideDocs: z.boolean().optional(), allowlistOptions: AllowlistOptions$outboundSchema.optional(), }); export function dlpConfigToJSON(dlpConfig: DlpConfig): string { return JSON.stringify(DlpConfig$outboundSchema.parse(dlpConfig)); } export function dlpConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DlpConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DlpConfig' from JSON`, ); }