Skip to content

Commit e191243

Browse files
chore: generated code for commit 7a85822. [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 7a85822 commit e191243

File tree

90 files changed

+4795
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4795
-284
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package com.algolia.model.recommend;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import java.util.HashMap;
5+
import java.util.Map;
6+
import java.util.Objects;
7+
8+
/** Defining how facets should be ordered. */
9+
public class FacetOrdering {
10+
11+
@SerializedName("facets")
12+
private Facets facets;
13+
14+
@SerializedName("values")
15+
private Map<String, Value> values;
16+
17+
public FacetOrdering setFacets(Facets facets) {
18+
this.facets = facets;
19+
return this;
20+
}
21+
22+
/**
23+
* Get facets
24+
*
25+
* @return facets
26+
*/
27+
@javax.annotation.Nullable
28+
public Facets getFacets() {
29+
return facets;
30+
}
31+
32+
public FacetOrdering setValues(Map<String, Value> values) {
33+
this.values = values;
34+
return this;
35+
}
36+
37+
public FacetOrdering putValues(String key, Value valuesItem) {
38+
if (this.values == null) {
39+
this.values = new HashMap<>();
40+
}
41+
this.values.put(key, valuesItem);
42+
return this;
43+
}
44+
45+
/**
46+
* The ordering of facet values, within an individual list.
47+
*
48+
* @return values
49+
*/
50+
@javax.annotation.Nullable
51+
public Map<String, Value> getValues() {
52+
return values;
53+
}
54+
55+
@Override
56+
public boolean equals(Object o) {
57+
if (this == o) {
58+
return true;
59+
}
60+
if (o == null || getClass() != o.getClass()) {
61+
return false;
62+
}
63+
FacetOrdering facetOrdering = (FacetOrdering) o;
64+
return Objects.equals(this.facets, facetOrdering.facets) && Objects.equals(this.values, facetOrdering.values);
65+
}
66+
67+
@Override
68+
public int hashCode() {
69+
return Objects.hash(facets, values);
70+
}
71+
72+
@Override
73+
public String toString() {
74+
StringBuilder sb = new StringBuilder();
75+
sb.append("class FacetOrdering {\n");
76+
sb.append(" facets: ").append(toIndentedString(facets)).append("\n");
77+
sb.append(" values: ").append(toIndentedString(values)).append("\n");
78+
sb.append("}");
79+
return sb.toString();
80+
}
81+
82+
/**
83+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
84+
*/
85+
private String toIndentedString(Object o) {
86+
if (o == null) {
87+
return "null";
88+
}
89+
return o.toString().replace("\n", "\n ");
90+
}
91+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package com.algolia.model.recommend;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import java.util.ArrayList;
5+
import java.util.List;
6+
import java.util.Objects;
7+
8+
/** The ordering of facets (widgets). */
9+
public class Facets {
10+
11+
@SerializedName("order")
12+
private List<String> order;
13+
14+
public Facets setOrder(List<String> order) {
15+
this.order = order;
16+
return this;
17+
}
18+
19+
public Facets addOrder(String orderItem) {
20+
if (this.order == null) {
21+
this.order = new ArrayList<>();
22+
}
23+
this.order.add(orderItem);
24+
return this;
25+
}
26+
27+
/**
28+
* Pinned order of facet lists.
29+
*
30+
* @return order
31+
*/
32+
@javax.annotation.Nullable
33+
public List<String> getOrder() {
34+
return order;
35+
}
36+
37+
@Override
38+
public boolean equals(Object o) {
39+
if (this == o) {
40+
return true;
41+
}
42+
if (o == null || getClass() != o.getClass()) {
43+
return false;
44+
}
45+
Facets facets = (Facets) o;
46+
return Objects.equals(this.order, facets.order);
47+
}
48+
49+
@Override
50+
public int hashCode() {
51+
return Objects.hash(order);
52+
}
53+
54+
@Override
55+
public String toString() {
56+
StringBuilder sb = new StringBuilder();
57+
sb.append("class Facets {\n");
58+
sb.append(" order: ").append(toIndentedString(order)).append("\n");
59+
sb.append("}");
60+
return sb.toString();
61+
}
62+
63+
/**
64+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
65+
*/
66+
private String toIndentedString(Object o) {
67+
if (o == null) {
68+
return "null";
69+
}
70+
return o.toString().replace("\n", "\n ");
71+
}
72+
}

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/IndexSettingsAsSearchParams.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public class IndexSettingsAsSearchParams {
132132
private Boolean attributeCriteriaComputedByMinProximity;
133133

134134
@SerializedName("renderingContent")
135-
private Object renderingContent;
135+
private RenderingContent renderingContent;
136136

137137
public IndexSettingsAsSearchParams setAttributesForFaceting(List<String> attributesForFaceting) {
138138
this.attributesForFaceting = attributesForFaceting;
@@ -878,19 +878,18 @@ public Boolean getAttributeCriteriaComputedByMinProximity() {
878878
return attributeCriteriaComputedByMinProximity;
879879
}
880880

881-
public IndexSettingsAsSearchParams setRenderingContent(Object renderingContent) {
881+
public IndexSettingsAsSearchParams setRenderingContent(RenderingContent renderingContent) {
882882
this.renderingContent = renderingContent;
883883
return this;
884884
}
885885

886886
/**
887-
* Content defining how the search interface should be rendered. Can be set via the settings for a
888-
* default value and can be overridden via rules.
887+
* Get renderingContent
889888
*
890889
* @return renderingContent
891890
*/
892891
@javax.annotation.Nullable
893-
public Object getRenderingContent() {
892+
public RenderingContent getRenderingContent() {
894893
return renderingContent;
895894
}
896895

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package com.algolia.model.recommend;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import java.util.Objects;
5+
6+
/**
7+
* Content defining how the search interface should be rendered. Can be set via the settings for a
8+
* default value and can be overridden via rules.
9+
*/
10+
public class RenderingContent {
11+
12+
@SerializedName("facetOrdering")
13+
private FacetOrdering facetOrdering;
14+
15+
public RenderingContent setFacetOrdering(FacetOrdering facetOrdering) {
16+
this.facetOrdering = facetOrdering;
17+
return this;
18+
}
19+
20+
/**
21+
* Get facetOrdering
22+
*
23+
* @return facetOrdering
24+
*/
25+
@javax.annotation.Nullable
26+
public FacetOrdering getFacetOrdering() {
27+
return facetOrdering;
28+
}
29+
30+
@Override
31+
public boolean equals(Object o) {
32+
if (this == o) {
33+
return true;
34+
}
35+
if (o == null || getClass() != o.getClass()) {
36+
return false;
37+
}
38+
RenderingContent renderingContent = (RenderingContent) o;
39+
return Objects.equals(this.facetOrdering, renderingContent.facetOrdering);
40+
}
41+
42+
@Override
43+
public int hashCode() {
44+
return Objects.hash(facetOrdering);
45+
}
46+
47+
@Override
48+
public String toString() {
49+
StringBuilder sb = new StringBuilder();
50+
sb.append("class RenderingContent {\n");
51+
sb.append(" facetOrdering: ").append(toIndentedString(facetOrdering)).append("\n");
52+
sb.append("}");
53+
return sb.toString();
54+
}
55+
56+
/**
57+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
58+
*/
59+
private String toIndentedString(Object o) {
60+
if (o == null) {
61+
return "null";
62+
}
63+
return o.toString().replace("\n", "\n ");
64+
}
65+
}

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/recommend/SearchParamsObject.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public class SearchParamsObject {
234234
private Boolean attributeCriteriaComputedByMinProximity;
235235

236236
@SerializedName("renderingContent")
237-
private Object renderingContent;
237+
private RenderingContent renderingContent;
238238

239239
public SearchParamsObject setQuery(String query) {
240240
this.query = query;
@@ -1544,19 +1544,18 @@ public Boolean getAttributeCriteriaComputedByMinProximity() {
15441544
return attributeCriteriaComputedByMinProximity;
15451545
}
15461546

1547-
public SearchParamsObject setRenderingContent(Object renderingContent) {
1547+
public SearchParamsObject setRenderingContent(RenderingContent renderingContent) {
15481548
this.renderingContent = renderingContent;
15491549
return this;
15501550
}
15511551

15521552
/**
1553-
* Content defining how the search interface should be rendered. Can be set via the settings for a
1554-
* default value and can be overridden via rules.
1553+
* Get renderingContent
15551554
*
15561555
* @return renderingContent
15571556
*/
15581557
@javax.annotation.Nullable
1559-
public Object getRenderingContent() {
1558+
public RenderingContent getRenderingContent() {
15601559
return renderingContent;
15611560
}
15621561

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package com.algolia.model.recommend;
2+
3+
import com.google.gson.TypeAdapter;
4+
import com.google.gson.annotations.JsonAdapter;
5+
import com.google.gson.stream.JsonReader;
6+
import com.google.gson.stream.JsonWriter;
7+
import java.io.IOException;
8+
9+
/**
10+
* How to display the remaining items. - `count`: facet count (descending). - `alpha`: alphabetical
11+
* (ascending). - `hidden`: show only pinned values.
12+
*/
13+
@JsonAdapter(SortRemainingBy.Adapter.class)
14+
public enum SortRemainingBy {
15+
COUNT("count"),
16+
17+
ALPHA("alpha"),
18+
19+
HIDDEN("hidden");
20+
21+
private final String value;
22+
23+
SortRemainingBy(String value) {
24+
this.value = value;
25+
}
26+
27+
public String getValue() {
28+
return value;
29+
}
30+
31+
@Override
32+
public String toString() {
33+
return String.valueOf(value);
34+
}
35+
36+
public static SortRemainingBy fromValue(String value) {
37+
for (SortRemainingBy b : SortRemainingBy.values()) {
38+
if (b.value.equals(value)) {
39+
return b;
40+
}
41+
}
42+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
43+
}
44+
45+
public static class Adapter extends TypeAdapter<SortRemainingBy> {
46+
47+
@Override
48+
public void write(final JsonWriter jsonWriter, final SortRemainingBy enumeration) throws IOException {
49+
jsonWriter.value(enumeration.getValue());
50+
}
51+
52+
@Override
53+
public SortRemainingBy read(final JsonReader jsonReader) throws IOException {
54+
String value = jsonReader.nextString();
55+
return SortRemainingBy.fromValue(value);
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)