Skip to content

Commit 2061aae

Browse files
committed
merge main
2 parents 3bd3e2c + a12d204 commit 2061aae

Some content is hidden

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

41 files changed

+4543
-684
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package com.algolia.model;
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+
/** type of operation. */
10+
@JsonAdapter(Action.Adapter.class)
11+
public enum Action {
12+
ADDOBJECT("addObject"),
13+
14+
UPDATEOBJECT("updateObject"),
15+
16+
PARTIALUPDATEOBJECT("partialUpdateObject"),
17+
18+
PARTIALUPDATEOBJECTNOCREATE("partialUpdateObjectNoCreate"),
19+
20+
DELETEOBJECT("deleteObject"),
21+
22+
DELETE("delete"),
23+
24+
CLEAR("clear");
25+
26+
private String value;
27+
28+
Action(String value) {
29+
this.value = value;
30+
}
31+
32+
public String getValue() {
33+
return value;
34+
}
35+
36+
@Override
37+
public String toString() {
38+
return String.valueOf(value);
39+
}
40+
41+
public static Action fromValue(String value) {
42+
for (Action b : Action.values()) {
43+
if (b.value.equals(value)) {
44+
return b;
45+
}
46+
}
47+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
48+
}
49+
50+
public static class Adapter extends TypeAdapter<Action> {
51+
52+
@Override
53+
public void write(final JsonWriter jsonWriter, final Action enumeration)
54+
throws IOException {
55+
jsonWriter.value(enumeration.getValue());
56+
}
57+
58+
@Override
59+
public Action read(final JsonReader jsonReader) throws IOException {
60+
String value = jsonReader.nextString();
61+
return Action.fromValue(value);
62+
}
63+
}
64+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
package com.algolia.model;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import io.swagger.annotations.ApiModelProperty;
5+
import java.time.OffsetDateTime;
6+
import java.util.Objects;
7+
8+
/** AddOrUpdateObjectResponse */
9+
public class AddOrUpdateObjectResponse {
10+
11+
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
12+
13+
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
14+
private OffsetDateTime updatedAt;
15+
16+
public static final String SERIALIZED_NAME_TASK_I_D = "taskID";
17+
18+
@SerializedName(SERIALIZED_NAME_TASK_I_D)
19+
private Integer taskID;
20+
21+
public static final String SERIALIZED_NAME_OBJECT_I_D = "objectID";
22+
23+
@SerializedName(SERIALIZED_NAME_OBJECT_I_D)
24+
private String objectID;
25+
26+
public AddOrUpdateObjectResponse updatedAt(OffsetDateTime updatedAt) {
27+
this.updatedAt = updatedAt;
28+
return this;
29+
}
30+
31+
/**
32+
* Date of last update (ISO-8601 format).
33+
*
34+
* @return updatedAt
35+
*/
36+
@javax.annotation.Nullable
37+
@ApiModelProperty(value = "Date of last update (ISO-8601 format).")
38+
public OffsetDateTime getUpdatedAt() {
39+
return updatedAt;
40+
}
41+
42+
public void setUpdatedAt(OffsetDateTime updatedAt) {
43+
this.updatedAt = updatedAt;
44+
}
45+
46+
public AddOrUpdateObjectResponse taskID(Integer taskID) {
47+
this.taskID = taskID;
48+
return this;
49+
}
50+
51+
/**
52+
* taskID of the indexing task to wait for.
53+
*
54+
* @return taskID
55+
*/
56+
@javax.annotation.Nullable
57+
@ApiModelProperty(value = "taskID of the indexing task to wait for.")
58+
public Integer getTaskID() {
59+
return taskID;
60+
}
61+
62+
public void setTaskID(Integer taskID) {
63+
this.taskID = taskID;
64+
}
65+
66+
public AddOrUpdateObjectResponse objectID(String objectID) {
67+
this.objectID = objectID;
68+
return this;
69+
}
70+
71+
/**
72+
* Unique identifier of the object.
73+
*
74+
* @return objectID
75+
*/
76+
@javax.annotation.Nullable
77+
@ApiModelProperty(value = "Unique identifier of the object.")
78+
public String getObjectID() {
79+
return objectID;
80+
}
81+
82+
public void setObjectID(String objectID) {
83+
this.objectID = objectID;
84+
}
85+
86+
@Override
87+
public boolean equals(Object o) {
88+
if (this == o) {
89+
return true;
90+
}
91+
if (o == null || getClass() != o.getClass()) {
92+
return false;
93+
}
94+
AddOrUpdateObjectResponse addOrUpdateObjectResponse = (AddOrUpdateObjectResponse) o;
95+
return (
96+
Objects.equals(this.updatedAt, addOrUpdateObjectResponse.updatedAt) &&
97+
Objects.equals(this.taskID, addOrUpdateObjectResponse.taskID) &&
98+
Objects.equals(this.objectID, addOrUpdateObjectResponse.objectID)
99+
);
100+
}
101+
102+
@Override
103+
public int hashCode() {
104+
return Objects.hash(updatedAt, taskID, objectID);
105+
}
106+
107+
@Override
108+
public String toString() {
109+
StringBuilder sb = new StringBuilder();
110+
sb.append("class AddOrUpdateObjectResponse {\n");
111+
sb
112+
.append(" updatedAt: ")
113+
.append(toIndentedString(updatedAt))
114+
.append("\n");
115+
sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n");
116+
sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n");
117+
sb.append("}");
118+
return sb.toString();
119+
}
120+
121+
/**
122+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
123+
*/
124+
private String toIndentedString(Object o) {
125+
if (o == null) {
126+
return "null";
127+
}
128+
return o.toString().replace("\n", "\n ");
129+
}
130+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
package com.algolia.model;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import io.swagger.annotations.ApiModel;
5+
import io.swagger.annotations.ApiModelProperty;
6+
import java.util.ArrayList;
7+
import java.util.List;
8+
import java.util.Objects;
9+
10+
/** The `batch` requests. */
11+
@ApiModel(description = "The `batch` requests.")
12+
public class BatchWriteObject {
13+
14+
public static final String SERIALIZED_NAME_REQUESTS = "requests";
15+
16+
@SerializedName(SERIALIZED_NAME_REQUESTS)
17+
private List<Operation> requests = null;
18+
19+
public BatchWriteObject requests(List<Operation> requests) {
20+
this.requests = requests;
21+
return this;
22+
}
23+
24+
public BatchWriteObject addRequestsItem(Operation requestsItem) {
25+
if (this.requests == null) {
26+
this.requests = new ArrayList<>();
27+
}
28+
this.requests.add(requestsItem);
29+
return this;
30+
}
31+
32+
/**
33+
* Get requests
34+
*
35+
* @return requests
36+
*/
37+
@javax.annotation.Nullable
38+
@ApiModelProperty(value = "")
39+
public List<Operation> getRequests() {
40+
return requests;
41+
}
42+
43+
public void setRequests(List<Operation> requests) {
44+
this.requests = requests;
45+
}
46+
47+
@Override
48+
public boolean equals(Object o) {
49+
if (this == o) {
50+
return true;
51+
}
52+
if (o == null || getClass() != o.getClass()) {
53+
return false;
54+
}
55+
BatchWriteObject batchWriteObject = (BatchWriteObject) o;
56+
return Objects.equals(this.requests, batchWriteObject.requests);
57+
}
58+
59+
@Override
60+
public int hashCode() {
61+
return Objects.hash(requests);
62+
}
63+
64+
@Override
65+
public String toString() {
66+
StringBuilder sb = new StringBuilder();
67+
sb.append("class BatchWriteObject {\n");
68+
sb.append(" requests: ").append(toIndentedString(requests)).append("\n");
69+
sb.append("}");
70+
return sb.toString();
71+
}
72+
73+
/**
74+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
75+
*/
76+
private String toIndentedString(Object o) {
77+
if (o == null) {
78+
return "null";
79+
}
80+
return o.toString().replace("\n", "\n ");
81+
}
82+
}

0 commit comments

Comments
 (0)