Skip to content

Commit

Permalink
feat(specs): update estimate response type [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4101

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Christopher Hawke <[email protected]>
  • Loading branch information
algolia-bot and cdhawke committed Nov 14, 2024
1 parent bb6687e commit 5248938
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions lib/algolia/models/abtesting/estimate_ab_test_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ class EstimateABTestResponse
# Estimated number of days needed to reach the sample sizes required for detecting the configured effect. This value is based on historical traffic.
attr_accessor :duration_days

# Number of tracked searches needed to be able to detect the configured effect for the control variant.
attr_accessor :control_sample_size

# Number of tracked searches needed to be able to detect the configured effect for the experiment variant.
attr_accessor :experiment_sample_size
# Sample size estimates for each variant. The first element is the control variant. Each element is the estimated number of searches required to achieve the desired statistical significance.
attr_accessor :sample_sizes

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:duration_days => :durationDays,
:control_sample_size => :controlSampleSize,
:experiment_sample_size => :experimentSampleSize
:sample_sizes => :sampleSizes
}
end

Expand All @@ -33,8 +29,7 @@ def self.acceptable_attributes
def self.types_mapping
{
:duration_days => :"Integer",
:control_sample_size => :"Integer",
:experiment_sample_size => :"Integer"
:sample_sizes => :"Array<Integer>"
}
end

Expand Down Expand Up @@ -72,12 +67,10 @@ def initialize(attributes = {})
self.duration_days = attributes[:duration_days]
end

if attributes.key?(:control_sample_size)
self.control_sample_size = attributes[:control_sample_size]
end

if attributes.key?(:experiment_sample_size)
self.experiment_sample_size = attributes[:experiment_sample_size]
if attributes.key?(:sample_sizes)
if (value = attributes[:sample_sizes]).is_a?(Array)
self.sample_sizes = value
end
end
end

Expand All @@ -87,8 +80,7 @@ def ==(other)
return true if self.equal?(other)
self.class == other.class &&
duration_days == other.duration_days &&
control_sample_size == other.control_sample_size &&
experiment_sample_size == other.experiment_sample_size
sample_sizes == other.sample_sizes
end

# @see the `==` method
Expand All @@ -100,7 +92,7 @@ def eql?(other)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[duration_days, control_sample_size, experiment_sample_size].hash
[duration_days, sample_sizes].hash
end

# Builds the object from hash
Expand Down

0 comments on commit 5248938

Please sign in to comment.