-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(spec): add customRequest methods (#178)
- Loading branch information
Showing
129 changed files
with
5,986 additions
and
803 deletions.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/model/BatchOperation.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,92 @@ | ||
package com.algolia.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import java.util.Objects; | ||
|
||
/** BatchOperation */ | ||
public class BatchOperation { | ||
|
||
@SerializedName("action") | ||
private Action action; | ||
|
||
@SerializedName("body") | ||
private Object body; | ||
|
||
public BatchOperation action(Action action) { | ||
this.action = action; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get action | ||
* | ||
* @return action | ||
*/ | ||
@javax.annotation.Nullable | ||
public Action getAction() { | ||
return action; | ||
} | ||
|
||
public void setAction(Action action) { | ||
this.action = action; | ||
} | ||
|
||
public BatchOperation body(Object body) { | ||
this.body = body; | ||
return this; | ||
} | ||
|
||
/** | ||
* arguments to the operation (depends on the type of the operation). | ||
* | ||
* @return body | ||
*/ | ||
@javax.annotation.Nullable | ||
public Object getBody() { | ||
return body; | ||
} | ||
|
||
public void setBody(Object body) { | ||
this.body = body; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
BatchOperation batchOperation = (BatchOperation) o; | ||
return ( | ||
Objects.equals(this.action, batchOperation.action) && | ||
Objects.equals(this.body, batchOperation.body) | ||
); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(action, body); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class BatchOperation {\n"); | ||
sb.append(" action: ").append(toIndentedString(action)).append("\n"); | ||
sb.append(" body: ").append(toIndentedString(body)).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 "); | ||
} | ||
} |
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
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
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
Oops, something went wrong.