/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 196398edf32f */ 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 { DocumentSpecUnion, DocumentSpecUnion$inboundSchema, DocumentSpecUnion$Outbound, DocumentSpecUnion$outboundSchema, } from "./documentspecunion.js"; export type RestrictionFilters = { /** * Specifications for containers that should be used as part of the restriction (include/exclude). Memberships are recursively defined for a subset of datasources (currently: SharePoint, OneDrive, Google Drive, and Confluence). Please contact the Glean team to enable this for more datasources. Recursive memberships do not apply for Collections. */ containerSpecs?: Array | undefined; }; /** @internal */ export const RestrictionFilters$inboundSchema: z.ZodType< RestrictionFilters, z.ZodTypeDef, unknown > = z.object({ containerSpecs: z.array(DocumentSpecUnion$inboundSchema).optional(), }); /** @internal */ export type RestrictionFilters$Outbound = { containerSpecs?: Array | undefined; }; /** @internal */ export const RestrictionFilters$outboundSchema: z.ZodType< RestrictionFilters$Outbound, z.ZodTypeDef, RestrictionFilters > = z.object({ containerSpecs: z.array(DocumentSpecUnion$outboundSchema).optional(), }); export function restrictionFiltersToJSON( restrictionFilters: RestrictionFilters, ): string { return JSON.stringify( RestrictionFilters$outboundSchema.parse(restrictionFilters), ); } export function restrictionFiltersFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RestrictionFilters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RestrictionFilters' from JSON`, ); }