/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; export type GatePartialUpdateDtoTargetValue = Array | Array | string | number; export const GatePartialUpdateDtoRulesType = { AppVersion: "app_version", BrowserName: "browser_name", BrowserVersion: "browser_version", Country: "country", CustomField: "custom_field", Email: "email", EnvironmentTier: "environment_tier", FailsGate: "fails_gate", FailsSegment: "fails_segment", IpAddress: "ip_address", Locale: "locale", OsName: "os_name", OsVersion: "os_version", PassesGate: "passes_gate", PassesSegment: "passes_segment", Public: "public", Time: "time", UnitId: "unit_id", UserId: "user_id", Url: "url", Javascript: "javascript", DeviceModel: "device_model", TargetApp: "target_app", } as const; export type GatePartialUpdateDtoRulesType = ClosedEnum; export type GatePartialUpdateDtoConditions = { targetValue?: Array | Array | string | number | null | undefined; operator?: string | undefined; field?: any | null | undefined; customID?: any | null | undefined; type: GatePartialUpdateDtoRulesType; }; export type GatePartialUpdateDtoRules = { /** * The name of this rule. */ name: string; /** * Of the users that meet the conditions of this rule, what percent should return true. */ passPercentage: number; /** * An array of Condition objects. */ conditions: Array; /** * The environments this rule is enabled for. */ environments?: Array | null | undefined; /** * The Statsig ID of this rule. */ id?: string | undefined; /** * The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout */ baseID?: string | undefined; }; export const GatePartialUpdateDtoType = { Permanent: "PERMANENT", Temporary: "TEMPORARY", } as const; export type GatePartialUpdateDtoType = ClosedEnum; export type GatePartialUpdateDtoTargetApps = string | Array; export type GatePartialUpdateDtoMonitoringMetrics = { name: string; type: string; }; export type GatePartialUpdateDto = { isEnabled?: boolean | undefined; description?: string | undefined; rules?: Array | undefined; tags?: Array | undefined; type?: GatePartialUpdateDtoType | undefined; idType?: string | undefined; targetApps?: string | Array | undefined; creatorID?: any | null | undefined; creatorEmail?: any | null | undefined; team?: any | null | undefined; measureMetricLifts?: boolean | undefined; monitoringMetrics?: Array | undefined; }; /** @internal */ export const GatePartialUpdateDtoTargetValue$inboundSchema: z.ZodType< GatePartialUpdateDtoTargetValue, z.ZodTypeDef, unknown > = z.union([z.array(z.string()), z.array(z.number()), z.string(), z.number()]); /** @internal */ export type GatePartialUpdateDtoTargetValue$Outbound = | Array | Array | string | number; /** @internal */ export const GatePartialUpdateDtoTargetValue$outboundSchema: z.ZodType< GatePartialUpdateDtoTargetValue$Outbound, z.ZodTypeDef, GatePartialUpdateDtoTargetValue > = z.union([z.array(z.string()), z.array(z.number()), z.string(), z.number()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GatePartialUpdateDtoTargetValue$ { /** @deprecated use `GatePartialUpdateDtoTargetValue$inboundSchema` instead. */ export const inboundSchema = GatePartialUpdateDtoTargetValue$inboundSchema; /** @deprecated use `GatePartialUpdateDtoTargetValue$outboundSchema` instead. */ export const outboundSchema = GatePartialUpdateDtoTargetValue$outboundSchema; /** @deprecated use `GatePartialUpdateDtoTargetValue$Outbound` instead. */ export type Outbound = GatePartialUpdateDtoTargetValue$Outbound; } /** @internal */ export const GatePartialUpdateDtoRulesType$inboundSchema: z.ZodNativeEnum< typeof GatePartialUpdateDtoRulesType > = z.nativeEnum(GatePartialUpdateDtoRulesType); /** @internal */ export const GatePartialUpdateDtoRulesType$outboundSchema: z.ZodNativeEnum< typeof GatePartialUpdateDtoRulesType > = GatePartialUpdateDtoRulesType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GatePartialUpdateDtoRulesType$ { /** @deprecated use `GatePartialUpdateDtoRulesType$inboundSchema` instead. */ export const inboundSchema = GatePartialUpdateDtoRulesType$inboundSchema; /** @deprecated use `GatePartialUpdateDtoRulesType$outboundSchema` instead. */ export const outboundSchema = GatePartialUpdateDtoRulesType$outboundSchema; } /** @internal */ export const GatePartialUpdateDtoConditions$inboundSchema: z.ZodType< GatePartialUpdateDtoConditions, z.ZodTypeDef, unknown > = z.object({ targetValue: z .nullable(z.union([z.array(z.string()), z.array(z.number()), z.string(), z.number()])) .optional(), operator: z.string().optional(), field: z.nullable(z.any()).optional(), customID: z.nullable(z.any()).optional(), type: GatePartialUpdateDtoRulesType$inboundSchema, }); /** @internal */ export type GatePartialUpdateDtoConditions$Outbound = { targetValue?: Array | Array | string | number | null | undefined; operator?: string | undefined; field?: any | null | undefined; customID?: any | null | undefined; type: string; }; /** @internal */ export const GatePartialUpdateDtoConditions$outboundSchema: z.ZodType< GatePartialUpdateDtoConditions$Outbound, z.ZodTypeDef, GatePartialUpdateDtoConditions > = z.object({ targetValue: z .nullable(z.union([z.array(z.string()), z.array(z.number()), z.string(), z.number()])) .optional(), operator: z.string().optional(), field: z.nullable(z.any()).optional(), customID: z.nullable(z.any()).optional(), type: GatePartialUpdateDtoRulesType$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GatePartialUpdateDtoConditions$ { /** @deprecated use `GatePartialUpdateDtoConditions$inboundSchema` instead. */ export const inboundSchema = GatePartialUpdateDtoConditions$inboundSchema; /** @deprecated use `GatePartialUpdateDtoConditions$outboundSchema` instead. */ export const outboundSchema = GatePartialUpdateDtoConditions$outboundSchema; /** @deprecated use `GatePartialUpdateDtoConditions$Outbound` instead. */ export type Outbound = GatePartialUpdateDtoConditions$Outbound; } /** @internal */ export const GatePartialUpdateDtoRules$inboundSchema: z.ZodType< GatePartialUpdateDtoRules, z.ZodTypeDef, unknown > = z.object({ name: z.string(), passPercentage: z.number(), conditions: z.array(z.lazy(() => GatePartialUpdateDtoConditions$inboundSchema)), environments: z.nullable(z.array(z.string())).optional(), id: z.string().optional(), baseID: z.string().optional(), }); /** @internal */ export type GatePartialUpdateDtoRules$Outbound = { name: string; passPercentage: number; conditions: Array; environments?: Array | null | undefined; id?: string | undefined; baseID?: string | undefined; }; /** @internal */ export const GatePartialUpdateDtoRules$outboundSchema: z.ZodType< GatePartialUpdateDtoRules$Outbound, z.ZodTypeDef, GatePartialUpdateDtoRules > = z.object({ name: z.string(), passPercentage: z.number(), conditions: z.array(z.lazy(() => GatePartialUpdateDtoConditions$outboundSchema)), environments: z.nullable(z.array(z.string())).optional(), id: z.string().optional(), baseID: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GatePartialUpdateDtoRules$ { /** @deprecated use `GatePartialUpdateDtoRules$inboundSchema` instead. */ export const inboundSchema = GatePartialUpdateDtoRules$inboundSchema; /** @deprecated use `GatePartialUpdateDtoRules$outboundSchema` instead. */ export const outboundSchema = GatePartialUpdateDtoRules$outboundSchema; /** @deprecated use `GatePartialUpdateDtoRules$Outbound` instead. */ export type Outbound = GatePartialUpdateDtoRules$Outbound; } /** @internal */ export const GatePartialUpdateDtoType$inboundSchema: z.ZodNativeEnum< typeof GatePartialUpdateDtoType > = z.nativeEnum(GatePartialUpdateDtoType); /** @internal */ export const GatePartialUpdateDtoType$outboundSchema: z.ZodNativeEnum< typeof GatePartialUpdateDtoType > = GatePartialUpdateDtoType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GatePartialUpdateDtoType$ { /** @deprecated use `GatePartialUpdateDtoType$inboundSchema` instead. */ export const inboundSchema = GatePartialUpdateDtoType$inboundSchema; /** @deprecated use `GatePartialUpdateDtoType$outboundSchema` instead. */ export const outboundSchema = GatePartialUpdateDtoType$outboundSchema; } /** @internal */ export const GatePartialUpdateDtoTargetApps$inboundSchema: z.ZodType< GatePartialUpdateDtoTargetApps, z.ZodTypeDef, unknown > = z.union([z.string(), z.array(z.string())]); /** @internal */ export type GatePartialUpdateDtoTargetApps$Outbound = string | Array; /** @internal */ export const GatePartialUpdateDtoTargetApps$outboundSchema: z.ZodType< GatePartialUpdateDtoTargetApps$Outbound, z.ZodTypeDef, GatePartialUpdateDtoTargetApps > = z.union([z.string(), z.array(z.string())]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GatePartialUpdateDtoTargetApps$ { /** @deprecated use `GatePartialUpdateDtoTargetApps$inboundSchema` instead. */ export const inboundSchema = GatePartialUpdateDtoTargetApps$inboundSchema; /** @deprecated use `GatePartialUpdateDtoTargetApps$outboundSchema` instead. */ export const outboundSchema = GatePartialUpdateDtoTargetApps$outboundSchema; /** @deprecated use `GatePartialUpdateDtoTargetApps$Outbound` instead. */ export type Outbound = GatePartialUpdateDtoTargetApps$Outbound; } /** @internal */ export const GatePartialUpdateDtoMonitoringMetrics$inboundSchema: z.ZodType< GatePartialUpdateDtoMonitoringMetrics, z.ZodTypeDef, unknown > = z.object({ name: z.string(), type: z.string(), }); /** @internal */ export type GatePartialUpdateDtoMonitoringMetrics$Outbound = { name: string; type: string; }; /** @internal */ export const GatePartialUpdateDtoMonitoringMetrics$outboundSchema: z.ZodType< GatePartialUpdateDtoMonitoringMetrics$Outbound, z.ZodTypeDef, GatePartialUpdateDtoMonitoringMetrics > = z.object({ name: z.string(), type: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GatePartialUpdateDtoMonitoringMetrics$ { /** @deprecated use `GatePartialUpdateDtoMonitoringMetrics$inboundSchema` instead. */ export const inboundSchema = GatePartialUpdateDtoMonitoringMetrics$inboundSchema; /** @deprecated use `GatePartialUpdateDtoMonitoringMetrics$outboundSchema` instead. */ export const outboundSchema = GatePartialUpdateDtoMonitoringMetrics$outboundSchema; /** @deprecated use `GatePartialUpdateDtoMonitoringMetrics$Outbound` instead. */ export type Outbound = GatePartialUpdateDtoMonitoringMetrics$Outbound; } /** @internal */ export const GatePartialUpdateDto$inboundSchema: z.ZodType< GatePartialUpdateDto, z.ZodTypeDef, unknown > = z.object({ isEnabled: z.boolean().optional(), description: z.string().optional(), rules: z.array(z.lazy(() => GatePartialUpdateDtoRules$inboundSchema)).optional(), tags: z.array(z.string()).optional(), type: GatePartialUpdateDtoType$inboundSchema.optional(), idType: z.string().optional(), targetApps: z.union([z.string(), z.array(z.string())]).optional(), creatorID: z.nullable(z.any()).optional(), creatorEmail: z.nullable(z.any()).optional(), team: z.nullable(z.any()).optional(), measureMetricLifts: z.boolean().optional(), monitoringMetrics: z .array(z.lazy(() => GatePartialUpdateDtoMonitoringMetrics$inboundSchema)) .optional(), }); /** @internal */ export type GatePartialUpdateDto$Outbound = { isEnabled?: boolean | undefined; description?: string | undefined; rules?: Array | undefined; tags?: Array | undefined; type?: string | undefined; idType?: string | undefined; targetApps?: string | Array | undefined; creatorID?: any | null | undefined; creatorEmail?: any | null | undefined; team?: any | null | undefined; measureMetricLifts?: boolean | undefined; monitoringMetrics?: Array | undefined; }; /** @internal */ export const GatePartialUpdateDto$outboundSchema: z.ZodType< GatePartialUpdateDto$Outbound, z.ZodTypeDef, GatePartialUpdateDto > = z.object({ isEnabled: z.boolean().optional(), description: z.string().optional(), rules: z.array(z.lazy(() => GatePartialUpdateDtoRules$outboundSchema)).optional(), tags: z.array(z.string()).optional(), type: GatePartialUpdateDtoType$outboundSchema.optional(), idType: z.string().optional(), targetApps: z.union([z.string(), z.array(z.string())]).optional(), creatorID: z.nullable(z.any()).optional(), creatorEmail: z.nullable(z.any()).optional(), team: z.nullable(z.any()).optional(), measureMetricLifts: z.boolean().optional(), monitoringMetrics: z .array(z.lazy(() => GatePartialUpdateDtoMonitoringMetrics$outboundSchema)) .optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GatePartialUpdateDto$ { /** @deprecated use `GatePartialUpdateDto$inboundSchema` instead. */ export const inboundSchema = GatePartialUpdateDto$inboundSchema; /** @deprecated use `GatePartialUpdateDto$outboundSchema` instead. */ export const outboundSchema = GatePartialUpdateDto$outboundSchema; /** @deprecated use `GatePartialUpdateDto$Outbound` instead. */ export type Outbound = GatePartialUpdateDto$Outbound; }