Skip to content

Commit 5248938

Browse files
algolia-botcdhawke
andcommitted
feat(specs): update estimate response type [skip-bc] (generated)
algolia/api-clients-automation#4101 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Christopher Hawke <[email protected]>
1 parent bb6687e commit 5248938

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

lib/algolia/models/abtesting/estimate_ab_test_response.rb

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ class EstimateABTestResponse
99
# Estimated number of days needed to reach the sample sizes required for detecting the configured effect. This value is based on historical traffic.
1010
attr_accessor :duration_days
1111

12-
# Number of tracked searches needed to be able to detect the configured effect for the control variant.
13-
attr_accessor :control_sample_size
14-
15-
# Number of tracked searches needed to be able to detect the configured effect for the experiment variant.
16-
attr_accessor :experiment_sample_size
12+
# 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.
13+
attr_accessor :sample_sizes
1714

1815
# Attribute mapping from ruby-style variable name to JSON key.
1916
def self.attribute_map
2017
{
2118
:duration_days => :durationDays,
22-
:control_sample_size => :controlSampleSize,
23-
:experiment_sample_size => :experimentSampleSize
19+
:sample_sizes => :sampleSizes
2420
}
2521
end
2622

@@ -33,8 +29,7 @@ def self.acceptable_attributes
3329
def self.types_mapping
3430
{
3531
:duration_days => :"Integer",
36-
:control_sample_size => :"Integer",
37-
:experiment_sample_size => :"Integer"
32+
:sample_sizes => :"Array<Integer>"
3833
}
3934
end
4035

@@ -72,12 +67,10 @@ def initialize(attributes = {})
7267
self.duration_days = attributes[:duration_days]
7368
end
7469

75-
if attributes.key?(:control_sample_size)
76-
self.control_sample_size = attributes[:control_sample_size]
77-
end
78-
79-
if attributes.key?(:experiment_sample_size)
80-
self.experiment_sample_size = attributes[:experiment_sample_size]
70+
if attributes.key?(:sample_sizes)
71+
if (value = attributes[:sample_sizes]).is_a?(Array)
72+
self.sample_sizes = value
73+
end
8174
end
8275
end
8376

@@ -87,8 +80,7 @@ def ==(other)
8780
return true if self.equal?(other)
8881
self.class == other.class &&
8982
duration_days == other.duration_days &&
90-
control_sample_size == other.control_sample_size &&
91-
experiment_sample_size == other.experiment_sample_size
83+
sample_sizes == other.sample_sizes
9284
end
9385

9486
# @see the `==` method
@@ -100,7 +92,7 @@ def eql?(other)
10092
# Calculates hash code according to all attributes.
10193
# @return [Integer] Hash code
10294
def hash
103-
[duration_days, control_sample_size, experiment_sample_size].hash
95+
[duration_days, sample_sizes].hash
10496
end
10597

10698
# Builds the object from hash

0 commit comments

Comments
 (0)