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