Class CreateExperimentRequest

java.lang.Object
ai.shipeasy.admin.model.CreateExperimentRequest

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class CreateExperimentRequest extends Object
Body for `POST /api/admin/experiments`. `name`, `universe`, and `groups` (≥2, weights sum to 10000) required.
  • Field Details

  • Constructor Details

    • CreateExperimentRequest

      public CreateExperimentRequest()
  • Method Details

    • name

      public CreateExperimentRequest name(@Nonnull String name)
    • getName

      @Nonnull public String getName()
      Stable experiment key. Single segment or `folder.name` (a-z, 0-9, `_`/`-`; max 128 chars). Used by SDKs as `Shipeasy.getExperiment(user, '<name>')`. Immutable after create.
      Returns:
      name
    • setName

      public void setName(@Nonnull String name)
    • description

      public CreateExperimentRequest description(@Nullable String description)
    • getDescription

      @Nullable public String getDescription()
      Free-form description. Max 2000 chars, markdown rendered in the dashboard.
      Returns:
      description
    • setDescription

      public void setDescription(@Nullable String description)
    • hypothesis

      public CreateExperimentRequest hypothesis(@Nullable String hypothesis)
    • getHypothesis

      @Nullable public String getHypothesis()
      Hypothesis statement shown in the editor. Display-only.
      Returns:
      hypothesis
    • setHypothesis

      public void setHypothesis(@Nullable String hypothesis)
    • tag

      public CreateExperimentRequest tag(@Nullable String tag)
    • getTag

      @Nullable public String getTag()
      Short tag chip rendered next to the name. Display-only.
      Returns:
      tag
    • setTag

      public void setTag(@Nullable String tag)
    • ownerEmail

      public CreateExperimentRequest ownerEmail(@Nullable String ownerEmail)
    • getOwnerEmail

      @Nullable public String getOwnerEmail()
      Owner email. Display-only.
      Returns:
      ownerEmail
    • setOwnerEmail

      public void setOwnerEmail(@Nullable String ownerEmail)
    • audience

      public CreateExperimentRequest audience(@Nullable String audience)
    • getAudience

      @Nullable public String getAudience()
      Audience label shown in the editor. Display-only.
      Returns:
      audience
    • setAudience

      public void setAudience(@Nullable String audience)
    • bucketBy

      public CreateExperimentRequest bucketBy(@Nullable String bucketBy)
    • getBucketBy

      @Nullable public String getBucketBy()
      User-attribute name used as the bucketing key — e.g. `user_id` (default), `session_id`, `device_id`, or a custom attribute like `company_id` to keep a whole org on one variant. Defaults to `user_id` when omitted.
      Returns:
      bucketBy
    • setBucketBy

      public void setBucketBy(@Nullable String bucketBy)
    • folder

      public CreateExperimentRequest folder(@Nullable String folder)
    • getFolder

      @Nullable public String getFolder()
      Optional folder name grouping items in the dashboard. Alphanumeric, `_` or `-` (no `/`). Part of the SDK lookup key (`<folder>/<name>`).
      Returns:
      folder
    • setFolder

      public void setFolder(@Nullable String folder)
    • universe

      public CreateExperimentRequest universe(@Nonnull String universe)
    • getUniverse

      @Nonnull public String getUniverse()
      Name of an existing universe in the project. Returns `422` if the universe doesn't exist.
      Returns:
      universe
    • setUniverse

      public void setUniverse(@Nonnull String universe)
    • targetingGate

      public CreateExperimentRequest targetingGate(@Nullable String targetingGate)
    • getTargetingGate

      @Nullable public String getTargetingGate()
      Optional gate name. Only callers that pass the gate are enrolled in the experiment.
      Returns:
      targetingGate
    • setTargetingGate

      public void setTargetingGate(@Nullable String targetingGate)
    • allocationPct

      public CreateExperimentRequest allocationPct(@Nullable Integer allocationPct)
    • getAllocationPct

      @Nullable public Integer getAllocationPct()
      Share of the (gated) audience allocated to the experiment, in basis points (0–10000 = 0%–100%). `0` = unallocated. Use `allocation_percent` (0–100) below to think in percent. Immutable while the experiment is running. minimum: 0 maximum: 10000
      Returns:
      allocationPct
    • setAllocationPct

      public void setAllocationPct(@Nullable Integer allocationPct)
    • allocationPercent

      public CreateExperimentRequest allocationPercent(@Nullable BigDecimal allocationPercent)
    • getAllocationPercent

      @Nullable public BigDecimal getAllocationPercent()
      Allocation as a **percentage** (0–100, fractional ok). Friendlier alias for `allocation_pct`; converted to basis points server-side (e.g. `50` = 5000 bp). If both are set, `allocation_percent` wins. minimum: 0 maximum: 100
      Returns:
      allocationPercent
    • setAllocationPercent

      public void setAllocationPercent(@Nullable BigDecimal allocationPercent)
    • salt

      public CreateExperimentRequest salt(@Nullable String salt)
    • getSalt

      @Nullable public String getSalt()
      Hash salt for bucketing. Auto-generated if omitted. Immutable while running.
      Returns:
      salt
    • setSalt

      public void setSalt(@Nullable String salt)
    • params

    • putParamsItem

      public CreateExperimentRequest putParamsItem(String key, CreateExperimentRequest.InnerEnum paramsItem)
    • getParams

      @Nullable public Map<String,CreateExperimentRequest.InnerEnum> getParams()
      Map of param-name → scalar type. Defines the shape of `groups[].params`. Example: `{ headline: 'string', show_cta: 'bool' }`.
      Returns:
      params
    • setParams

      public void setParams(@Nullable Map<String,CreateExperimentRequest.InnerEnum> params)
    • groups

    • addGroupsItem

    • getGroups

      @Nonnull public List<ListExperimentsResponseDataInnerGroupsInner> getGroups()
      Two or more variants. Weights must sum to exactly 10000 (100%). Immutable while running.
      Returns:
      groups
    • setGroups

      public void setGroups(@Nonnull List<ListExperimentsResponseDataInnerGroupsInner> groups)
    • significanceThreshold

      public CreateExperimentRequest significanceThreshold(@Nullable BigDecimal significanceThreshold)
    • getSignificanceThreshold

      @Nullable public BigDecimal getSignificanceThreshold()
      p-value cutoff used by the analysis pass. Defaults to `0.05`. Values other than 0.05 require Pro plan or higher. minimum: 0.00010 maximum: 0.5
      Returns:
      significanceThreshold
    • setSignificanceThreshold

      public void setSignificanceThreshold(@Nullable BigDecimal significanceThreshold)
    • minRuntimeDays

      public CreateExperimentRequest minRuntimeDays(@Nullable Integer minRuntimeDays)
    • getMinRuntimeDays

      @Nullable public Integer getMinRuntimeDays()
      Minimum days the experiment must run before results are considered conclusive. minimum: 0 maximum: 365
      Returns:
      minRuntimeDays
    • setMinRuntimeDays

      public void setMinRuntimeDays(@Nullable Integer minRuntimeDays)
    • minSampleSize

      public CreateExperimentRequest minSampleSize(@Nullable Integer minSampleSize)
    • getMinSampleSize

      @Nullable public Integer getMinSampleSize()
      Minimum exposures per group before results are considered conclusive. minimum: 1 maximum: 9007199254740991
      Returns:
      minSampleSize
    • setMinSampleSize

      public void setMinSampleSize(@Nullable Integer minSampleSize)
    • sequentialTesting

      public CreateExperimentRequest sequentialTesting(@Nullable Boolean sequentialTesting)
    • getSequentialTesting

      @Nullable public Boolean getSequentialTesting()
      Enable sequential testing (always-valid p-values). Requires Premium plan or higher.
      Returns:
      sequentialTesting
    • setSequentialTesting

      public void setSequentialTesting(@Nullable Boolean sequentialTesting)
    • goalMetric

      public CreateExperimentRequest goalMetric(@Nullable ExperimentInlineMetric goalMetric)
    • getGoalMetric

      @Nullable public ExperimentInlineMetric getGoalMetric()
      Single goal metric defined inline — either a DSL `query` or an `event` (+`aggregation`/`value`) the server compiles. Attaching one is required before the experiment can be started. The underlying event is auto-created if missing.
      Returns:
      goalMetric
    • setGoalMetric

      public void setGoalMetric(@Nullable ExperimentInlineMetric goalMetric)
    • guardrailMetrics

      public CreateExperimentRequest guardrailMetrics(@Nullable List<ExperimentInlineMetric> guardrailMetrics)
    • addGuardrailMetricsItem

      public CreateExperimentRequest addGuardrailMetricsItem(ExperimentInlineMetric guardrailMetricsItem)
    • getGuardrailMetrics

      @Nullable public List<ExperimentInlineMetric> getGuardrailMetrics()
      Up to 10 guardrail metrics defined inline. Each is upserted (event + metric) and attached with role=guardrail.
      Returns:
      guardrailMetrics
    • setGuardrailMetrics

      public void setGuardrailMetrics(@Nullable List<ExperimentInlineMetric> guardrailMetrics)
    • putAdditionalProperty

      public CreateExperimentRequest putAdditionalProperty(String key, Object value)
      Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.
      Parameters:
      key - name of the property
      value - value of the property
      Returns:
      the CreateExperimentRequest instance itself
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Return the additional (undeclared) property.
      Returns:
      a map of objects
    • getAdditionalProperty

      public Object getAdditionalProperty(String key)
      Return the additional (undeclared) property with the specified name.
      Parameters:
      key - name of the property
      Returns:
      an object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to CreateExperimentRequest
    • fromJson

      public static CreateExperimentRequest fromJson(String jsonString) throws IOException
      Create an instance of CreateExperimentRequest given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of CreateExperimentRequest
      Throws:
      IOException - if the JSON string is invalid with respect to CreateExperimentRequest
    • toJson

      public String toJson()
      Convert an instance of CreateExperimentRequest to an JSON string
      Returns:
      JSON string