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

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

The newest version!
// AUTO-GENERATED FILE. DO NOT MODIFY.
//
// This class was automatically generated by Apollo GraphQL plugin from the GraphQL queries it found.
// It should not be modified by hand.
//
package com.github.twitch4j.graphql.internal;

import com.apollographql.apollo.api.Input;
import com.apollographql.apollo.api.Operation;
import com.apollographql.apollo.api.OperationName;
import com.apollographql.apollo.api.Query;
import com.apollographql.apollo.api.Response;
import com.apollographql.apollo.api.ResponseField;
import com.apollographql.apollo.api.ScalarTypeAdapters;
import com.apollographql.apollo.api.internal.InputFieldMarshaller;
import com.apollographql.apollo.api.internal.InputFieldWriter;
import com.apollographql.apollo.api.internal.OperationRequestBodyComposer;
import com.apollographql.apollo.api.internal.QueryDocumentMinifier;
import com.apollographql.apollo.api.internal.ResponseFieldMapper;
import com.apollographql.apollo.api.internal.ResponseFieldMarshaller;
import com.apollographql.apollo.api.internal.ResponseReader;
import com.apollographql.apollo.api.internal.ResponseWriter;
import com.apollographql.apollo.api.internal.SimpleOperationResponseParser;
import com.apollographql.apollo.api.internal.UnmodifiableMapBuilder;
import com.apollographql.apollo.api.internal.Utils;
import com.github.twitch4j.graphql.internal.type.CustomType;
import com.github.twitch4j.graphql.internal.type.VideoCommentSource;
import com.github.twitch4j.graphql.internal.type.VideoCommentState;
import java.io.IOException;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import okio.Buffer;
import okio.BufferedSource;
import okio.ByteString;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public final class FetchVideoCommentsQuery implements Query {
  public static final String OPERATION_ID = "05ddeecbe88ff96bc02e9cc15fba0c2cdee3266a2a008a7c5af6f0aa61737d7c";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query fetchVideoComments($first: Int, $after: Cursor, $last: Int, $Before: Cursor, $id: String, $videoID: String, $channelID: String) {\n"
        + "  videoComments(first: $first, after: $after, last: $last, Before: $Before, id: $id, videoID: $videoID, channelID: $channelID) {\n"
        + "    __typename\n"
        + "    edges {\n"
        + "      __typename\n"
        + "      cursor\n"
        + "      node {\n"
        + "        __typename\n"
        + "        commenter {\n"
        + "          __typename\n"
        + "          id\n"
        + "          login\n"
        + "          displayName\n"
        + "          description\n"
        + "          createdAt\n"
        + "          updatedAt\n"
        + "          profileImageURL(width: 300)\n"
        + "        }\n"
        + "        contentOffsetSeconds\n"
        + "        createdAt\n"
        + "        id\n"
        + "        message {\n"
        + "          __typename\n"
        + "          fragments {\n"
        + "            __typename\n"
        + "            emote {\n"
        + "              __typename\n"
        + "              emoteID\n"
        + "              from\n"
        + "              id\n"
        + "              setID\n"
        + "              to\n"
        + "            }\n"
        + "            mention {\n"
        + "              __typename\n"
        + "              id\n"
        + "              displayName\n"
        + "              login\n"
        + "            }\n"
        + "            text\n"
        + "          }\n"
        + "          userBadges {\n"
        + "            __typename\n"
        + "            clickURL\n"
        + "            description\n"
        + "            id\n"
        + "            imageURL\n"
        + "            setID\n"
        + "            title\n"
        + "            version\n"
        + "          }\n"
        + "          userColor\n"
        + "        }\n"
        + "        source\n"
        + "        state\n"
        + "        updatedAt\n"
        + "        video {\n"
        + "          __typename\n"
        + "          id\n"
        + "        }\n"
        + "      }\n"
        + "    }\n"
        + "    pageInfo {\n"
        + "      __typename\n"
        + "      hasNextPage\n"
        + "      hasPreviousPage\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

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

  private final FetchVideoCommentsQuery.Variables variables;

  public FetchVideoCommentsQuery(@NotNull Input first, @NotNull Input after,
      @NotNull Input last, @NotNull Input before, @NotNull Input id,
      @NotNull Input videoID, @NotNull Input channelID) {
    Utils.checkNotNull(first, "first == null");
    Utils.checkNotNull(after, "after == null");
    Utils.checkNotNull(last, "last == null");
    Utils.checkNotNull(before, "before == null");
    Utils.checkNotNull(id, "id == null");
    Utils.checkNotNull(videoID, "videoID == null");
    Utils.checkNotNull(channelID, "channelID == null");
    variables = new FetchVideoCommentsQuery.Variables(first, after, last, before, id, videoID, channelID);
  }

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

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

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

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

    private Input after = Input.absent();

    private Input last = Input.absent();

    private Input before = Input.absent();

    private Input id = Input.absent();

    private Input videoID = Input.absent();

    private Input channelID = Input.absent();

    Builder() {
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    public FetchVideoCommentsQuery build() {
      return new FetchVideoCommentsQuery(first, after, last, before, id, videoID, channelID);
    }
  }

  public static final class Variables extends Operation.Variables {
    private final Input first;

    private final Input after;

    private final Input last;

    private final Input before;

    private final Input id;

    private final Input videoID;

    private final Input channelID;

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

    Variables(Input first, Input after, Input last, Input before,
        Input id, Input videoID, Input channelID) {
      this.first = first;
      this.after = after;
      this.last = last;
      this.before = before;
      this.id = id;
      this.videoID = videoID;
      this.channelID = channelID;
      if (first.defined) {
        this.valueMap.put("first", first.value);
      }
      if (after.defined) {
        this.valueMap.put("after", after.value);
      }
      if (last.defined) {
        this.valueMap.put("last", last.value);
      }
      if (before.defined) {
        this.valueMap.put("Before", before.value);
      }
      if (id.defined) {
        this.valueMap.put("id", id.value);
      }
      if (videoID.defined) {
        this.valueMap.put("videoID", videoID.value);
      }
      if (channelID.defined) {
        this.valueMap.put("channelID", channelID.value);
      }
    }

    public Input first() {
      return first;
    }

    public Input after() {
      return after;
    }

    public Input last() {
      return last;
    }

    public Input before() {
      return before;
    }

    public Input id() {
      return id;
    }

    public Input videoID() {
      return videoID;
    }

    public Input channelID() {
      return channelID;
    }

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

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

  /**
   * Data from the response after executing this GraphQL operation
   */
  public static class Data implements Operation.Data {
    static final ResponseField[] $responseFields = {
      ResponseField.forObject("videoComments", "videoComments", new UnmodifiableMapBuilder(7)
      .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("last", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "last")
        .build())
      .put("Before", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "Before")
        .build())
      .put("id", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "id")
        .build())
      .put("videoID", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "videoID")
        .build())
      .put("channelID", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "channelID")
        .build())
      .build(), true, Collections.emptyList())
    };

    final @Nullable VideoComments videoComments;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Data(@Nullable VideoComments videoComments) {
      this.videoComments = videoComments;
    }

    /**
     * A paginated list of comments against id, videoID, or channelID.
     */
    public @Nullable VideoComments videoComments() {
      return this.videoComments;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final VideoComments.Mapper videoCommentsFieldMapper = new VideoComments.Mapper();

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

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

    final @NotNull String __typename;

    final @Nullable List edges;

    final @NotNull PageInfo pageInfo;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

    public @Nullable List edges() {
      return this.edges;
    }

    public @NotNull PageInfo pageInfo() {
      return this.pageInfo;
    }

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

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

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

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

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

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

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

  /**
   * Video comment edge with cursor and the comment node.
   */
  public static class Edge {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("cursor", "cursor", null, true, CustomType.CURSOR, Collections.emptyList()),
      ResponseField.forObject("node", "node", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

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

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

    public @Nullable Object cursor() {
      return this.cursor;
    }

    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 == null) ? (that.cursor == null) : 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 == null) ? 0 : 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);
      }
    }
  }

  /**
   * Comment on a video.
   */
  public static class Node {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("commenter", "commenter", null, true, Collections.emptyList()),
      ResponseField.forInt("contentOffsetSeconds", "contentOffsetSeconds", null, false, Collections.emptyList()),
      ResponseField.forCustomType("createdAt", "createdAt", null, false, CustomType.TIME, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("message", "message", null, true, Collections.emptyList()),
      ResponseField.forString("source", "source", null, false, Collections.emptyList()),
      ResponseField.forString("state", "state", null, false, Collections.emptyList()),
      ResponseField.forCustomType("updatedAt", "updatedAt", null, false, CustomType.TIME, Collections.emptyList()),
      ResponseField.forObject("video", "video", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable Commenter commenter;

    final int contentOffsetSeconds;

    final @NotNull Object createdAt;

    final @NotNull String id;

    final @Nullable Message message;

    final @NotNull VideoCommentSource source;

    final @NotNull VideoCommentState state;

    final @NotNull Object updatedAt;

    final @Nullable Video video;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Node(@NotNull String __typename, @Nullable Commenter commenter, int contentOffsetSeconds,
        @NotNull Object createdAt, @NotNull String id, @Nullable Message message,
        @NotNull VideoCommentSource source, @NotNull VideoCommentState state,
        @NotNull Object updatedAt, @Nullable Video video) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.commenter = commenter;
      this.contentOffsetSeconds = contentOffsetSeconds;
      this.createdAt = Utils.checkNotNull(createdAt, "createdAt == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.message = message;
      this.source = Utils.checkNotNull(source, "source == null");
      this.state = Utils.checkNotNull(state, "state == null");
      this.updatedAt = Utils.checkNotNull(updatedAt, "updatedAt == null");
      this.video = video;
    }

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

    /**
     * Author of the comment.
     */
    public @Nullable Commenter commenter() {
      return this.commenter;
    }

    /**
     * Position of the video where this comment was added.
     */
    public int contentOffsetSeconds() {
      return this.contentOffsetSeconds;
    }

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

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

    /**
     * The message of the comment.
     */
    public @Nullable Message message() {
      return this.message;
    }

    /**
     * Where the comment originated.
     */
    public @NotNull VideoCommentSource source() {
      return this.source;
    }

    /**
     * Current state of the comment.
     */
    public @NotNull VideoCommentState state() {
      return this.state;
    }

    /**
     * The last time this comment was updated.
     */
    public @NotNull Object updatedAt() {
      return this.updatedAt;
    }

    /**
     * The video on which this comment was added.
     */
    public @Nullable Video video() {
      return this.video;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeObject($responseFields[1], commenter != null ? commenter.marshaller() : null);
          writer.writeInt($responseFields[2], contentOffsetSeconds);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[3], createdAt);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[4], id);
          writer.writeObject($responseFields[5], message != null ? message.marshaller() : null);
          writer.writeString($responseFields[6], source.rawValue());
          writer.writeString($responseFields[7], state.rawValue());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[8], updatedAt);
          writer.writeObject($responseFields[9], video != null ? video.marshaller() : null);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Node{"
          + "__typename=" + __typename + ", "
          + "commenter=" + commenter + ", "
          + "contentOffsetSeconds=" + contentOffsetSeconds + ", "
          + "createdAt=" + createdAt + ", "
          + "id=" + id + ", "
          + "message=" + message + ", "
          + "source=" + source + ", "
          + "state=" + state + ", "
          + "updatedAt=" + updatedAt + ", "
          + "video=" + video
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Node) {
        Node that = (Node) o;
        return this.__typename.equals(that.__typename)
         && ((this.commenter == null) ? (that.commenter == null) : this.commenter.equals(that.commenter))
         && this.contentOffsetSeconds == that.contentOffsetSeconds
         && this.createdAt.equals(that.createdAt)
         && this.id.equals(that.id)
         && ((this.message == null) ? (that.message == null) : this.message.equals(that.message))
         && this.source.equals(that.source)
         && this.state.equals(that.state)
         && this.updatedAt.equals(that.updatedAt)
         && ((this.video == null) ? (that.video == null) : this.video.equals(that.video));
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= (commenter == null) ? 0 : commenter.hashCode();
        h *= 1000003;
        h ^= contentOffsetSeconds;
        h *= 1000003;
        h ^= createdAt.hashCode();
        h *= 1000003;
        h ^= id.hashCode();
        h *= 1000003;
        h ^= (message == null) ? 0 : message.hashCode();
        h *= 1000003;
        h ^= source.hashCode();
        h *= 1000003;
        h ^= state.hashCode();
        h *= 1000003;
        h ^= updatedAt.hashCode();
        h *= 1000003;
        h ^= (video == null) ? 0 : video.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final Commenter.Mapper commenterFieldMapper = new Commenter.Mapper();

      final Message.Mapper messageFieldMapper = new Message.Mapper();

      final Video.Mapper videoFieldMapper = new Video.Mapper();

      @Override
      public Node map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Commenter commenter = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Commenter read(ResponseReader reader) {
            return commenterFieldMapper.map(reader);
          }
        });
        final int contentOffsetSeconds = reader.readInt($responseFields[2]);
        final Object createdAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[3]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[4]);
        final Message message = reader.readObject($responseFields[5], new ResponseReader.ObjectReader() {
          @Override
          public Message read(ResponseReader reader) {
            return messageFieldMapper.map(reader);
          }
        });
        final String sourceStr = reader.readString($responseFields[6]);
        final VideoCommentSource source;
        if (sourceStr != null) {
          source = VideoCommentSource.safeValueOf(sourceStr);
        } else {
          source = null;
        }
        final String stateStr = reader.readString($responseFields[7]);
        final VideoCommentState state;
        if (stateStr != null) {
          state = VideoCommentState.safeValueOf(stateStr);
        } else {
          state = null;
        }
        final Object updatedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[8]);
        final Video video = reader.readObject($responseFields[9], new ResponseReader.ObjectReader