All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bloxbean.cardano.gql.AddressSummaryQuery Maven / Gradle / Ivy

There is a newer version: 0.3.0-beta1
Show newest version
// 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.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 AddressSummaryQuery implements Query {
  public static final String OPERATION_ID = "1313decb78055a354c748163c9a54ee38965bf520d5e91a701d1fdf05f57b7f8";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query AddressSummary($addresses:[String]!) {\n"
        + "  paymentAddresses(addresses: $addresses) {\n"
        + "    __typename\n"
        + "    summary {\n"
        + "      __typename\n"
        + "      assetBalances {\n"
        + "        __typename\n"
        + "        asset {\n"
        + "          __typename\n"
        + "          assetId\n"
        + "          policyId\n"
        + "          assetName\n"
        + "          fingerprint\n"
        + "        }\n"
        + "        quantity\n"
        + "      }\n"
        + "    }\n"
        + "    address\n"
        + "    summary {\n"
        + "      __typename\n"
        + "      utxosCount\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

  public static final OperationName OPERATION_NAME = new OperationName() {
    @Override
    public String name() {
      return "AddressSummary";
    }
  };

  private final AddressSummaryQuery.Variables variables;

  public AddressSummaryQuery(@NotNull List addresses) {
    Utils.checkNotNull(addresses, "addresses == null");
    variables = new AddressSummaryQuery.Variables(addresses);
  }

  @Override
  public String operationId() {
    return OPERATION_ID;
  }

  @Override
  public String queryDocument() {
    return QUERY_DOCUMENT;
  }

  @Override
  public AddressSummaryQuery.Data wrapData(AddressSummaryQuery.Data data) {
    return data;
  }

  @Override
  public AddressSummaryQuery.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 @NotNull List addresses;

    Builder() {
    }

    public Builder addresses(@NotNull List addresses) {
      this.addresses = addresses;
      return this;
    }

    public AddressSummaryQuery build() {
      Utils.checkNotNull(addresses, "addresses == null");
      return new AddressSummaryQuery(addresses);
    }
  }

  public static final class Variables extends Operation.Variables {
    private final @NotNull List addresses;

    private final transient Map valueMap = new LinkedHashMap<>();

    Variables(@NotNull List addresses) {
      this.addresses = addresses;
      this.valueMap.put("addresses", addresses);
    }

    public @NotNull List addresses() {
      return addresses;
    }

    @Override
    public Map valueMap() {
      return Collections.unmodifiableMap(valueMap);
    }

    @Override
    public InputFieldMarshaller marshaller() {
      return new InputFieldMarshaller() {
        @Override
        public void marshal(InputFieldWriter writer) throws IOException {
          writer.writeList("addresses", new InputFieldWriter.ListWriter() {
            @Override
            public void write(InputFieldWriter.ListItemWriter listItemWriter) throws IOException {
              for (final String $item : addresses) {
                listItemWriter.writeString($item);
              }
            }
          });
        }
      };
    }
  }

  /**
   * Data from the response after executing this GraphQL operation
   */
  public static class Data implements Operation.Data {
    static final ResponseField[] $responseFields = {
      ResponseField.forList("paymentAddresses", "paymentAddresses", new UnmodifiableMapBuilder(1)
      .put("addresses", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "addresses")
        .build())
      .build(), true, Collections.emptyList())
    };

    final @Nullable List paymentAddresses;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Data(@Nullable List paymentAddresses) {
      this.paymentAddresses = paymentAddresses;
    }

    public @Nullable List paymentAddresses() {
      return this.paymentAddresses;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeList($responseFields[0], paymentAddresses, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((PaymentAddress) item).marshaller());
              }
            }
          });
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Data{"
          + "paymentAddresses=" + paymentAddresses
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Data) {
        Data that = (Data) o;
        return ((this.paymentAddresses == null) ? (that.paymentAddresses == null) : this.paymentAddresses.equals(that.paymentAddresses));
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= (paymentAddresses == null) ? 0 : paymentAddresses.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final PaymentAddress.Mapper paymentAddressFieldMapper = new PaymentAddress.Mapper();

      @Override
      public Data map(ResponseReader reader) {
        final List paymentAddresses = reader.readList($responseFields[0], new ResponseReader.ListReader() {
          @Override
          public PaymentAddress read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public PaymentAddress read(ResponseReader reader) {
                return paymentAddressFieldMapper.map(reader);
              }
            });
          }
        });
        return new Data(paymentAddresses);
      }
    }
  }

  public static class PaymentAddress {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("summary", "summary", null, true, Collections.emptyList()),
      ResponseField.forString("address", "address", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable Summary summary;

    final @NotNull String address;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public PaymentAddress(@NotNull String __typename, @Nullable Summary summary,
        @NotNull String address) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.summary = summary;
      this.address = Utils.checkNotNull(address, "address == null");
    }

    public @NotNull String __typename() {
      return this.__typename;
    }

    public @Nullable Summary summary() {
      return this.summary;
    }

    public @NotNull String address() {
      return this.address;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeObject($responseFields[1], summary != null ? summary.marshaller() : null);
          writer.writeString($responseFields[2], address);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "PaymentAddress{"
          + "__typename=" + __typename + ", "
          + "summary=" + summary + ", "
          + "address=" + address
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof PaymentAddress) {
        PaymentAddress that = (PaymentAddress) o;
        return this.__typename.equals(that.__typename)
         && ((this.summary == null) ? (that.summary == null) : this.summary.equals(that.summary))
         && this.address.equals(that.address);
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= (summary == null) ? 0 : summary.hashCode();
        h *= 1000003;
        h ^= address.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final Summary.Mapper summaryFieldMapper = new Summary.Mapper();

      @Override
      public PaymentAddress map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Summary summary = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Summary read(ResponseReader reader) {
            return summaryFieldMapper.map(reader);
          }
        });
        final String address = reader.readString($responseFields[2]);
        return new PaymentAddress(__typename, summary, address);
      }
    }
  }

  public static class Summary {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forList("assetBalances", "assetBalances", null, false, Collections.emptyList()),
      ResponseField.forInt("utxosCount", "utxosCount", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull List assetBalances;

    final int utxosCount;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Summary(@NotNull String __typename, @NotNull List assetBalances,
        int utxosCount) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.assetBalances = Utils.checkNotNull(assetBalances, "assetBalances == null");
      this.utxosCount = utxosCount;
    }

    public @NotNull String __typename() {
      return this.__typename;
    }

    public @NotNull List assetBalances() {
      return this.assetBalances;
    }

    public int utxosCount() {
      return this.utxosCount;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeList($responseFields[1], assetBalances, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((AssetBalance) item).marshaller());
              }
            }
          });
          writer.writeInt($responseFields[2], utxosCount);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Summary{"
          + "__typename=" + __typename + ", "
          + "assetBalances=" + assetBalances + ", "
          + "utxosCount=" + utxosCount
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Summary) {
        Summary that = (Summary) o;
        return this.__typename.equals(that.__typename)
         && this.assetBalances.equals(that.assetBalances)
         && this.utxosCount == that.utxosCount;
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= assetBalances.hashCode();
        h *= 1000003;
        h ^= utxosCount;
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final AssetBalance.Mapper assetBalanceFieldMapper = new AssetBalance.Mapper();

      @Override
      public Summary map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final List assetBalances = reader.readList($responseFields[1], new ResponseReader.ListReader() {
          @Override
          public AssetBalance read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public AssetBalance read(ResponseReader reader) {
                return assetBalanceFieldMapper.map(reader);
              }
            });
          }
        });
        final int utxosCount = reader.readInt($responseFields[2]);
        return new Summary(__typename, assetBalances, utxosCount);
      }
    }
  }

  public static class AssetBalance {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("asset", "asset", null, false, Collections.emptyList()),
      ResponseField.forString("quantity", "quantity", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Asset asset;

    final @NotNull String quantity;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public AssetBalance(@NotNull String __typename, @NotNull Asset asset,
        @NotNull String quantity) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.asset = Utils.checkNotNull(asset, "asset == null");
      this.quantity = Utils.checkNotNull(quantity, "quantity == null");
    }

    public @NotNull String __typename() {
      return this.__typename;
    }

    public @NotNull Asset asset() {
      return this.asset;
    }

    public @NotNull String quantity() {
      return this.quantity;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeObject($responseFields[1], asset.marshaller());
          writer.writeString($responseFields[2], quantity);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "AssetBalance{"
          + "__typename=" + __typename + ", "
          + "asset=" + asset + ", "
          + "quantity=" + quantity
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof AssetBalance) {
        AssetBalance that = (AssetBalance) o;
        return this.__typename.equals(that.__typename)
         && this.asset.equals(that.asset)
         && this.quantity.equals(that.quantity);
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= asset.hashCode();
        h *= 1000003;
        h ^= quantity.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final Asset.Mapper assetFieldMapper = new Asset.Mapper();

      @Override
      public AssetBalance map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Asset asset = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Asset read(ResponseReader reader) {
            return assetFieldMapper.map(reader);
          }
        });
        final String quantity = reader.readString($responseFields[2]);
        return new AssetBalance(__typename, asset, quantity);
      }
    }
  }

  public static class Asset {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("assetId", "assetId", null, false, CustomType.HEX, Collections.emptyList()),
      ResponseField.forCustomType("policyId", "policyId", null, false, CustomType.HASH28HEX, Collections.emptyList()),
      ResponseField.forCustomType("assetName", "assetName", null, true, CustomType.HEX, Collections.emptyList()),
      ResponseField.forCustomType("fingerprint", "fingerprint", null, true, CustomType.ASSETFINGERPRINT, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Object assetId;

    final @NotNull Object policyId;

    final @Nullable Object assetName;

    final @Nullable Object fingerprint;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Asset(@NotNull String __typename, @NotNull Object assetId, @NotNull Object policyId,
        @Nullable Object assetName, @Nullable Object fingerprint) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.assetId = Utils.checkNotNull(assetId, "assetId == null");
      this.policyId = Utils.checkNotNull(policyId, "policyId == null");
      this.assetName = assetName;
      this.fingerprint = fingerprint;
    }

    public @NotNull String __typename() {
      return this.__typename;
    }

    public @NotNull Object assetId() {
      return this.assetId;
    }

    public @NotNull Object policyId() {
      return this.policyId;
    }

    public @Nullable Object assetName() {
      return this.assetName;
    }

    public @Nullable Object fingerprint() {
      return this.fingerprint;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[1], assetId);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], policyId);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[3], assetName);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[4], fingerprint);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Asset{"
          + "__typename=" + __typename + ", "
          + "assetId=" + assetId + ", "
          + "policyId=" + policyId + ", "
          + "assetName=" + assetName + ", "
          + "fingerprint=" + fingerprint
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Asset) {
        Asset that = (Asset) o;
        return this.__typename.equals(that.__typename)
         && this.assetId.equals(that.assetId)
         && this.policyId.equals(that.policyId)
         && ((this.assetName == null) ? (that.assetName == null) : this.assetName.equals(that.assetName))
         && ((this.fingerprint == null) ? (that.fingerprint == null) : this.fingerprint.equals(that.fingerprint));
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= assetId.hashCode();
        h *= 1000003;
        h ^= policyId.hashCode();
        h *= 1000003;
        h ^= (assetName == null) ? 0 : assetName.hashCode();
        h *= 1000003;
        h ^= (fingerprint == null) ? 0 : fingerprint.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Asset map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object assetId = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final Object policyId = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final Object assetName = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[3]);
        final Object fingerprint = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[4]);
        return new Asset(__typename, assetId, policyId, assetName, fingerprint);
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy