Skip to content

Commit cb2e80c

Browse files
chore: generated code for commit b56b2b4. [skip ci]
Co-authored-by: François Chalifour <[email protected]>
1 parent b56b2b4 commit cb2e80c

File tree

14 files changed

+111
-88
lines changed

14 files changed

+111
-88
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/predict/PredictionsAffinities.java

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
@JsonSerialize(using = PredictionsAffinities.PredictionsAffinitiesSerializer.class)
2020
public abstract class PredictionsAffinities implements CompoundType {
2121

22-
public static PredictionsAffinities of(AffinitiesSuccess inside) {
23-
return new PredictionsAffinitiesAffinitiesSuccess(inside);
24-
}
25-
2622
public static PredictionsAffinities of(Error inside) {
2723
return new PredictionsAffinitiesError(inside);
2824
}
2925

26+
public static PredictionsAffinities of(PredictionsAffinitiesSuccess inside) {
27+
return new PredictionsAffinitiesPredictionsAffinitiesSuccess(inside);
28+
}
29+
3030
public static class PredictionsAffinitiesSerializer extends StdSerializer<PredictionsAffinities> {
3131

3232
public PredictionsAffinitiesSerializer(Class<PredictionsAffinities> t) {
@@ -62,62 +62,66 @@ public PredictionsAffinities deserialize(JsonParser jp, DeserializationContext c
6262
int match = 0;
6363
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
6464
String currentType = "";
65-
// deserialize AffinitiesSuccess
65+
// deserialize Error
6666
try {
6767
boolean attemptParsing = true;
68-
currentType = "AffinitiesSuccess";
68+
currentType = "Error";
6969
if (
7070
((currentType.equals("Integer") || currentType.equals("Long")) && token == JsonToken.VALUE_NUMBER_INT) |
7171
((currentType.equals("Float") || currentType.equals("Double")) && token == JsonToken.VALUE_NUMBER_FLOAT) |
7272
(currentType.equals("Boolean") && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)) |
7373
(currentType.equals("String") && token == JsonToken.VALUE_STRING) |
7474
(currentType.startsWith("List<") && token == JsonToken.START_ARRAY)
7575
) {
76-
deserialized =
77-
PredictionsAffinities.of(
78-
(AffinitiesSuccess) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<AffinitiesSuccess>() {})
79-
);
76+
deserialized = PredictionsAffinities.of((Error) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Error>() {}));
8077
match++;
8178
} else if (token == JsonToken.START_OBJECT) {
8279
try {
83-
deserialized =
84-
PredictionsAffinities.of(
85-
(AffinitiesSuccess) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<AffinitiesSuccess>() {})
86-
);
80+
deserialized = PredictionsAffinities.of((Error) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Error>() {}));
8781
match++;
8882
} catch (IOException e) {
8983
// do nothing
9084
}
9185
}
9286
} catch (Exception e) {
9387
// deserialization failed, continue
94-
System.err.println("Failed to deserialize oneOf AffinitiesSuccess (error: " + e.getMessage() + ") (type: " + currentType + ")");
88+
System.err.println("Failed to deserialize oneOf Error (error: " + e.getMessage() + ") (type: " + currentType + ")");
9589
}
9690

97-
// deserialize Error
91+
// deserialize PredictionsAffinitiesSuccess
9892
try {
9993
boolean attemptParsing = true;
100-
currentType = "Error";
94+
currentType = "PredictionsAffinitiesSuccess";
10195
if (
10296
((currentType.equals("Integer") || currentType.equals("Long")) && token == JsonToken.VALUE_NUMBER_INT) |
10397
((currentType.equals("Float") || currentType.equals("Double")) && token == JsonToken.VALUE_NUMBER_FLOAT) |
10498
(currentType.equals("Boolean") && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)) |
10599
(currentType.equals("String") && token == JsonToken.VALUE_STRING) |
106100
(currentType.startsWith("List<") && token == JsonToken.START_ARRAY)
107101
) {
108-
deserialized = PredictionsAffinities.of((Error) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Error>() {}));
102+
deserialized =
103+
PredictionsAffinities.of(
104+
(PredictionsAffinitiesSuccess) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<PredictionsAffinitiesSuccess>() {})
105+
);
109106
match++;
110107
} else if (token == JsonToken.START_OBJECT) {
111108
try {
112-
deserialized = PredictionsAffinities.of((Error) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Error>() {}));
109+
deserialized =
110+
PredictionsAffinities.of(
111+
(PredictionsAffinitiesSuccess) tree
112+
.traverse(jp.getCodec())
113+
.readValueAs(new TypeReference<PredictionsAffinitiesSuccess>() {})
114+
);
113115
match++;
114116
} catch (IOException e) {
115117
// do nothing
116118
}
117119
}
118120
} catch (Exception e) {
119121
// deserialization failed, continue
120-
System.err.println("Failed to deserialize oneOf Error (error: " + e.getMessage() + ") (type: " + currentType + ")");
122+
System.err.println(
123+
"Failed to deserialize oneOf PredictionsAffinitiesSuccess (error: " + e.getMessage() + ") (type: " + currentType + ")"
124+
);
121125
}
122126

123127
if (match == 1) {
@@ -136,30 +140,30 @@ public PredictionsAffinities getNullValue(DeserializationContext ctxt) throws Js
136140
}
137141
}
138142

139-
class PredictionsAffinitiesAffinitiesSuccess extends PredictionsAffinities {
143+
class PredictionsAffinitiesError extends PredictionsAffinities {
140144

141-
private final AffinitiesSuccess insideValue;
145+
private final Error insideValue;
142146

143-
PredictionsAffinitiesAffinitiesSuccess(AffinitiesSuccess insideValue) {
147+
PredictionsAffinitiesError(Error insideValue) {
144148
this.insideValue = insideValue;
145149
}
146150

147151
@Override
148-
public AffinitiesSuccess getInsideValue() {
152+
public Error getInsideValue() {
149153
return insideValue;
150154
}
151155
}
152156

153-
class PredictionsAffinitiesError extends PredictionsAffinities {
157+
class PredictionsAffinitiesPredictionsAffinitiesSuccess extends PredictionsAffinities {
154158

155-
private final Error insideValue;
159+
private final PredictionsAffinitiesSuccess insideValue;
156160

157-
PredictionsAffinitiesError(Error insideValue) {
161+
PredictionsAffinitiesPredictionsAffinitiesSuccess(PredictionsAffinitiesSuccess insideValue) {
158162
this.insideValue = insideValue;
159163
}
160164

161165
@Override
162-
public Error getInsideValue() {
166+
public PredictionsAffinitiesSuccess getInsideValue() {
163167
return insideValue;
164168
}
165169
}
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
import java.util.Objects;
1010

1111
/** Prediction for the **affinities** model. */
12-
public class AffinitiesSuccess {
12+
public class PredictionsAffinitiesSuccess {
1313

1414
@JsonProperty("value")
1515
private List<Affinity> value = new ArrayList<>();
1616

1717
@JsonProperty("lastUpdatedAt")
1818
private String lastUpdatedAt;
1919

20-
public AffinitiesSuccess setValue(List<Affinity> value) {
20+
public PredictionsAffinitiesSuccess setValue(List<Affinity> value) {
2121
this.value = value;
2222
return this;
2323
}
2424

25-
public AffinitiesSuccess addValue(Affinity valueItem) {
25+
public PredictionsAffinitiesSuccess addValue(Affinity valueItem) {
2626
this.value.add(valueItem);
2727
return this;
2828
}
@@ -37,7 +37,7 @@ public List<Affinity> getValue() {
3737
return value;
3838
}
3939

40-
public AffinitiesSuccess setLastUpdatedAt(String lastUpdatedAt) {
40+
public PredictionsAffinitiesSuccess setLastUpdatedAt(String lastUpdatedAt) {
4141
this.lastUpdatedAt = lastUpdatedAt;
4242
return this;
4343
}
@@ -60,8 +60,11 @@ public boolean equals(Object o) {
6060
if (o == null || getClass() != o.getClass()) {
6161
return false;
6262
}
63-
AffinitiesSuccess affinitiesSuccess = (AffinitiesSuccess) o;
64-
return Objects.equals(this.value, affinitiesSuccess.value) && Objects.equals(this.lastUpdatedAt, affinitiesSuccess.lastUpdatedAt);
63+
PredictionsAffinitiesSuccess predictionsAffinitiesSuccess = (PredictionsAffinitiesSuccess) o;
64+
return (
65+
Objects.equals(this.value, predictionsAffinitiesSuccess.value) &&
66+
Objects.equals(this.lastUpdatedAt, predictionsAffinitiesSuccess.lastUpdatedAt)
67+
);
6568
}
6669

6770
@Override
@@ -72,7 +75,7 @@ public int hashCode() {
7275
@Override
7376
public String toString() {
7477
StringBuilder sb = new StringBuilder();
75-
sb.append("class AffinitiesSuccess {\n");
78+
sb.append("class PredictionsAffinitiesSuccess {\n");
7679
sb.append(" value: ").append(toIndentedString(value)).append("\n");
7780
sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n");
7881
sb.append("}");

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/predict/PredictionsFunnelStage.java

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public static PredictionsFunnelStage of(Error inside) {
2323
return new PredictionsFunnelStageError(inside);
2424
}
2525

26-
public static PredictionsFunnelStage of(FunnelStageSuccess inside) {
27-
return new PredictionsFunnelStageFunnelStageSuccess(inside);
26+
public static PredictionsFunnelStage of(PredictionsFunnelStageSuccess inside) {
27+
return new PredictionsFunnelStagePredictionsFunnelStageSuccess(inside);
2828
}
2929

3030
public static class PredictionsFunnelStageSerializer extends StdSerializer<PredictionsFunnelStage> {
@@ -88,10 +88,10 @@ public PredictionsFunnelStage deserialize(JsonParser jp, DeserializationContext
8888
System.err.println("Failed to deserialize oneOf Error (error: " + e.getMessage() + ") (type: " + currentType + ")");
8989
}
9090

91-
// deserialize FunnelStageSuccess
91+
// deserialize PredictionsFunnelStageSuccess
9292
try {
9393
boolean attemptParsing = true;
94-
currentType = "FunnelStageSuccess";
94+
currentType = "PredictionsFunnelStageSuccess";
9595
if (
9696
((currentType.equals("Integer") || currentType.equals("Long")) && token == JsonToken.VALUE_NUMBER_INT) |
9797
((currentType.equals("Float") || currentType.equals("Double")) && token == JsonToken.VALUE_NUMBER_FLOAT) |
@@ -101,14 +101,18 @@ public PredictionsFunnelStage deserialize(JsonParser jp, DeserializationContext
101101
) {
102102
deserialized =
103103
PredictionsFunnelStage.of(
104-
(FunnelStageSuccess) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<FunnelStageSuccess>() {})
104+
(PredictionsFunnelStageSuccess) tree
105+
.traverse(jp.getCodec())
106+
.readValueAs(new TypeReference<PredictionsFunnelStageSuccess>() {})
105107
);
106108
match++;
107109
} else if (token == JsonToken.START_OBJECT) {
108110
try {
109111
deserialized =
110112
PredictionsFunnelStage.of(
111-
(FunnelStageSuccess) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<FunnelStageSuccess>() {})
113+
(PredictionsFunnelStageSuccess) tree
114+
.traverse(jp.getCodec())
115+
.readValueAs(new TypeReference<PredictionsFunnelStageSuccess>() {})
112116
);
113117
match++;
114118
} catch (IOException e) {
@@ -117,7 +121,9 @@ public PredictionsFunnelStage deserialize(JsonParser jp, DeserializationContext
117121
}
118122
} catch (Exception e) {
119123
// deserialization failed, continue
120-
System.err.println("Failed to deserialize oneOf FunnelStageSuccess (error: " + e.getMessage() + ") (type: " + currentType + ")");
124+
System.err.println(
125+
"Failed to deserialize oneOf PredictionsFunnelStageSuccess (error: " + e.getMessage() + ") (type: " + currentType + ")"
126+
);
121127
}
122128

123129
if (match == 1) {
@@ -150,16 +156,16 @@ public Error getInsideValue() {
150156
}
151157
}
152158

153-
class PredictionsFunnelStageFunnelStageSuccess extends PredictionsFunnelStage {
159+
class PredictionsFunnelStagePredictionsFunnelStageSuccess extends PredictionsFunnelStage {
154160

155-
private final FunnelStageSuccess insideValue;
161+
private final PredictionsFunnelStageSuccess insideValue;
156162

157-
PredictionsFunnelStageFunnelStageSuccess(FunnelStageSuccess insideValue) {
163+
PredictionsFunnelStagePredictionsFunnelStageSuccess(PredictionsFunnelStageSuccess insideValue) {
158164
this.insideValue = insideValue;
159165
}
160166

161167
@Override
162-
public FunnelStageSuccess getInsideValue() {
168+
public PredictionsFunnelStageSuccess getInsideValue() {
163169
return insideValue;
164170
}
165171
}
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
import java.util.Objects;
1010

1111
/** Prediction for the **funnel_stage** model. */
12-
public class FunnelStageSuccess {
12+
public class PredictionsFunnelStageSuccess {
1313

1414
@JsonProperty("value")
1515
private List<FunnelStage> value = new ArrayList<>();
1616

1717
@JsonProperty("lastUpdatedAt")
1818
private String lastUpdatedAt;
1919

20-
public FunnelStageSuccess setValue(List<FunnelStage> value) {
20+
public PredictionsFunnelStageSuccess setValue(List<FunnelStage> value) {
2121
this.value = value;
2222
return this;
2323
}
2424

25-
public FunnelStageSuccess addValue(FunnelStage valueItem) {
25+
public PredictionsFunnelStageSuccess addValue(FunnelStage valueItem) {
2626
this.value.add(valueItem);
2727
return this;
2828
}
@@ -37,7 +37,7 @@ public List<FunnelStage> getValue() {
3737
return value;
3838
}
3939

40-
public FunnelStageSuccess setLastUpdatedAt(String lastUpdatedAt) {
40+
public PredictionsFunnelStageSuccess setLastUpdatedAt(String lastUpdatedAt) {
4141
this.lastUpdatedAt = lastUpdatedAt;
4242
return this;
4343
}
@@ -60,8 +60,11 @@ public boolean equals(Object o) {
6060
if (o == null || getClass() != o.getClass()) {
6161
return false;
6262
}
63-
FunnelStageSuccess funnelStageSuccess = (FunnelStageSuccess) o;
64-
return Objects.equals(this.value, funnelStageSuccess.value) && Objects.equals(this.lastUpdatedAt, funnelStageSuccess.lastUpdatedAt);
63+
PredictionsFunnelStageSuccess predictionsFunnelStageSuccess = (PredictionsFunnelStageSuccess) o;
64+
return (
65+
Objects.equals(this.value, predictionsFunnelStageSuccess.value) &&
66+
Objects.equals(this.lastUpdatedAt, predictionsFunnelStageSuccess.lastUpdatedAt)
67+
);
6568
}
6669

6770
@Override
@@ -72,7 +75,7 @@ public int hashCode() {
7275
@Override
7376
public String toString() {
7477
StringBuilder sb = new StringBuilder();
75-
sb.append("class FunnelStageSuccess {\n");
78+
sb.append("class PredictionsFunnelStageSuccess {\n");
7679
sb.append(" value: ").append(toIndentedString(value)).append("\n");
7780
sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n");
7881
sb.append("}");

0 commit comments

Comments
 (0)