import type * as Whop from "../../../../index.js"; /** * @example * { * id: "id" * } */ export interface UpdateExperimentsRequest { /** The experiment identifier — the `expt_` id or the flag_key handle. */ id: string; /** Owning account ID. Required when id is a flag key; optional for an expt_ ID. */ account_id?: string; control?: UpdateExperimentsRequest.Control; /** Omit to leave unchanged. Send an empty string to clear it. Not accepted on feature flags. When setting it, structure it as "If we [change] for [cohort], then [measurable behavior] will [increase/decrease], resulting in [business outcome], because [evidence]. Created by [name]." same as on create. */ hypothesis?: string | null; /** Resource owned by the account that this experiment is bound to, such as an app or product. `null` when unbound. Fixed once the experiment first activates. */ related_resource?: Whop.ExperimentResourceReference; /** Replace the targeting rules with this set. Omit to leave unchanged. */ targeting_rules?: UpdateExperimentsRequest.TargetingRules.Item[]; /** Grow treatment allocation. Pass every existing treatment with an equal-or-higher weight; append new names to add arms. Weights never decrease and arms are never removed. Omit to leave unchanged. */ variants?: UpdateExperimentsRequest.Variants.Item[]; } export declare namespace UpdateExperimentsRequest { interface Control { related_resource?: Whop.ExperimentResourceReference | undefined; } type TargetingRules = TargetingRules.Item[]; namespace TargetingRules { interface Item { /** Conditions within this rule. Must be non-empty. All conditions must be satisfied for the rule to match (AND logic). Rules are OR-ed together. */ conditions: Item.Conditions.Item[]; /** `include` — users matching this rule qualify; `exclude` — users matching this rule are always excluded, overriding any include rule. Defaults to `include`. */ type?: Item.Type | undefined; } namespace Item { type Conditions = Conditions.Item[]; namespace Conditions { interface Item { /** Property name to read from the user context. Required when `type` is `property`. */ field?: (string | null) | undefined; /** Comparison to apply: `any`/`none` — inclusion/exclusion list; `eq`/`neq` — equality; `gt`/`gte`/`lt`/`lte` — numeric range. */ operator: Item.Operator; /** `user_id` — match on subject user ID; `account_id` — match on account ID (prefixed `biz_`); `property` — match on a named user property (requires `field`). */ type: Item.Type; value?: unknown | undefined; } namespace Item { /** Comparison to apply: `any`/`none` — inclusion/exclusion list; `eq`/`neq` — equality; `gt`/`gte`/`lt`/`lte` — numeric range. */ const Operator: { readonly Any: "any"; readonly None: "none"; readonly Eq: "eq"; readonly Neq: "neq"; readonly Gt: "gt"; readonly Gte: "gte"; readonly Lt: "lt"; readonly Lte: "lte"; }; type Operator = (typeof Operator)[keyof typeof Operator]; /** `user_id` — match on subject user ID; `account_id` — match on account ID (prefixed `biz_`); `property` — match on a named user property (requires `field`). */ const Type: { readonly UserId: "user_id"; readonly AccountId: "account_id"; readonly Property: "property"; }; type Type = (typeof Type)[keyof typeof Type]; } } /** `include` — users matching this rule qualify; `exclude` — users matching this rule are always excluded, overriding any include rule. Defaults to `include`. */ const Type: { readonly Include: "include"; readonly Exclude: "exclude"; }; type Type = (typeof Type)[keyof typeof Type]; } } type Variants = Variants.Item[]; namespace Variants { interface Item { /** Treatment name. Pass every existing treatment (weights equal or higher); append new names to add arms. `control` is reserved. */ name: string; related_resource?: Whop.ExperimentResourceReference | undefined; /** Percentage assigned to treatment; allocation may only grow. */ weight?: number | undefined; } } }