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

com.bloxbean.cardano.gql.AddressTransactionsByInputsQuery 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 com.bloxbean.cardano.gql.type.Order_by;
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 AddressTransactionsByInputsQuery implements Query {
  public static final String OPERATION_ID = "2903c03f9cd4e76d090bfc1e36b10baf932adafb07789171252e9b42560234af";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query AddressTransactionsByInputs($address: String!, $limit: Int!, $offset: Int!, $orderby: order_by!) {\n"
        + "  transactions(limit: $limit, offset: $offset, order_by: [{\n"
        + "                includedAt: $orderby\n"
        + "            }], where: {inputs: {address: {_eq: $address}}}) {\n"
        + "      __typename\n"
        + "      hash\n"
        + "      includedAt\n"
        + "      block {\n"
        + "        __typename\n"
        + "        number\n"
        + "      }\n"
        + "      blockIndex\n"
        + "    }\n"
        + "  }"
  );

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

  private final AddressTransactionsByInputsQuery.Variables variables;

  public AddressTransactionsByInputsQuery(@NotNull String address, int limit, int offset,
      @NotNull Order_by orderby) {
    Utils.checkNotNull(address, "address == null");
    Utils.checkNotNull(orderby, "orderby == null");
    variables = new AddressTransactionsByInputsQuery.Variables(address, limit, offset, orderby);
  }

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

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

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

  @Override
  public AddressTransactionsByInputsQuery.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 String address;

    private int limit;

    private int offset;

    private @NotNull Order_by orderby;

    Builder() {
    }

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

    public Builder limit(int limit) {
      this.limit = limit;
      return this;
    }

    public Builder offset(int offset) {
      this.offset = offset;
      return this;
    }

    public Builder orderby(@NotNull Order_by orderby) {
      this.orderby = orderby;
      return this;
    }

    public AddressTransactionsByInputsQuery build() {
      Utils.checkNotNull(address, "address == null");
      Utils.checkNotNull(orderby, "orderby == null");
      return new AddressTransactionsByInputsQuery(address, limit, offset, orderby);
    }
  }

  public static final class Variables extends Operation.Variables {
    private final @NotNull String address;

    private final int limit;

    private final int offset;

    private final @NotNull Order_by orderby;

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

    Variables(@NotNull String address, int limit, int offset, @NotNull Order_by orderby) {
      this.address = address;
      this.limit = limit;
      this.offset = offset;
      this.orderby = orderby;
      this.valueMap.put("address", address);
      this.valueMap.put("limit", limit);
      this.valueMap.put("offset", offset);
      this.valueMap.put("orderby", orderby);
    }

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

    public int limit() {
      return limit;
    }

    public int offset() {
      return offset;
    }

    public @NotNull Order_by orderby() {
      return orderby;
    }

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

    @Override
    public InputFieldMarshaller marshaller() {
      return new InputFieldMarshaller() {
        @Override
        public void marshal(InputFieldWriter writer) throws IOException {
          writer.writeString("address", address);
          writer.writeInt("limit", limit);
          writer.writeInt("offset", offset);
          writer.writeString("orderby", orderby.rawValue());
        }
      };
    }
  }

  /**
   * Data from the response after executing this GraphQL operation
   */
  public static class Data implements Operation.Data {
    static final ResponseField[] $responseFields = {
      ResponseField.forList("transactions", "transactions", new UnmodifiableMapBuilder(4)
      .put("limit", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "limit")
        .build())
      .put("offset", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "offset")
        .build())
      .put("order_by", "[{includedAt={kind=Variable, variableName=orderby}}]")
      .put("where", new UnmodifiableMapBuilder(1)
        .put("inputs", new UnmodifiableMapBuilder(1)
          .put("address", new UnmodifiableMapBuilder(1)
            .put("_eq", new UnmodifiableMapBuilder(2)
              .put("kind", "Variable")
              .put("variableName", "address")
              .build())
            .build())
          .build())
        .build())
      .build(), false, Collections.emptyList())
    };

    final @NotNull List transactions;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Data(@NotNull List transactions) {
      this.transactions = Utils.checkNotNull(transactions, "transactions == null");
    }

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

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Transaction.Mapper transactionFieldMapper = new Transaction.Mapper();

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

  public static class Transaction {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("hash", "hash", null, false, CustomType.HASH32HEX, Collections.emptyList()),
      ResponseField.forCustomType("includedAt", "includedAt", null, false, CustomType.DATETIME, Collections.emptyList()),
      ResponseField.forObject("block", "block", null, true, Collections.emptyList()),
      ResponseField.forInt("blockIndex", "blockIndex", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Object hash;

    final @NotNull Object includedAt;

    final @Nullable Block block;

    final int blockIndex;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Transaction(@NotNull String __typename, @NotNull Object hash, @NotNull Object includedAt,
        @Nullable Block block, int blockIndex) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.hash = Utils.checkNotNull(hash, "hash == null");
      this.includedAt = Utils.checkNotNull(includedAt, "includedAt == null");
      this.block = block;
      this.blockIndex = blockIndex;
    }

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

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

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

    public @Nullable Block block() {
      return this.block;
    }

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

    @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], hash);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], includedAt);
          writer.writeObject($responseFields[3], block != null ? block.marshaller() : null);
          writer.writeInt($responseFields[4], blockIndex);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Transaction{"
          + "__typename=" + __typename + ", "
          + "hash=" + hash + ", "
          + "includedAt=" + includedAt + ", "
          + "block=" + block + ", "
          + "blockIndex=" + blockIndex
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Transaction) {
        Transaction that = (Transaction) o;
        return this.__typename.equals(that.__typename)
         && this.hash.equals(that.hash)
         && this.includedAt.equals(that.includedAt)
         && ((this.block == null) ? (that.block == null) : this.block.equals(that.block))
         && this.blockIndex == that.blockIndex;
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final Block.Mapper blockFieldMapper = new Block.Mapper();

      @Override
      public Transaction map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object hash = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final Object includedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final Block block = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public Block read(ResponseReader reader) {
            return blockFieldMapper.map(reader);
          }
        });
        final int blockIndex = reader.readInt($responseFields[4]);
        return new Transaction(__typename, hash, includedAt, block, blockIndex);
      }
    }
  }

  public static class Block {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forInt("number", "number", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable Integer number;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Block(@NotNull String __typename, @Nullable Integer number) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.number = number;
    }

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

    public @Nullable Integer number() {
      return this.number;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Block{"
          + "__typename=" + __typename + ", "
          + "number=" + number
          + "}";
      }
      return $toString;
    }

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

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Block map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Integer number = reader.readInt($responseFields[1]);
        return new Block(__typename, number);
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy