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