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

com.github.twitch4j.graphql.internal.FetchUserSubscriptionsQuery Maven / Gradle / Ivy

The 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.github.twitch4j.graphql.internal;

import com.apollographql.apollo.api.Input;
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.github.twitch4j.graphql.internal.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 FetchUserSubscriptionsQuery implements Query {
  public static final String OPERATION_ID = "5ae9efd9b1d10af3286bf6f780f5a8c7bbc19ce99b04603f24457807cef65353";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query fetchUserSubscriptions($id: ID!, $first: Int = 75, $after: Cursor) {\n"
        + "  user(id: $id) {\n"
        + "    __typename\n"
        + "    subscriptionBenefits(first: $first, after: $after, criteria: {filter: ALL}) {\n"
        + "      __typename\n"
        + "      edges {\n"
        + "        __typename\n"
        + "        cursor\n"
        + "        node {\n"
        + "          __typename\n"
        + "          endsAt\n"
        + "          gift {\n"
        + "            __typename\n"
        + "            giftDate\n"
        + "            gifter {\n"
        + "              __typename\n"
        + "              id\n"
        + "              login\n"
        + "              displayName\n"
        + "              profileImageURL(width: 50)\n"
        + "            }\n"
        + "            isGift\n"
        + "          }\n"
        + "          id\n"
        + "          product {\n"
        + "            __typename\n"
        + "            displayName\n"
        + "            id\n"
        + "            name\n"
        + "            emoteGroups(state: ACTIVE) {\n"
        + "              __typename\n"
        + "              id\n"
        + "            }\n"
        + "          }\n"
        + "          purchasedWithPrime\n"
        + "          renewsAt\n"
        + "          tier\n"
        + "          user {\n"
        + "            __typename\n"
        + "            id\n"
        + "            login\n"
        + "            displayName\n"
        + "            profileImageURL(width: 50)\n"
        + "          }\n"
        + "        }\n"
        + "      }\n"
        + "      pageInfo {\n"
        + "        __typename\n"
        + "        hasNextPage\n"
        + "      }\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

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

  private final FetchUserSubscriptionsQuery.Variables variables;

  public FetchUserSubscriptionsQuery(@NotNull String id, @NotNull Input first,
      @NotNull Input after) {
    Utils.checkNotNull(id, "id == null");
    Utils.checkNotNull(first, "first == null");
    Utils.checkNotNull(after, "after == null");
    variables = new FetchUserSubscriptionsQuery.Variables(id, first, after);
  }

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

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

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

  @Override
  public FetchUserSubscriptionsQuery.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 id;

    private Input first = Input.absent();

    private Input after = Input.absent();

    Builder() {
    }

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

    public Builder first(@Nullable Integer first) {
      this.first = Input.fromNullable(first);
      return this;
    }

    public Builder after(@Nullable Object after) {
      this.after = Input.fromNullable(after);
      return this;
    }

    public Builder firstInput(@NotNull Input first) {
      this.first = Utils.checkNotNull(first, "first == null");
      return this;
    }

    public Builder afterInput(@NotNull Input after) {
      this.after = Utils.checkNotNull(after, "after == null");
      return this;
    }

    public FetchUserSubscriptionsQuery build() {
      Utils.checkNotNull(id, "id == null");
      return new FetchUserSubscriptionsQuery(id, first, after);
    }
  }

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

    private final Input first;

    private final Input after;

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

    Variables(@NotNull String id, Input first, Input after) {
      this.id = id;
      this.first = first;
      this.after = after;
      this.valueMap.put("id", id);
      if (first.defined) {
        this.valueMap.put("first", first.value);
      }
      if (after.defined) {
        this.valueMap.put("after", after.value);
      }
    }

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

    public Input first() {
      return first;
    }

    public Input after() {
      return after;
    }

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

    @Override
    public InputFieldMarshaller marshaller() {
      return new InputFieldMarshaller() {
        @Override
        public void marshal(InputFieldWriter writer) throws IOException {
          writer.writeCustom("id", com.github.twitch4j.graphql.internal.type.CustomType.ID, id);
          if (first.defined) {
            writer.writeInt("first", first.value);
          }
          if (after.defined) {
            writer.writeCustom("after", com.github.twitch4j.graphql.internal.type.CustomType.CURSOR, after.value != null ? after.value : null);
          }
        }
      };
    }
  }

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

    final @Nullable User user;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Data(@Nullable User user) {
      this.user = user;
    }

    /**
     * Get a user by their ID or login.
     * If no ID or login is provided, null is returned.
     * Lookup type can tell the resolver to include all users (inclusing deleted and
     * suspended accounts) on the lookup, defaults to only retrieve active users.
     */
    public @Nullable User user() {
      return this.user;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final User.Mapper userFieldMapper = new User.Mapper();

      @Override
      public Data map(ResponseReader reader) {
        final User user = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
          @Override
          public User read(ResponseReader reader) {
            return userFieldMapper.map(reader);
          }
        });
        return new Data(user);
      }
    }
  }

  /**
   * Twitch user.
   */
  public static class User {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("subscriptionBenefits", "subscriptionBenefits", new UnmodifiableMapBuilder(3)
      .put("first", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "first")
        .build())
      .put("after", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "after")
        .build())
      .put("criteria", new UnmodifiableMapBuilder(1)
        .put("filter", "ALL")
        .build())
      .build(), true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable SubscriptionBenefits subscriptionBenefits;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public User(@NotNull String __typename, @Nullable SubscriptionBenefits subscriptionBenefits) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.subscriptionBenefits = subscriptionBenefits;
    }

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

    /**
     * A paginated list of user's all active subscriptions.
     * Only resolves for the current user. Returns a forbidden error if requested for another user.
     */
    public @Nullable SubscriptionBenefits subscriptionBenefits() {
      return this.subscriptionBenefits;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final SubscriptionBenefits.Mapper subscriptionBenefitsFieldMapper = new SubscriptionBenefits.Mapper();

      @Override
      public User map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final SubscriptionBenefits subscriptionBenefits = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public SubscriptionBenefits read(ResponseReader reader) {
            return subscriptionBenefitsFieldMapper.map(reader);
          }
        });
        return new User(__typename, subscriptionBenefits);
      }
    }
  }

  /**
   * A paginated list of subscription benefits.
   */
  public static class SubscriptionBenefits {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forList("edges", "edges", null, true, Collections.emptyList()),
      ResponseField.forObject("pageInfo", "pageInfo", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable List edges;

    final @NotNull PageInfo pageInfo;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public SubscriptionBenefits(@NotNull String __typename, @Nullable List edges,
        @NotNull PageInfo pageInfo) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.edges = edges;
      this.pageInfo = Utils.checkNotNull(pageInfo, "pageInfo == null");
    }

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

    /**
     * The list of subscription benefits on this page.
     */
    public @Nullable List edges() {
      return this.edges;
    }

    /**
     * Information about this page of payment transactions.
     */
    public @NotNull PageInfo pageInfo() {
      return this.pageInfo;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "SubscriptionBenefits{"
          + "__typename=" + __typename + ", "
          + "edges=" + edges + ", "
          + "pageInfo=" + pageInfo
          + "}";
      }
      return $toString;
    }

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Edge.Mapper edgeFieldMapper = new Edge.Mapper();

      final PageInfo.Mapper pageInfoFieldMapper = new PageInfo.Mapper();

      @Override
      public SubscriptionBenefits map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final List edges = reader.readList($responseFields[1], new ResponseReader.ListReader() {
          @Override
          public Edge read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Edge read(ResponseReader reader) {
                return edgeFieldMapper.map(reader);
              }
            });
          }
        });
        final PageInfo pageInfo = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public PageInfo read(ResponseReader reader) {
            return pageInfoFieldMapper.map(reader);
          }
        });
        return new SubscriptionBenefits(__typename, edges, pageInfo);
      }
    }
  }

  /**
   * An element in a paginated list of subscription benefits.
   */
  public static class Edge {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("cursor", "cursor", null, false, CustomType.CURSOR, Collections.emptyList()),
      ResponseField.forObject("node", "node", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Object cursor;

    final @Nullable Node node;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Edge(@NotNull String __typename, @NotNull Object cursor, @Nullable Node node) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.cursor = Utils.checkNotNull(cursor, "cursor == null");
      this.node = node;
    }

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

    /**
     * Opaque cursor describing this edge's position in the paginated list.
     */
    public @NotNull Object cursor() {
      return this.cursor;
    }

    /**
     * The element node.
     */
    public @Nullable Node node() {
      return this.node;
    }

    @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], cursor);
          writer.writeObject($responseFields[2], node != null ? node.marshaller() : null);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Edge{"
          + "__typename=" + __typename + ", "
          + "cursor=" + cursor + ", "
          + "node=" + node
          + "}";
      }
      return $toString;
    }

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Node.Mapper nodeFieldMapper = new Node.Mapper();

      @Override
      public Edge map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object cursor = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final Node node = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public Node read(ResponseReader reader) {
            return nodeFieldMapper.map(reader);
          }
        });
        return new Edge(__typename, cursor, node);
      }
    }
  }

  /**
   * Data about a user's subscription to a broadcaster.
   */
  public static class Node {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("endsAt", "endsAt", null, true, CustomType.TIME, Collections.emptyList()),
      ResponseField.forObject("gift", "gift", null, true, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("product", "product", null, true, Collections.emptyList()),
      ResponseField.forBoolean("purchasedWithPrime", "purchasedWithPrime", null, false, Collections.emptyList()),
      ResponseField.forCustomType("renewsAt", "renewsAt", null, true, CustomType.TIME, Collections.emptyList()),
      ResponseField.forString("tier", "tier", null, false, Collections.emptyList()),
      ResponseField.forObject("user", "user", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable Object endsAt;

    final @Nullable Gift gift;

    final @NotNull String id;

    final @Nullable Product product;

    final boolean purchasedWithPrime;

    final @Nullable Object renewsAt;

    final @NotNull String tier;

    final @Nullable User1 user;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Node(@NotNull String __typename, @Nullable Object endsAt, @Nullable Gift gift,
        @NotNull String id, @Nullable Product product, boolean purchasedWithPrime,
        @Nullable Object renewsAt, @NotNull String tier, @Nullable User1 user) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.endsAt = endsAt;
      this.gift = gift;
      this.id = Utils.checkNotNull(id, "id == null");
      this.product = product;
      this.purchasedWithPrime = purchasedWithPrime;
      this.renewsAt = renewsAt;
      this.tier = Utils.checkNotNull(tier, "tier == null");
      this.user = user;
    }

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

    /**
     * The date that the subscription benefit ends.
     */
    public @Nullable Object endsAt() {
      return this.endsAt;
    }

    /**
     * gift resolves gift info about a SubscriptionBenefit.
     */
    public @Nullable Gift gift() {
      return this.gift;
    }

    /**
     * The unique identifier.
     */
    public @NotNull String id() {
      return this.id;
    }

    /**
     * Resolves the product that the subscription benefit is to.
     */
    public @Nullable Product product() {
      return this.product;
    }

    /**
     * Whether this benefit was achieved using a Twitch Prime subscription.
     */
    public boolean purchasedWithPrime() {
      return this.purchasedWithPrime;
    }

    /**
     * The date that the subscription benefit will renew. Will be nil if the subscription benefit
     * is not going to renew.
     */
    public @Nullable Object renewsAt() {
      return this.renewsAt;
    }

    /**
     * The subscription tier.
     */
    public @NotNull String tier() {
      return this.tier;
    }

    /**
     * The user who is subscribed to.
     */
    public @Nullable User1 user() {
      return this.user;
    }

    @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], endsAt);
          writer.writeObject($responseFields[2], gift != null ? gift.marshaller() : null);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[3], id);
          writer.writeObject($responseFields[4], product != null ? product.marshaller() : null);
          writer.writeBoolean($responseFields[5], purchasedWithPrime);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[6], renewsAt);
          writer.writeString($responseFields[7], tier);
          writer.writeObject($responseFields[8], user != null ? user.marshaller() : null);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Node{"
          + "__typename=" + __typename + ", "
          + "endsAt=" + endsAt + ", "
          + "gift=" + gift + ", "
          + "id=" + id + ", "
          + "product=" + product + ", "
          + "purchasedWithPrime=" + purchasedWithPrime + ", "
          + "renewsAt=" + renewsAt + ", "
          + "tier=" + tier + ", "
          + "user=" + user
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Node) {
        Node that = (Node) o;
        return this.__typename.equals(that.__typename)
         && ((this.endsAt == null) ? (that.endsAt == null) : this.endsAt.equals(that.endsAt))
         && ((this.gift == null) ? (that.gift == null) : this.gift.equals(that.gift))
         && this.id.equals(that.id)
         && ((this.product == null) ? (that.product == null) : this.product.equals(that.product))
         && this.purchasedWithPrime == that.purchasedWithPrime
         && ((this.renewsAt == null) ? (that.renewsAt == null) : this.renewsAt.equals(that.renewsAt))
         && this.tier.equals(that.tier)
         && ((this.user == null) ? (that.user == null) : this.user.equals(that.user));
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= (endsAt == null) ? 0 : endsAt.hashCode();
        h *= 1000003;
        h ^= (gift == null) ? 0 : gift.hashCode();
        h *= 1000003;
        h ^= id.hashCode();
        h *= 1000003;
        h ^= (product == null) ? 0 : product.hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(purchasedWithPrime).hashCode();
        h *= 1000003;
        h ^= (renewsAt == null) ? 0 : renewsAt.hashCode();
        h *= 1000003;
        h ^= tier.hashCode();
        h *= 1000003;
        h ^= (user == null) ? 0 : user.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final Gift.Mapper giftFieldMapper = new Gift.Mapper();

      final Product.Mapper productFieldMapper = new Product.Mapper();

      final User1.Mapper user1FieldMapper = new User1.Mapper();

      @Override
      public Node map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object endsAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final Gift gift = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public Gift read(ResponseReader reader) {
            return giftFieldMapper.map(reader);
          }
        });
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[3]);
        final Product product = reader.readObject($responseFields[4], new ResponseReader.ObjectReader() {
          @Override
          public Product read(ResponseReader reader) {
            return productFieldMapper.map(reader);
          }
        });
        final boolean purchasedWithPrime = reader.readBoolean($responseFields[5]);
        final Object renewsAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[6]);
        final String tier = reader.readString($responseFields[7]);
        final User1 user = reader.readObject($responseFields[8], new ResponseReader.ObjectReader() {
          @Override
          public User1 read(ResponseReader reader) {
            return user1FieldMapper.map(reader);
          }
        });
        return new Node(__typename, endsAt, gift, id, product, purchasedWithPrime, renewsAt, tier, user);
      }
    }
  }

  /**
   * Gift information for a subscription benefit.
   */
  public static class Gift {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("giftDate", "giftDate", null, true, CustomType.TIME, Collections.emptyList()),
      ResponseField.forObject("gifter", "gifter", null, true, Collections.emptyList()),
      ResponseField.forBoolean("isGift", "isGift", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable Object giftDate;

    final @Nullable Gifter gifter;

    final boolean isGift;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Gift(@NotNull String __typename, @Nullable Object giftDate, @Nullable Gifter gifter,
        boolean isGift) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.giftDate = giftDate;
      this.gifter = gifter;
      this.isGift = isGift;
    }

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

    /**
     * giftDate is the date that the gift was given.
     */
    public @Nullable Object giftDate() {
      return this.giftDate;
    }

    /**
     * Gifter is the user who sent the gift. Will be nil if isGift is false or is the gift is anonymous.
     */
    public @Nullable Gifter gifter() {
      return this.gifter;
    }

    /**
     * isGift says whether the subscription benefit is a gift or not.
     */
    public boolean isGift() {
      return this.isGift;
    }

    @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], giftDate);
          writer.writeObject($responseFields[2], gifter != null ? gifter.marshaller() : null);
          writer.writeBoolean($responseFields[3], isGift);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Gift{"
          + "__typename=" + __typename + ", "
          + "giftDate=" + giftDate + ", "
          + "gifter=" + gifter + ", "
          + "isGift=" + isGift
          + "}";
      }
      return $toString;
    }

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Gifter.Mapper gifterFieldMapper = new Gifter.Mapper();

      @Override
      public Gift map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object giftDate = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final Gifter gifter = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public Gifter read(ResponseReader reader) {
            return gifterFieldMapper.map(reader);
          }
        });
        final boolean isGift = reader.readBoolean($responseFields[3]);
        return new Gift(__typename, giftDate, gifter, isGift);
      }
    }
  }

  /**
   * Twitch user.
   */
  public static class Gifter {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forString("login", "login", null, false, Collections.emptyList()),
      ResponseField.forString("displayName", "displayName", null, false, Collections.emptyList()),
      ResponseField.forString("profileImageURL", "profileImageURL", new UnmodifiableMapBuilder(1)
      .put("width", 50)
      .build(), true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @NotNull String login;

    final @NotNull String displayName;

    final @Nullable String profileImageURL;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Gifter(@NotNull String __typename, @NotNull String id, @NotNull String login,
        @NotNull String displayName, @Nullable String profileImageURL) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.login = Utils.checkNotNull(login, "login == null");
      this.displayName = Utils.checkNotNull(displayName, "displayName == null");
      this.profileImageURL = profileImageURL;
    }

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

    /**
     * The user's unique identifier.
     */
    public @NotNull String id() {
      return this.id;
    }

    /**
     * The user's standard alphanumeric Twitch name.
     */
    public @NotNull String login() {
      return this.login;
    }

    /**
     * A user-styled version of their login.
     * For international users, this could be the user's login with localized characters.
     */
    public @NotNull String displayName() {
      return this.displayName;
    }

    /**
     * A URL to the user's profile image.
     * Valid widths are 28, 50, 70, 96, 150, 300, and 600.
     * The image height will be the same as the given width.
     */
    public @Nullable String profileImageURL() {
      return this.profileImageURL;
    }

    @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], id);
          writer.writeString($responseFields[2], login);
          writer.writeString($responseFields[3], displayName);
          writer.writeString($responseFields[4], profileImageURL);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Gifter{"
          + "__typename=" + __typename + ", "
          + "id=" + id + ", "
          + "login=" + login + ", "
          + "displayName=" + displayName + ", "
          + "profileImageURL=" + profileImageURL
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Gifter) {
        Gifter that = (Gifter) o;
        return this.__typename.equals(that.__typename)
         && this.id.equals(that.id)
         && this.login.equals(that.login)
         && this.displayName.equals(that.displayName)
         && ((this.profileImageURL == null) ? (that.profileImageURL == null) : this.profileImageURL.equals(that.profileImageURL));
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Gifter map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final String login = reader.readString($responseFields[2]);
        final String displayName = reader.readString($responseFields[3]);
        final String profileImageURL = reader.readString($responseFields[4]);
        return new Gifter(__typename, id, login, displayName, profileImageURL);
      }
    }
  }

  /**
   * A subscription that is purchasable by users.
   * Once purchased, the subscription entitles the user to use special emote sets on Twitch.
   */
  public static class Product {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("displayName", "displayName", null, true, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forString("name", "name", null, false, Collections.emptyList()),
      ResponseField.forList("emoteGroups", "emoteGroups", new UnmodifiableMapBuilder(1)
      .put("state", "ACTIVE")
      .build(), true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable String displayName;

    final @NotNull String id;

    final @NotNull String name;

    final @Nullable List emoteGroups;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Product(@NotNull String __typename, @Nullable String displayName, @NotNull String id,
        @NotNull String name, @Nullable List emoteGroups) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.displayName = displayName;
      this.id = Utils.checkNotNull(id, "id == null");
      this.name = Utils.checkNotNull(name, "name == null");
      this.emoteGroups = emoteGroups;
    }

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

    /**
     * The subscription product's display name.
     */
    public @Nullable String displayName() {
      return this.displayName;
    }

    /**
     * The subscription product's identifier.
     */
    public @NotNull String id() {
      return this.id;
    }

    /**
     * The subscription product's name.
     */
    public @NotNull String name() {
      return this.name;
    }

    /**
     * The emote groups that the user gains access to use on Twitch when they purchase this product.
     * When using the ALL filter the data is uncached and should only be used on the creator dashboard.
     */
    public @Nullable List emoteGroups() {
      return this.emoteGroups;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeString($responseFields[1], displayName);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], id);
          writer.writeString($responseFields[3], name);
          writer.writeList($responseFields[4], emoteGroups, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((EmoteGroup) item).marshaller());
              }
            }
          });
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Product{"
          + "__typename=" + __typename + ", "
          + "displayName=" + displayName + ", "
          + "id=" + id + ", "
          + "name=" + name + ", "
          + "emoteGroups=" + emoteGroups
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Product) {
        Product that = (Product) o;
        return this.__typename.equals(that.__typename)
         && ((this.displayName == null) ? (that.displayName == null) : this.displayName.equals(that.displayName))
         && this.id.equals(that.id)
         && this.name.equals(that.name)
         && ((this.emoteGroups == null) ? (that.emoteGroups == null) : this.emoteGroups.equals(that.emoteGroups));
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final EmoteGroup.Mapper emoteGroupFieldMapper = new EmoteGroup.Mapper();

      @Override
      public Product map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String displayName = reader.readString($responseFields[1]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final String name = reader.readString($responseFields[3]);
        final List emoteGroups = reader.readList($responseFields[4], new ResponseReader.ListReader() {
          @Override
          public EmoteGroup read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public EmoteGroup read(ResponseReader reader) {
                return emoteGroupFieldMapper.map(reader);
              }
            });
          }
        });
        return new Product(__typename, displayName, id, name, emoteGroups);
      }
    }
  }

  /**
   * Represents a group of emotes.
   */
  public static class EmoteGroup {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, true, CustomType.ID, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable String id;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public EmoteGroup(@NotNull String __typename, @Nullable String id) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.id = id;
    }

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

    /**
     * The emote set's identifier.
     */
    public @Nullable String id() {
      return this.id;
    }

    @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], id);
        }
      };
    }

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public EmoteGroup map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        return new EmoteGroup(__typename, id);
      }
    }
  }

  /**
   * Twitch user.
   */
  public static class User1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forString("login", "login", null, false, Collections.emptyList()),
      ResponseField.forString("displayName", "displayName", null, false, Collections.emptyList()),
      ResponseField.forString("profileImageURL", "profileImageURL", new UnmodifiableMapBuilder(1)
      .put("width", 50)
      .build(), true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @NotNull String login;

    final @NotNull String displayName;

    final @Nullable String profileImageURL;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public User1(@NotNull String __typename, @NotNull String id, @NotNull String login,
        @NotNull String displayName, @Nullable String profileImageURL) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.login = Utils.checkNotNull(login, "login == null");
      this.displayName = Utils.checkNotNull(displayName, "displayName == null");
      this.profileImageURL = profileImageURL;
    }

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

    /**
     * The user's unique identifier.
     */
    public @NotNull String id() {
      return this.id;
    }

    /**
     * The user's standard alphanumeric Twitch name.
     */
    public @NotNull String login() {
      return this.login;
    }

    /**
     * A user-styled version of their login.
     * For international users, this could be the user's login with localized characters.
     */
    public @NotNull String displayName() {
      return this.displayName;
    }

    /**
     * A URL to the user's profile image.
     * Valid widths are 28, 50, 70, 96, 150, 300, and 600.
     * The image height will be the same as the given width.
     */
    public @Nullable String profileImageURL() {
      return this.profileImageURL;
    }

    @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], id);
          writer.writeString($responseFields[2], login);
          writer.writeString($responseFields[3], displayName);
          writer.writeString($responseFields[4], profileImageURL);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "User1{"
          + "__typename=" + __typename + ", "
          + "id=" + id + ", "
          + "login=" + login + ", "
          + "displayName=" + displayName + ", "
          + "profileImageURL=" + profileImageURL
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof User1) {
        User1 that = (User1) o;
        return this.__typename.equals(that.__typename)
         && this.id.equals(that.id)
         && this.login.equals(that.login)
         && this.displayName.equals(that.displayName)
         && ((this.profileImageURL == null) ? (that.profileImageURL == null) : this.profileImageURL.equals(that.profileImageURL));
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public User1 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final String login = reader.readString($responseFields[2]);
        final String displayName = reader.readString($responseFields[3]);
        final String profileImageURL = reader.readString($responseFields[4]);
        return new User1(__typename, id, login, displayName, profileImageURL);
      }
    }
  }

  /**
   * PageInfo is a special field which contains information about the page,
   * specifically the cursors which the page starts and ends, and whether or
   * not the client can forward-paginate or backward-paginate.
   *
   * This is part of the Relay Cursor Connections Specification:
   * https://facebook.github.io/relay/graphql/connections.htm.
   */
  public static class PageInfo {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forBoolean("hasNextPage", "hasNextPage", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final boolean hasNextPage;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public PageInfo(@NotNull String __typename, boolean hasNextPage) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.hasNextPage = hasNextPage;
    }

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

    public boolean hasNextPage() {
      return this.hasNextPage;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public PageInfo map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final boolean hasNextPage = reader.readBoolean($responseFields[1]);
        return new PageInfo(__typename, hasNextPage);
      }
    }
  }
}