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

com.github.twitch4j.graphql.internal.FetchModsQuery 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 FetchModsQuery implements Query {
  public static final String OPERATION_ID = "e7bbf8e03401fdd68293eca6018e5f79566dca9a194d8fbc96b30df1d167099a";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query fetchMods($channelLogin: String!, $first: Int = 10, $after: Cursor) {\n"
        + "  user(login: $channelLogin) {\n"
        + "    __typename\n"
        + "    id\n"
        + "    mods(first: $first, after: $after) {\n"
        + "      __typename\n"
        + "      edges {\n"
        + "        __typename\n"
        + "        cursor\n"
        + "        grantedAt\n"
        + "        node {\n"
        + "          __typename\n"
        + "          id\n"
        + "          displayName\n"
        + "          login\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 "fetchMods";
    }
  };

  private final FetchModsQuery.Variables variables;

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

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

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

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

  @Override
  public FetchModsQuery.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 channelLogin;

    private Input first = Input.absent();

    private Input after = Input.absent();

    Builder() {
    }

    public Builder channelLogin(@NotNull String channelLogin) {
      this.channelLogin = channelLogin;
      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 FetchModsQuery build() {
      Utils.checkNotNull(channelLogin, "channelLogin == null");
      return new FetchModsQuery(channelLogin, first, after);
    }
  }

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

    private final Input first;

    private final Input after;

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

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

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

    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.writeString("channelLogin", channelLogin);
          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("login", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "channelLogin")
        .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.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("mods", "mods", new UnmodifiableMapBuilder(2)
      .put("first", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "first")
        .build())
      .put("after", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "after")
        .build())
      .build(), true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @Nullable Mods mods;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

    /**
     * Returns a paginated list of channel moderators.
     */
    public @Nullable Mods mods() {
      return this.mods;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "User{"
          + "__typename=" + __typename + ", "
          + "id=" + id + ", "
          + "mods=" + mods
          + "}";
      }
      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.id.equals(that.id)
         && ((this.mods == null) ? (that.mods == null) : this.mods.equals(that.mods));
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final Mods.Mapper modsFieldMapper = new Mods.Mapper();

      @Override
      public User map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final Mods mods = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public Mods read(ResponseReader reader) {
            return modsFieldMapper.map(reader);
          }
        });
        return new User(__typename, id, mods);
      }
    }
  }

  /**
   * Paginated list of moderators of a channel.
   */
  public static class Mods {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forList("edges", "edges", null, false, Collections.emptyList()),
      ResponseField.forObject("pageInfo", "pageInfo", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull List edges;

    final @NotNull PageInfo pageInfo;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

    /**
     * The elements of the list.
     */
    public @NotNull List edges() {
      return this.edges;
    }

    /**
     * Information about this page.
     */
    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 = "Mods{"
          + "__typename=" + __typename + ", "
          + "edges=" + edges + ", "
          + "pageInfo=" + pageInfo
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Mods) {
        Mods that = (Mods) o;
        return this.__typename.equals(that.__typename)
         && 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.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 Mods 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 Mods(__typename, edges, pageInfo);
      }
    }
  }

  /**
   * Element in a list of moderators of a channel.
   */
  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.forCustomType("grantedAt", "grantedAt", null, false, CustomType.TIME, Collections.emptyList()),
      ResponseField.forObject("node", "node", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Object cursor;

    final @NotNull Object grantedAt;

    final @NotNull 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, @NotNull Object grantedAt,
        @NotNull Node node) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.cursor = Utils.checkNotNull(cursor, "cursor == null");
      this.grantedAt = Utils.checkNotNull(grantedAt, "grantedAt == null");
      this.node = Utils.checkNotNull(node, "node == null");
    }

    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;
    }

    /**
     * Timestamp of when the moderator status was granted.
     */
    public @NotNull Object grantedAt() {
      return this.grantedAt;
    }

    /**
     * The user that is a moderator.
     */
    public @NotNull 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.writeCustom((ResponseField.CustomTypeField) $responseFields[2], grantedAt);
          writer.writeObject($responseFields[3], node.marshaller());
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Edge{"
          + "__typename=" + __typename + ", "
          + "cursor=" + cursor + ", "
          + "grantedAt=" + grantedAt + ", "
          + "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.grantedAt.equals(that.grantedAt)
         && 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 ^= grantedAt.hashCode();
        h *= 1000003;
        h ^= 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 Object grantedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final Node node = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public Node read(ResponseReader reader) {
            return nodeFieldMapper.map(reader);
          }
        });
        return new Edge(__typename, cursor, grantedAt, node);
      }
    }
  }

  /**
   * Twitch user.
   */
  public static class Node {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forString("displayName", "displayName", null, false, Collections.emptyList()),
      ResponseField.forString("login", "login", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @NotNull String displayName;

    final @NotNull String login;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

    /**
     * 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;
    }

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

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Node{"
          + "__typename=" + __typename + ", "
          + "id=" + id + ", "
          + "displayName=" + displayName + ", "
          + "login=" + login
          + "}";
      }
      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.id.equals(that.id)
         && this.displayName.equals(that.displayName)
         && this.login.equals(that.login);
      }
      return false;
    }

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

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

  /**
   * 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);
      }
    }
  }
}