-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(specs): add objects endpoints (#54)
- Loading branch information
Showing
42 changed files
with
4,561 additions
and
683 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/Action.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.algolia.model; | ||
|
||
import com.google.gson.TypeAdapter; | ||
import com.google.gson.annotations.JsonAdapter; | ||
import com.google.gson.stream.JsonReader; | ||
import com.google.gson.stream.JsonWriter; | ||
import java.io.IOException; | ||
|
||
/** type of operation. */ | ||
@JsonAdapter(Action.Adapter.class) | ||
public enum Action { | ||
ADDOBJECT("addObject"), | ||
|
||
UPDATEOBJECT("updateObject"), | ||
|
||
PARTIALUPDATEOBJECT("partialUpdateObject"), | ||
|
||
PARTIALUPDATEOBJECTNOCREATE("partialUpdateObjectNoCreate"), | ||
|
||
DELETEOBJECT("deleteObject"), | ||
|
||
DELETE("delete"), | ||
|
||
CLEAR("clear"); | ||
|
||
private String value; | ||
|
||
Action(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
|
||
public static Action fromValue(String value) { | ||
for (Action b : Action.values()) { | ||
if (b.value.equals(value)) { | ||
return b; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unexpected value '" + value + "'"); | ||
} | ||
|
||
public static class Adapter extends TypeAdapter<Action> { | ||
|
||
@Override | ||
public void write(final JsonWriter jsonWriter, final Action enumeration) | ||
throws IOException { | ||
jsonWriter.value(enumeration.getValue()); | ||
} | ||
|
||
@Override | ||
public Action read(final JsonReader jsonReader) throws IOException { | ||
String value = jsonReader.nextString(); | ||
return Action.fromValue(value); | ||
} | ||
} | ||
} |
130 changes: 130 additions & 0 deletions
130
...asearch-client-java-2/algoliasearch-core/com/algolia/model/AddOrUpdateObjectResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
package com.algolia.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import java.time.OffsetDateTime; | ||
import java.util.Objects; | ||
|
||
/** AddOrUpdateObjectResponse */ | ||
public class AddOrUpdateObjectResponse { | ||
|
||
public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; | ||
|
||
@SerializedName(SERIALIZED_NAME_UPDATED_AT) | ||
private OffsetDateTime updatedAt; | ||
|
||
public static final String SERIALIZED_NAME_TASK_I_D = "taskID"; | ||
|
||
@SerializedName(SERIALIZED_NAME_TASK_I_D) | ||
private Integer taskID; | ||
|
||
public static final String SERIALIZED_NAME_OBJECT_I_D = "objectID"; | ||
|
||
@SerializedName(SERIALIZED_NAME_OBJECT_I_D) | ||
private String objectID; | ||
|
||
public AddOrUpdateObjectResponse updatedAt(OffsetDateTime updatedAt) { | ||
this.updatedAt = updatedAt; | ||
return this; | ||
} | ||
|
||
/** | ||
* Date of last update (ISO-8601 format). | ||
* | ||
* @return updatedAt | ||
*/ | ||
@javax.annotation.Nullable | ||
@ApiModelProperty(value = "Date of last update (ISO-8601 format).") | ||
public OffsetDateTime getUpdatedAt() { | ||
return updatedAt; | ||
} | ||
|
||
public void setUpdatedAt(OffsetDateTime updatedAt) { | ||
this.updatedAt = updatedAt; | ||
} | ||
|
||
public AddOrUpdateObjectResponse taskID(Integer taskID) { | ||
this.taskID = taskID; | ||
return this; | ||
} | ||
|
||
/** | ||
* taskID of the indexing task to wait for. | ||
* | ||
* @return taskID | ||
*/ | ||
@javax.annotation.Nullable | ||
@ApiModelProperty(value = "taskID of the indexing task to wait for.") | ||
public Integer getTaskID() { | ||
return taskID; | ||
} | ||
|
||
public void setTaskID(Integer taskID) { | ||
this.taskID = taskID; | ||
} | ||
|
||
public AddOrUpdateObjectResponse objectID(String objectID) { | ||
this.objectID = objectID; | ||
return this; | ||
} | ||
|
||
/** | ||
* Unique identifier of the object. | ||
* | ||
* @return objectID | ||
*/ | ||
@javax.annotation.Nullable | ||
@ApiModelProperty(value = "Unique identifier of the object.") | ||
public String getObjectID() { | ||
return objectID; | ||
} | ||
|
||
public void setObjectID(String objectID) { | ||
this.objectID = objectID; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
AddOrUpdateObjectResponse addOrUpdateObjectResponse = (AddOrUpdateObjectResponse) o; | ||
return ( | ||
Objects.equals(this.updatedAt, addOrUpdateObjectResponse.updatedAt) && | ||
Objects.equals(this.taskID, addOrUpdateObjectResponse.taskID) && | ||
Objects.equals(this.objectID, addOrUpdateObjectResponse.objectID) | ||
); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(updatedAt, taskID, objectID); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class AddOrUpdateObjectResponse {\n"); | ||
sb | ||
.append(" updatedAt: ") | ||
.append(toIndentedString(updatedAt)) | ||
.append("\n"); | ||
sb.append(" taskID: ").append(toIndentedString(taskID)).append("\n"); | ||
sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n"); | ||
sb.append("}"); | ||
return sb.toString(); | ||
} | ||
|
||
/** | ||
* Convert the given object to string with each line indented by 4 spaces (except the first line). | ||
*/ | ||
private String toIndentedString(Object o) { | ||
if (o == null) { | ||
return "null"; | ||
} | ||
return o.toString().replace("\n", "\n "); | ||
} | ||
} |
82 changes: 82 additions & 0 deletions
82
...ts/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BatchWriteObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.algolia.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** The `batch` requests. */ | ||
@ApiModel(description = "The `batch` requests.") | ||
public class BatchWriteObject { | ||
|
||
public static final String SERIALIZED_NAME_REQUESTS = "requests"; | ||
|
||
@SerializedName(SERIALIZED_NAME_REQUESTS) | ||
private List<Operation> requests = null; | ||
|
||
public BatchWriteObject requests(List<Operation> requests) { | ||
this.requests = requests; | ||
return this; | ||
} | ||
|
||
public BatchWriteObject addRequestsItem(Operation requestsItem) { | ||
if (this.requests == null) { | ||
this.requests = new ArrayList<>(); | ||
} | ||
this.requests.add(requestsItem); | ||
return this; | ||
} | ||
|
||
/** | ||
* Get requests | ||
* | ||
* @return requests | ||
*/ | ||
@javax.annotation.Nullable | ||
@ApiModelProperty(value = "") | ||
public List<Operation> getRequests() { | ||
return requests; | ||
} | ||
|
||
public void setRequests(List<Operation> requests) { | ||
this.requests = requests; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
BatchWriteObject batchWriteObject = (BatchWriteObject) o; | ||
return Objects.equals(this.requests, batchWriteObject.requests); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(requests); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class BatchWriteObject {\n"); | ||
sb.append(" requests: ").append(toIndentedString(requests)).append("\n"); | ||
sb.append("}"); | ||
return sb.toString(); | ||
} | ||
|
||
/** | ||
* Convert the given object to string with each line indented by 4 spaces (except the first line). | ||
*/ | ||
private String toIndentedString(Object o) { | ||
if (o == null) { | ||
return "null"; | ||
} | ||
return o.toString().replace("\n", "\n "); | ||
} | ||
} |
Oops, something went wrong.