com.commercetools.graphql.api.client.CartsGraphQLQuery Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-graphql-api Show documentation
Show all versions of commercetools-graphql-api Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package com.commercetools.graphql.api.client;
import com.netflix.graphql.dgs.client.codegen.GraphQLQuery;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class CartsGraphQLQuery extends GraphQLQuery {
public CartsGraphQLQuery(String where, List sort, Integer limit, Integer offset,
String queryName, Set fieldsSet) {
super("query", queryName);
if (where != null || fieldsSet.contains("where")) {
getInput().put("where", where);
}if (sort != null || fieldsSet.contains("sort")) {
getInput().put("sort", sort);
}if (limit != null || fieldsSet.contains("limit")) {
getInput().put("limit", limit);
}if (offset != null || fieldsSet.contains("offset")) {
getInput().put("offset", offset);
}
}
public CartsGraphQLQuery() {
super("query");
}
@Override
public String getOperationName() {
return "carts";
}
public static Builder newRequest() {
return new Builder();
}
public static class Builder {
private Set fieldsSet = new HashSet<>();
private String where;
private List sort;
private Integer limit;
private Integer offset;
private String queryName;
public CartsGraphQLQuery build() {
return new CartsGraphQLQuery(where, sort, limit, offset, queryName, fieldsSet);
}
public Builder where(String where) {
this.where = where;
this.fieldsSet.add("where");
return this;
}
public Builder sort(List sort) {
this.sort = sort;
this.fieldsSet.add("sort");
return this;
}
public Builder limit(Integer limit) {
this.limit = limit;
this.fieldsSet.add("limit");
return this;
}
public Builder offset(Integer offset) {
this.offset = offset;
this.fieldsSet.add("offset");
return this;
}
public Builder queryName(String queryName) {
this.queryName = queryName;
return this;
}
}
}