/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 82d4ceeff497 */ 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 { TimeRange, TimeRange$inboundSchema, TimeRange$Outbound, TimeRange$outboundSchema, } from "./timerange.js"; /** * The types of datasource for which to run the report/policy. */ export const DatasourcesType = { All: "ALL", Custom: "CUSTOM", } as const; /** * The types of datasource for which to run the report/policy. */ export type DatasourcesType = OpenEnum; /** * Type of time period for which to run the report/policy. PAST_DAY is deprecated. */ export const InputOptionsTimePeriodType = { AllTime: "ALL_TIME", PastYear: "PAST_YEAR", PastDay: "PAST_DAY", Custom: "CUSTOM", LastNDays: "LAST_N_DAYS", } as const; /** * Type of time period for which to run the report/policy. PAST_DAY is deprecated. */ export type InputOptionsTimePeriodType = OpenEnum< typeof InputOptionsTimePeriodType >; /** * Controls which data-sources and what time-range to include in scans. */ export type InputOptions = { /** * list of url regex matching documents excluded from report * * @deprecated field: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Field is deprecated. */ urlGreenlist?: Array | undefined; /** * The types of datasource for which to run the report/policy. */ datasourcesType?: DatasourcesType | undefined; /** * List of datasources to consider for report. DEPRECATED - use datasourceInstances instead. * * @deprecated field: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use datasourceInstances instead. */ datasources?: Array | undefined; /** * List of datasource instances to consider for report/policy. */ datasourceInstances?: Array | undefined; /** * Type of time period for which to run the report/policy. PAST_DAY is deprecated. */ timePeriodType?: InputOptionsTimePeriodType | undefined; customTimeRange?: TimeRange | undefined; /** * Subset of document IDs to scan. If empty, all documents matching other scope criteria will be scanned. */ subsetDocIdsToScan?: Array | undefined; }; /** @internal */ export const DatasourcesType$inboundSchema: z.ZodType< DatasourcesType, z.ZodTypeDef, unknown > = openEnums.inboundSchema(DatasourcesType); /** @internal */ export const DatasourcesType$outboundSchema: z.ZodType< string, z.ZodTypeDef, DatasourcesType > = openEnums.outboundSchema(DatasourcesType); /** @internal */ export const InputOptionsTimePeriodType$inboundSchema: z.ZodType< InputOptionsTimePeriodType, z.ZodTypeDef, unknown > = openEnums.inboundSchema(InputOptionsTimePeriodType); /** @internal */ export const InputOptionsTimePeriodType$outboundSchema: z.ZodType< string, z.ZodTypeDef, InputOptionsTimePeriodType > = openEnums.outboundSchema(InputOptionsTimePeriodType); /** @internal */ export const InputOptions$inboundSchema: z.ZodType< InputOptions, z.ZodTypeDef, unknown > = z.object({ urlGreenlist: z.array(z.string()).optional(), datasourcesType: DatasourcesType$inboundSchema.optional(), datasources: z.array(z.string()).optional(), datasourceInstances: z.array(z.string()).optional(), timePeriodType: InputOptionsTimePeriodType$inboundSchema.optional(), customTimeRange: TimeRange$inboundSchema.optional(), subsetDocIdsToScan: z.array(z.string()).optional(), }); /** @internal */ export type InputOptions$Outbound = { urlGreenlist?: Array | undefined; datasourcesType?: string | undefined; datasources?: Array | undefined; datasourceInstances?: Array | undefined; timePeriodType?: string | undefined; customTimeRange?: TimeRange$Outbound | undefined; subsetDocIdsToScan?: Array | undefined; }; /** @internal */ export const InputOptions$outboundSchema: z.ZodType< InputOptions$Outbound, z.ZodTypeDef, InputOptions > = z.object({ urlGreenlist: z.array(z.string()).optional(), datasourcesType: DatasourcesType$outboundSchema.optional(), datasources: z.array(z.string()).optional(), datasourceInstances: z.array(z.string()).optional(), timePeriodType: InputOptionsTimePeriodType$outboundSchema.optional(), customTimeRange: TimeRange$outboundSchema.optional(), subsetDocIdsToScan: z.array(z.string()).optional(), }); export function inputOptionsToJSON(inputOptions: InputOptions): string { return JSON.stringify(InputOptions$outboundSchema.parse(inputOptions)); } export function inputOptionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InputOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InputOptions' from JSON`, ); }