com.bloxbean.cardano.gql.ProtocolParamQuery Maven / Gradle / Ivy
// AUTO-GENERATED FILE. DO NOT MODIFY.
//
// This class was automatically generated by Apollo GraphQL plugin from the GraphQL queries it found.
// It should not be modified by hand.
//
package com.bloxbean.cardano.gql;
import com.apollographql.apollo.api.Operation;
import com.apollographql.apollo.api.OperationName;
import com.apollographql.apollo.api.Query;
import com.apollographql.apollo.api.Response;
import com.apollographql.apollo.api.ResponseField;
import com.apollographql.apollo.api.ScalarTypeAdapters;
import com.apollographql.apollo.api.internal.InputFieldMarshaller;
import com.apollographql.apollo.api.internal.InputFieldWriter;
import com.apollographql.apollo.api.internal.OperationRequestBodyComposer;
import com.apollographql.apollo.api.internal.QueryDocumentMinifier;
import com.apollographql.apollo.api.internal.ResponseFieldMapper;
import com.apollographql.apollo.api.internal.ResponseFieldMarshaller;
import com.apollographql.apollo.api.internal.ResponseReader;
import com.apollographql.apollo.api.internal.ResponseWriter;
import com.apollographql.apollo.api.internal.SimpleOperationResponseParser;
import com.apollographql.apollo.api.internal.UnmodifiableMapBuilder;
import com.apollographql.apollo.api.internal.Utils;
import com.bloxbean.cardano.gql.type.CustomType;
import java.io.IOException;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import okio.Buffer;
import okio.BufferedSource;
import okio.ByteString;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public final class ProtocolParamQuery implements Query {
public static final String OPERATION_ID = "93ae3da1fd5704582e385beb6a5c6111342af89de42d2ee3d430f907ad1bf9ce";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"query ProtocolParamQuery($number: Int!) {\n"
+ " epochs(where: {number: {_eq: $number}}) {\n"
+ " __typename\n"
+ " protocolParams {\n"
+ " __typename\n"
+ " a0\n"
+ " decentralisationParam\n"
+ " eMax\n"
+ " extraEntropy\n"
+ " keyDeposit\n"
+ " maxBlockBodySize\n"
+ " maxBlockHeaderSize\n"
+ " maxTxSize\n"
+ " minFeeA\n"
+ " minFeeB\n"
+ " minPoolCost\n"
+ " minUTxOValue\n"
+ " nOpt\n"
+ " poolDeposit\n"
+ " protocolVersion\n"
+ " rho\n"
+ " tau\n"
+ " coinsPerUtxoWord\n"
+ " collateralPercent\n"
+ " maxCollateralInputs\n"
+ " }\n"
+ " }\n"
+ "}"
);
public static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "ProtocolParamQuery";
}
};
private final ProtocolParamQuery.Variables variables;
public ProtocolParamQuery(int number) {
variables = new ProtocolParamQuery.Variables(number);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public ProtocolParamQuery.Data wrapData(ProtocolParamQuery.Data data) {
return data;
}
@Override
public ProtocolParamQuery.Variables variables() {
return variables;
}
@Override
public ResponseFieldMapper responseFieldMapper() {
return new Data.Mapper();
}
public static Builder builder() {
return new Builder();
}
@Override
public OperationName name() {
return OPERATION_NAME;
}
@Override
@NotNull
public Response parse(@NotNull final BufferedSource source,
@NotNull final ScalarTypeAdapters scalarTypeAdapters) throws IOException {
return SimpleOperationResponseParser.parse(source, this, scalarTypeAdapters);
}
@Override
@NotNull
public Response parse(@NotNull final ByteString byteString,
@NotNull final ScalarTypeAdapters scalarTypeAdapters) throws IOException {
return parse(new Buffer().write(byteString), scalarTypeAdapters);
}
@Override
@NotNull
public Response parse(@NotNull final BufferedSource source) throws
IOException {
return parse(source, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public Response parse(@NotNull final ByteString byteString) throws
IOException {
return parse(byteString, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public ByteString composeRequestBody(@NotNull final ScalarTypeAdapters scalarTypeAdapters) {
return OperationRequestBodyComposer.compose(this, false, true, scalarTypeAdapters);
}
@NotNull
@Override
public ByteString composeRequestBody() {
return OperationRequestBodyComposer.compose(this, false, true, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public ByteString composeRequestBody(final boolean autoPersistQueries,
final boolean withQueryDocument, @NotNull final ScalarTypeAdapters scalarTypeAdapters) {
return OperationRequestBodyComposer.compose(this, autoPersistQueries, withQueryDocument, scalarTypeAdapters);
}
public static final class Builder {
private int number;
Builder() {
}
public Builder number(int number) {
this.number = number;
return this;
}
public ProtocolParamQuery build() {
return new ProtocolParamQuery(number);
}
}
public static final class Variables extends Operation.Variables {
private final int number;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(int number) {
this.number = number;
this.valueMap.put("number", number);
}
public int number() {
return number;
}
@Override
public Map valueMap() {
return Collections.unmodifiableMap(valueMap);
}
@Override
public InputFieldMarshaller marshaller() {
return new InputFieldMarshaller() {
@Override
public void marshal(InputFieldWriter writer) throws IOException {
writer.writeInt("number", number);
}
};
}
}
/**
* Data from the response after executing this GraphQL operation
*/
public static class Data implements Operation.Data {
static final ResponseField[] $responseFields = {
ResponseField.forList("epochs", "epochs", new UnmodifiableMapBuilder(1)
.put("where", new UnmodifiableMapBuilder(1)
.put("number", new UnmodifiableMapBuilder(1)
.put("_eq", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "number")
.build())
.build())
.build())
.build(), false, Collections.emptyList())
};
final @NotNull List epochs;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Data(@NotNull List epochs) {
this.epochs = Utils.checkNotNull(epochs, "epochs == null");
}
public @NotNull List epochs() {
return this.epochs;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeList($responseFields[0], epochs, new ResponseWriter.ListWriter() {
@Override
public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
for (Object item : items) {
listItemWriter.writeObject(((Epoch) item).marshaller());
}
}
});
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "epochs=" + epochs
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return this.epochs.equals(that.epochs);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= epochs.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final Epoch.Mapper epochFieldMapper = new Epoch.Mapper();
@Override
public Data map(ResponseReader reader) {
final List epochs = reader.readList($responseFields[0], new ResponseReader.ListReader() {
@Override
public Epoch read(ResponseReader.ListItemReader listItemReader) {
return listItemReader.readObject(new ResponseReader.ObjectReader() {
@Override
public Epoch read(ResponseReader reader) {
return epochFieldMapper.map(reader);
}
});
}
});
return new Data(epochs);
}
}
}
public static class Epoch {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forObject("protocolParams", "protocolParams", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @Nullable ProtocolParams protocolParams;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Epoch(@NotNull String __typename, @Nullable ProtocolParams protocolParams) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.protocolParams = protocolParams;
}
public @NotNull String __typename() {
return this.__typename;
}
public @Nullable ProtocolParams protocolParams() {
return this.protocolParams;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeObject($responseFields[1], protocolParams != null ? protocolParams.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Epoch{"
+ "__typename=" + __typename + ", "
+ "protocolParams=" + protocolParams
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Epoch) {
Epoch that = (Epoch) o;
return this.__typename.equals(that.__typename)
&& ((this.protocolParams == null) ? (that.protocolParams == null) : this.protocolParams.equals(that.protocolParams));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= (protocolParams == null) ? 0 : protocolParams.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final ProtocolParams.Mapper protocolParamsFieldMapper = new ProtocolParams.Mapper();
@Override
public Epoch map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final ProtocolParams protocolParams = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
@Override
public ProtocolParams read(ResponseReader reader) {
return protocolParamsFieldMapper.map(reader);
}
});
return new Epoch(__typename, protocolParams);
}
}
}
public static class ProtocolParams {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forDouble("a0", "a0", null, false, Collections.emptyList()),
ResponseField.forDouble("decentralisationParam", "decentralisationParam", null, false, Collections.emptyList()),
ResponseField.forInt("eMax", "eMax", null, false, Collections.emptyList()),
ResponseField.forCustomType("extraEntropy", "extraEntropy", null, true, CustomType.JSONOBJECT, Collections.emptyList()),
ResponseField.forInt("keyDeposit", "keyDeposit", null, false, Collections.emptyList()),
ResponseField.forInt("maxBlockBodySize", "maxBlockBodySize", null, false, Collections.emptyList()),
ResponseField.forInt("maxBlockHeaderSize", "maxBlockHeaderSize", null, false, Collections.emptyList()),
ResponseField.forInt("maxTxSize", "maxTxSize", null, false, Collections.emptyList()),
ResponseField.forInt("minFeeA", "minFeeA", null, false, Collections.emptyList()),
ResponseField.forInt("minFeeB", "minFeeB", null, false, Collections.emptyList()),
ResponseField.forInt("minPoolCost", "minPoolCost", null, false, Collections.emptyList()),
ResponseField.forInt("minUTxOValue", "minUTxOValue", null, false, Collections.emptyList()),
ResponseField.forInt("nOpt", "nOpt", null, false, Collections.emptyList()),
ResponseField.forInt("poolDeposit", "poolDeposit", null, false, Collections.emptyList()),
ResponseField.forCustomType("protocolVersion", "protocolVersion", null, false, CustomType.JSONOBJECT, Collections.emptyList()),
ResponseField.forDouble("rho", "rho", null, false, Collections.emptyList()),
ResponseField.forDouble("tau", "tau", null, false, Collections.emptyList()),
ResponseField.forInt("coinsPerUtxoWord", "coinsPerUtxoWord", null, true, Collections.emptyList()),
ResponseField.forInt("collateralPercent", "collateralPercent", null, true, Collections.emptyList()),
ResponseField.forInt("maxCollateralInputs", "maxCollateralInputs", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final double a0;
final double decentralisationParam;
final int eMax;
final @Nullable Object extraEntropy;
final int keyDeposit;
final int maxBlockBodySize;
final int maxBlockHeaderSize;
final int maxTxSize;
final int minFeeA;
final int minFeeB;
final int minPoolCost;
final int minUTxOValue;
final int nOpt;
final int poolDeposit;
final @NotNull Object protocolVersion;
final double rho;
final double tau;
final @Nullable Integer coinsPerUtxoWord;
final @Nullable Integer collateralPercent;
final @Nullable Integer maxCollateralInputs;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public ProtocolParams(@NotNull String __typename, double a0, double decentralisationParam,
int eMax, @Nullable Object extraEntropy, int keyDeposit, int maxBlockBodySize,
int maxBlockHeaderSize, int maxTxSize, int minFeeA, int minFeeB, int minPoolCost,
int minUTxOValue, int nOpt, int poolDeposit, @NotNull Object protocolVersion, double rho,
double tau, @Nullable Integer coinsPerUtxoWord, @Nullable Integer collateralPercent,
@Nullable Integer maxCollateralInputs) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.a0 = a0;
this.decentralisationParam = decentralisationParam;
this.eMax = eMax;
this.extraEntropy = extraEntropy;
this.keyDeposit = keyDeposit;
this.maxBlockBodySize = maxBlockBodySize;
this.maxBlockHeaderSize = maxBlockHeaderSize;
this.maxTxSize = maxTxSize;
this.minFeeA = minFeeA;
this.minFeeB = minFeeB;
this.minPoolCost = minPoolCost;
this.minUTxOValue = minUTxOValue;
this.nOpt = nOpt;
this.poolDeposit = poolDeposit;
this.protocolVersion = Utils.checkNotNull(protocolVersion, "protocolVersion == null");
this.rho = rho;
this.tau = tau;
this.coinsPerUtxoWord = coinsPerUtxoWord;
this.collateralPercent = collateralPercent;
this.maxCollateralInputs = maxCollateralInputs;
}
public @NotNull String __typename() {
return this.__typename;
}
public double a0() {
return this.a0;
}
public double decentralisationParam() {
return this.decentralisationParam;
}
public int eMax() {
return this.eMax;
}
public @Nullable Object extraEntropy() {
return this.extraEntropy;
}
public int keyDeposit() {
return this.keyDeposit;
}
public int maxBlockBodySize() {
return this.maxBlockBodySize;
}
public int maxBlockHeaderSize() {
return this.maxBlockHeaderSize;
}
public int maxTxSize() {
return this.maxTxSize;
}
public int minFeeA() {
return this.minFeeA;
}
public int minFeeB() {
return this.minFeeB;
}
public int minPoolCost() {
return this.minPoolCost;
}
public int minUTxOValue() {
return this.minUTxOValue;
}
public int nOpt() {
return this.nOpt;
}
public int poolDeposit() {
return this.poolDeposit;
}
public @NotNull Object protocolVersion() {
return this.protocolVersion;
}
public double rho() {
return this.rho;
}
public double tau() {
return this.tau;
}
public @Nullable Integer coinsPerUtxoWord() {
return this.coinsPerUtxoWord;
}
public @Nullable Integer collateralPercent() {
return this.collateralPercent;
}
public @Nullable Integer maxCollateralInputs() {
return this.maxCollateralInputs;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeDouble($responseFields[1], a0);
writer.writeDouble($responseFields[2], decentralisationParam);
writer.writeInt($responseFields[3], eMax);
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[4], extraEntropy);
writer.writeInt($responseFields[5], keyDeposit);
writer.writeInt($responseFields[6], maxBlockBodySize);
writer.writeInt($responseFields[7], maxBlockHeaderSize);
writer.writeInt($responseFields[8], maxTxSize);
writer.writeInt($responseFields[9], minFeeA);
writer.writeInt($responseFields[10], minFeeB);
writer.writeInt($responseFields[11], minPoolCost);
writer.writeInt($responseFields[12], minUTxOValue);
writer.writeInt($responseFields[13], nOpt);
writer.writeInt($responseFields[14], poolDeposit);
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[15], protocolVersion);
writer.writeDouble($responseFields[16], rho);
writer.writeDouble($responseFields[17], tau);
writer.writeInt($responseFields[18], coinsPerUtxoWord);
writer.writeInt($responseFields[19], collateralPercent);
writer.writeInt($responseFields[20], maxCollateralInputs);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "ProtocolParams{"
+ "__typename=" + __typename + ", "
+ "a0=" + a0 + ", "
+ "decentralisationParam=" + decentralisationParam + ", "
+ "eMax=" + eMax + ", "
+ "extraEntropy=" + extraEntropy + ", "
+ "keyDeposit=" + keyDeposit + ", "
+ "maxBlockBodySize=" + maxBlockBodySize + ", "
+ "maxBlockHeaderSize=" + maxBlockHeaderSize + ", "
+ "maxTxSize=" + maxTxSize + ", "
+ "minFeeA=" + minFeeA + ", "
+ "minFeeB=" + minFeeB + ", "
+ "minPoolCost=" + minPoolCost + ", "
+ "minUTxOValue=" + minUTxOValue + ", "
+ "nOpt=" + nOpt + ", "
+ "poolDeposit=" + poolDeposit + ", "
+ "protocolVersion=" + protocolVersion + ", "
+ "rho=" + rho + ", "
+ "tau=" + tau + ", "
+ "coinsPerUtxoWord=" + coinsPerUtxoWord + ", "
+ "collateralPercent=" + collateralPercent + ", "
+ "maxCollateralInputs=" + maxCollateralInputs
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ProtocolParams) {
ProtocolParams that = (ProtocolParams) o;
return this.__typename.equals(that.__typename)
&& Double.doubleToLongBits(this.a0) == Double.doubleToLongBits(that.a0)
&& Double.doubleToLongBits(this.decentralisationParam) == Double.doubleToLongBits(that.decentralisationParam)
&& this.eMax == that.eMax
&& ((this.extraEntropy == null) ? (that.extraEntropy == null) : this.extraEntropy.equals(that.extraEntropy))
&& this.keyDeposit == that.keyDeposit
&& this.maxBlockBodySize == that.maxBlockBodySize
&& this.maxBlockHeaderSize == that.maxBlockHeaderSize
&& this.maxTxSize == that.maxTxSize
&& this.minFeeA == that.minFeeA
&& this.minFeeB == that.minFeeB
&& this.minPoolCost == that.minPoolCost
&& this.minUTxOValue == that.minUTxOValue
&& this.nOpt == that.nOpt
&& this.poolDeposit == that.poolDeposit
&& this.protocolVersion.equals(that.protocolVersion)
&& Double.doubleToLongBits(this.rho) == Double.doubleToLongBits(that.rho)
&& Double.doubleToLongBits(this.tau) == Double.doubleToLongBits(that.tau)
&& ((this.coinsPerUtxoWord == null) ? (that.coinsPerUtxoWord == null) : this.coinsPerUtxoWord.equals(that.coinsPerUtxoWord))
&& ((this.collateralPercent == null) ? (that.collateralPercent == null) : this.collateralPercent.equals(that.collateralPercent))
&& ((this.maxCollateralInputs == null) ? (that.maxCollateralInputs == null) : this.maxCollateralInputs.equals(that.maxCollateralInputs));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= Double.valueOf(a0).hashCode();
h *= 1000003;
h ^= Double.valueOf(decentralisationParam).hashCode();
h *= 1000003;
h ^= eMax;
h *= 1000003;
h ^= (extraEntropy == null) ? 0 : extraEntropy.hashCode();
h *= 1000003;
h ^= keyDeposit;
h *= 1000003;
h ^= maxBlockBodySize;
h *= 1000003;
h ^= maxBlockHeaderSize;
h *= 1000003;
h ^= maxTxSize;
h *= 1000003;
h ^= minFeeA;
h *= 1000003;
h ^= minFeeB;
h *= 1000003;
h ^= minPoolCost;
h *= 1000003;
h ^= minUTxOValue;
h *= 1000003;
h ^= nOpt;
h *= 1000003;
h ^= poolDeposit;
h *= 1000003;
h ^= protocolVersion.hashCode();
h *= 1000003;
h ^= Double.valueOf(rho).hashCode();
h *= 1000003;
h ^= Double.valueOf(tau).hashCode();
h *= 1000003;
h ^= (coinsPerUtxoWord == null) ? 0 : coinsPerUtxoWord.hashCode();
h *= 1000003;
h ^= (collateralPercent == null) ? 0 : collateralPercent.hashCode();
h *= 1000003;
h ^= (maxCollateralInputs == null) ? 0 : maxCollateralInputs.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public ProtocolParams map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final double a0 = reader.readDouble($responseFields[1]);
final double decentralisationParam = reader.readDouble($responseFields[2]);
final int eMax = reader.readInt($responseFields[3]);
final Object extraEntropy = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[4]);
final int keyDeposit = reader.readInt($responseFields[5]);
final int maxBlockBodySize = reader.readInt($responseFields[6]);
final int maxBlockHeaderSize = reader.readInt($responseFields[7]);
final int maxTxSize = reader.readInt($responseFields[8]);
final int minFeeA = reader.readInt($responseFields[9]);
final int minFeeB = reader.readInt($responseFields[10]);
final int minPoolCost = reader.readInt($responseFields[11]);
final int minUTxOValue = reader.readInt($responseFields[12]);
final int nOpt = reader.readInt($responseFields[13]);
final int poolDeposit = reader.readInt($responseFields[14]);
final Object protocolVersion = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[15]);
final double rho = reader.readDouble($responseFields[16]);
final double tau = reader.readDouble($responseFields[17]);
final Integer coinsPerUtxoWord = reader.readInt($responseFields[18]);
final Integer collateralPercent = reader.readInt($responseFields[19]);
final Integer maxCollateralInputs = reader.readInt($responseFields[20]);
return new ProtocolParams(__typename, a0, decentralisationParam, eMax, extraEntropy, keyDeposit, maxBlockBodySize, maxBlockHeaderSize, maxTxSize, minFeeA, minFeeB, minPoolCost, minUTxOValue, nOpt, poolDeposit, protocolVersion, rho, tau, coinsPerUtxoWord, collateralPercent, maxCollateralInputs);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy