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

com.github.twitch4j.graphql.internal.FetchUnbanRequestsQuery 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 com.github.twitch4j.graphql.internal.type.UnbanRequestStatus;
import com.github.twitch4j.graphql.internal.type.UnbanRequestsSortOrder;
import java.io.IOException;
import java.lang.Double;
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 FetchUnbanRequestsQuery implements Query {
  public static final String OPERATION_ID = "3a67e01dc74b57c770c66b0028e5cf278c76a7304a9ff920dbf52e1d2d6bbc95";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query fetchUnbanRequests($channelLogin: String!, $after: Cursor, $first: Int = 25, $order: UnbanRequestsSortOrder = NEWEST, $status: UnbanRequestStatus = PENDING, $userId: ID) {\n"
        + "  channel(name: $channelLogin) {\n"
        + "    __typename\n"
        + "    id\n"
        + "    unbanRequests(after: $after, first: $first, options: {order: $order, status: $status, userID: $userId}) {\n"
        + "      __typename\n"
        + "      edges {\n"
        + "        __typename\n"
        + "        cursor\n"
        + "        node {\n"
        + "          __typename\n"
        + "          createdAt\n"
        + "          id\n"
        + "          requester {\n"
        + "            __typename\n"
        + "            id\n"
        + "            login\n"
        + "            displayName\n"
        + "            profileImageURL(width: 50)\n"
        + "          }\n"
        + "          requesterMessage\n"
        + "          resolvedAt\n"
        + "          resolvedBy {\n"
        + "            __typename\n"
        + "            id\n"
        + "            login\n"
        + "            displayName\n"
        + "          }\n"
        + "          resolverMessage\n"
        + "          status\n"
        + "        }\n"
        + "      }\n"
        + "      pageInfo {\n"
        + "        __typename\n"
        + "        hasNextPage\n"
        + "      }\n"
        + "      totalCount(status: $status)\n"
        + "    }\n"
        + "    unbanRequestsSettings {\n"
        + "      __typename\n"
        + "      cooldownMinutes\n"
        + "      isEnabled\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

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

  private final FetchUnbanRequestsQuery.Variables variables;

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

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

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

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

  @Override
  public FetchUnbanRequestsQuery.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 after = Input.absent();

    private Input first = Input.absent();

    private Input order = Input.absent();

    private Input status = Input.absent();

    private Input userId = Input.absent();

    Builder() {
    }

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

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

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

    public Builder order(@Nullable UnbanRequestsSortOrder order) {
      this.order = Input.fromNullable(order);
      return this;
    }

    public Builder status(@Nullable UnbanRequestStatus status) {
      this.status = Input.fromNullable(status);
      return this;
    }

    public Builder userId(@Nullable String userId) {
      this.userId = Input.fromNullable(userId);
      return this;
    }

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

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

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

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

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

    public FetchUnbanRequestsQuery build() {
      Utils.checkNotNull(channelLogin, "channelLogin == null");
      return new FetchUnbanRequestsQuery(channelLogin, after, first, order, status, userId);
    }
  }

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

    private final Input after;

    private final Input first;

    private final Input order;

    private final Input status;

    private final Input userId;

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

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

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

    public Input after() {
      return after;
    }

    public Input first() {
      return first;
    }

    public Input order() {
      return order;
    }

    public Input status() {
      return status;
    }

    public Input userId() {
      return userId;
    }

    @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 (after.defined) {
            writer.writeCustom("after", com.github.twitch4j.graphql.internal.type.CustomType.CURSOR, after.value != null ? after.value : null);
          }
          if (first.defined) {
            writer.writeInt("first", first.value);
          }
          if (order.defined) {
            writer.writeString("order", order.value != null ? order.value.rawValue() : null);
          }
          if (status.defined) {
            writer.writeString("status", status.value != null ? status.value.rawValue() : null);
          }
          if (userId.defined) {
            writer.writeCustom("userId", com.github.twitch4j.graphql.internal.type.CustomType.ID, userId.value != null ? userId.value : null);
          }
        }
      };
    }
  }

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

    final @Nullable Channel channel;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Data(@Nullable Channel channel) {
      this.channel = channel;
    }

    /**
     * Get a channel by ID or name.
     */
    public @Nullable Channel channel() {
      return this.channel;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Channel.Mapper channelFieldMapper = new Channel.Mapper();

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

  /**
   * A User's place on Twitch.
   */
  public static class Channel {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("unbanRequests", "unbanRequests", new UnmodifiableMapBuilder(3)
      .put("after", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "after")
        .build())
      .put("first", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "first")
        .build())
      .put("options", new UnmodifiableMapBuilder(3)
        .put("order", new UnmodifiableMapBuilder(2)
          .put("kind", "Variable")
          .put("variableName", "order")
          .build())
        .put("status", new UnmodifiableMapBuilder(2)
          .put("kind", "Variable")
          .put("variableName", "status")
          .build())
        .put("userID", new UnmodifiableMapBuilder(2)
          .put("kind", "Variable")
          .put("variableName", "userId")
          .build())
        .build())
      .build(), true, Collections.emptyList()),
      ResponseField.forObject("unbanRequestsSettings", "unbanRequestsSettings", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @Nullable UnbanRequests unbanRequests;

    final @Nullable UnbanRequestsSettings unbanRequestsSettings;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Channel(@NotNull String __typename, @NotNull String id,
        @Nullable UnbanRequests unbanRequests,
        @Nullable UnbanRequestsSettings unbanRequestsSettings) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.unbanRequests = unbanRequests;
      this.unbanRequestsSettings = unbanRequestsSettings;
    }

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

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

    /**
     * Requests from channel-banned users to be unbanned submitted on the channel.
     * Accessible by users with moderator role or higher.
     */
    public @Nullable UnbanRequests unbanRequests() {
      return this.unbanRequests;
    }

    /**
     * Settings for users creating unban requests on the channel.
     */
    public @Nullable UnbanRequestsSettings unbanRequestsSettings() {
      return this.unbanRequestsSettings;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final UnbanRequests.Mapper unbanRequestsFieldMapper = new UnbanRequests.Mapper();

      final UnbanRequestsSettings.Mapper unbanRequestsSettingsFieldMapper = new UnbanRequestsSettings.Mapper();

      @Override
      public Channel map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final UnbanRequests unbanRequests = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public UnbanRequests read(ResponseReader reader) {
            return unbanRequestsFieldMapper.map(reader);
          }
        });
        final UnbanRequestsSettings unbanRequestsSettings = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public UnbanRequestsSettings read(ResponseReader reader) {
            return unbanRequestsSettingsFieldMapper.map(reader);
          }
        });
        return new Channel(__typename, id, unbanRequests, unbanRequestsSettings);
      }
    }
  }

  /**
   * Paginated list of Unban Requests.
   */
  public static class UnbanRequests {
    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()),
      ResponseField.forDouble("totalCount", "totalCount", new UnmodifiableMapBuilder(1)
      .put("status", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "status")
        .build())
      .build(), true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable List edges;

    final @NotNull PageInfo pageInfo;

    final @Nullable Double totalCount;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

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

    /**
     * Count of all pending unban requests.
     */
    public @Nullable Double totalCount() {
      return this.totalCount;
    }

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof UnbanRequests) {
        UnbanRequests that = (UnbanRequests) o;
        return this.__typename.equals(that.__typename)
         && ((this.edges == null) ? (that.edges == null) : this.edges.equals(that.edges))
         && this.pageInfo.equals(that.pageInfo)
         && ((this.totalCount == null) ? (that.totalCount == null) : this.totalCount.equals(that.totalCount));
      }
      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();
        h *= 1000003;
        h ^= (totalCount == null) ? 0 : totalCount.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 UnbanRequests 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);
          }
        });
        final Double totalCount = reader.readDouble($responseFields[3]);
        return new UnbanRequests(__typename, edges, pageInfo, totalCount);
      }
    }
  }

  /**
   * Element in a list of Unban Requests.
   */
  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 unban request.
     */
    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);
      }
    }
  }

  /**
   * A request from a channel-banned user to the channel moderators to be unbanned
   * from the channel.
   */
  public static class Node {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("createdAt", "createdAt", null, false, CustomType.TIME, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("requester", "requester", null, true, Collections.emptyList()),
      ResponseField.forString("requesterMessage", "requesterMessage", null, true, Collections.emptyList()),
      ResponseField.forCustomType("resolvedAt", "resolvedAt", null, true, CustomType.TIME, Collections.emptyList()),
      ResponseField.forObject("resolvedBy", "resolvedBy", null, true, Collections.emptyList()),
      ResponseField.forString("resolverMessage", "resolverMessage", null, true, Collections.emptyList()),
      ResponseField.forString("status", "status", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Object createdAt;

    final @NotNull String id;

    final @Nullable Requester requester;

    final @Nullable String requesterMessage;

    final @Nullable Object resolvedAt;

    final @Nullable ResolvedBy resolvedBy;

    final @Nullable String resolverMessage;

    final @NotNull UnbanRequestStatus status;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Node(@NotNull String __typename, @NotNull Object createdAt, @NotNull String id,
        @Nullable Requester requester, @Nullable String requesterMessage,
        @Nullable Object resolvedAt, @Nullable ResolvedBy resolvedBy,
        @Nullable String resolverMessage, @NotNull UnbanRequestStatus status) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.createdAt = Utils.checkNotNull(createdAt, "createdAt == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.requester = requester;
      this.requesterMessage = requesterMessage;
      this.resolvedAt = resolvedAt;
      this.resolvedBy = resolvedBy;
      this.resolverMessage = resolverMessage;
      this.status = Utils.checkNotNull(status, "status == null");
    }

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

    /**
     * The time at which the unban request was created.
     */
    public @NotNull Object createdAt() {
      return this.createdAt;
    }

    /**
     * UUID of the Unban Request.
     */
    public @NotNull String id() {
      return this.id;
    }

    /**
     * The banned user appealing the ban.
     */
    public @Nullable Requester requester() {
      return this.requester;
    }

    /**
     * Custom message provided by the requester.
     */
    public @Nullable String requesterMessage() {
      return this.requesterMessage;
    }

    /**
     * The time at which the unban request was resolved (approved or denied).
     */
    public @Nullable Object resolvedAt() {
      return this.resolvedAt;
    }

    /**
     * The moderator that has taken action on the user.
     */
    public @Nullable ResolvedBy resolvedBy() {
      return this.resolvedBy;
    }

    /**
     * Custom message provided by the resolver.
     */
    public @Nullable String resolverMessage() {
      return this.resolverMessage;
    }

    /**
     * The status of the unban request.
     */
    public @NotNull UnbanRequestStatus status() {
      return this.status;
    }

    @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], createdAt);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], id);
          writer.writeObject($responseFields[3], requester != null ? requester.marshaller() : null);
          writer.writeString($responseFields[4], requesterMessage);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[5], resolvedAt);
          writer.writeObject($responseFields[6], resolvedBy != null ? resolvedBy.marshaller() : null);
          writer.writeString($responseFields[7], resolverMessage);
          writer.writeString($responseFields[8], status.rawValue());
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Node{"
          + "__typename=" + __typename + ", "
          + "createdAt=" + createdAt + ", "
          + "id=" + id + ", "
          + "requester=" + requester + ", "
          + "requesterMessage=" + requesterMessage + ", "
          + "resolvedAt=" + resolvedAt + ", "
          + "resolvedBy=" + resolvedBy + ", "
          + "resolverMessage=" + resolverMessage + ", "
          + "status=" + status
          + "}";
      }
      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.createdAt.equals(that.createdAt)
         && this.id.equals(that.id)
         && ((this.requester == null) ? (that.requester == null) : this.requester.equals(that.requester))
         && ((this.requesterMessage == null) ? (that.requesterMessage == null) : this.requesterMessage.equals(that.requesterMessage))
         && ((this.resolvedAt == null) ? (that.resolvedAt == null) : this.resolvedAt.equals(that.resolvedAt))
         && ((this.resolvedBy == null) ? (that.resolvedBy == null) : this.resolvedBy.equals(that.resolvedBy))
         && ((this.resolverMessage == null) ? (that.resolverMessage == null) : this.resolverMessage.equals(that.resolverMessage))
         && this.status.equals(that.status);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final Requester.Mapper requesterFieldMapper = new Requester.Mapper();

      final ResolvedBy.Mapper resolvedByFieldMapper = new ResolvedBy.Mapper();

      @Override
      public Node map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object createdAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final Requester requester = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public Requester read(ResponseReader reader) {
            return requesterFieldMapper.map(reader);
          }
        });
        final String requesterMessage = reader.readString($responseFields[4]);
        final Object resolvedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[5]);
        final ResolvedBy resolvedBy = reader.readObject($responseFields[6], new ResponseReader.ObjectReader() {
          @Override
          public ResolvedBy read(ResponseReader reader) {
            return resolvedByFieldMapper.map(reader);
          }
        });
        final String resolverMessage = reader.readString($responseFields[7]);
        final String statusStr = reader.readString($responseFields[8]);
        final UnbanRequestStatus status;
        if (statusStr != null) {
          status = UnbanRequestStatus.safeValueOf(statusStr);
        } else {
          status = null;
        }
        return new Node(__typename, createdAt, id, requester, requesterMessage, resolvedAt, resolvedBy, resolverMessage, status);
      }
    }
  }

  /**
   * Twitch user.
   */
  public static class Requester {
    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 Requester(@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 = "Requester{"
          + "__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 Requester) {
        Requester that = (Requester) 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 Requester 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 Requester(__typename, id, login, displayName, profileImageURL);
      }
    }
  }

  /**
   * Twitch user.
   */
  public static class ResolvedBy {
    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())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @NotNull String login;

    final @NotNull String displayName;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public ResolvedBy(@NotNull String __typename, @NotNull String id, @NotNull String login,
        @NotNull String displayName) {
      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");
    }

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

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof ResolvedBy) {
        ResolvedBy that = (ResolvedBy) o;
        return this.__typename.equals(that.__typename)
         && this.id.equals(that.id)
         && this.login.equals(that.login)
         && this.displayName.equals(that.displayName);
      }
      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();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public ResolvedBy 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]);
        return new ResolvedBy(__typename, id, login, displayName);
      }
    }
  }

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

  /**
   * Set of preferences set by the channel owner regarding unban requests.
   */
  public static class UnbanRequestsSettings {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forInt("cooldownMinutes", "cooldownMinutes", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isEnabled", "isEnabled", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final int cooldownMinutes;

    final boolean isEnabled;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public UnbanRequestsSettings(@NotNull String __typename, int cooldownMinutes,
        boolean isEnabled) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.cooldownMinutes = cooldownMinutes;
      this.isEnabled = isEnabled;
    }

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

    /**
     * The number of minutes after being banned before users can request an unban.
     */
    public int cooldownMinutes() {
      return this.cooldownMinutes;
    }

    /**
     * Whether users can create requests on the channel or not.
     */
    public boolean isEnabled() {
      return this.isEnabled;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "UnbanRequestsSettings{"
          + "__typename=" + __typename + ", "
          + "cooldownMinutes=" + cooldownMinutes + ", "
          + "isEnabled=" + isEnabled
          + "}";
      }
      return $toString;
    }

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

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

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