Skip to content

Commit 59c70a8

Browse files
chore: generated code for commit 193fb73. [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 193fb73 commit 59c70a8

Some content is hidden

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

50 files changed

+626
-346
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java

Lines changed: 51 additions & 47 deletions
Large diffs are not rendered by default.

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/Acl.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77
import com.fasterxml.jackson.annotation.JsonCreator;
88
import com.fasterxml.jackson.annotation.JsonValue;
99

10-
/** Gets or Sets acl */
10+
/**
11+
* List of rights for the API key. The following rights can be used: addObject: allows to add/update
12+
* an object in the index (copy/move index are also allowed with this right). analytics: allows to
13+
* retrieve the analytics through the Analytics API. browse: allows to retrieve all index content
14+
* via the browse API. deleteIndex: allows to delete or clear index content. deleteObject: allows to
15+
* delete objects from the index. editSettings: allows to change index settings. listIndexes: allows
16+
* to list all accessible indices. logs: allows to get the logs. recommendation: Allows usage of the
17+
* Personalization dashboard and the Recommendation API. search: allows to search the index.
18+
* seeUnretrievableAttributes: disable unretrievableAttributes feature for all operations returning
19+
* records. settings: allows to get index settings.
20+
*/
1121
public enum Acl {
1222
ADD_OBJECT("addObject"),
1323

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/AddApiKeyResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public AddApiKeyResponse setKey(String key) {
2121
}
2222

2323
/**
24-
* Key string.
24+
* The API key.
2525
*
2626
* @return key
2727
*/
Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,50 @@
1414
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
1515
import java.io.IOException;
1616

17-
/** AttributeOrBuiltInOperation */
18-
@JsonDeserialize(using = AttributeOrBuiltInOperation.AttributeOrBuiltInOperationDeserializer.class)
19-
@JsonSerialize(using = AttributeOrBuiltInOperation.AttributeOrBuiltInOperationSerializer.class)
20-
public abstract class AttributeOrBuiltInOperation implements CompoundType {
17+
/** AttributeToUpdate */
18+
@JsonDeserialize(using = AttributeToUpdate.AttributeToUpdateDeserializer.class)
19+
@JsonSerialize(using = AttributeToUpdate.AttributeToUpdateSerializer.class)
20+
public abstract class AttributeToUpdate implements CompoundType {
2121

22-
public static AttributeOrBuiltInOperation of(BuiltInOperation inside) {
23-
return new AttributeOrBuiltInOperationBuiltInOperation(inside);
22+
public static AttributeToUpdate of(BuiltInOperation inside) {
23+
return new AttributeToUpdateBuiltInOperation(inside);
2424
}
2525

26-
public static AttributeOrBuiltInOperation of(String inside) {
27-
return new AttributeOrBuiltInOperationString(inside);
26+
public static AttributeToUpdate of(String inside) {
27+
return new AttributeToUpdateString(inside);
2828
}
2929

30-
public static class AttributeOrBuiltInOperationSerializer extends StdSerializer<AttributeOrBuiltInOperation> {
30+
public static class AttributeToUpdateSerializer extends StdSerializer<AttributeToUpdate> {
3131

32-
public AttributeOrBuiltInOperationSerializer(Class<AttributeOrBuiltInOperation> t) {
32+
public AttributeToUpdateSerializer(Class<AttributeToUpdate> t) {
3333
super(t);
3434
}
3535

36-
public AttributeOrBuiltInOperationSerializer() {
36+
public AttributeToUpdateSerializer() {
3737
this(null);
3838
}
3939

4040
@Override
41-
public void serialize(AttributeOrBuiltInOperation value, JsonGenerator jgen, SerializerProvider provider)
41+
public void serialize(AttributeToUpdate value, JsonGenerator jgen, SerializerProvider provider)
4242
throws IOException, JsonProcessingException {
4343
jgen.writeObject(value.getInsideValue());
4444
}
4545
}
4646

47-
public static class AttributeOrBuiltInOperationDeserializer extends StdDeserializer<AttributeOrBuiltInOperation> {
47+
public static class AttributeToUpdateDeserializer extends StdDeserializer<AttributeToUpdate> {
4848

49-
public AttributeOrBuiltInOperationDeserializer() {
50-
this(AttributeOrBuiltInOperation.class);
49+
public AttributeToUpdateDeserializer() {
50+
this(AttributeToUpdate.class);
5151
}
5252

53-
public AttributeOrBuiltInOperationDeserializer(Class<?> vc) {
53+
public AttributeToUpdateDeserializer(Class<?> vc) {
5454
super(vc);
5555
}
5656

5757
@Override
58-
public AttributeOrBuiltInOperation deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
58+
public AttributeToUpdate deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
5959
JsonNode tree = jp.readValueAsTree();
60-
AttributeOrBuiltInOperation deserialized = null;
60+
AttributeToUpdate deserialized = null;
6161

6262
int match = 0;
6363
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
@@ -74,16 +74,12 @@ public AttributeOrBuiltInOperation deserialize(JsonParser jp, DeserializationCon
7474
(currentType.startsWith("List<") && token == JsonToken.START_ARRAY)
7575
) {
7676
deserialized =
77-
AttributeOrBuiltInOperation.of(
78-
(BuiltInOperation) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<BuiltInOperation>() {})
79-
);
77+
AttributeToUpdate.of((BuiltInOperation) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<BuiltInOperation>() {}));
8078
match++;
8179
} else if (token == JsonToken.START_OBJECT) {
8280
try {
8381
deserialized =
84-
AttributeOrBuiltInOperation.of(
85-
(BuiltInOperation) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<BuiltInOperation>() {})
86-
);
82+
AttributeToUpdate.of((BuiltInOperation) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<BuiltInOperation>() {}));
8783
match++;
8884
} catch (IOException e) {
8985
// do nothing
@@ -105,12 +101,11 @@ public AttributeOrBuiltInOperation deserialize(JsonParser jp, DeserializationCon
105101
(currentType.equals("String") && token == JsonToken.VALUE_STRING) |
106102
(currentType.startsWith("List<") && token == JsonToken.START_ARRAY)
107103
) {
108-
deserialized = AttributeOrBuiltInOperation.of((String) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<String>() {}));
104+
deserialized = AttributeToUpdate.of((String) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<String>() {}));
109105
match++;
110106
} else if (token == JsonToken.START_OBJECT) {
111107
try {
112-
deserialized =
113-
AttributeOrBuiltInOperation.of((String) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<String>() {}));
108+
deserialized = AttributeToUpdate.of((String) tree.traverse(jp.getCodec()).readValueAs(new TypeReference<String>() {}));
114109
match++;
115110
} catch (IOException e) {
116111
// do nothing
@@ -124,24 +119,22 @@ public AttributeOrBuiltInOperation deserialize(JsonParser jp, DeserializationCon
124119
if (match == 1) {
125120
return deserialized;
126121
}
127-
throw new IOException(
128-
String.format("Failed deserialization for AttributeOrBuiltInOperation: %d classes match result," + " expected 1", match)
129-
);
122+
throw new IOException(String.format("Failed deserialization for AttributeToUpdate: %d classes match result, expected 1", match));
130123
}
131124

132125
/** Handle deserialization of the 'null' value. */
133126
@Override
134-
public AttributeOrBuiltInOperation getNullValue(DeserializationContext ctxt) throws JsonMappingException {
135-
throw new JsonMappingException(ctxt.getParser(), "AttributeOrBuiltInOperation cannot be null");
127+
public AttributeToUpdate getNullValue(DeserializationContext ctxt) throws JsonMappingException {
128+
throw new JsonMappingException(ctxt.getParser(), "AttributeToUpdate cannot be null");
136129
}
137130
}
138131
}
139132

140-
class AttributeOrBuiltInOperationBuiltInOperation extends AttributeOrBuiltInOperation {
133+
class AttributeToUpdateBuiltInOperation extends AttributeToUpdate {
141134

142135
private final BuiltInOperation insideValue;
143136

144-
AttributeOrBuiltInOperationBuiltInOperation(BuiltInOperation insideValue) {
137+
AttributeToUpdateBuiltInOperation(BuiltInOperation insideValue) {
145138
this.insideValue = insideValue;
146139
}
147140

@@ -151,11 +144,11 @@ public BuiltInOperation getInsideValue() {
151144
}
152145
}
153146

154-
class AttributeOrBuiltInOperationString extends AttributeOrBuiltInOperation {
147+
class AttributeToUpdateString extends AttributeToUpdate {
155148

156149
private final String insideValue;
157150

158-
AttributeOrBuiltInOperationString(String insideValue) {
151+
AttributeToUpdateString(String insideValue) {
159152
this.insideValue = insideValue;
160153
}
161154

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,42 @@
66
import com.fasterxml.jackson.annotation.*;
77
import java.util.Objects;
88

9-
/** CreatedAtObject */
10-
public class CreatedAtObject {
9+
/** BaseGetApiKeyResponse */
10+
public class BaseGetApiKeyResponse {
11+
12+
@JsonProperty("value")
13+
private String value;
1114

1215
@JsonProperty("createdAt")
13-
private String createdAt;
16+
private Long createdAt;
17+
18+
public BaseGetApiKeyResponse setValue(String value) {
19+
this.value = value;
20+
return this;
21+
}
22+
23+
/**
24+
* The API key.
25+
*
26+
* @return value
27+
*/
28+
@javax.annotation.Nullable
29+
public String getValue() {
30+
return value;
31+
}
1432

15-
public CreatedAtObject setCreatedAt(String createdAt) {
33+
public BaseGetApiKeyResponse setCreatedAt(Long createdAt) {
1634
this.createdAt = createdAt;
1735
return this;
1836
}
1937

2038
/**
21-
* Date of creation (ISO-8601 format).
39+
* Time of the event expressed in milliseconds since the Unix epoch.
2240
*
2341
* @return createdAt
2442
*/
2543
@javax.annotation.Nonnull
26-
public String getCreatedAt() {
44+
public Long getCreatedAt() {
2745
return createdAt;
2846
}
2947

@@ -35,19 +53,20 @@ public boolean equals(Object o) {
3553
if (o == null || getClass() != o.getClass()) {
3654
return false;
3755
}
38-
CreatedAtObject createdAtObject = (CreatedAtObject) o;
39-
return Objects.equals(this.createdAt, createdAtObject.createdAt);
56+
BaseGetApiKeyResponse baseGetApiKeyResponse = (BaseGetApiKeyResponse) o;
57+
return Objects.equals(this.value, baseGetApiKeyResponse.value) && Objects.equals(this.createdAt, baseGetApiKeyResponse.createdAt);
4058
}
4159

4260
@Override
4361
public int hashCode() {
44-
return Objects.hash(createdAt);
62+
return Objects.hash(value, createdAt);
4563
}
4664

4765
@Override
4866
public String toString() {
4967
StringBuilder sb = new StringBuilder();
50-
sb.append("class CreatedAtObject {\n");
68+
sb.append("class BaseGetApiKeyResponse {\n");
69+
sb.append(" value: ").append(toIndentedString(value)).append("\n");
5170
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
5271
sb.append("}");
5372
return sb.toString();

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/model/search/BatchParams.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@
1212
public class BatchParams {
1313

1414
@JsonProperty("requests")
15-
private List<MultipleBatchRequest> requests;
15+
private List<MultipleBatchRequest> requests = new ArrayList<>();
1616

1717
public BatchParams setRequests(List<MultipleBatchRequest> requests) {
1818
this.requests = requests;
1919
return this;
2020
}
2121

2222
public BatchParams addRequests(MultipleBatchRequest requestsItem) {
23-
if (this.requests == null) {
24-
this.requests = new ArrayList<>();
25-
}
2623
this.requests.add(requestsItem);
2724
return this;
2825
}
@@ -32,7 +29,7 @@ public BatchParams addRequests(MultipleBatchRequest requestsItem) {
3229
*
3330
* @return requests
3431
*/
35-
@javax.annotation.Nullable
32+
@javax.annotation.Nonnull
3633
public List<MultipleBatchRequest> getRequests() {
3734
return requests;
3835
}

0 commit comments

Comments
 (0)