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