Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(specs): improve consistency and naming #96

Merged
merged 5 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import com.google.gson.annotations.SerializedName;
import java.util.Objects;

/** Assign userID object. */
public class AssignUserIdObject {
/** Assign userID parameters. */
public class AssignUserIdParams {

@SerializedName("cluster")
private String cluster;

public AssignUserIdObject cluster(String cluster) {
public AssignUserIdParams cluster(String cluster) {
this.cluster = cluster;
return this;
}
Expand All @@ -36,8 +36,8 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
AssignUserIdObject assignUserIdObject = (AssignUserIdObject) o;
return Objects.equals(this.cluster, assignUserIdObject.cluster);
AssignUserIdParams assignUserIdParams = (AssignUserIdParams) o;
return Objects.equals(this.cluster, assignUserIdParams.cluster);
}

@Override
Expand All @@ -48,7 +48,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AssignUserIdObject {\n");
sb.append("class AssignUserIdParams {\n");
sb.append(" cluster: ").append(toIndentedString(cluster)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
import java.util.List;
import java.util.Objects;

/** Assign userID object. */
public class BatchAssignUserIdsObject {
/** Assign userID parameters. */
public class BatchAssignUserIdsParams {

@SerializedName("cluster")
private String cluster;

@SerializedName("users")
private List<String> users = new ArrayList<>();

public BatchAssignUserIdsObject cluster(String cluster) {
public BatchAssignUserIdsParams cluster(String cluster) {
this.cluster = cluster;
return this;
}
Expand All @@ -33,12 +33,12 @@ public void setCluster(String cluster) {
this.cluster = cluster;
}

public BatchAssignUserIdsObject users(List<String> users) {
public BatchAssignUserIdsParams users(List<String> users) {
this.users = users;
return this;
}

public BatchAssignUserIdsObject addUsersItem(String usersItem) {
public BatchAssignUserIdsParams addUsersItem(String usersItem) {
this.users.add(usersItem);
return this;
}
Expand All @@ -65,10 +65,10 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
BatchAssignUserIdsObject batchAssignUserIdsObject = (BatchAssignUserIdsObject) o;
BatchAssignUserIdsParams batchAssignUserIdsParams = (BatchAssignUserIdsParams) o;
return (
Objects.equals(this.cluster, batchAssignUserIdsObject.cluster) &&
Objects.equals(this.users, batchAssignUserIdsObject.users)
Objects.equals(this.cluster, batchAssignUserIdsParams.cluster) &&
Objects.equals(this.users, batchAssignUserIdsParams.users)
);
}

Expand All @@ -80,7 +80,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BatchAssignUserIdsObject {\n");
sb.append("class BatchAssignUserIdsParams {\n");
sb.append(" cluster: ").append(toIndentedString(cluster)).append("\n");
sb.append(" users: ").append(toIndentedString(users)).append("\n");
sb.append("}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
import java.util.List;
import java.util.Objects;

/** The `batch` requests. */
public class BatchObject {
/** The `multipleBatch` parameters. */
public class BatchParams {

@SerializedName("requests")
private List<Operation> requests = null;

public BatchObject requests(List<Operation> requests) {
public BatchParams requests(List<Operation> requests) {
this.requests = requests;
return this;
}

public BatchObject addRequestsItem(Operation requestsItem) {
public BatchParams addRequestsItem(Operation requestsItem) {
if (this.requests == null) {
this.requests = new ArrayList<>();
}
Expand Down Expand Up @@ -46,8 +46,8 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
BatchObject batchObject = (BatchObject) o;
return Objects.equals(this.requests, batchObject.requests);
BatchParams batchParams = (BatchParams) o;
return Objects.equals(this.requests, batchParams.requests);
}

@Override
Expand All @@ -58,7 +58,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BatchObject {\n");
sb.append("class BatchParams {\n");
sb.append(" requests: ").append(toIndentedString(requests)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
import java.util.List;
import java.util.Objects;

/** The `batch` requests. */
public class BatchWriteObject {
/** The `batch` parameters. */
public class BatchWriteParams {

@SerializedName("requests")
private List<Operation> requests = null;

public BatchWriteObject requests(List<Operation> requests) {
public BatchWriteParams requests(List<Operation> requests) {
this.requests = requests;
return this;
}

public BatchWriteObject addRequestsItem(Operation requestsItem) {
public BatchWriteParams addRequestsItem(Operation requestsItem) {
if (this.requests == null) {
this.requests = new ArrayList<>();
}
Expand Down Expand Up @@ -46,8 +46,8 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
BatchWriteObject batchWriteObject = (BatchWriteObject) o;
return Objects.equals(this.requests, batchWriteObject.requests);
BatchWriteParams batchWriteParams = (BatchWriteParams) o;
return Objects.equals(this.requests, batchWriteParams.requests);
}

@Override
Expand All @@ -58,7 +58,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BatchWriteObject {\n");
sb.append("class BatchWriteParams {\n");
sb.append(" requests: ").append(toIndentedString(requests)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class BrowseResponse {
private Object userData = new Object();

@SerializedName("hits")
private List<Record> hits = new ArrayList<>();
private List<Hit> hits = new ArrayList<>();

@SerializedName("cursor")
private String cursor;
Expand Down Expand Up @@ -576,12 +576,12 @@ public void setUserData(Object userData) {
this.userData = userData;
}

public BrowseResponse hits(List<Record> hits) {
public BrowseResponse hits(List<Hit> hits) {
this.hits = hits;
return this;
}

public BrowseResponse addHitsItem(Record hitsItem) {
public BrowseResponse addHitsItem(Hit hitsItem) {
this.hits.add(hitsItem);
return this;
}
Expand All @@ -592,11 +592,11 @@ public BrowseResponse addHitsItem(Record hitsItem) {
* @return hits
*/
@javax.annotation.Nonnull
public List<Record> getHits() {
public List<Hit> getHits() {
return hits;
}

public void setHits(List<Record> hits) {
public void setHits(List<Hit> hits) {
this.hits = hits;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
import java.util.List;
import java.util.Objects;

/** The `getObjects` requests. */
public class GetObjectsObject {
/** The `getObjects` parameters. */
public class GetObjectsParams {

@SerializedName("requests")
private List<MultipleGetObjectsObject> requests = null;
private List<MultipleGetObjectsParams> requests = null;

public GetObjectsObject requests(List<MultipleGetObjectsObject> requests) {
public GetObjectsParams requests(List<MultipleGetObjectsParams> requests) {
this.requests = requests;
return this;
}

public GetObjectsObject addRequestsItem(
MultipleGetObjectsObject requestsItem
public GetObjectsParams addRequestsItem(
MultipleGetObjectsParams requestsItem
) {
if (this.requests == null) {
this.requests = new ArrayList<>();
Expand All @@ -32,11 +32,11 @@ public GetObjectsObject addRequestsItem(
* @return requests
*/
@javax.annotation.Nullable
public List<MultipleGetObjectsObject> getRequests() {
public List<MultipleGetObjectsParams> getRequests() {
return requests;
}

public void setRequests(List<MultipleGetObjectsObject> requests) {
public void setRequests(List<MultipleGetObjectsParams> requests) {
this.requests = requests;
}

Expand All @@ -48,8 +48,8 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
GetObjectsObject getObjectsObject = (GetObjectsObject) o;
return Objects.equals(this.requests, getObjectsObject.requests);
GetObjectsParams getObjectsParams = (GetObjectsParams) o;
return Objects.equals(this.requests, getObjectsParams.requests);
}

@Override
Expand All @@ -60,7 +60,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetObjectsObject {\n");
sb.append("class GetObjectsParams {\n");
sb.append(" requests: ").append(toIndentedString(requests)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.HashMap;
import java.util.Objects;

/** A single record. */
public class Record extends HashMap<String, Object> {
/** A single hit. */
public class Hit extends HashMap<String, Object> {

@SerializedName("objectID")
private String objectID;
Expand All @@ -22,7 +22,7 @@ public class Record extends HashMap<String, Object> {
@SerializedName("_distinctSeqID")
private Integer distinctSeqID;

public Record objectID(String objectID) {
public Hit objectID(String objectID) {
this.objectID = objectID;
return this;
}
Expand All @@ -41,7 +41,7 @@ public void setObjectID(String objectID) {
this.objectID = objectID;
}

public Record highlightResult(HighlightResult highlightResult) {
public Hit highlightResult(HighlightResult highlightResult) {
this.highlightResult = highlightResult;
return this;
}
Expand All @@ -60,7 +60,7 @@ public void setHighlightResult(HighlightResult highlightResult) {
this.highlightResult = highlightResult;
}

public Record snippetResult(SnippetResult snippetResult) {
public Hit snippetResult(SnippetResult snippetResult) {
this.snippetResult = snippetResult;
return this;
}
Expand All @@ -79,7 +79,7 @@ public void setSnippetResult(SnippetResult snippetResult) {
this.snippetResult = snippetResult;
}

public Record rankingInfo(RankingInfo rankingInfo) {
public Hit rankingInfo(RankingInfo rankingInfo) {
this.rankingInfo = rankingInfo;
return this;
}
Expand All @@ -98,7 +98,7 @@ public void setRankingInfo(RankingInfo rankingInfo) {
this.rankingInfo = rankingInfo;
}

public Record distinctSeqID(Integer distinctSeqID) {
public Hit distinctSeqID(Integer distinctSeqID) {
this.distinctSeqID = distinctSeqID;
return this;
}
Expand All @@ -125,13 +125,13 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
Record record = (Record) o;
Hit hit = (Hit) o;
return (
Objects.equals(this.objectID, record.objectID) &&
Objects.equals(this.highlightResult, record.highlightResult) &&
Objects.equals(this.snippetResult, record.snippetResult) &&
Objects.equals(this.rankingInfo, record.rankingInfo) &&
Objects.equals(this.distinctSeqID, record.distinctSeqID) &&
Objects.equals(this.objectID, hit.objectID) &&
Objects.equals(this.highlightResult, hit.highlightResult) &&
Objects.equals(this.snippetResult, hit.snippetResult) &&
Objects.equals(this.rankingInfo, hit.rankingInfo) &&
Objects.equals(this.distinctSeqID, hit.distinctSeqID) &&
super.equals(o)
);
}
Expand All @@ -151,7 +151,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Record {\n");
sb.append("class Hit {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" objectID: ").append(toIndentedString(objectID)).append("\n");
sb
Expand Down
Loading