Skip to content

Commit 12c6244

Browse files
algolia-botcdhawke
andcommitted
feat(specs): update estimate response type [skip-bc] (#4101) (generated) [skip ci]
Co-authored-by: Christopher Hawke <[email protected]>
1 parent 39ad054 commit 12c6244

File tree

12 files changed

+127
-246
lines changed

12 files changed

+127
-246
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Models/Abtesting/EstimateABTestResponse.cs

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,11 @@ public EstimateABTestResponse()
3131
public long? DurationDays { get; set; }
3232

3333
/// <summary>
34-
/// Number of tracked searches needed to be able to detect the configured effect for the control variant.
34+
/// 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.
3535
/// </summary>
36-
/// <value>Number of tracked searches needed to be able to detect the configured effect for the control variant.</value>
37-
[JsonPropertyName("controlSampleSize")]
38-
public long? ControlSampleSize { get; set; }
39-
40-
/// <summary>
41-
/// Number of tracked searches needed to be able to detect the configured effect for the experiment variant.
42-
/// </summary>
43-
/// <value>Number of tracked searches needed to be able to detect the configured effect for the experiment variant.</value>
44-
[JsonPropertyName("experimentSampleSize")]
45-
public long? ExperimentSampleSize { get; set; }
36+
/// <value>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. </value>
37+
[JsonPropertyName("sampleSizes")]
38+
public List<long> SampleSizes { get; set; }
4639

4740
/// <summary>
4841
/// Returns the string presentation of the object
@@ -53,8 +46,7 @@ public override string ToString()
5346
StringBuilder sb = new StringBuilder();
5447
sb.Append("class EstimateABTestResponse {\n");
5548
sb.Append(" DurationDays: ").Append(DurationDays).Append("\n");
56-
sb.Append(" ControlSampleSize: ").Append(ControlSampleSize).Append("\n");
57-
sb.Append(" ExperimentSampleSize: ").Append(ExperimentSampleSize).Append("\n");
49+
sb.Append(" SampleSizes: ").Append(SampleSizes).Append("\n");
5850
sb.Append("}\n");
5951
return sb.ToString();
6052
}
@@ -82,8 +74,7 @@ public override bool Equals(object obj)
8274

8375
return
8476
(DurationDays == input.DurationDays || DurationDays.Equals(input.DurationDays)) &&
85-
(ControlSampleSize == input.ControlSampleSize || ControlSampleSize.Equals(input.ControlSampleSize)) &&
86-
(ExperimentSampleSize == input.ExperimentSampleSize || ExperimentSampleSize.Equals(input.ExperimentSampleSize));
77+
(SampleSizes == input.SampleSizes || SampleSizes != null && input.SampleSizes != null && SampleSizes.SequenceEqual(input.SampleSizes));
8778
}
8879

8980
/// <summary>
@@ -96,8 +87,10 @@ public override int GetHashCode()
9687
{
9788
int hashCode = 41;
9889
hashCode = (hashCode * 59) + DurationDays.GetHashCode();
99-
hashCode = (hashCode * 59) + ControlSampleSize.GetHashCode();
100-
hashCode = (hashCode * 59) + ExperimentSampleSize.GetHashCode();
90+
if (SampleSizes != null)
91+
{
92+
hashCode = (hashCode * 59) + SampleSizes.GetHashCode();
93+
}
10194
return hashCode;
10295
}
10396
}

clients/algoliasearch-client-go/algolia/abtesting/model_estimate_ab_test_response.go

Lines changed: 22 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/abtesting/EstimateABTestResponse.java

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import com.fasterxml.jackson.annotation.*;
77
import com.fasterxml.jackson.databind.annotation.*;
8+
import java.util.ArrayList;
9+
import java.util.List;
810
import java.util.Objects;
911

1012
/** EstimateABTestResponse */
@@ -13,11 +15,8 @@ public class EstimateABTestResponse {
1315
@JsonProperty("durationDays")
1416
private Long durationDays;
1517

16-
@JsonProperty("controlSampleSize")
17-
private Long controlSampleSize;
18-
19-
@JsonProperty("experimentSampleSize")
20-
private Long experimentSampleSize;
18+
@JsonProperty("sampleSizes")
19+
private List<Long> sampleSizes;
2120

2221
public EstimateABTestResponse setDurationDays(Long durationDays) {
2322
this.durationDays = durationDays;
@@ -33,32 +32,26 @@ public Long getDurationDays() {
3332
return durationDays;
3433
}
3534

36-
public EstimateABTestResponse setControlSampleSize(Long controlSampleSize) {
37-
this.controlSampleSize = controlSampleSize;
35+
public EstimateABTestResponse setSampleSizes(List<Long> sampleSizes) {
36+
this.sampleSizes = sampleSizes;
3837
return this;
3938
}
4039

41-
/**
42-
* Number of tracked searches needed to be able to detect the configured effect for the control
43-
* variant.
44-
*/
45-
@javax.annotation.Nullable
46-
public Long getControlSampleSize() {
47-
return controlSampleSize;
48-
}
49-
50-
public EstimateABTestResponse setExperimentSampleSize(Long experimentSampleSize) {
51-
this.experimentSampleSize = experimentSampleSize;
40+
public EstimateABTestResponse addSampleSizes(Long sampleSizesItem) {
41+
if (this.sampleSizes == null) {
42+
this.sampleSizes = new ArrayList<>();
43+
}
44+
this.sampleSizes.add(sampleSizesItem);
5245
return this;
5346
}
5447

5548
/**
56-
* Number of tracked searches needed to be able to detect the configured effect for the experiment
57-
* variant.
49+
* Sample size estimates for each variant. The first element is the control variant. Each element
50+
* is the estimated number of searches required to achieve the desired statistical significance.
5851
*/
5952
@javax.annotation.Nullable
60-
public Long getExperimentSampleSize() {
61-
return experimentSampleSize;
53+
public List<Long> getSampleSizes() {
54+
return sampleSizes;
6255
}
6356

6457
@Override
@@ -72,23 +65,21 @@ public boolean equals(Object o) {
7265
EstimateABTestResponse estimateABTestResponse = (EstimateABTestResponse) o;
7366
return (
7467
Objects.equals(this.durationDays, estimateABTestResponse.durationDays) &&
75-
Objects.equals(this.controlSampleSize, estimateABTestResponse.controlSampleSize) &&
76-
Objects.equals(this.experimentSampleSize, estimateABTestResponse.experimentSampleSize)
68+
Objects.equals(this.sampleSizes, estimateABTestResponse.sampleSizes)
7769
);
7870
}
7971

8072
@Override
8173
public int hashCode() {
82-
return Objects.hash(durationDays, controlSampleSize, experimentSampleSize);
74+
return Objects.hash(durationDays, sampleSizes);
8375
}
8476

8577
@Override
8678
public String toString() {
8779
StringBuilder sb = new StringBuilder();
8880
sb.append("class EstimateABTestResponse {\n");
8981
sb.append(" durationDays: ").append(toIndentedString(durationDays)).append("\n");
90-
sb.append(" controlSampleSize: ").append(toIndentedString(controlSampleSize)).append("\n");
91-
sb.append(" experimentSampleSize: ").append(toIndentedString(experimentSampleSize)).append("\n");
82+
sb.append(" sampleSizes: ").append(toIndentedString(sampleSizes)).append("\n");
9283
sb.append("}");
9384
return sb.toString();
9485
}

clients/algoliasearch-client-javascript/packages/client-abtesting/model/estimateABTestResponse.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ export type EstimateABTestResponse = {
77
durationDays?: number;
88

99
/**
10-
* Number of tracked searches needed to be able to detect the configured effect for the control variant.
10+
* 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.
1111
*/
12-
controlSampleSize?: number;
13-
14-
/**
15-
* Number of tracked searches needed to be able to detect the configured effect for the experiment variant.
16-
*/
17-
experimentSampleSize?: number;
12+
sampleSizes?: Array<number>;
1813
};

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/abtesting/EstimateABTestResponse.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@ import kotlinx.serialization.json.*
88
* EstimateABTestResponse
99
*
1010
* @param durationDays Estimated number of days needed to reach the sample sizes required for detecting the configured effect. This value is based on historical traffic.
11-
* @param controlSampleSize Number of tracked searches needed to be able to detect the configured effect for the control variant.
12-
* @param experimentSampleSize Number of tracked searches needed to be able to detect the configured effect for the experiment variant.
11+
* @param sampleSizes 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.
1312
*/
1413
@Serializable
1514
public data class EstimateABTestResponse(
1615

1716
/** Estimated number of days needed to reach the sample sizes required for detecting the configured effect. This value is based on historical traffic. */
1817
@SerialName(value = "durationDays") val durationDays: Long? = null,
1918

20-
/** Number of tracked searches needed to be able to detect the configured effect for the control variant. */
21-
@SerialName(value = "controlSampleSize") val controlSampleSize: Long? = null,
22-
23-
/** Number of tracked searches needed to be able to detect the configured effect for the experiment variant. */
24-
@SerialName(value = "experimentSampleSize") val experimentSampleSize: Long? = null,
19+
/** 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. */
20+
@SerialName(value = "sampleSizes") val sampleSizes: List<Long>? = null,
2521
)

0 commit comments

Comments
 (0)