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

com.github.twitch4j.graphql.internal.FetchChatHistoryQuery 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.AutoModCaughtMessageCategory;
import com.github.twitch4j.graphql.internal.type.AutoModCaughtMessageStatus;
import com.github.twitch4j.graphql.internal.type.CustomType;
import com.github.twitch4j.graphql.internal.type.ModLogsAction;
import com.github.twitch4j.graphql.internal.type.SortOrder;
import java.io.IOException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Arrays;
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 FetchChatHistoryQuery implements Query {
  public static final String OPERATION_ID = "8940ea9b03c4ac8ca04702f5d440eacd470509b2d26dfca8f50ff42aba9398ff";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query fetchChatHistory($channelID: ID!, $userID: ID!, $after: Cursor, $first: Int = 100, $order: SortOrder = DESC, $includeMessageCount: Boolean = true, $includeTargetedActions: Boolean = true, $includeAutoModCaughtMessages: Boolean = true) {\n"
        + "  user(id: $channelID) {\n"
        + "    __typename\n"
        + "    modLogs {\n"
        + "      __typename\n"
        + "      messagesBySender(senderID: $userID, first: $first, after: $after, order: $order, includeMessageCount: $includeMessageCount, includeTargetedActions: $includeTargetedActions, includeAutoModCaughtMessages: $includeAutoModCaughtMessages) {\n"
        + "        __typename\n"
        + "        edges {\n"
        + "          __typename\n"
        + "          cursor\n"
        + "          node {\n"
        + "            __typename\n"
        + "            ... on AutoModCaughtMessage {\n"
        + "              category\n"
        + "              id\n"
        + "              modLogsMessage {\n"
        + "                __typename\n"
        + "                content {\n"
        + "                  __typename\n"
        + "                  fragments {\n"
        + "                    __typename\n"
        + "                    content {\n"
        + "                      __typename\n"
        + "                      ... on AutoMod {\n"
        + "                        topics {\n"
        + "                          __typename\n"
        + "                          type\n"
        + "                          weight\n"
        + "                        }\n"
        + "                      }\n"
        + "                    }\n"
        + "                    text\n"
        + "                  }\n"
        + "                  text\n"
        + "                }\n"
        + "                id\n"
        + "                sender {\n"
        + "                  __typename\n"
        + "                  id\n"
        + "                  login\n"
        + "                  displayName\n"
        + "                }\n"
        + "                sentAt\n"
        + "              }\n"
        + "              resolvedAt\n"
        + "              resolver {\n"
        + "                __typename\n"
        + "                id\n"
        + "                login\n"
        + "                displayName\n"
        + "              }\n"
        + "              status\n"
        + "            }\n"
        + "            ... on ModLogsMessage {\n"
        + "              content {\n"
        + "                __typename\n"
        + "                fragments {\n"
        + "                  __typename\n"
        + "                  content {\n"
        + "                    __typename\n"
        + "                    ... on AutoMod {\n"
        + "                      topics {\n"
        + "                        __typename\n"
        + "                        type\n"
        + "                        weight\n"
        + "                      }\n"
        + "                    }\n"
        + "                  }\n"
        + "                  text\n"
        + "                }\n"
        + "                text\n"
        + "              }\n"
        + "              id\n"
        + "              sender {\n"
        + "                __typename\n"
        + "                id\n"
        + "                login\n"
        + "                displayName\n"
        + "              }\n"
        + "              sentAt\n"
        + "            }\n"
        + "            ... on ModLogsTargetedModActionsEntry {\n"
        + "              action\n"
        + "              channel {\n"
        + "                __typename\n"
        + "                id\n"
        + "                login\n"
        + "                displayName\n"
        + "              }\n"
        + "              details {\n"
        + "                __typename\n"
        + "                bannedAt\n"
        + "                durationSeconds\n"
        + "                expiresAt\n"
        + "                reason\n"
        + "              }\n"
        + "              id\n"
        + "              target {\n"
        + "                __typename\n"
        + "                id\n"
        + "                login\n"
        + "                displayName\n"
        + "              }\n"
        + "              timestamp\n"
        + "              user {\n"
        + "                __typename\n"
        + "                id\n"
        + "                login\n"
        + "                displayName\n"
        + "              }\n"
        + "            }\n"
        + "          }\n"
        + "        }\n"
        + "        messageCount\n"
        + "        pageInfo {\n"
        + "          __typename\n"
        + "          hasNextPage\n"
        + "        }\n"
        + "      }\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

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

  private final FetchChatHistoryQuery.Variables variables;

  public FetchChatHistoryQuery(@NotNull String channelID, @NotNull String userID,
      @NotNull Input after, @NotNull Input first, @NotNull Input order,
      @NotNull Input includeMessageCount, @NotNull Input includeTargetedActions,
      @NotNull Input includeAutoModCaughtMessages) {
    Utils.checkNotNull(channelID, "channelID == null");
    Utils.checkNotNull(userID, "userID == null");
    Utils.checkNotNull(after, "after == null");
    Utils.checkNotNull(first, "first == null");
    Utils.checkNotNull(order, "order == null");
    Utils.checkNotNull(includeMessageCount, "includeMessageCount == null");
    Utils.checkNotNull(includeTargetedActions, "includeTargetedActions == null");
    Utils.checkNotNull(includeAutoModCaughtMessages, "includeAutoModCaughtMessages == null");
    variables = new FetchChatHistoryQuery.Variables(channelID, userID, after, first, order, includeMessageCount, includeTargetedActions, includeAutoModCaughtMessages);
  }

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

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

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

  @Override
  public FetchChatHistoryQuery.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 channelID;

    private @NotNull String userID;

    private Input after = Input.absent();

    private Input first = Input.absent();

    private Input order = Input.absent();

    private Input includeMessageCount = Input.absent();

    private Input includeTargetedActions = Input.absent();

    private Input includeAutoModCaughtMessages = Input.absent();

    Builder() {
    }

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

    public Builder userID(@NotNull String userID) {
      this.userID = userID;
      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 SortOrder order) {
      this.order = Input.fromNullable(order);
      return this;
    }

    public Builder includeMessageCount(@Nullable Boolean includeMessageCount) {
      this.includeMessageCount = Input.fromNullable(includeMessageCount);
      return this;
    }

    public Builder includeTargetedActions(@Nullable Boolean includeTargetedActions) {
      this.includeTargetedActions = Input.fromNullable(includeTargetedActions);
      return this;
    }

    public Builder includeAutoModCaughtMessages(@Nullable Boolean includeAutoModCaughtMessages) {
      this.includeAutoModCaughtMessages = Input.fromNullable(includeAutoModCaughtMessages);
      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 includeMessageCountInput(@NotNull Input includeMessageCount) {
      this.includeMessageCount = Utils.checkNotNull(includeMessageCount, "includeMessageCount == null");
      return this;
    }

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

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

    public FetchChatHistoryQuery build() {
      Utils.checkNotNull(channelID, "channelID == null");
      Utils.checkNotNull(userID, "userID == null");
      return new FetchChatHistoryQuery(channelID, userID, after, first, order, includeMessageCount, includeTargetedActions, includeAutoModCaughtMessages);
    }
  }

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

    private final @NotNull String userID;

    private final Input after;

    private final Input first;

    private final Input order;

    private final Input includeMessageCount;

    private final Input includeTargetedActions;

    private final Input includeAutoModCaughtMessages;

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

    Variables(@NotNull String channelID, @NotNull String userID, Input after,
        Input first, Input order, Input includeMessageCount,
        Input includeTargetedActions, Input includeAutoModCaughtMessages) {
      this.channelID = channelID;
      this.userID = userID;
      this.after = after;
      this.first = first;
      this.order = order;
      this.includeMessageCount = includeMessageCount;
      this.includeTargetedActions = includeTargetedActions;
      this.includeAutoModCaughtMessages = includeAutoModCaughtMessages;
      this.valueMap.put("channelID", channelID);
      this.valueMap.put("userID", userID);
      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 (includeMessageCount.defined) {
        this.valueMap.put("includeMessageCount", includeMessageCount.value);
      }
      if (includeTargetedActions.defined) {
        this.valueMap.put("includeTargetedActions", includeTargetedActions.value);
      }
      if (includeAutoModCaughtMessages.defined) {
        this.valueMap.put("includeAutoModCaughtMessages", includeAutoModCaughtMessages.value);
      }
    }

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

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

    public Input after() {
      return after;
    }

    public Input first() {
      return first;
    }

    public Input order() {
      return order;
    }

    public Input includeMessageCount() {
      return includeMessageCount;
    }

    public Input includeTargetedActions() {
      return includeTargetedActions;
    }

    public Input includeAutoModCaughtMessages() {
      return includeAutoModCaughtMessages;
    }

    @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("channelID", com.github.twitch4j.graphql.internal.type.CustomType.ID, channelID);
          writer.writeCustom("userID", com.github.twitch4j.graphql.internal.type.CustomType.ID, userID);
          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 (includeMessageCount.defined) {
            writer.writeBoolean("includeMessageCount", includeMessageCount.value);
          }
          if (includeTargetedActions.defined) {
            writer.writeBoolean("includeTargetedActions", includeTargetedActions.value);
          }
          if (includeAutoModCaughtMessages.defined) {
            writer.writeBoolean("includeAutoModCaughtMessages", includeAutoModCaughtMessages.value);
          }
        }
      };
    }
  }

  /**
   * 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", "channelID")
        .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("modLogs", "modLogs", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable ModLogs modLogs;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

    /**
     * Returns a resolver to query different subsets of the moderation logs.
     */
    public @Nullable ModLogs modLogs() {
      return this.modLogs;
    }

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final ModLogs.Mapper modLogsFieldMapper = new ModLogs.Mapper();

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

  /**
   * An interface to query subsets of the moderation logs information for a given channel.
   */
  public static class ModLogs {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("messagesBySender", "messagesBySender", new UnmodifiableMapBuilder(7)
      .put("senderID", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "userID")
        .build())
      .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("order", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "order")
        .build())
      .put("includeMessageCount", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "includeMessageCount")
        .build())
      .put("includeTargetedActions", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "includeTargetedActions")
        .build())
      .put("includeAutoModCaughtMessages", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "includeAutoModCaughtMessages")
        .build())
      .build(), true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable MessagesBySender messagesBySender;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public ModLogs(@NotNull String __typename, @Nullable MessagesBySender messagesBySender) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.messagesBySender = messagesBySender;
    }

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

    /**
     * The chat history for an specified user on a given channel.
     */
    public @Nullable MessagesBySender messagesBySender() {
      return this.messagesBySender;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final MessagesBySender.Mapper messagesBySenderFieldMapper = new MessagesBySender.Mapper();

      @Override
      public ModLogs map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final MessagesBySender messagesBySender = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public MessagesBySender read(ResponseReader reader) {
            return messagesBySenderFieldMapper.map(reader);
          }
        });
        return new ModLogs(__typename, messagesBySender);
      }
    }
  }

  /**
   * Paginated list of messages from a single sender in a channel.
   */
  public static class MessagesBySender {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forList("edges", "edges", null, false, Collections.emptyList()),
      ResponseField.forInt("messageCount", "messageCount", null, true, Collections.emptyList()),
      ResponseField.forObject("pageInfo", "pageInfo", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull List edges;

    final @Nullable Integer messageCount;

    final @NotNull PageInfo pageInfo;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public MessagesBySender(@NotNull String __typename, @NotNull List edges,
        @Nullable Integer messageCount, @NotNull PageInfo pageInfo) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.edges = Utils.checkNotNull(edges, "edges == null");
      this.messageCount = messageCount;
      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;
    }

    /**
     * The partial count of messages (up to 1000).
     * Empty if includeMessageCount was not set when the query was requested.
     */
    public @Nullable Integer messageCount() {
      return this.messageCount;
    }

    /**
     * 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.writeInt($responseFields[2], messageCount);
          writer.writeObject($responseFields[3], pageInfo.marshaller());
        }
      };
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof MessagesBySender) {
        MessagesBySender that = (MessagesBySender) o;
        return this.__typename.equals(that.__typename)
         && this.edges.equals(that.edges)
         && ((this.messageCount == null) ? (that.messageCount == null) : this.messageCount.equals(that.messageCount))
         && 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 ^= (messageCount == null) ? 0 : messageCount.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 MessagesBySender 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 Integer messageCount = reader.readInt($responseFields[2]);
        final PageInfo pageInfo = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public PageInfo read(ResponseReader reader) {
            return pageInfoFieldMapper.map(reader);
          }
        });
        return new MessagesBySender(__typename, edges, messageCount, pageInfo);
      }
    }
  }

  /**
   * Element in a list of messages.
   */
  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 message or targeted moderation action.
     */
    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);
      }
    }
  }

  /**
   * ModLogsMessageResult defines the types of entries that appear as mod log messages: Mod Logs (Chat) Messages and Targeted Mod Actions.
   */
  public interface Node {
    @NotNull String __typename();

    ResponseFieldMarshaller marshaller();

    final class Mapper implements ResponseFieldMapper {
      static final ResponseField[] $responseFields = {
        ResponseField.forFragment("__typename", "__typename", Arrays.asList(
          ResponseField.Condition.typeCondition(new String[] {"AutoModCaughtMessage"})
        )),
        ResponseField.forFragment("__typename", "__typename", Arrays.asList(
          ResponseField.Condition.typeCondition(new String[] {"ModLogsMessage"})
        )),
        ResponseField.forFragment("__typename", "__typename", Arrays.asList(
          ResponseField.Condition.typeCondition(new String[] {"ModLogsTargetedModActionsEntry"})
        ))
      };

      final AsAutoModCaughtMessage.Mapper asAutoModCaughtMessageFieldMapper = new AsAutoModCaughtMessage.Mapper();

      final AsModLogsMessage.Mapper asModLogsMessageFieldMapper = new AsModLogsMessage.Mapper();

      final AsModLogsTargetedModActionsEntry.Mapper asModLogsTargetedModActionsEntryFieldMapper = new AsModLogsTargetedModActionsEntry.Mapper();

      final AsModLogsMessageResult.Mapper asModLogsMessageResultFieldMapper = new AsModLogsMessageResult.Mapper();

      @Override
      public Node map(ResponseReader reader) {
        final AsAutoModCaughtMessage asAutoModCaughtMessage = reader.readFragment($responseFields[0], new ResponseReader.ObjectReader() {
          @Override
          public AsAutoModCaughtMessage read(ResponseReader reader) {
            return asAutoModCaughtMessageFieldMapper.map(reader);
          }
        });
        if (asAutoModCaughtMessage != null) {
          return asAutoModCaughtMessage;
        }
        final AsModLogsMessage asModLogsMessage = reader.readFragment($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public AsModLogsMessage read(ResponseReader reader) {
            return asModLogsMessageFieldMapper.map(reader);
          }
        });
        if (asModLogsMessage != null) {
          return asModLogsMessage;
        }
        final AsModLogsTargetedModActionsEntry asModLogsTargetedModActionsEntry = reader.readFragment($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public AsModLogsTargetedModActionsEntry read(ResponseReader reader) {
            return asModLogsTargetedModActionsEntryFieldMapper.map(reader);
          }
        });
        if (asModLogsTargetedModActionsEntry != null) {
          return asModLogsTargetedModActionsEntry;
        }
        return asModLogsMessageResultFieldMapper.map(reader);
      }
    }
  }

  /**
   * A message rejected by automod.
   */
  public static class AsAutoModCaughtMessage implements Node {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("category", "category", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("modLogsMessage", "modLogsMessage", null, false, Collections.emptyList()),
      ResponseField.forCustomType("resolvedAt", "resolvedAt", null, true, CustomType.TIME, Collections.emptyList()),
      ResponseField.forObject("resolver", "resolver", null, true, Collections.emptyList()),
      ResponseField.forString("status", "status", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull AutoModCaughtMessageCategory category;

    final @NotNull String id;

    final @NotNull ModLogsMessage modLogsMessage;

    final @Nullable Object resolvedAt;

    final @Nullable Resolver resolver;

    final @NotNull AutoModCaughtMessageStatus status;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public AsAutoModCaughtMessage(@NotNull String __typename,
        @NotNull AutoModCaughtMessageCategory category, @NotNull String id,
        @NotNull ModLogsMessage modLogsMessage, @Nullable Object resolvedAt,
        @Nullable Resolver resolver, @NotNull AutoModCaughtMessageStatus status) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.category = Utils.checkNotNull(category, "category == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.modLogsMessage = Utils.checkNotNull(modLogsMessage, "modLogsMessage == null");
      this.resolvedAt = resolvedAt;
      this.resolver = resolver;
      this.status = Utils.checkNotNull(status, "status == null");
    }

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

    /**
     * Reason why the message was flagged and/or rejected.
     */
    public @NotNull AutoModCaughtMessageCategory category() {
      return this.category;
    }

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

    /**
     * The contents of the message itself, including its content, sender, sentAt timestamp, etc.
     */
    public @NotNull ModLogsMessage modLogsMessage() {
      return this.modLogsMessage;
    }

    /**
     * Time when a moderator allowed or denied a flagged message.
     */
    public @Nullable Object resolvedAt() {
      return this.resolvedAt;
    }

    /**
     * The user (mod) who approve/denied the flagged message.
     */
    public @Nullable Resolver resolver() {
      return this.resolver;
    }

    /**
     * The approval status of the caught message.
     */
    public @NotNull AutoModCaughtMessageStatus 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.writeString($responseFields[1], category.rawValue());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], id);
          writer.writeObject($responseFields[3], modLogsMessage.marshaller());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[4], resolvedAt);
          writer.writeObject($responseFields[5], resolver != null ? resolver.marshaller() : null);
          writer.writeString($responseFields[6], status.rawValue());
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "AsAutoModCaughtMessage{"
          + "__typename=" + __typename + ", "
          + "category=" + category + ", "
          + "id=" + id + ", "
          + "modLogsMessage=" + modLogsMessage + ", "
          + "resolvedAt=" + resolvedAt + ", "
          + "resolver=" + resolver + ", "
          + "status=" + status
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof AsAutoModCaughtMessage) {
        AsAutoModCaughtMessage that = (AsAutoModCaughtMessage) o;
        return this.__typename.equals(that.__typename)
         && this.category.equals(that.category)
         && this.id.equals(that.id)
         && this.modLogsMessage.equals(that.modLogsMessage)
         && ((this.resolvedAt == null) ? (that.resolvedAt == null) : this.resolvedAt.equals(that.resolvedAt))
         && ((this.resolver == null) ? (that.resolver == null) : this.resolver.equals(that.resolver))
         && this.status.equals(that.status);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final ModLogsMessage.Mapper modLogsMessageFieldMapper = new ModLogsMessage.Mapper();

      final Resolver.Mapper resolverFieldMapper = new Resolver.Mapper();

      @Override
      public AsAutoModCaughtMessage map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String categoryStr = reader.readString($responseFields[1]);
        final AutoModCaughtMessageCategory category;
        if (categoryStr != null) {
          category = AutoModCaughtMessageCategory.safeValueOf(categoryStr);
        } else {
          category = null;
        }
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final ModLogsMessage modLogsMessage = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public ModLogsMessage read(ResponseReader reader) {
            return modLogsMessageFieldMapper.map(reader);
          }
        });
        final Object resolvedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[4]);
        final Resolver resolver = reader.readObject($responseFields[5], new ResponseReader.ObjectReader() {
          @Override
          public Resolver read(ResponseReader reader) {
            return resolverFieldMapper.map(reader);
          }
        });
        final String statusStr = reader.readString($responseFields[6]);
        final AutoModCaughtMessageStatus status;
        if (statusStr != null) {
          status = AutoModCaughtMessageStatus.safeValueOf(statusStr);
        } else {
          status = null;
        }
        return new AsAutoModCaughtMessage(__typename, category, id, modLogsMessage, resolvedAt, resolver, status);
      }
    }
  }

  /**
   * A message sent from a user to a room.
   */
  public static class ModLogsMessage {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("content", "content", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("sender", "sender", null, true, Collections.emptyList()),
      ResponseField.forCustomType("sentAt", "sentAt", null, false, CustomType.TIME, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Content content;

    final @NotNull String id;

    final @Nullable Sender sender;

    final @NotNull Object sentAt;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public ModLogsMessage(@NotNull String __typename, @NotNull Content content, @NotNull String id,
        @Nullable Sender sender, @NotNull Object sentAt) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.content = Utils.checkNotNull(content, "content == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.sender = sender;
      this.sentAt = Utils.checkNotNull(sentAt, "sentAt == null");
    }

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

    /**
     * The text and emoticon content of a message.
     */
    public @NotNull Content content() {
      return this.content;
    }

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

    /**
     * The user that sent the message.
     */
    public @Nullable Sender sender() {
      return this.sender;
    }

    /**
     * Time the message was sent.
     */
    public @NotNull Object sentAt() {
      return this.sentAt;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeObject($responseFields[1], content.marshaller());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], id);
          writer.writeObject($responseFields[3], sender != null ? sender.marshaller() : null);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[4], sentAt);
        }
      };
    }

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Content.Mapper contentFieldMapper = new Content.Mapper();

      final Sender.Mapper senderFieldMapper = new Sender.Mapper();

      @Override
      public ModLogsMessage map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Content content = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Content read(ResponseReader reader) {
            return contentFieldMapper.map(reader);
          }
        });
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final Sender sender = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public Sender read(ResponseReader reader) {
            return senderFieldMapper.map(reader);
          }
        });
        final Object sentAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[4]);
        return new ModLogsMessage(__typename, content, id, sender, sentAt);
      }
    }
  }

  /**
   * The content of a user's message to a room.
   */
  public static class Content {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forList("fragments", "fragments", null, false, Collections.emptyList()),
      ResponseField.forString("text", "text", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull List fragments;

    final @NotNull String text;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Content(@NotNull String __typename, @NotNull List fragments,
        @NotNull String text) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.fragments = Utils.checkNotNull(fragments, "fragments == null");
      this.text = Utils.checkNotNull(text, "text == null");
    }

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

    /**
     * Parsed list of fragments in the message, include emotes, mentions, and plaintext.
     */
    public @NotNull List fragments() {
      return this.fragments;
    }

    /**
     * String representation of the user message.
     */
    public @NotNull String text() {
      return this.text;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Content{"
          + "__typename=" + __typename + ", "
          + "fragments=" + fragments + ", "
          + "text=" + text
          + "}";
      }
      return $toString;
    }

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Fragment.Mapper fragmentFieldMapper = new Fragment.Mapper();

      @Override
      public Content map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final List fragments = reader.readList($responseFields[1], new ResponseReader.ListReader() {
          @Override
          public Fragment read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Fragment read(ResponseReader reader) {
                return fragmentFieldMapper.map(reader);
              }
            });
          }
        });
        final String text = reader.readString($responseFields[2]);
        return new Content(__typename, fragments, text);
      }
    }
  }

  /**
   * One parsed part of a message, which may be an emote, mention, or plaintext.
   */
  public static class Fragment {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("content", "content", null, true, Collections.emptyList()),
      ResponseField.forString("text", "text", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable Content1 content;

    final @NotNull String text;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Fragment(@NotNull String __typename, @Nullable Content1 content, @NotNull String text) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.content = content;
      this.text = Utils.checkNotNull(text, "text == null");
    }

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

    /**
     * Contains an emote or a mentioned user depending on the text of the fragment.
     */
    public @Nullable Content1 content() {
      return this.content;
    }

    /**
     * Plaintext representation of the fragment.
     */
    public @NotNull String text() {
      return this.text;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Fragment{"
          + "__typename=" + __typename + ", "
          + "content=" + content + ", "
          + "text=" + text
          + "}";
      }
      return $toString;
    }

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Content1.Mapper content1FieldMapper = new Content1.Mapper();

      @Override
      public Fragment map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Content1 content = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Content1 read(ResponseReader reader) {
            return content1FieldMapper.map(reader);
          }
        });
        final String text = reader.readString($responseFields[2]);
        return new Fragment(__typename, content, text);
      }
    }
  }

  /**
   * FragmentContent contains the parse content of a fragment, and can be an emote or a mention.
   * NOTE: should have been called RoomMessageFragmentContent.
   */
  public interface Content1 {
    @NotNull String __typename();

    ResponseFieldMarshaller marshaller();

    final class Mapper implements ResponseFieldMapper {
      static final ResponseField[] $responseFields = {
        ResponseField.forFragment("__typename", "__typename", Arrays.asList(
          ResponseField.Condition.typeCondition(new String[] {"AutoMod"})
        ))
      };

      final AsAutoMod.Mapper asAutoModFieldMapper = new AsAutoMod.Mapper();

      final AsFragmentContent.Mapper asFragmentContentFieldMapper = new AsFragmentContent.Mapper();

      @Override
      public Content1 map(ResponseReader reader) {
        final AsAutoMod asAutoMod = reader.readFragment($responseFields[0], new ResponseReader.ObjectReader() {
          @Override
          public AsAutoMod read(ResponseReader reader) {
            return asAutoModFieldMapper.map(reader);
          }
        });
        if (asAutoMod != null) {
          return asAutoMod;
        }
        return asFragmentContentFieldMapper.map(reader);
      }
    }
  }

  /**
   * An automod fragment type, which is text that is flagged by AutoModeration.
   * It contains a list of topics which contain reasons why AutoModeration flagged the text.
   */
  public static class AsAutoMod implements Content1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forList("topics", "topics", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull List topics;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public AsAutoMod(@NotNull String __typename, @NotNull List topics) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.topics = Utils.checkNotNull(topics, "topics == null");
    }

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

    /**
     * The topics that were flagged by AutoModeration.
     */
    public @NotNull List topics() {
      return this.topics;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Topic.Mapper topicFieldMapper = new Topic.Mapper();

      @Override
      public AsAutoMod map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final List topics = reader.readList($responseFields[1], new ResponseReader.ListReader() {
          @Override
          public Topic read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Topic read(ResponseReader reader) {
                return topicFieldMapper.map(reader);
              }
            });
          }
        });
        return new AsAutoMod(__typename, topics);
      }
    }
  }

  /**
   * An auto moderation topic with value.
   */
  public static class Topic {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("type", "type", null, false, Collections.emptyList()),
      ResponseField.forInt("weight", "weight", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String type;

    final int weight;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Topic(@NotNull String __typename, @NotNull String type, int weight) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.type = Utils.checkNotNull(type, "type == null");
      this.weight = weight;
    }

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

    /**
     * The topic type, defined by Zuma.
     */
    public @NotNull String type() {
      return this.type;
    }

    /**
     * The weight assigned to the topic.
     */
    public int weight() {
      return this.weight;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Topic{"
          + "__typename=" + __typename + ", "
          + "type=" + type + ", "
          + "weight=" + weight
          + "}";
      }
      return $toString;
    }

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

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

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

  /**
   * FragmentContent contains the parse content of a fragment, and can be an emote or a mention.
   * NOTE: should have been called RoomMessageFragmentContent.
   */
  public static class AsFragmentContent implements Content1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

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

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

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

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

  /**
   * Twitch user.
   */
  public static class Sender {
    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 Sender(@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 = "Sender{"
          + "__typename=" + __typename + ", "
          + "id=" + id + ", "
          + "login=" + login + ", "
          + "displayName=" + displayName
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Sender) {
        Sender that = (Sender) 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 Sender 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 Sender(__typename, id, login, displayName);
      }
    }
  }

  /**
   * Twitch user.
   */
  public static class Resolver {
    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 Resolver(@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 = "Resolver{"
          + "__typename=" + __typename + ", "
          + "id=" + id + ", "
          + "login=" + login + ", "
          + "displayName=" + displayName
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Resolver) {
        Resolver that = (Resolver) 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 Resolver 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 Resolver(__typename, id, login, displayName);
      }
    }
  }

  /**
   * A message sent from a user to a room.
   */
  public static class AsModLogsMessage implements Node {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("content", "content", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("sender", "sender", null, true, Collections.emptyList()),
      ResponseField.forCustomType("sentAt", "sentAt", null, false, CustomType.TIME, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Content2 content;

    final @NotNull String id;

    final @Nullable Sender1 sender;

    final @NotNull Object sentAt;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public AsModLogsMessage(@NotNull String __typename, @NotNull Content2 content,
        @NotNull String id, @Nullable Sender1 sender, @NotNull Object sentAt) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.content = Utils.checkNotNull(content, "content == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.sender = sender;
      this.sentAt = Utils.checkNotNull(sentAt, "sentAt == null");
    }

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

    /**
     * The text and emoticon content of a message.
     */
    public @NotNull Content2 content() {
      return this.content;
    }

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

    /**
     * The user that sent the message.
     */
    public @Nullable Sender1 sender() {
      return this.sender;
    }

    /**
     * Time the message was sent.
     */
    public @NotNull Object sentAt() {
      return this.sentAt;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeObject($responseFields[1], content.marshaller());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], id);
          writer.writeObject($responseFields[3], sender != null ? sender.marshaller() : null);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[4], sentAt);
        }
      };
    }

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Content2.Mapper content2FieldMapper = new Content2.Mapper();

      final Sender1.Mapper sender1FieldMapper = new Sender1.Mapper();

      @Override
      public AsModLogsMessage map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Content2 content = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Content2 read(ResponseReader reader) {
            return content2FieldMapper.map(reader);
          }
        });
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final Sender1 sender = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public Sender1 read(ResponseReader reader) {
            return sender1FieldMapper.map(reader);
          }
        });
        final Object sentAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[4]);
        return new AsModLogsMessage(__typename, content, id, sender, sentAt);
      }
    }
  }

  /**
   * The content of a user's message to a room.
   */
  public static class Content2 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forList("fragments", "fragments", null, false, Collections.emptyList()),
      ResponseField.forString("text", "text", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull List fragments;

    final @NotNull String text;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Content2(@NotNull String __typename, @NotNull List fragments,
        @NotNull String text) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.fragments = Utils.checkNotNull(fragments, "fragments == null");
      this.text = Utils.checkNotNull(text, "text == null");
    }

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

    /**
     * Parsed list of fragments in the message, include emotes, mentions, and plaintext.
     */
    public @NotNull List fragments() {
      return this.fragments;
    }

    /**
     * String representation of the user message.
     */
    public @NotNull String text() {
      return this.text;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Content2{"
          + "__typename=" + __typename + ", "
          + "fragments=" + fragments + ", "
          + "text=" + text
          + "}";
      }
      return $toString;
    }

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Fragment1.Mapper fragment1FieldMapper = new Fragment1.Mapper();

      @Override
      public Content2 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final List fragments = reader.readList($responseFields[1], new ResponseReader.ListReader() {
          @Override
          public Fragment1 read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Fragment1 read(ResponseReader reader) {
                return fragment1FieldMapper.map(reader);
              }
            });
          }
        });
        final String text = reader.readString($responseFields[2]);
        return new Content2(__typename, fragments, text);
      }
    }
  }

  /**
   * One parsed part of a message, which may be an emote, mention, or plaintext.
   */
  public static class Fragment1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("content", "content", null, true, Collections.emptyList()),
      ResponseField.forString("text", "text", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable Content3 content;

    final @NotNull String text;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Fragment1(@NotNull String __typename, @Nullable Content3 content, @NotNull String text) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.content = content;
      this.text = Utils.checkNotNull(text, "text == null");
    }

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

    /**
     * Contains an emote or a mentioned user depending on the text of the fragment.
     */
    public @Nullable Content3 content() {
      return this.content;
    }

    /**
     * Plaintext representation of the fragment.
     */
    public @NotNull String text() {
      return this.text;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Fragment1{"
          + "__typename=" + __typename + ", "
          + "content=" + content + ", "
          + "text=" + text
          + "}";
      }
      return $toString;
    }

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Content3.Mapper content3FieldMapper = new Content3.Mapper();

      @Override
      public Fragment1 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Content3 content = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Content3 read(ResponseReader reader) {
            return content3FieldMapper.map(reader);
          }
        });
        final String text = reader.readString($responseFields[2]);
        return new Fragment1(__typename, content, text);
      }
    }
  }

  /**
   * FragmentContent contains the parse content of a fragment, and can be an emote or a mention.
   * NOTE: should have been called RoomMessageFragmentContent.
   */
  public interface Content3 {
    @NotNull String __typename();

    ResponseFieldMarshaller marshaller();

    final class Mapper implements ResponseFieldMapper {
      static final ResponseField[] $responseFields = {
        ResponseField.forFragment("__typename", "__typename", Arrays.asList(
          ResponseField.Condition.typeCondition(new String[] {"AutoMod"})
        ))
      };

      final AsAutoMod1.Mapper asAutoMod1FieldMapper = new AsAutoMod1.Mapper();

      final AsFragmentContent1.Mapper asFragmentContent1FieldMapper = new AsFragmentContent1.Mapper();

      @Override
      public Content3 map(ResponseReader reader) {
        final AsAutoMod1 asAutoMod = reader.readFragment($responseFields[0], new ResponseReader.ObjectReader() {
          @Override
          public AsAutoMod1 read(ResponseReader reader) {
            return asAutoMod1FieldMapper.map(reader);
          }
        });
        if (asAutoMod != null) {
          return asAutoMod;
        }
        return asFragmentContent1FieldMapper.map(reader);
      }
    }
  }

  /**
   * An automod fragment type, which is text that is flagged by AutoModeration.
   * It contains a list of topics which contain reasons why AutoModeration flagged the text.
   */
  public static class AsAutoMod1 implements Content3 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forList("topics", "topics", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull List topics;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public AsAutoMod1(@NotNull String __typename, @NotNull List topics) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.topics = Utils.checkNotNull(topics, "topics == null");
    }

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

    /**
     * The topics that were flagged by AutoModeration.
     */
    public @NotNull List topics() {
      return this.topics;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Topic1.Mapper topic1FieldMapper = new Topic1.Mapper();

      @Override
      public AsAutoMod1 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final List topics = reader.readList($responseFields[1], new ResponseReader.ListReader() {
          @Override
          public Topic1 read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Topic1 read(ResponseReader reader) {
                return topic1FieldMapper.map(reader);
              }
            });
          }
        });
        return new AsAutoMod1(__typename, topics);
      }
    }
  }

  /**
   * An auto moderation topic with value.
   */
  public static class Topic1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("type", "type", null, false, Collections.emptyList()),
      ResponseField.forInt("weight", "weight", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String type;

    final int weight;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Topic1(@NotNull String __typename, @NotNull String type, int weight) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.type = Utils.checkNotNull(type, "type == null");
      this.weight = weight;
    }

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

    /**
     * The topic type, defined by Zuma.
     */
    public @NotNull String type() {
      return this.type;
    }

    /**
     * The weight assigned to the topic.
     */
    public int weight() {
      return this.weight;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Topic1{"
          + "__typename=" + __typename + ", "
          + "type=" + type + ", "
          + "weight=" + weight
          + "}";
      }
      return $toString;
    }

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

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

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

  /**
   * FragmentContent contains the parse content of a fragment, and can be an emote or a mention.
   * NOTE: should have been called RoomMessageFragmentContent.
   */
  public static class AsFragmentContent1 implements Content3 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

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

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

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

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

  /**
   * Twitch user.
   */
  public static class Sender1 {
    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 Sender1(@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 = "Sender1{"
          + "__typename=" + __typename + ", "
          + "id=" + id + ", "
          + "login=" + login + ", "
          + "displayName=" + displayName
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Sender1) {
        Sender1 that = (Sender1) 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 Sender1 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 Sender1(__typename, id, login, displayName);
      }
    }
  }

  /**
   * ModLogsTargetedModActionsEntry defines an entry of a user's moderation history on a channel.
   */
  public static class AsModLogsTargetedModActionsEntry implements Node {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("action", "action", null, false, Collections.emptyList()),
      ResponseField.forObject("channel", "channel", null, true, Collections.emptyList()),
      ResponseField.forObject("details", "details", null, true, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("target", "target", null, true, Collections.emptyList()),
      ResponseField.forCustomType("timestamp", "timestamp", null, false, CustomType.TIME, Collections.emptyList()),
      ResponseField.forObject("user", "user", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull ModLogsAction action;

    final @Nullable Channel channel;

    final @Nullable Details details;

    final @NotNull String id;

    final @Nullable Target target;

    final @NotNull Object timestamp;

    final @Nullable User1 user;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public AsModLogsTargetedModActionsEntry(@NotNull String __typename,
        @NotNull ModLogsAction action, @Nullable Channel channel, @Nullable Details details,
        @NotNull String id, @Nullable Target target, @NotNull Object timestamp,
        @Nullable User1 user) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.action = Utils.checkNotNull(action, "action == null");
      this.channel = channel;
      this.details = details;
      this.id = Utils.checkNotNull(id, "id == null");
      this.target = target;
      this.timestamp = Utils.checkNotNull(timestamp, "timestamp == null");
      this.user = user;
    }

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

    /**
     * Action is the mod action of the entry.
     */
    public @NotNull ModLogsAction action() {
      return this.action;
    }

    /**
     * Channel is where the mod action was taken.
     */
    public @Nullable Channel channel() {
      return this.channel;
    }

    /**
     * Details about the mod action.
     */
    public @Nullable Details details() {
      return this.details;
    }

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

    /**
     * Target is the target user of the mod action.
     */
    public @Nullable Target target() {
      return this.target;
    }

    /**
     * Timestamp when entry was created.
     */
    public @NotNull Object timestamp() {
      return this.timestamp;
    }

    /**
     * User is the mod that created the action.
     */
    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.writeString($responseFields[1], action.rawValue());
          writer.writeObject($responseFields[2], channel != null ? channel.marshaller() : null);
          writer.writeObject($responseFields[3], details != null ? details.marshaller() : null);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[4], id);
          writer.writeObject($responseFields[5], target != null ? target.marshaller() : null);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[6], timestamp);
          writer.writeObject($responseFields[7], user != null ? user.marshaller() : null);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "AsModLogsTargetedModActionsEntry{"
          + "__typename=" + __typename + ", "
          + "action=" + action + ", "
          + "channel=" + channel + ", "
          + "details=" + details + ", "
          + "id=" + id + ", "
          + "target=" + target + ", "
          + "timestamp=" + timestamp + ", "
          + "user=" + user
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof AsModLogsTargetedModActionsEntry) {
        AsModLogsTargetedModActionsEntry that = (AsModLogsTargetedModActionsEntry) o;
        return this.__typename.equals(that.__typename)
         && this.action.equals(that.action)
         && ((this.channel == null) ? (that.channel == null) : this.channel.equals(that.channel))
         && ((this.details == null) ? (that.details == null) : this.details.equals(that.details))
         && this.id.equals(that.id)
         && ((this.target == null) ? (that.target == null) : this.target.equals(that.target))
         && this.timestamp.equals(that.timestamp)
         && ((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 ^= action.hashCode();
        h *= 1000003;
        h ^= (channel == null) ? 0 : channel.hashCode();
        h *= 1000003;
        h ^= (details == null) ? 0 : details.hashCode();
        h *= 1000003;
        h ^= id.hashCode();
        h *= 1000003;
        h ^= (target == null) ? 0 : target.hashCode();
        h *= 1000003;
        h ^= timestamp.hashCode();
        h *= 1000003;
        h ^= (user == null) ? 0 : user.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

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

      final Details.Mapper detailsFieldMapper = new Details.Mapper();

      final Target.Mapper targetFieldMapper = new Target.Mapper();

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

      @Override
      public AsModLogsTargetedModActionsEntry map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String actionStr = reader.readString($responseFields[1]);
        final ModLogsAction action;
        if (actionStr != null) {
          action = ModLogsAction.safeValueOf(actionStr);
        } else {
          action = null;
        }
        final Channel channel = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public Channel read(ResponseReader reader) {
            return channelFieldMapper.map(reader);
          }
        });
        final Details details = reader.readObject($responseFields[3], new ResponseReader.ObjectReader
() { @Override public Details read(ResponseReader reader) { return detailsFieldMapper.map(reader); } }); final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[4]); final Target target = reader.readObject($responseFields[5], new ResponseReader.ObjectReader() { @Override public Target read(ResponseReader reader) { return targetFieldMapper.map(reader); } }); final Object timestamp = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[6]); final User1 user = reader.readObject($responseFields[7], new ResponseReader.ObjectReader() { @Override public User1 read(ResponseReader reader) { return user1FieldMapper.map(reader); } }); return new AsModLogsTargetedModActionsEntry(__typename, action, channel, details, id, target, timestamp, user); } } } /** * Twitch user. */ 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.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 Channel(@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 = "Channel{" + "__typename=" + __typename + ", " + "id=" + id + ", " + "login=" + login + ", " + "displayName=" + displayName + "}"; } 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.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 Channel 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 Channel(__typename, id, login, displayName); } } } /** * TargetedModerationAction is a ModLogs entry of a chat ban,timeout, or unban. */ public static class Details { static final ResponseField[] $responseFields = { ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()), ResponseField.forCustomType("bannedAt", "bannedAt", null, true, CustomType.TIME, Collections.emptyList()), ResponseField.forInt("durationSeconds", "durationSeconds", null, true, Collections.emptyList()), ResponseField.forCustomType("expiresAt", "expiresAt", null, true, CustomType.TIME, Collections.emptyList()), ResponseField.forString("reason", "reason", null, true, Collections.emptyList()) }; final @NotNull String __typename; final @Nullable Object bannedAt; final @Nullable Integer durationSeconds; final @Nullable Object expiresAt; final @Nullable String reason; private transient volatile String $toString; private transient volatile int $hashCode; private transient volatile boolean $hashCodeMemoized; public Details(@NotNull String __typename, @Nullable Object bannedAt, @Nullable Integer durationSeconds, @Nullable Object expiresAt, @Nullable String reason) { this.__typename = Utils.checkNotNull(__typename, "__typename == null"); this.bannedAt = bannedAt; this.durationSeconds = durationSeconds; this.expiresAt = expiresAt; this.reason = reason; } public @NotNull String __typename() { return this.__typename; } /** * Timestamp when user was banned/timed-out. */ public @Nullable Object bannedAt() { return this.bannedAt; } /** * Duration of the chat timeout (in seconds). */ public @Nullable Integer durationSeconds() { return this.durationSeconds; } /** * Timestamp when the chat timeout expires. */ public @Nullable Object expiresAt() { return this.expiresAt; } /** * Reason of the action. */ public @Nullable String reason() { return this.reason; } @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], bannedAt); writer.writeInt($responseFields[2], durationSeconds); writer.writeCustom((ResponseField.CustomTypeField) $responseFields[3], expiresAt); writer.writeString($responseFields[4], reason); } }; } @Override public String toString() { if ($toString == null) { $toString = "Details{" + "__typename=" + __typename + ", " + "bannedAt=" + bannedAt + ", " + "durationSeconds=" + durationSeconds + ", " + "expiresAt=" + expiresAt + ", " + "reason=" + reason + "}"; } return $toString; } @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Details) { Details that = (Details) o; return this.__typename.equals(that.__typename) && ((this.bannedAt == null) ? (that.bannedAt == null) : this.bannedAt.equals(that.bannedAt)) && ((this.durationSeconds == null) ? (that.durationSeconds == null) : this.durationSeconds.equals(that.durationSeconds)) && ((this.expiresAt == null) ? (that.expiresAt == null) : this.expiresAt.equals(that.expiresAt)) && ((this.reason == null) ? (that.reason == null) : this.reason.equals(that.reason)); } return false; } @Override public int hashCode() { if (!$hashCodeMemoized) { int h = 1; h *= 1000003; h ^= __typename.hashCode(); h *= 1000003; h ^= (bannedAt == null) ? 0 : bannedAt.hashCode(); h *= 1000003; h ^= (durationSeconds == null) ? 0 : durationSeconds.hashCode(); h *= 1000003; h ^= (expiresAt == null) ? 0 : expiresAt.hashCode(); h *= 1000003; h ^= (reason == null) ? 0 : reason.hashCode(); $hashCode = h; $hashCodeMemoized = true; } return $hashCode; } public static final class Mapper implements ResponseFieldMapper
{ @Override public Details map(ResponseReader reader) { final String __typename = reader.readString($responseFields[0]); final Object bannedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]); final Integer durationSeconds = reader.readInt($responseFields[2]); final Object expiresAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[3]); final String reason = reader.readString($responseFields[4]); return new Details(__typename, bannedAt, durationSeconds, expiresAt, reason); } } } /** * Twitch user. */ public static class Target { 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 Target(@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 = "Target{" + "__typename=" + __typename + ", " + "id=" + id + ", " + "login=" + login + ", " + "displayName=" + displayName + "}"; } return $toString; } @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Target) { Target that = (Target) 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 Target 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 Target(__typename, id, login, displayName); } } } /** * 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()) }; 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 User1(@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 = "User1{" + "__typename=" + __typename + ", " + "id=" + id + ", " + "login=" + login + ", " + "displayName=" + displayName + "}"; } 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); } 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 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]); return new User1(__typename, id, login, displayName); } } } /** * ModLogsMessageResult defines the types of entries that appear as mod log messages: Mod Logs (Chat) Messages and Targeted Mod Actions. */ public static class AsModLogsMessageResult implements Node { static final ResponseField[] $responseFields = { ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()) }; final @NotNull String __typename; private transient volatile String $toString; private transient volatile int $hashCode; private transient volatile boolean $hashCodeMemoized; public AsModLogsMessageResult(@NotNull String __typename) { this.__typename = Utils.checkNotNull(__typename, "__typename == null"); } public @NotNull String __typename() { return this.__typename; } @SuppressWarnings({"rawtypes", "unchecked"}) public ResponseFieldMarshaller marshaller() { return new ResponseFieldMarshaller() { @Override public void marshal(ResponseWriter writer) { writer.writeString($responseFields[0], __typename); } }; } @Override public String toString() { if ($toString == null) { $toString = "AsModLogsMessageResult{" + "__typename=" + __typename + "}"; } return $toString; } @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof AsModLogsMessageResult) { AsModLogsMessageResult that = (AsModLogsMessageResult) o; return this.__typename.equals(that.__typename); } return false; } @Override public int hashCode() { if (!$hashCodeMemoized) { int h = 1; h *= 1000003; h ^= __typename.hashCode(); $hashCode = h; $hashCodeMemoized = true; } return $hashCode; } public static final class Mapper implements ResponseFieldMapper { @Override public AsModLogsMessageResult map(ResponseReader reader) { final String __typename = reader.readString($responseFields[0]); return new AsModLogsMessageResult(__typename); } } } /** * 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); } } } }