/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; export type GateCreateDtoTargetValue = Array | Array | string | number; export const GateCreateDtoType = { 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 GateCreateDtoType = ClosedEnum; export type GateCreateDtoConditions = { targetValue?: Array | Array | string | number | null | undefined; operator?: string | undefined; field?: any | null | undefined; customID?: any | null | undefined; type: GateCreateDtoType; }; export type GateCreateDtoRules = { /** * 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 Type = { Permanent: "PERMANENT", Temporary: "TEMPORARY", } as const; export type Type = ClosedEnum; export type GateCreateDtoTargetApps = string | Array; export type MonitoringMetrics = { name: string; type: string; }; /** * Create a new gate */ export type GateCreateDto = { isEnabled?: boolean | undefined; description?: string | undefined; rules?: Array | undefined; tags?: Array | undefined; type?: Type | 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; name?: string | undefined; id?: string | undefined; }; /** @internal */ export const GateCreateDtoTargetValue$inboundSchema: z.ZodType< GateCreateDtoTargetValue, z.ZodTypeDef, unknown > = z.union([z.array(z.string()), z.array(z.number()), z.string(), z.number()]); /** @internal */ export type GateCreateDtoTargetValue$Outbound = Array | Array | string | number; /** @internal */ export const GateCreateDtoTargetValue$outboundSchema: z.ZodType< GateCreateDtoTargetValue$Outbound, z.ZodTypeDef, GateCreateDtoTargetValue > = 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 GateCreateDtoTargetValue$ { /** @deprecated use `GateCreateDtoTargetValue$inboundSchema` instead. */ export const inboundSchema = GateCreateDtoTargetValue$inboundSchema; /** @deprecated use `GateCreateDtoTargetValue$outboundSchema` instead. */ export const outboundSchema = GateCreateDtoTargetValue$outboundSchema; /** @deprecated use `GateCreateDtoTargetValue$Outbound` instead. */ export type Outbound = GateCreateDtoTargetValue$Outbound; } /** @internal */ export const GateCreateDtoType$inboundSchema: z.ZodNativeEnum = z.nativeEnum(GateCreateDtoType); /** @internal */ export const GateCreateDtoType$outboundSchema: z.ZodNativeEnum = GateCreateDtoType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GateCreateDtoType$ { /** @deprecated use `GateCreateDtoType$inboundSchema` instead. */ export const inboundSchema = GateCreateDtoType$inboundSchema; /** @deprecated use `GateCreateDtoType$outboundSchema` instead. */ export const outboundSchema = GateCreateDtoType$outboundSchema; } /** @internal */ export const GateCreateDtoConditions$inboundSchema: z.ZodType< GateCreateDtoConditions, 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: GateCreateDtoType$inboundSchema, }); /** @internal */ export type GateCreateDtoConditions$Outbound = { targetValue?: Array | Array | string | number | null | undefined; operator?: string | undefined; field?: any | null | undefined; customID?: any | null | undefined; type: string; }; /** @internal */ export const GateCreateDtoConditions$outboundSchema: z.ZodType< GateCreateDtoConditions$Outbound, z.ZodTypeDef, GateCreateDtoConditions > = 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: GateCreateDtoType$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GateCreateDtoConditions$ { /** @deprecated use `GateCreateDtoConditions$inboundSchema` instead. */ export const inboundSchema = GateCreateDtoConditions$inboundSchema; /** @deprecated use `GateCreateDtoConditions$outboundSchema` instead. */ export const outboundSchema = GateCreateDtoConditions$outboundSchema; /** @deprecated use `GateCreateDtoConditions$Outbound` instead. */ export type Outbound = GateCreateDtoConditions$Outbound; } /** @internal */ export const GateCreateDtoRules$inboundSchema: z.ZodType< GateCreateDtoRules, z.ZodTypeDef, unknown > = z.object({ name: z.string(), passPercentage: z.number(), conditions: z.array(z.lazy(() => GateCreateDtoConditions$inboundSchema)), environments: z.nullable(z.array(z.string())).optional(), id: z.string().optional(), baseID: z.string().optional(), }); /** @internal */ export type GateCreateDtoRules$Outbound = { name: string; passPercentage: number; conditions: Array; environments?: Array | null | undefined; id?: string | undefined; baseID?: string | undefined; }; /** @internal */ export const GateCreateDtoRules$outboundSchema: z.ZodType< GateCreateDtoRules$Outbound, z.ZodTypeDef, GateCreateDtoRules > = z.object({ name: z.string(), passPercentage: z.number(), conditions: z.array(z.lazy(() => GateCreateDtoConditions$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 GateCreateDtoRules$ { /** @deprecated use `GateCreateDtoRules$inboundSchema` instead. */ export const inboundSchema = GateCreateDtoRules$inboundSchema; /** @deprecated use `GateCreateDtoRules$outboundSchema` instead. */ export const outboundSchema = GateCreateDtoRules$outboundSchema; /** @deprecated use `GateCreateDtoRules$Outbound` instead. */ export type Outbound = GateCreateDtoRules$Outbound; } /** @internal */ export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); /** @internal */ export const Type$outboundSchema: z.ZodNativeEnum = Type$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Type$ { /** @deprecated use `Type$inboundSchema` instead. */ export const inboundSchema = Type$inboundSchema; /** @deprecated use `Type$outboundSchema` instead. */ export const outboundSchema = Type$outboundSchema; } /** @internal */ export const GateCreateDtoTargetApps$inboundSchema: z.ZodType< GateCreateDtoTargetApps, z.ZodTypeDef, unknown > = z.union([z.string(), z.array(z.string())]); /** @internal */ export type GateCreateDtoTargetApps$Outbound = string | Array; /** @internal */ export const GateCreateDtoTargetApps$outboundSchema: z.ZodType< GateCreateDtoTargetApps$Outbound, z.ZodTypeDef, GateCreateDtoTargetApps > = 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 GateCreateDtoTargetApps$ { /** @deprecated use `GateCreateDtoTargetApps$inboundSchema` instead. */ export const inboundSchema = GateCreateDtoTargetApps$inboundSchema; /** @deprecated use `GateCreateDtoTargetApps$outboundSchema` instead. */ export const outboundSchema = GateCreateDtoTargetApps$outboundSchema; /** @deprecated use `GateCreateDtoTargetApps$Outbound` instead. */ export type Outbound = GateCreateDtoTargetApps$Outbound; } /** @internal */ export const MonitoringMetrics$inboundSchema: z.ZodType = z.object({ name: z.string(), type: z.string(), }); /** @internal */ export type MonitoringMetrics$Outbound = { name: string; type: string; }; /** @internal */ export const MonitoringMetrics$outboundSchema: z.ZodType< MonitoringMetrics$Outbound, z.ZodTypeDef, MonitoringMetrics > = 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 MonitoringMetrics$ { /** @deprecated use `MonitoringMetrics$inboundSchema` instead. */ export const inboundSchema = MonitoringMetrics$inboundSchema; /** @deprecated use `MonitoringMetrics$outboundSchema` instead. */ export const outboundSchema = MonitoringMetrics$outboundSchema; /** @deprecated use `MonitoringMetrics$Outbound` instead. */ export type Outbound = MonitoringMetrics$Outbound; } /** @internal */ export const GateCreateDto$inboundSchema: z.ZodType = z.object({ isEnabled: z.boolean().optional(), description: z.string().optional(), rules: z.array(z.lazy(() => GateCreateDtoRules$inboundSchema)).optional(), tags: z.array(z.string()).optional(), type: Type$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(() => MonitoringMetrics$inboundSchema)).optional(), name: z.string().optional(), id: z.string().optional(), }); /** @internal */ export type GateCreateDto$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; name?: string | undefined; id?: string | undefined; }; /** @internal */ export const GateCreateDto$outboundSchema: z.ZodType< GateCreateDto$Outbound, z.ZodTypeDef, GateCreateDto > = z.object({ isEnabled: z.boolean().optional(), description: z.string().optional(), rules: z.array(z.lazy(() => GateCreateDtoRules$outboundSchema)).optional(), tags: z.array(z.string()).optional(), type: Type$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(() => MonitoringMetrics$outboundSchema)).optional(), name: z.string().optional(), id: 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 GateCreateDto$ { /** @deprecated use `GateCreateDto$inboundSchema` instead. */ export const inboundSchema = GateCreateDto$inboundSchema; /** @deprecated use `GateCreateDto$outboundSchema` instead. */ export const outboundSchema = GateCreateDto$outboundSchema; /** @deprecated use `GateCreateDto$Outbound` instead. */ export type Outbound = GateCreateDto$Outbound; }