/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; export type AutotuneExperimentDtoVariants = { /** * Variant name */ name: string; /** * Variant JSON data */ json?: any | undefined; /** * The name that was originally given to the autotune on creation but formatted as an ID ("A Autotune" -> "a_autotune"). */ id: string; }; /** * The initial time period where Autotune will equally split the traffic. */ export const AutotuneExperimentDtoExplorationWindow = { Onehr: "1hr", TwentyFourhr: "24hr", FortyEighthr: "48hr", One: "1", TwentyFour: "24", FortyEight: "48", Onehrs: "1hrs", TwentyFourhrs: "24hrs", FortyEighthrs: "48hrs", } as const; /** * The initial time period where Autotune will equally split the traffic. */ export type AutotuneExperimentDtoExplorationWindow = ClosedEnum< typeof AutotuneExperimentDtoExplorationWindow >; /** * The maximum duration between the exposure and success event that counts as a success. */ export const AutotuneExperimentDtoAttributionWindow = { Onehr: "1hr", Twohr: "2hr", Fourhr: "4hr", TwentyFourhr: "24hr", Onehrs: "1hrs", Twohrs: "2hrs", Fourhrs: "4hrs", TwentyFourhrs: "24hrs", One: "1", Two: "2", Four: "4", TwentyFour: "24", } as const; /** * The maximum duration between the exposure and success event that counts as a success. */ export type AutotuneExperimentDtoAttributionWindow = ClosedEnum< typeof AutotuneExperimentDtoAttributionWindow >; /** * The "probability of best" threshold a variant needs to achieve for Autotune to declare it the winner, stop collecting data, and direct all traffic. */ export const AutotuneExperimentDtoWinnerThreshold = { EightyPercent: "80%", NinetyPercent: "90%", NinetyFivePercent: "95%", NinetyEightPercent: "98%", NinetyNinePercent: "99%", } as const; /** * The "probability of best" threshold a variant needs to achieve for Autotune to declare it the winner, stop collecting data, and direct all traffic. */ export type AutotuneExperimentDtoWinnerThreshold = ClosedEnum< typeof AutotuneExperimentDtoWinnerThreshold >; export type Winner = { /** * The Statsig UserID of the last modifier of this autotune. */ id: string; /** * The Statsig Username of the last modifier of this autotune. */ name: string; }; export type AutotuneExperimentDto = { /** * Detailed description of the configuration’s purpose. */ description: string; variants: Array; /** * The event you are trying to optimize for. */ successEvent: string; /** * The value that should come with the event for it to be considered successful. */ successEventValue: string; /** * The initial time period where Autotune will equally split the traffic. */ explorationWindow: AutotuneExperimentDtoExplorationWindow; /** * The maximum duration between the exposure and success event that counts as a success. */ attributionWindow: AutotuneExperimentDtoAttributionWindow; /** * The "probability of best" threshold a variant needs to achieve for Autotune to declare it the winner, stop collecting data, and direct all traffic. */ winnerThreshold: AutotuneExperimentDtoWinnerThreshold; /** * ID */ id: string; /** * Optional name for the configuration. */ name?: string | undefined; /** * Type of ID */ idType: string; /** * ID of the last modifier. */ lastModifierID?: any | null | undefined; /** * Time of the last modification. */ lastModifiedTime?: any | null | undefined; /** * Email of the last modifier. */ lastModifierEmail?: any | null | undefined; /** * Name of the last modifier. */ lastModifierName?: any | null | undefined; /** * ID of the user who created the entity. */ creatorID?: any | null | undefined; /** * Timestamp when the entity was created. */ createdTime: number; /** * Name of the creator. */ creatorName?: any | null | undefined; /** * Email of the creator. */ creatorEmail?: any | null | undefined; /** * Optional tags for categorization. */ tags?: Array | undefined; /** * List of target applications associated with this configuration. */ targetApps?: Array | undefined; /** * Holdouts applied to this configuration. */ holdoutIDs?: Array | undefined; /** * Optional identifier for the responsible team. */ team?: any | null | undefined; /** * Is the autotune experiment currently running. */ isStarted: boolean; winner: Winner | null; }; /** @internal */ export const AutotuneExperimentDtoVariants$inboundSchema: z.ZodType< AutotuneExperimentDtoVariants, z.ZodTypeDef, unknown > = z.object({ name: z.string(), json: z.any().optional(), id: z.string(), }); /** @internal */ export type AutotuneExperimentDtoVariants$Outbound = { name: string; json?: any | undefined; id: string; }; /** @internal */ export const AutotuneExperimentDtoVariants$outboundSchema: z.ZodType< AutotuneExperimentDtoVariants$Outbound, z.ZodTypeDef, AutotuneExperimentDtoVariants > = z.object({ name: z.string(), json: z.any().optional(), id: 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 AutotuneExperimentDtoVariants$ { /** @deprecated use `AutotuneExperimentDtoVariants$inboundSchema` instead. */ export const inboundSchema = AutotuneExperimentDtoVariants$inboundSchema; /** @deprecated use `AutotuneExperimentDtoVariants$outboundSchema` instead. */ export const outboundSchema = AutotuneExperimentDtoVariants$outboundSchema; /** @deprecated use `AutotuneExperimentDtoVariants$Outbound` instead. */ export type Outbound = AutotuneExperimentDtoVariants$Outbound; } /** @internal */ export const AutotuneExperimentDtoExplorationWindow$inboundSchema: z.ZodNativeEnum< typeof AutotuneExperimentDtoExplorationWindow > = z.nativeEnum(AutotuneExperimentDtoExplorationWindow); /** @internal */ export const AutotuneExperimentDtoExplorationWindow$outboundSchema: z.ZodNativeEnum< typeof AutotuneExperimentDtoExplorationWindow > = AutotuneExperimentDtoExplorationWindow$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AutotuneExperimentDtoExplorationWindow$ { /** @deprecated use `AutotuneExperimentDtoExplorationWindow$inboundSchema` instead. */ export const inboundSchema = AutotuneExperimentDtoExplorationWindow$inboundSchema; /** @deprecated use `AutotuneExperimentDtoExplorationWindow$outboundSchema` instead. */ export const outboundSchema = AutotuneExperimentDtoExplorationWindow$outboundSchema; } /** @internal */ export const AutotuneExperimentDtoAttributionWindow$inboundSchema: z.ZodNativeEnum< typeof AutotuneExperimentDtoAttributionWindow > = z.nativeEnum(AutotuneExperimentDtoAttributionWindow); /** @internal */ export const AutotuneExperimentDtoAttributionWindow$outboundSchema: z.ZodNativeEnum< typeof AutotuneExperimentDtoAttributionWindow > = AutotuneExperimentDtoAttributionWindow$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AutotuneExperimentDtoAttributionWindow$ { /** @deprecated use `AutotuneExperimentDtoAttributionWindow$inboundSchema` instead. */ export const inboundSchema = AutotuneExperimentDtoAttributionWindow$inboundSchema; /** @deprecated use `AutotuneExperimentDtoAttributionWindow$outboundSchema` instead. */ export const outboundSchema = AutotuneExperimentDtoAttributionWindow$outboundSchema; } /** @internal */ export const AutotuneExperimentDtoWinnerThreshold$inboundSchema: z.ZodNativeEnum< typeof AutotuneExperimentDtoWinnerThreshold > = z.nativeEnum(AutotuneExperimentDtoWinnerThreshold); /** @internal */ export const AutotuneExperimentDtoWinnerThreshold$outboundSchema: z.ZodNativeEnum< typeof AutotuneExperimentDtoWinnerThreshold > = AutotuneExperimentDtoWinnerThreshold$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AutotuneExperimentDtoWinnerThreshold$ { /** @deprecated use `AutotuneExperimentDtoWinnerThreshold$inboundSchema` instead. */ export const inboundSchema = AutotuneExperimentDtoWinnerThreshold$inboundSchema; /** @deprecated use `AutotuneExperimentDtoWinnerThreshold$outboundSchema` instead. */ export const outboundSchema = AutotuneExperimentDtoWinnerThreshold$outboundSchema; } /** @internal */ export const Winner$inboundSchema: z.ZodType = z.object({ id: z.string(), name: z.string(), }); /** @internal */ export type Winner$Outbound = { id: string; name: string; }; /** @internal */ export const Winner$outboundSchema: z.ZodType = z.object({ id: z.string(), name: 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 Winner$ { /** @deprecated use `Winner$inboundSchema` instead. */ export const inboundSchema = Winner$inboundSchema; /** @deprecated use `Winner$outboundSchema` instead. */ export const outboundSchema = Winner$outboundSchema; /** @deprecated use `Winner$Outbound` instead. */ export type Outbound = Winner$Outbound; } /** @internal */ export const AutotuneExperimentDto$inboundSchema: z.ZodType< AutotuneExperimentDto, z.ZodTypeDef, unknown > = z.object({ description: z.string(), variants: z.array(z.lazy(() => AutotuneExperimentDtoVariants$inboundSchema)), successEvent: z.string(), successEventValue: z.string(), explorationWindow: AutotuneExperimentDtoExplorationWindow$inboundSchema, attributionWindow: AutotuneExperimentDtoAttributionWindow$inboundSchema, winnerThreshold: AutotuneExperimentDtoWinnerThreshold$inboundSchema, id: z.string(), name: z.string().optional(), idType: z.string(), lastModifierID: z.nullable(z.any()).optional(), lastModifiedTime: z.nullable(z.any()).optional(), lastModifierEmail: z.nullable(z.any()).optional(), lastModifierName: z.nullable(z.any()).optional(), creatorID: z.nullable(z.any()).optional(), createdTime: z.number(), creatorName: z.nullable(z.any()).optional(), creatorEmail: z.nullable(z.any()).optional(), tags: z.array(z.string()).optional(), targetApps: z.array(z.string()).optional(), holdoutIDs: z.array(z.string()).optional(), team: z.nullable(z.any()).optional(), isStarted: z.boolean(), winner: z.nullable(z.lazy(() => Winner$inboundSchema)), }); /** @internal */ export type AutotuneExperimentDto$Outbound = { description: string; variants: Array; successEvent: string; successEventValue: string; explorationWindow: string; attributionWindow: string; winnerThreshold: string; id: string; name?: string | undefined; idType: string; lastModifierID?: any | null | undefined; lastModifiedTime?: any | null | undefined; lastModifierEmail?: any | null | undefined; lastModifierName?: any | null | undefined; creatorID?: any | null | undefined; createdTime: number; creatorName?: any | null | undefined; creatorEmail?: any | null | undefined; tags?: Array | undefined; targetApps?: Array | undefined; holdoutIDs?: Array | undefined; team?: any | null | undefined; isStarted: boolean; winner: Winner$Outbound | null; }; /** @internal */ export const AutotuneExperimentDto$outboundSchema: z.ZodType< AutotuneExperimentDto$Outbound, z.ZodTypeDef, AutotuneExperimentDto > = z.object({ description: z.string(), variants: z.array(z.lazy(() => AutotuneExperimentDtoVariants$outboundSchema)), successEvent: z.string(), successEventValue: z.string(), explorationWindow: AutotuneExperimentDtoExplorationWindow$outboundSchema, attributionWindow: AutotuneExperimentDtoAttributionWindow$outboundSchema, winnerThreshold: AutotuneExperimentDtoWinnerThreshold$outboundSchema, id: z.string(), name: z.string().optional(), idType: z.string(), lastModifierID: z.nullable(z.any()).optional(), lastModifiedTime: z.nullable(z.any()).optional(), lastModifierEmail: z.nullable(z.any()).optional(), lastModifierName: z.nullable(z.any()).optional(), creatorID: z.nullable(z.any()).optional(), createdTime: z.number(), creatorName: z.nullable(z.any()).optional(), creatorEmail: z.nullable(z.any()).optional(), tags: z.array(z.string()).optional(), targetApps: z.array(z.string()).optional(), holdoutIDs: z.array(z.string()).optional(), team: z.nullable(z.any()).optional(), isStarted: z.boolean(), winner: z.nullable(z.lazy(() => Winner$outboundSchema)), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AutotuneExperimentDto$ { /** @deprecated use `AutotuneExperimentDto$inboundSchema` instead. */ export const inboundSchema = AutotuneExperimentDto$inboundSchema; /** @deprecated use `AutotuneExperimentDto$outboundSchema` instead. */ export const outboundSchema = AutotuneExperimentDto$outboundSchema; /** @deprecated use `AutotuneExperimentDto$Outbound` instead. */ export type Outbound = AutotuneExperimentDto$Outbound; }