Skip to content

Commit f313a49

Browse files
algolia-botFluf22
andcommitted
fix(specs): update search api specs [skip-bc] (generated)
algolia/api-clients-automation#3760 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Thomas Raffray <[email protected]>
1 parent ebc9165 commit f313a49

File tree

6 files changed

+72
-252
lines changed

6 files changed

+72
-252
lines changed

algoliasearch/src/main/java/com/algolia/model/recommend/HighlightResult.java

Lines changed: 16 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@
1818
@JsonDeserialize(using = HighlightResult.Deserializer.class)
1919
public interface HighlightResult {
2020
// HighlightResult as Map<String, HighlightResult> wrapper.
21-
static HighlightResult ofMapOfStringHighlightResult(Map<String, HighlightResult> value) {
21+
static HighlightResult of(Map<String, HighlightResult> value) {
2222
return new MapOfStringHighlightResultWrapper(value);
2323
}
2424

25-
// HighlightResult as Map<String, HighlightResultOption> wrapper.
26-
static HighlightResult ofMapOfStringHighlightResultOption(Map<String, HighlightResultOption> value) {
27-
return new MapOfStringHighlightResultOptionWrapper(value);
28-
}
29-
30-
// HighlightResult as List<HighlightResultOption> wrapper.
31-
static HighlightResult of(List<HighlightResultOption> value) {
32-
return new ListOfHighlightResultOptionWrapper(value);
25+
// HighlightResult as List<HighlightResult> wrapper.
26+
static HighlightResult of(List<HighlightResult> value) {
27+
return new ListOfHighlightResultWrapper(value);
3328
}
3429

3530
// HighlightResult as Map<String, HighlightResult> wrapper.
@@ -55,48 +50,24 @@ public void serialize(MapOfStringHighlightResultWrapper value, JsonGenerator gen
5550
}
5651
}
5752

58-
// HighlightResult as Map<String, HighlightResultOption> wrapper.
59-
@JsonSerialize(using = MapOfStringHighlightResultOptionWrapper.Serializer.class)
60-
class MapOfStringHighlightResultOptionWrapper implements HighlightResult {
53+
// HighlightResult as List<HighlightResult> wrapper.
54+
@JsonSerialize(using = ListOfHighlightResultWrapper.Serializer.class)
55+
class ListOfHighlightResultWrapper implements HighlightResult {
6156

62-
private final Map<String, HighlightResultOption> value;
57+
private final List<HighlightResult> value;
6358

64-
MapOfStringHighlightResultOptionWrapper(Map<String, HighlightResultOption> value) {
59+
ListOfHighlightResultWrapper(List<HighlightResult> value) {
6560
this.value = value;
6661
}
6762

68-
public Map<String, HighlightResultOption> getValue() {
63+
public List<HighlightResult> getValue() {
6964
return value;
7065
}
7166

72-
static class Serializer extends JsonSerializer<MapOfStringHighlightResultOptionWrapper> {
67+
static class Serializer extends JsonSerializer<ListOfHighlightResultWrapper> {
7368

7469
@Override
75-
public void serialize(MapOfStringHighlightResultOptionWrapper value, JsonGenerator gen, SerializerProvider provider)
76-
throws IOException {
77-
gen.writeObject(value.getValue());
78-
}
79-
}
80-
}
81-
82-
// HighlightResult as List<HighlightResultOption> wrapper.
83-
@JsonSerialize(using = ListOfHighlightResultOptionWrapper.Serializer.class)
84-
class ListOfHighlightResultOptionWrapper implements HighlightResult {
85-
86-
private final List<HighlightResultOption> value;
87-
88-
ListOfHighlightResultOptionWrapper(List<HighlightResultOption> value) {
89-
this.value = value;
90-
}
91-
92-
public List<HighlightResultOption> getValue() {
93-
return value;
94-
}
95-
96-
static class Serializer extends JsonSerializer<ListOfHighlightResultOptionWrapper> {
97-
98-
@Override
99-
public void serialize(ListOfHighlightResultOptionWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException {
70+
public void serialize(ListOfHighlightResultWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException {
10071
gen.writeObject(value.getValue());
10172
}
10273
}
@@ -130,30 +101,14 @@ public HighlightResult deserialize(JsonParser jp, DeserializationContext ctxt) t
130101
);
131102
}
132103
}
133-
// deserialize Map<String, HighlightResultOption>
134-
if (tree.isObject()) {
135-
try (JsonParser parser = tree.traverse(jp.getCodec())) {
136-
Map<String, HighlightResultOption> value = parser.readValueAs(new TypeReference<Map<String, HighlightResultOption>>() {});
137-
return new HighlightResult.MapOfStringHighlightResultOptionWrapper(value);
138-
} catch (Exception e) {
139-
// deserialization failed, continue
140-
LOGGER.finest(
141-
"Failed to deserialize oneOf Map<String, HighlightResultOption> (error: " +
142-
e.getMessage() +
143-
") (type: Map<String, HighlightResultOption>)"
144-
);
145-
}
146-
}
147-
// deserialize List<HighlightResultOption>
104+
// deserialize List<HighlightResult>
148105
if (tree.isArray()) {
149106
try (JsonParser parser = tree.traverse(jp.getCodec())) {
150-
List<HighlightResultOption> value = parser.readValueAs(new TypeReference<List<HighlightResultOption>>() {});
151-
return new HighlightResult.ListOfHighlightResultOptionWrapper(value);
107+
List<HighlightResult> value = parser.readValueAs(new TypeReference<List<HighlightResult>>() {});
108+
return new HighlightResult.ListOfHighlightResultWrapper(value);
152109
} catch (Exception e) {
153110
// deserialization failed, continue
154-
LOGGER.finest(
155-
"Failed to deserialize oneOf List<HighlightResultOption> (error: " + e.getMessage() + ") (type: List<HighlightResultOption>)"
156-
);
111+
LOGGER.finest("Failed to deserialize oneOf List<HighlightResult> (error: " + e.getMessage() + ") (type: List<HighlightResult>)");
157112
}
158113
}
159114
throw new AlgoliaRuntimeException(String.format("Failed to deserialize json element: %s", tree));

algoliasearch/src/main/java/com/algolia/model/recommend/RecommendationsResults.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public RecommendationsResults setPage(Integer page) {
436436
}
437437

438438
/** Page of search results to retrieve. minimum: 0 */
439-
@javax.annotation.Nonnull
439+
@javax.annotation.Nullable
440440
public Integer getPage() {
441441
return page;
442442
}
@@ -447,7 +447,7 @@ public RecommendationsResults setNbHits(Integer nbHits) {
447447
}
448448

449449
/** Number of results (hits). */
450-
@javax.annotation.Nonnull
450+
@javax.annotation.Nullable
451451
public Integer getNbHits() {
452452
return nbHits;
453453
}
@@ -458,7 +458,7 @@ public RecommendationsResults setNbPages(Integer nbPages) {
458458
}
459459

460460
/** Number of pages of results. */
461-
@javax.annotation.Nonnull
461+
@javax.annotation.Nullable
462462
public Integer getNbPages() {
463463
return nbPages;
464464
}
@@ -469,7 +469,7 @@ public RecommendationsResults setHitsPerPage(Integer hitsPerPage) {
469469
}
470470

471471
/** Number of hits per page. minimum: 1 maximum: 1000 */
472-
@javax.annotation.Nonnull
472+
@javax.annotation.Nullable
473473
public Integer getHitsPerPage() {
474474
return hitsPerPage;
475475
}

algoliasearch/src/main/java/com/algolia/model/recommend/SnippetResult.java

Lines changed: 16 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@
1818
@JsonDeserialize(using = SnippetResult.Deserializer.class)
1919
public interface SnippetResult {
2020
// SnippetResult as Map<String, SnippetResult> wrapper.
21-
static SnippetResult ofMapOfStringSnippetResult(Map<String, SnippetResult> value) {
21+
static SnippetResult of(Map<String, SnippetResult> value) {
2222
return new MapOfStringSnippetResultWrapper(value);
2323
}
2424

25-
// SnippetResult as Map<String, SnippetResultOption> wrapper.
26-
static SnippetResult ofMapOfStringSnippetResultOption(Map<String, SnippetResultOption> value) {
27-
return new MapOfStringSnippetResultOptionWrapper(value);
28-
}
29-
30-
// SnippetResult as List<SnippetResultOption> wrapper.
31-
static SnippetResult of(List<SnippetResultOption> value) {
32-
return new ListOfSnippetResultOptionWrapper(value);
25+
// SnippetResult as List<SnippetResult> wrapper.
26+
static SnippetResult of(List<SnippetResult> value) {
27+
return new ListOfSnippetResultWrapper(value);
3328
}
3429

3530
// SnippetResult as Map<String, SnippetResult> wrapper.
@@ -55,48 +50,24 @@ public void serialize(MapOfStringSnippetResultWrapper value, JsonGenerator gen,
5550
}
5651
}
5752

58-
// SnippetResult as Map<String, SnippetResultOption> wrapper.
59-
@JsonSerialize(using = MapOfStringSnippetResultOptionWrapper.Serializer.class)
60-
class MapOfStringSnippetResultOptionWrapper implements SnippetResult {
53+
// SnippetResult as List<SnippetResult> wrapper.
54+
@JsonSerialize(using = ListOfSnippetResultWrapper.Serializer.class)
55+
class ListOfSnippetResultWrapper implements SnippetResult {
6156

62-
private final Map<String, SnippetResultOption> value;
57+
private final List<SnippetResult> value;
6358

64-
MapOfStringSnippetResultOptionWrapper(Map<String, SnippetResultOption> value) {
59+
ListOfSnippetResultWrapper(List<SnippetResult> value) {
6560
this.value = value;
6661
}
6762

68-
public Map<String, SnippetResultOption> getValue() {
63+
public List<SnippetResult> getValue() {
6964
return value;
7065
}
7166

72-
static class Serializer extends JsonSerializer<MapOfStringSnippetResultOptionWrapper> {
67+
static class Serializer extends JsonSerializer<ListOfSnippetResultWrapper> {
7368

7469
@Override
75-
public void serialize(MapOfStringSnippetResultOptionWrapper value, JsonGenerator gen, SerializerProvider provider)
76-
throws IOException {
77-
gen.writeObject(value.getValue());
78-
}
79-
}
80-
}
81-
82-
// SnippetResult as List<SnippetResultOption> wrapper.
83-
@JsonSerialize(using = ListOfSnippetResultOptionWrapper.Serializer.class)
84-
class ListOfSnippetResultOptionWrapper implements SnippetResult {
85-
86-
private final List<SnippetResultOption> value;
87-
88-
ListOfSnippetResultOptionWrapper(List<SnippetResultOption> value) {
89-
this.value = value;
90-
}
91-
92-
public List<SnippetResultOption> getValue() {
93-
return value;
94-
}
95-
96-
static class Serializer extends JsonSerializer<ListOfSnippetResultOptionWrapper> {
97-
98-
@Override
99-
public void serialize(ListOfSnippetResultOptionWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException {
70+
public void serialize(ListOfSnippetResultWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException {
10071
gen.writeObject(value.getValue());
10172
}
10273
}
@@ -130,30 +101,14 @@ public SnippetResult deserialize(JsonParser jp, DeserializationContext ctxt) thr
130101
);
131102
}
132103
}
133-
// deserialize Map<String, SnippetResultOption>
134-
if (tree.isObject()) {
135-
try (JsonParser parser = tree.traverse(jp.getCodec())) {
136-
Map<String, SnippetResultOption> value = parser.readValueAs(new TypeReference<Map<String, SnippetResultOption>>() {});
137-
return new SnippetResult.MapOfStringSnippetResultOptionWrapper(value);
138-
} catch (Exception e) {
139-
// deserialization failed, continue
140-
LOGGER.finest(
141-
"Failed to deserialize oneOf Map<String, SnippetResultOption> (error: " +
142-
e.getMessage() +
143-
") (type: Map<String, SnippetResultOption>)"
144-
);
145-
}
146-
}
147-
// deserialize List<SnippetResultOption>
104+
// deserialize List<SnippetResult>
148105
if (tree.isArray()) {
149106
try (JsonParser parser = tree.traverse(jp.getCodec())) {
150-
List<SnippetResultOption> value = parser.readValueAs(new TypeReference<List<SnippetResultOption>>() {});
151-
return new SnippetResult.ListOfSnippetResultOptionWrapper(value);
107+
List<SnippetResult> value = parser.readValueAs(new TypeReference<List<SnippetResult>>() {});
108+
return new SnippetResult.ListOfSnippetResultWrapper(value);
152109
} catch (Exception e) {
153110
// deserialization failed, continue
154-
LOGGER.finest(
155-
"Failed to deserialize oneOf List<SnippetResultOption> (error: " + e.getMessage() + ") (type: List<SnippetResultOption>)"
156-
);
111+
LOGGER.finest("Failed to deserialize oneOf List<SnippetResult> (error: " + e.getMessage() + ") (type: List<SnippetResult>)");
157112
}
158113
}
159114
throw new AlgoliaRuntimeException(String.format("Failed to deserialize json element: %s", tree));

algoliasearch/src/main/java/com/algolia/model/search/HighlightResult.java

Lines changed: 16 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@
1818
@JsonDeserialize(using = HighlightResult.Deserializer.class)
1919
public interface HighlightResult {
2020
// HighlightResult as Map<String, HighlightResult> wrapper.
21-
static HighlightResult ofMapOfStringHighlightResult(Map<String, HighlightResult> value) {
21+
static HighlightResult of(Map<String, HighlightResult> value) {
2222
return new MapOfStringHighlightResultWrapper(value);
2323
}
2424

25-
// HighlightResult as Map<String, HighlightResultOption> wrapper.
26-
static HighlightResult ofMapOfStringHighlightResultOption(Map<String, HighlightResultOption> value) {
27-
return new MapOfStringHighlightResultOptionWrapper(value);
28-
}
29-
30-
// HighlightResult as List<HighlightResultOption> wrapper.
31-
static HighlightResult of(List<HighlightResultOption> value) {
32-
return new ListOfHighlightResultOptionWrapper(value);
25+
// HighlightResult as List<HighlightResult> wrapper.
26+
static HighlightResult of(List<HighlightResult> value) {
27+
return new ListOfHighlightResultWrapper(value);
3328
}
3429

3530
// HighlightResult as Map<String, HighlightResult> wrapper.
@@ -55,48 +50,24 @@ public void serialize(MapOfStringHighlightResultWrapper value, JsonGenerator gen
5550
}
5651
}
5752

58-
// HighlightResult as Map<String, HighlightResultOption> wrapper.
59-
@JsonSerialize(using = MapOfStringHighlightResultOptionWrapper.Serializer.class)
60-
class MapOfStringHighlightResultOptionWrapper implements HighlightResult {
53+
// HighlightResult as List<HighlightResult> wrapper.
54+
@JsonSerialize(using = ListOfHighlightResultWrapper.Serializer.class)
55+
class ListOfHighlightResultWrapper implements HighlightResult {
6156

62-
private final Map<String, HighlightResultOption> value;
57+
private final List<HighlightResult> value;
6358

64-
MapOfStringHighlightResultOptionWrapper(Map<String, HighlightResultOption> value) {
59+
ListOfHighlightResultWrapper(List<HighlightResult> value) {
6560
this.value = value;
6661
}
6762

68-
public Map<String, HighlightResultOption> getValue() {
63+
public List<HighlightResult> getValue() {
6964
return value;
7065
}
7166

72-
static class Serializer extends JsonSerializer<MapOfStringHighlightResultOptionWrapper> {
67+
static class Serializer extends JsonSerializer<ListOfHighlightResultWrapper> {
7368

7469
@Override
75-
public void serialize(MapOfStringHighlightResultOptionWrapper value, JsonGenerator gen, SerializerProvider provider)
76-
throws IOException {
77-
gen.writeObject(value.getValue());
78-
}
79-
}
80-
}
81-
82-
// HighlightResult as List<HighlightResultOption> wrapper.
83-
@JsonSerialize(using = ListOfHighlightResultOptionWrapper.Serializer.class)
84-
class ListOfHighlightResultOptionWrapper implements HighlightResult {
85-
86-
private final List<HighlightResultOption> value;
87-
88-
ListOfHighlightResultOptionWrapper(List<HighlightResultOption> value) {
89-
this.value = value;
90-
}
91-
92-
public List<HighlightResultOption> getValue() {
93-
return value;
94-
}
95-
96-
static class Serializer extends JsonSerializer<ListOfHighlightResultOptionWrapper> {
97-
98-
@Override
99-
public void serialize(ListOfHighlightResultOptionWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException {
70+
public void serialize(ListOfHighlightResultWrapper value, JsonGenerator gen, SerializerProvider provider) throws IOException {
10071
gen.writeObject(value.getValue());
10172
}
10273
}
@@ -130,30 +101,14 @@ public HighlightResult deserialize(JsonParser jp, DeserializationContext ctxt) t
130101
);
131102
}
132103
}
133-
// deserialize Map<String, HighlightResultOption>
134-
if (tree.isObject()) {
135-
try (JsonParser parser = tree.traverse(jp.getCodec())) {
136-
Map<String, HighlightResultOption> value = parser.readValueAs(new TypeReference<Map<String, HighlightResultOption>>() {});
137-
return new HighlightResult.MapOfStringHighlightResultOptionWrapper(value);
138-
} catch (Exception e) {
139-
// deserialization failed, continue
140-
LOGGER.finest(
141-
"Failed to deserialize oneOf Map<String, HighlightResultOption> (error: " +
142-
e.getMessage() +
143-
") (type: Map<String, HighlightResultOption>)"
144-
);
145-
}
146-
}
147-
// deserialize List<HighlightResultOption>
104+
// deserialize List<HighlightResult>
148105
if (tree.isArray()) {
149106
try (JsonParser parser = tree.traverse(jp.getCodec())) {
150-
List<HighlightResultOption> value = parser.readValueAs(new TypeReference<List<HighlightResultOption>>() {});
151-
return new HighlightResult.ListOfHighlightResultOptionWrapper(value);
107+
List<HighlightResult> value = parser.readValueAs(new TypeReference<List<HighlightResult>>() {});
108+
return new HighlightResult.ListOfHighlightResultWrapper(value);
152109
} catch (Exception e) {
153110
// deserialization failed, continue
154-
LOGGER.finest(
155-
"Failed to deserialize oneOf List<HighlightResultOption> (error: " + e.getMessage() + ") (type: List<HighlightResultOption>)"
156-
);
111+
LOGGER.finest("Failed to deserialize oneOf List<HighlightResult> (error: " + e.getMessage() + ") (type: List<HighlightResult>)");
157112
}
158113
}
159114
throw new AlgoliaRuntimeException(String.format("Failed to deserialize json element: %s", tree));

0 commit comments

Comments
 (0)