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