/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; export type DynamicConfigFullUpdateDtoTargetValue = Array | Array | string | number; export const DynamicConfigFullUpdateDtoType = { 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 DynamicConfigFullUpdateDtoType = ClosedEnum; export type DynamicConfigFullUpdateDtoConditions = { targetValue?: Array | Array | string | number | null | undefined; operator?: string | undefined; field?: any | null | undefined; customID?: any | null | undefined; type: DynamicConfigFullUpdateDtoType; }; export type DynamicConfigFullUpdateDtoRules = { /** * 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; }; export type DynamicConfigFullUpdateDtoTargetApps = string | Array; export type DynamicConfigFullUpdateDto = { /** * Is the dynamic config enabled */ isEnabled?: boolean | undefined; /** * A brief summary of what the dynamic config is being used for */ description: string; /** * An array of Rule objects */ rules: Array; /** * The fallback JSON object when no rules are triggered */ defaultValue?: { [k: string]: any } | undefined; /** * Can include comments. If provided with defaultValue, must parse to the same JSON */ defaultValueJson5?: string | undefined; /** * The type of ID which the dynamic config is based on. */ idType?: string | undefined; /** * The list of tag names attached to the dynamic config */ tags?: Array | undefined; creatorID?: any | null | undefined; creatorEmail?: any | null | undefined; /** * A schema using JSON Schema Draft 2020-12 to enforce return values of this dynamic config's rules. */ schema?: any | null | undefined; /** * `schema` except with Json5 comments. Optional and should parse to same json as `schema`. */ schemaJson5?: any | null | undefined; targetApps?: string | Array | undefined; team?: any | null | undefined; }; /** @internal */ export const DynamicConfigFullUpdateDtoTargetValue$inboundSchema: z.ZodType< DynamicConfigFullUpdateDtoTargetValue, z.ZodTypeDef, unknown > = z.union([z.array(z.string()), z.array(z.number()), z.string(), z.number()]); /** @internal */ export type DynamicConfigFullUpdateDtoTargetValue$Outbound = | Array | Array | string | number; /** @internal */ export const DynamicConfigFullUpdateDtoTargetValue$outboundSchema: z.ZodType< DynamicConfigFullUpdateDtoTargetValue$Outbound, z.ZodTypeDef, DynamicConfigFullUpdateDtoTargetValue > = 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 DynamicConfigFullUpdateDtoTargetValue$ { /** @deprecated use `DynamicConfigFullUpdateDtoTargetValue$inboundSchema` instead. */ export const inboundSchema = DynamicConfigFullUpdateDtoTargetValue$inboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoTargetValue$outboundSchema` instead. */ export const outboundSchema = DynamicConfigFullUpdateDtoTargetValue$outboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoTargetValue$Outbound` instead. */ export type Outbound = DynamicConfigFullUpdateDtoTargetValue$Outbound; } /** @internal */ export const DynamicConfigFullUpdateDtoType$inboundSchema: z.ZodNativeEnum< typeof DynamicConfigFullUpdateDtoType > = z.nativeEnum(DynamicConfigFullUpdateDtoType); /** @internal */ export const DynamicConfigFullUpdateDtoType$outboundSchema: z.ZodNativeEnum< typeof DynamicConfigFullUpdateDtoType > = DynamicConfigFullUpdateDtoType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DynamicConfigFullUpdateDtoType$ { /** @deprecated use `DynamicConfigFullUpdateDtoType$inboundSchema` instead. */ export const inboundSchema = DynamicConfigFullUpdateDtoType$inboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoType$outboundSchema` instead. */ export const outboundSchema = DynamicConfigFullUpdateDtoType$outboundSchema; } /** @internal */ export const DynamicConfigFullUpdateDtoConditions$inboundSchema: z.ZodType< DynamicConfigFullUpdateDtoConditions, 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: DynamicConfigFullUpdateDtoType$inboundSchema, }); /** @internal */ export type DynamicConfigFullUpdateDtoConditions$Outbound = { targetValue?: Array | Array | string | number | null | undefined; operator?: string | undefined; field?: any | null | undefined; customID?: any | null | undefined; type: string; }; /** @internal */ export const DynamicConfigFullUpdateDtoConditions$outboundSchema: z.ZodType< DynamicConfigFullUpdateDtoConditions$Outbound, z.ZodTypeDef, DynamicConfigFullUpdateDtoConditions > = 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: DynamicConfigFullUpdateDtoType$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DynamicConfigFullUpdateDtoConditions$ { /** @deprecated use `DynamicConfigFullUpdateDtoConditions$inboundSchema` instead. */ export const inboundSchema = DynamicConfigFullUpdateDtoConditions$inboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoConditions$outboundSchema` instead. */ export const outboundSchema = DynamicConfigFullUpdateDtoConditions$outboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoConditions$Outbound` instead. */ export type Outbound = DynamicConfigFullUpdateDtoConditions$Outbound; } /** @internal */ export const DynamicConfigFullUpdateDtoRules$inboundSchema: z.ZodType< DynamicConfigFullUpdateDtoRules, z.ZodTypeDef, unknown > = z.object({ name: z.string(), passPercentage: z.number(), conditions: z.array(z.lazy(() => DynamicConfigFullUpdateDtoConditions$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 DynamicConfigFullUpdateDtoRules$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 DynamicConfigFullUpdateDtoRules$outboundSchema: z.ZodType< DynamicConfigFullUpdateDtoRules$Outbound, z.ZodTypeDef, DynamicConfigFullUpdateDtoRules > = z.object({ name: z.string(), passPercentage: z.number(), conditions: z.array(z.lazy(() => DynamicConfigFullUpdateDtoConditions$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 DynamicConfigFullUpdateDtoRules$ { /** @deprecated use `DynamicConfigFullUpdateDtoRules$inboundSchema` instead. */ export const inboundSchema = DynamicConfigFullUpdateDtoRules$inboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoRules$outboundSchema` instead. */ export const outboundSchema = DynamicConfigFullUpdateDtoRules$outboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoRules$Outbound` instead. */ export type Outbound = DynamicConfigFullUpdateDtoRules$Outbound; } /** @internal */ export const DynamicConfigFullUpdateDtoTargetApps$inboundSchema: z.ZodType< DynamicConfigFullUpdateDtoTargetApps, z.ZodTypeDef, unknown > = z.union([z.string(), z.array(z.string())]); /** @internal */ export type DynamicConfigFullUpdateDtoTargetApps$Outbound = string | Array; /** @internal */ export const DynamicConfigFullUpdateDtoTargetApps$outboundSchema: z.ZodType< DynamicConfigFullUpdateDtoTargetApps$Outbound, z.ZodTypeDef, DynamicConfigFullUpdateDtoTargetApps > = 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 DynamicConfigFullUpdateDtoTargetApps$ { /** @deprecated use `DynamicConfigFullUpdateDtoTargetApps$inboundSchema` instead. */ export const inboundSchema = DynamicConfigFullUpdateDtoTargetApps$inboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoTargetApps$outboundSchema` instead. */ export const outboundSchema = DynamicConfigFullUpdateDtoTargetApps$outboundSchema; /** @deprecated use `DynamicConfigFullUpdateDtoTargetApps$Outbound` instead. */ export type Outbound = DynamicConfigFullUpdateDtoTargetApps$Outbound; } /** @internal */ export const DynamicConfigFullUpdateDto$inboundSchema: z.ZodType< DynamicConfigFullUpdateDto, z.ZodTypeDef, unknown > = z.object({ isEnabled: z.boolean().default(true), description: z.string(), rules: z.array(z.lazy(() => DynamicConfigFullUpdateDtoRules$inboundSchema)), defaultValue: z.record(z.any()).optional(), defaultValueJson5: z.string().optional(), idType: z.string().optional(), tags: z.array(z.string()).optional(), creatorID: z.nullable(z.any()).optional(), creatorEmail: z.nullable(z.any()).optional(), schema: z.nullable(z.any()).optional(), schemaJson5: z.nullable(z.any()).optional(), targetApps: z.union([z.string(), z.array(z.string())]).optional(), team: z.nullable(z.any()).optional(), }); /** @internal */ export type DynamicConfigFullUpdateDto$Outbound = { isEnabled: boolean; description: string; rules: Array; defaultValue?: { [k: string]: any } | undefined; defaultValueJson5?: string | undefined; idType?: string | undefined; tags?: Array | undefined; creatorID?: any | null | undefined; creatorEmail?: any | null | undefined; schema?: any | null | undefined; schemaJson5?: any | null | undefined; targetApps?: string | Array | undefined; team?: any | null | undefined; }; /** @internal */ export const DynamicConfigFullUpdateDto$outboundSchema: z.ZodType< DynamicConfigFullUpdateDto$Outbound, z.ZodTypeDef, DynamicConfigFullUpdateDto > = z.object({ isEnabled: z.boolean().default(true), description: z.string(), rules: z.array(z.lazy(() => DynamicConfigFullUpdateDtoRules$outboundSchema)), defaultValue: z.record(z.any()).optional(), defaultValueJson5: z.string().optional(), idType: z.string().optional(), tags: z.array(z.string()).optional(), creatorID: z.nullable(z.any()).optional(), creatorEmail: z.nullable(z.any()).optional(), schema: z.nullable(z.any()).optional(), schemaJson5: z.nullable(z.any()).optional(), targetApps: z.union([z.string(), z.array(z.string())]).optional(), team: z.nullable(z.any()).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DynamicConfigFullUpdateDto$ { /** @deprecated use `DynamicConfigFullUpdateDto$inboundSchema` instead. */ export const inboundSchema = DynamicConfigFullUpdateDto$inboundSchema; /** @deprecated use `DynamicConfigFullUpdateDto$outboundSchema` instead. */ export const outboundSchema = DynamicConfigFullUpdateDto$outboundSchema; /** @deprecated use `DynamicConfigFullUpdateDto$Outbound` instead. */ export type Outbound = DynamicConfigFullUpdateDto$Outbound; }