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

com.github.twitch4j.graphql.internal.FetchCommunityPointsSettingsQuery 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.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.CommunityPointsAutomaticRewardType;
import com.github.twitch4j.graphql.internal.type.CommunityPointsCommunityGoalStatus;
import com.github.twitch4j.graphql.internal.type.CommunityPointsCommunityGoalType;
import com.github.twitch4j.graphql.internal.type.CommunityPointsMultiplierReason;
import com.github.twitch4j.graphql.internal.type.CustomType;
import java.io.IOException;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import okio.Buffer;
import okio.BufferedSource;
import okio.ByteString;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public final class FetchCommunityPointsSettingsQuery implements Query {
  public static final String OPERATION_ID = "75dcb81ec8b71d405d88c105b63776518ee998ee76979353a2be90cd992af127";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query fetchCommunityPointsSettings($login: String!) {\n"
        + "  channel(name: $login) {\n"
        + "    __typename\n"
        + "    id\n"
        + "    communityPointsSettings {\n"
        + "      __typename\n"
        + "      name\n"
        + "      image {\n"
        + "        __typename\n"
        + "        url\n"
        + "        url2x\n"
        + "        url4x\n"
        + "      }\n"
        + "      isEnabled\n"
        + "      automaticRewards {\n"
        + "        __typename\n"
        + "        backgroundColor\n"
        + "        cost\n"
        + "        defaultBackgroundColor\n"
        + "        defaultCost\n"
        + "        defaultImage {\n"
        + "          __typename\n"
        + "          url\n"
        + "          url2x\n"
        + "          url4x\n"
        + "        }\n"
        + "        globallyUpdatedForIndicatorAt\n"
        + "        id\n"
        + "        image {\n"
        + "          __typename\n"
        + "          url\n"
        + "          url2x\n"
        + "          url4x\n"
        + "        }\n"
        + "        isEnabled\n"
        + "        isHiddenForSubs\n"
        + "        minimumCost\n"
        + "        type\n"
        + "        updatedForIndicatorAt\n"
        + "      }\n"
        + "      customRewards {\n"
        + "        __typename\n"
        + "        backgroundColor\n"
        + "        cooldownExpiresAt\n"
        + "        cost\n"
        + "        defaultImage {\n"
        + "          __typename\n"
        + "          url\n"
        + "          url2x\n"
        + "          url4x\n"
        + "        }\n"
        + "        globalCooldownSetting {\n"
        + "          __typename\n"
        + "          isEnabled\n"
        + "          globalCooldownSeconds\n"
        + "        }\n"
        + "        id\n"
        + "        image {\n"
        + "          __typename\n"
        + "          url\n"
        + "          url2x\n"
        + "          url4x\n"
        + "        }\n"
        + "        isEnabled\n"
        + "        isInStock\n"
        + "        isPaused\n"
        + "        isSubOnly\n"
        + "        isUserInputRequired\n"
        + "        maxPerStreamSetting {\n"
        + "          __typename\n"
        + "          isEnabled\n"
        + "          maxPerStream\n"
        + "        }\n"
        + "        maxPerUserPerStreamSetting {\n"
        + "          __typename\n"
        + "          isEnabled\n"
        + "          maxPerUserPerStream\n"
        + "        }\n"
        + "        prompt\n"
        + "        redemptionsRedeemedCurrentStream\n"
        + "        shouldRedemptionsSkipRequestQueue\n"
        + "        title\n"
        + "        updatedForIndicatorAt\n"
        + "      }\n"
        + "      goals {\n"
        + "        __typename\n"
        + "        amountNeeded\n"
        + "        backgroundColor\n"
        + "        defaultImage {\n"
        + "          __typename\n"
        + "          url\n"
        + "          url2x\n"
        + "          url4x\n"
        + "        }\n"
        + "        description\n"
        + "        durationDays\n"
        + "        endedAt\n"
        + "        id\n"
        + "        image {\n"
        + "          __typename\n"
        + "          url\n"
        + "          url2x\n"
        + "          url4x\n"
        + "        }\n"
        + "        isInStock\n"
        + "        perStreamUserMaximumContribution\n"
        + "        pointsContributed\n"
        + "        smallContribution\n"
        + "        startedAt\n"
        + "        status\n"
        + "        title\n"
        + "        type\n"
        + "      }\n"
        + "      emoteVariants {\n"
        + "        __typename\n"
        + "        emote {\n"
        + "          __typename\n"
        + "          id\n"
        + "          token\n"
        + "        }\n"
        + "        id\n"
        + "        isUnlockable\n"
        + "        modifications {\n"
        + "          __typename\n"
        + "          emote {\n"
        + "            __typename\n"
        + "            id\n"
        + "            token\n"
        + "          }\n"
        + "          globallyUpdatedForIndicatorAt\n"
        + "          id\n"
        + "          modifier {\n"
        + "            __typename\n"
        + "            id\n"
        + "          }\n"
        + "        }\n"
        + "      }\n"
        + "      earning {\n"
        + "        __typename\n"
        + "        averagePointsPerHour\n"
        + "        cheerPoints\n"
        + "        claimPoints\n"
        + "        followPoints\n"
        + "        id\n"
        + "        multipliers {\n"
        + "          __typename\n"
        + "          reasonCode\n"
        + "          factor\n"
        + "        }\n"
        + "        passiveWatchPoints\n"
        + "        raidPoints\n"
        + "        subscriptionGiftPoints\n"
        + "        watchStreakPoints {\n"
        + "          __typename\n"
        + "          points\n"
        + "          streakLength\n"
        + "        }\n"
        + "      }\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

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

  private final FetchCommunityPointsSettingsQuery.Variables variables;

  public FetchCommunityPointsSettingsQuery(@NotNull String login) {
    Utils.checkNotNull(login, "login == null");
    variables = new FetchCommunityPointsSettingsQuery.Variables(login);
  }

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

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

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

  @Override
  public FetchCommunityPointsSettingsQuery.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 login;

    Builder() {
    }

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

    public FetchCommunityPointsSettingsQuery build() {
      Utils.checkNotNull(login, "login == null");
      return new FetchCommunityPointsSettingsQuery(login);
    }
  }

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

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

    Variables(@NotNull String login) {
      this.login = login;
      this.valueMap.put("login", login);
    }

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

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

    @Override
    public InputFieldMarshaller marshaller() {
      return new InputFieldMarshaller() {
        @Override
        public void marshal(InputFieldWriter writer) throws IOException {
          writer.writeString("login", login);
        }
      };
    }
  }

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

    final @Nullable Channel channel;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

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

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

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

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

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

  /**
   * A User's place on Twitch.
   */
  public static class Channel {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("communityPointsSettings", "communityPointsSettings", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @Nullable CommunityPointsSettings communityPointsSettings;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

    /**
     * Details about community points in the channel.
     */
    public @Nullable CommunityPointsSettings communityPointsSettings() {
      return this.communityPointsSettings;
    }

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final CommunityPointsSettings.Mapper communityPointsSettingsFieldMapper = new CommunityPointsSettings.Mapper();

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

  /**
   * Settings for a channel's Community Points.
   */
  public static class CommunityPointsSettings {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("name", "name", null, true, Collections.emptyList()),
      ResponseField.forObject("image", "image", null, true, Collections.emptyList()),
      ResponseField.forBoolean("isEnabled", "isEnabled", null, false, Collections.emptyList()),
      ResponseField.forList("automaticRewards", "automaticRewards", null, true, Collections.emptyList()),
      ResponseField.forList("customRewards", "customRewards", null, true, Collections.emptyList()),
      ResponseField.forList("goals", "goals", null, true, Collections.emptyList()),
      ResponseField.forList("emoteVariants", "emoteVariants", null, true, Collections.emptyList()),
      ResponseField.forObject("earning", "earning", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable String name;

    final @Nullable Image image;

    final boolean isEnabled;

    final @Nullable List automaticRewards;

    final @Nullable List customRewards;

    final @Nullable List goals;

    final @Nullable List emoteVariants;

    final @Nullable Earning earning;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public CommunityPointsSettings(@NotNull String __typename, @Nullable String name,
        @Nullable Image image, boolean isEnabled, @Nullable List automaticRewards,
        @Nullable List customRewards, @Nullable List goals,
        @Nullable List emoteVariants, @Nullable Earning earning) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.name = name;
      this.image = image;
      this.isEnabled = isEnabled;
      this.automaticRewards = automaticRewards;
      this.customRewards = customRewards;
      this.goals = goals;
      this.emoteVariants = emoteVariants;
      this.earning = earning;
    }

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

    /**
     * The channel's custom community points name. Null if they have not set a name.
     */
    public @Nullable String name() {
      return this.name;
    }

    /**
     * The channel's custom community points icon. Null if they have not set an icon.
     */
    public @Nullable Image image() {
      return this.image;
    }

    /**
     * Whether the channel has community points turned on now.
     */
    public boolean isEnabled() {
      return this.isEnabled;
    }

    /**
     * Automatic rewards for this channel. If no automatic rewards exist, will be an empty array.
     */
    public @Nullable List automaticRewards() {
      return this.automaticRewards;
    }

    /**
     * Custom rewards for this channel. If no custom rewards exist, will be an empty array.
     */
    public @Nullable List customRewards() {
      return this.customRewards;
    }

    /**
     * Non-archived community goals for this channel.
     */
    public @Nullable List goals() {
      return this.goals;
    }

    /**
     * A list of the emote variants (base emote + modifications) that are available for this channel.
     */
    public @Nullable List emoteVariants() {
      return this.emoteVariants;
    }

    /**
     * Information on how points are earned by viewers in this channel.
     */
    public @Nullable Earning earning() {
      return this.earning;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeString($responseFields[1], name);
          writer.writeObject($responseFields[2], image != null ? image.marshaller() : null);
          writer.writeBoolean($responseFields[3], isEnabled);
          writer.writeList($responseFields[4], automaticRewards, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((AutomaticReward) item).marshaller());
              }
            }
          });
          writer.writeList($responseFields[5], customRewards, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((CustomReward) item).marshaller());
              }
            }
          });
          writer.writeList($responseFields[6], goals, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((Goal) item).marshaller());
              }
            }
          });
          writer.writeList($responseFields[7], emoteVariants, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((EmoteVariant) item).marshaller());
              }
            }
          });
          writer.writeObject($responseFields[8], earning != null ? earning.marshaller() : null);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "CommunityPointsSettings{"
          + "__typename=" + __typename + ", "
          + "name=" + name + ", "
          + "image=" + image + ", "
          + "isEnabled=" + isEnabled + ", "
          + "automaticRewards=" + automaticRewards + ", "
          + "customRewards=" + customRewards + ", "
          + "goals=" + goals + ", "
          + "emoteVariants=" + emoteVariants + ", "
          + "earning=" + earning
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof CommunityPointsSettings) {
        CommunityPointsSettings that = (CommunityPointsSettings) o;
        return this.__typename.equals(that.__typename)
         && ((this.name == null) ? (that.name == null) : this.name.equals(that.name))
         && ((this.image == null) ? (that.image == null) : this.image.equals(that.image))
         && this.isEnabled == that.isEnabled
         && ((this.automaticRewards == null) ? (that.automaticRewards == null) : this.automaticRewards.equals(that.automaticRewards))
         && ((this.customRewards == null) ? (that.customRewards == null) : this.customRewards.equals(that.customRewards))
         && ((this.goals == null) ? (that.goals == null) : this.goals.equals(that.goals))
         && ((this.emoteVariants == null) ? (that.emoteVariants == null) : this.emoteVariants.equals(that.emoteVariants))
         && ((this.earning == null) ? (that.earning == null) : this.earning.equals(that.earning));
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= (name == null) ? 0 : name.hashCode();
        h *= 1000003;
        h ^= (image == null) ? 0 : image.hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isEnabled).hashCode();
        h *= 1000003;
        h ^= (automaticRewards == null) ? 0 : automaticRewards.hashCode();
        h *= 1000003;
        h ^= (customRewards == null) ? 0 : customRewards.hashCode();
        h *= 1000003;
        h ^= (goals == null) ? 0 : goals.hashCode();
        h *= 1000003;
        h ^= (emoteVariants == null) ? 0 : emoteVariants.hashCode();
        h *= 1000003;
        h ^= (earning == null) ? 0 : earning.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final Image.Mapper imageFieldMapper = new Image.Mapper();

      final AutomaticReward.Mapper automaticRewardFieldMapper = new AutomaticReward.Mapper();

      final CustomReward.Mapper customRewardFieldMapper = new CustomReward.Mapper();

      final Goal.Mapper goalFieldMapper = new Goal.Mapper();

      final EmoteVariant.Mapper emoteVariantFieldMapper = new EmoteVariant.Mapper();

      final Earning.Mapper earningFieldMapper = new Earning.Mapper();

      @Override
      public CommunityPointsSettings map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String name = reader.readString($responseFields[1]);
        final Image image = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
          @Override
          public Image read(ResponseReader reader) {
            return imageFieldMapper.map(reader);
          }
        });
        final boolean isEnabled = reader.readBoolean($responseFields[3]);
        final List automaticRewards = reader.readList($responseFields[4], new ResponseReader.ListReader() {
          @Override
          public AutomaticReward read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public AutomaticReward read(ResponseReader reader) {
                return automaticRewardFieldMapper.map(reader);
              }
            });
          }
        });
        final List customRewards = reader.readList($responseFields[5], new ResponseReader.ListReader() {
          @Override
          public CustomReward read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public CustomReward read(ResponseReader reader) {
                return customRewardFieldMapper.map(reader);
              }
            });
          }
        });
        final List goals = reader.readList($responseFields[6], new ResponseReader.ListReader() {
          @Override
          public Goal read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Goal read(ResponseReader reader) {
                return goalFieldMapper.map(reader);
              }
            });
          }
        });
        final List emoteVariants = reader.readList($responseFields[7], new ResponseReader.ListReader() {
          @Override
          public EmoteVariant read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public EmoteVariant read(ResponseReader reader) {
                return emoteVariantFieldMapper.map(reader);
              }
            });
          }
        });
        final Earning earning = reader.readObject($responseFields[8], new ResponseReader.ObjectReader() {
          @Override
          public Earning read(ResponseReader reader) {
            return earningFieldMapper.map(reader);
          }
        });
        return new CommunityPointsSettings(__typename, name, image, isEnabled, automaticRewards, customRewards, goals, emoteVariants, earning);
      }
    }
  }

  /**
   * Image URLs of different sizes for community points rewards.
   */
  public static class Image {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("url", "url", null, false, Collections.emptyList()),
      ResponseField.forString("url2x", "url2x", null, false, Collections.emptyList()),
      ResponseField.forString("url4x", "url4x", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String url;

    final @NotNull String url2x;

    final @NotNull String url4x;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Image(@NotNull String __typename, @NotNull String url, @NotNull String url2x,
        @NotNull String url4x) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.url = Utils.checkNotNull(url, "url == null");
      this.url2x = Utils.checkNotNull(url2x, "url2x == null");
      this.url4x = Utils.checkNotNull(url4x, "url4x == null");
    }

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

    /**
     * The URL for the small size image.
     */
    public @NotNull String url() {
      return this.url;
    }

    /**
     * The URL for the medium size image.
     */
    public @NotNull String url2x() {
      return this.url2x;
    }

    /**
     * The URL for the large size image.
     */
    public @NotNull String url4x() {
      return this.url4x;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Image{"
          + "__typename=" + __typename + ", "
          + "url=" + url + ", "
          + "url2x=" + url2x + ", "
          + "url4x=" + url4x
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Image) {
        Image that = (Image) o;
        return this.__typename.equals(that.__typename)
         && this.url.equals(that.url)
         && this.url2x.equals(that.url2x)
         && this.url4x.equals(that.url4x);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Image map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String url = reader.readString($responseFields[1]);
        final String url2x = reader.readString($responseFields[2]);
        final String url4x = reader.readString($responseFields[3]);
        return new Image(__typename, url, url2x, url4x);
      }
    }
  }

  /**
   * An automatic community points reward.
   */
  public static class AutomaticReward {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("backgroundColor", "backgroundColor", null, true, Collections.emptyList()),
      ResponseField.forInt("cost", "cost", null, true, Collections.emptyList()),
      ResponseField.forString("defaultBackgroundColor", "defaultBackgroundColor", null, false, Collections.emptyList()),
      ResponseField.forInt("defaultCost", "defaultCost", null, false, Collections.emptyList()),
      ResponseField.forObject("defaultImage", "defaultImage", null, false, Collections.emptyList()),
      ResponseField.forCustomType("globallyUpdatedForIndicatorAt", "globallyUpdatedForIndicatorAt", null, false, CustomType.TIME, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("image", "image", null, true, Collections.emptyList()),
      ResponseField.forBoolean("isEnabled", "isEnabled", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isHiddenForSubs", "isHiddenForSubs", null, false, Collections.emptyList()),
      ResponseField.forInt("minimumCost", "minimumCost", null, false, Collections.emptyList()),
      ResponseField.forString("type", "type", null, false, Collections.emptyList()),
      ResponseField.forCustomType("updatedForIndicatorAt", "updatedForIndicatorAt", null, true, CustomType.TIME, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable String backgroundColor;

    final @Nullable Integer cost;

    final @NotNull String defaultBackgroundColor;

    final int defaultCost;

    final @NotNull DefaultImage defaultImage;

    final @NotNull Object globallyUpdatedForIndicatorAt;

    final @NotNull String id;

    final @Nullable Image1 image;

    final boolean isEnabled;

    final boolean isHiddenForSubs;

    final int minimumCost;

    final @NotNull CommunityPointsAutomaticRewardType type;

    final @Nullable Object updatedForIndicatorAt;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public AutomaticReward(@NotNull String __typename, @Nullable String backgroundColor,
        @Nullable Integer cost, @NotNull String defaultBackgroundColor, int defaultCost,
        @NotNull DefaultImage defaultImage, @NotNull Object globallyUpdatedForIndicatorAt,
        @NotNull String id, @Nullable Image1 image, boolean isEnabled, boolean isHiddenForSubs,
        int minimumCost, @NotNull CommunityPointsAutomaticRewardType type,
        @Nullable Object updatedForIndicatorAt) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.backgroundColor = backgroundColor;
      this.cost = cost;
      this.defaultBackgroundColor = Utils.checkNotNull(defaultBackgroundColor, "defaultBackgroundColor == null");
      this.defaultCost = defaultCost;
      this.defaultImage = Utils.checkNotNull(defaultImage, "defaultImage == null");
      this.globallyUpdatedForIndicatorAt = Utils.checkNotNull(globallyUpdatedForIndicatorAt, "globallyUpdatedForIndicatorAt == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.image = image;
      this.isEnabled = isEnabled;
      this.isHiddenForSubs = isHiddenForSubs;
      this.minimumCost = minimumCost;
      this.type = Utils.checkNotNull(type, "type == null");
      this.updatedForIndicatorAt = updatedForIndicatorAt;
    }

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

    /**
     * The background color for the reward icon.
     */
    public @Nullable String backgroundColor() {
      return this.backgroundColor;
    }

    /**
     * The point cost of this reward.
     */
    public @Nullable Integer cost() {
      return this.cost;
    }

    /**
     * The default background color for this reward.
     */
    public @NotNull String defaultBackgroundColor() {
      return this.defaultBackgroundColor;
    }

    /**
     * The default point cost of this reward.
     */
    public int defaultCost() {
      return this.defaultCost;
    }

    /**
     * The default image for this reward.
     */
    public @NotNull DefaultImage defaultImage() {
      return this.defaultImage;
    }

    /**
     * Time that the global template for this reward was last updated in a way that should show a new content indicator to viewers.
     */
    public @NotNull Object globallyUpdatedForIndicatorAt() {
      return this.globallyUpdatedForIndicatorAt;
    }

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

    /**
     * The custom icon for this reward, if any.
     */
    public @Nullable Image1 image() {
      return this.image;
    }

    /**
     * Whether this reward is turned on or off in this channel at the moment.
     */
    public boolean isEnabled() {
      return this.isEnabled;
    }

    /**
     * Whether only non-subscribers are allowed to redeem this reward in this channel.
     */
    public boolean isHiddenForSubs() {
      return this.isHiddenForSubs;
    }

    /**
     * The lowest the broadcaster is allowed to set the cost of this reward.
     */
    public int minimumCost() {
      return this.minimumCost;
    }

    /**
     * The type of automatic reward this is.
     */
    public @NotNull CommunityPointsAutomaticRewardType type() {
      return this.type;
    }

    /**
     * Time that this reward was last updated for the channel in a way that should show a new content indicator to viewers.
     * Will be null if the channel hasn't made any updates to override the global settings.
     */
    public @Nullable Object updatedForIndicatorAt() {
      return this.updatedForIndicatorAt;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeString($responseFields[1], backgroundColor);
          writer.writeInt($responseFields[2], cost);
          writer.writeString($responseFields[3], defaultBackgroundColor);
          writer.writeInt($responseFields[4], defaultCost);
          writer.writeObject($responseFields[5], defaultImage.marshaller());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[6], globallyUpdatedForIndicatorAt);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[7], id);
          writer.writeObject($responseFields[8], image != null ? image.marshaller() : null);
          writer.writeBoolean($responseFields[9], isEnabled);
          writer.writeBoolean($responseFields[10], isHiddenForSubs);
          writer.writeInt($responseFields[11], minimumCost);
          writer.writeString($responseFields[12], type.rawValue());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[13], updatedForIndicatorAt);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "AutomaticReward{"
          + "__typename=" + __typename + ", "
          + "backgroundColor=" + backgroundColor + ", "
          + "cost=" + cost + ", "
          + "defaultBackgroundColor=" + defaultBackgroundColor + ", "
          + "defaultCost=" + defaultCost + ", "
          + "defaultImage=" + defaultImage + ", "
          + "globallyUpdatedForIndicatorAt=" + globallyUpdatedForIndicatorAt + ", "
          + "id=" + id + ", "
          + "image=" + image + ", "
          + "isEnabled=" + isEnabled + ", "
          + "isHiddenForSubs=" + isHiddenForSubs + ", "
          + "minimumCost=" + minimumCost + ", "
          + "type=" + type + ", "
          + "updatedForIndicatorAt=" + updatedForIndicatorAt
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof AutomaticReward) {
        AutomaticReward that = (AutomaticReward) o;
        return this.__typename.equals(that.__typename)
         && ((this.backgroundColor == null) ? (that.backgroundColor == null) : this.backgroundColor.equals(that.backgroundColor))
         && ((this.cost == null) ? (that.cost == null) : this.cost.equals(that.cost))
         && this.defaultBackgroundColor.equals(that.defaultBackgroundColor)
         && this.defaultCost == that.defaultCost
         && this.defaultImage.equals(that.defaultImage)
         && this.globallyUpdatedForIndicatorAt.equals(that.globallyUpdatedForIndicatorAt)
         && this.id.equals(that.id)
         && ((this.image == null) ? (that.image == null) : this.image.equals(that.image))
         && this.isEnabled == that.isEnabled
         && this.isHiddenForSubs == that.isHiddenForSubs
         && this.minimumCost == that.minimumCost
         && this.type.equals(that.type)
         && ((this.updatedForIndicatorAt == null) ? (that.updatedForIndicatorAt == null) : this.updatedForIndicatorAt.equals(that.updatedForIndicatorAt));
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= (backgroundColor == null) ? 0 : backgroundColor.hashCode();
        h *= 1000003;
        h ^= (cost == null) ? 0 : cost.hashCode();
        h *= 1000003;
        h ^= defaultBackgroundColor.hashCode();
        h *= 1000003;
        h ^= defaultCost;
        h *= 1000003;
        h ^= defaultImage.hashCode();
        h *= 1000003;
        h ^= globallyUpdatedForIndicatorAt.hashCode();
        h *= 1000003;
        h ^= id.hashCode();
        h *= 1000003;
        h ^= (image == null) ? 0 : image.hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isEnabled).hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isHiddenForSubs).hashCode();
        h *= 1000003;
        h ^= minimumCost;
        h *= 1000003;
        h ^= type.hashCode();
        h *= 1000003;
        h ^= (updatedForIndicatorAt == null) ? 0 : updatedForIndicatorAt.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final DefaultImage.Mapper defaultImageFieldMapper = new DefaultImage.Mapper();

      final Image1.Mapper image1FieldMapper = new Image1.Mapper();

      @Override
      public AutomaticReward map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String backgroundColor = reader.readString($responseFields[1]);
        final Integer cost = reader.readInt($responseFields[2]);
        final String defaultBackgroundColor = reader.readString($responseFields[3]);
        final int defaultCost = reader.readInt($responseFields[4]);
        final DefaultImage defaultImage = reader.readObject($responseFields[5], new ResponseReader.ObjectReader() {
          @Override
          public DefaultImage read(ResponseReader reader) {
            return defaultImageFieldMapper.map(reader);
          }
        });
        final Object globallyUpdatedForIndicatorAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[6]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[7]);
        final Image1 image = reader.readObject($responseFields[8], new ResponseReader.ObjectReader() {
          @Override
          public Image1 read(ResponseReader reader) {
            return image1FieldMapper.map(reader);
          }
        });
        final boolean isEnabled = reader.readBoolean($responseFields[9]);
        final boolean isHiddenForSubs = reader.readBoolean($responseFields[10]);
        final int minimumCost = reader.readInt($responseFields[11]);
        final String typeStr = reader.readString($responseFields[12]);
        final CommunityPointsAutomaticRewardType type;
        if (typeStr != null) {
          type = CommunityPointsAutomaticRewardType.safeValueOf(typeStr);
        } else {
          type = null;
        }
        final Object updatedForIndicatorAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[13]);
        return new AutomaticReward(__typename, backgroundColor, cost, defaultBackgroundColor, defaultCost, defaultImage, globallyUpdatedForIndicatorAt, id, image, isEnabled, isHiddenForSubs, minimumCost, type, updatedForIndicatorAt);
      }
    }
  }

  /**
   * Image URLs of different sizes for community points rewards.
   */
  public static class DefaultImage {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("url", "url", null, false, Collections.emptyList()),
      ResponseField.forString("url2x", "url2x", null, false, Collections.emptyList()),
      ResponseField.forString("url4x", "url4x", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String url;

    final @NotNull String url2x;

    final @NotNull String url4x;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public DefaultImage(@NotNull String __typename, @NotNull String url, @NotNull String url2x,
        @NotNull String url4x) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.url = Utils.checkNotNull(url, "url == null");
      this.url2x = Utils.checkNotNull(url2x, "url2x == null");
      this.url4x = Utils.checkNotNull(url4x, "url4x == null");
    }

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

    /**
     * The URL for the small size image.
     */
    public @NotNull String url() {
      return this.url;
    }

    /**
     * The URL for the medium size image.
     */
    public @NotNull String url2x() {
      return this.url2x;
    }

    /**
     * The URL for the large size image.
     */
    public @NotNull String url4x() {
      return this.url4x;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "DefaultImage{"
          + "__typename=" + __typename + ", "
          + "url=" + url + ", "
          + "url2x=" + url2x + ", "
          + "url4x=" + url4x
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof DefaultImage) {
        DefaultImage that = (DefaultImage) o;
        return this.__typename.equals(that.__typename)
         && this.url.equals(that.url)
         && this.url2x.equals(that.url2x)
         && this.url4x.equals(that.url4x);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public DefaultImage map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String url = reader.readString($responseFields[1]);
        final String url2x = reader.readString($responseFields[2]);
        final String url4x = reader.readString($responseFields[3]);
        return new DefaultImage(__typename, url, url2x, url4x);
      }
    }
  }

  /**
   * Image URLs of different sizes for community points rewards.
   */
  public static class Image1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("url", "url", null, false, Collections.emptyList()),
      ResponseField.forString("url2x", "url2x", null, false, Collections.emptyList()),
      ResponseField.forString("url4x", "url4x", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String url;

    final @NotNull String url2x;

    final @NotNull String url4x;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Image1(@NotNull String __typename, @NotNull String url, @NotNull String url2x,
        @NotNull String url4x) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.url = Utils.checkNotNull(url, "url == null");
      this.url2x = Utils.checkNotNull(url2x, "url2x == null");
      this.url4x = Utils.checkNotNull(url4x, "url4x == null");
    }

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

    /**
     * The URL for the small size image.
     */
    public @NotNull String url() {
      return this.url;
    }

    /**
     * The URL for the medium size image.
     */
    public @NotNull String url2x() {
      return this.url2x;
    }

    /**
     * The URL for the large size image.
     */
    public @NotNull String url4x() {
      return this.url4x;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Image1{"
          + "__typename=" + __typename + ", "
          + "url=" + url + ", "
          + "url2x=" + url2x + ", "
          + "url4x=" + url4x
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Image1) {
        Image1 that = (Image1) o;
        return this.__typename.equals(that.__typename)
         && this.url.equals(that.url)
         && this.url2x.equals(that.url2x)
         && this.url4x.equals(that.url4x);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Image1 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String url = reader.readString($responseFields[1]);
        final String url2x = reader.readString($responseFields[2]);
        final String url4x = reader.readString($responseFields[3]);
        return new Image1(__typename, url, url2x, url4x);
      }
    }
  }

  /**
   * A custom community points reward on a channel.
   */
  public static class CustomReward {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("backgroundColor", "backgroundColor", null, true, Collections.emptyList()),
      ResponseField.forCustomType("cooldownExpiresAt", "cooldownExpiresAt", null, true, CustomType.TIME, Collections.emptyList()),
      ResponseField.forInt("cost", "cost", null, false, Collections.emptyList()),
      ResponseField.forObject("defaultImage", "defaultImage", null, false, Collections.emptyList()),
      ResponseField.forObject("globalCooldownSetting", "globalCooldownSetting", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("image", "image", null, true, Collections.emptyList()),
      ResponseField.forBoolean("isEnabled", "isEnabled", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isInStock", "isInStock", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isPaused", "isPaused", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isSubOnly", "isSubOnly", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isUserInputRequired", "isUserInputRequired", null, false, Collections.emptyList()),
      ResponseField.forObject("maxPerStreamSetting", "maxPerStreamSetting", null, false, Collections.emptyList()),
      ResponseField.forObject("maxPerUserPerStreamSetting", "maxPerUserPerStreamSetting", null, false, Collections.emptyList()),
      ResponseField.forString("prompt", "prompt", null, true, Collections.emptyList()),
      ResponseField.forInt("redemptionsRedeemedCurrentStream", "redemptionsRedeemedCurrentStream", null, true, Collections.emptyList()),
      ResponseField.forBoolean("shouldRedemptionsSkipRequestQueue", "shouldRedemptionsSkipRequestQueue", null, false, Collections.emptyList()),
      ResponseField.forString("title", "title", null, false, Collections.emptyList()),
      ResponseField.forCustomType("updatedForIndicatorAt", "updatedForIndicatorAt", null, false, CustomType.TIME, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @Nullable String backgroundColor;

    final @Nullable Object cooldownExpiresAt;

    final int cost;

    final @NotNull DefaultImage1 defaultImage;

    final @NotNull GlobalCooldownSetting globalCooldownSetting;

    final @NotNull String id;

    final @Nullable Image2 image;

    final boolean isEnabled;

    final boolean isInStock;

    final boolean isPaused;

    final boolean isSubOnly;

    final boolean isUserInputRequired;

    final @NotNull MaxPerStreamSetting maxPerStreamSetting;

    final @NotNull MaxPerUserPerStreamSetting maxPerUserPerStreamSetting;

    final @Nullable String prompt;

    final @Nullable Integer redemptionsRedeemedCurrentStream;

    final boolean shouldRedemptionsSkipRequestQueue;

    final @NotNull String title;

    final @NotNull Object updatedForIndicatorAt;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public CustomReward(@NotNull String __typename, @Nullable String backgroundColor,
        @Nullable Object cooldownExpiresAt, int cost, @NotNull DefaultImage1 defaultImage,
        @NotNull GlobalCooldownSetting globalCooldownSetting, @NotNull String id,
        @Nullable Image2 image, boolean isEnabled, boolean isInStock, boolean isPaused,
        boolean isSubOnly, boolean isUserInputRequired,
        @NotNull MaxPerStreamSetting maxPerStreamSetting,
        @NotNull MaxPerUserPerStreamSetting maxPerUserPerStreamSetting, @Nullable String prompt,
        @Nullable Integer redemptionsRedeemedCurrentStream,
        boolean shouldRedemptionsSkipRequestQueue, @NotNull String title,
        @NotNull Object updatedForIndicatorAt) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.backgroundColor = backgroundColor;
      this.cooldownExpiresAt = cooldownExpiresAt;
      this.cost = cost;
      this.defaultImage = Utils.checkNotNull(defaultImage, "defaultImage == null");
      this.globalCooldownSetting = Utils.checkNotNull(globalCooldownSetting, "globalCooldownSetting == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.image = image;
      this.isEnabled = isEnabled;
      this.isInStock = isInStock;
      this.isPaused = isPaused;
      this.isSubOnly = isSubOnly;
      this.isUserInputRequired = isUserInputRequired;
      this.maxPerStreamSetting = Utils.checkNotNull(maxPerStreamSetting, "maxPerStreamSetting == null");
      this.maxPerUserPerStreamSetting = Utils.checkNotNull(maxPerUserPerStreamSetting, "maxPerUserPerStreamSetting == null");
      this.prompt = prompt;
      this.redemptionsRedeemedCurrentStream = redemptionsRedeemedCurrentStream;
      this.shouldRedemptionsSkipRequestQueue = shouldRedemptionsSkipRequestQueue;
      this.title = Utils.checkNotNull(title, "title == null");
      this.updatedForIndicatorAt = Utils.checkNotNull(updatedForIndicatorAt, "updatedForIndicatorAt == null");
    }

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

    /**
     * The custom background color for this reward. If no background color specified, will be null.
     */
    public @Nullable String backgroundColor() {
      return this.backgroundColor;
    }

    /**
     * The cooldown expires at field indidicates when reward will be able to be redeemed after the cooldown is set.
     * This field will only have a value if the global cooldown feature is enabled and has been recently redeemed.
     */
    public @Nullable Object cooldownExpiresAt() {
      return this.cooldownExpiresAt;
    }

    /**
     * The point cost of this reward.
     */
    public int cost() {
      return this.cost;
    }

    /**
     * The default image for community points custom rewards.
     */
    public @NotNull DefaultImage1 defaultImage() {
      return this.defaultImage;
    }

    /**
     * The most rewards of this type that can be redeemed per the global cooldown.
     */
    public @NotNull GlobalCooldownSetting globalCooldownSetting() {
      return this.globalCooldownSetting;
    }

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

    /**
     * The custom image for this reward. If no image exists, will be null.
     */
    public @Nullable Image2 image() {
      return this.image;
    }

    /**
     * Whether this reward is enabled in this channel at the moment.
     */
    public boolean isEnabled() {
      return this.isEnabled;
    }

    /**
     * Whether this reward is in stock at the moment.
     * If the reward has already been redeemed the maximum number of times per stream, this will be false.
     */
    public boolean isInStock() {
      return this.isInStock;
    }

    /**
     * Whether redemptions of this reward are temporarily paused.
     */
    public boolean isPaused() {
      return this.isPaused;
    }

    /**
     * Whether only subscribers are allowed to redeem this reward in this channel.
     */
    public boolean isSubOnly() {
      return this.isSubOnly;
    }

    /**
     * Whether this reward requires users to enter text input.
     */
    public boolean isUserInputRequired() {
      return this.isUserInputRequired;
    }

    /**
     * The most rewards of this type that can be redeemed per stream.
     */
    public @NotNull MaxPerStreamSetting maxPerStreamSetting() {
      return this.maxPerStreamSetting;
    }

    /**
     * The most rewards of this type that can be redeemed per user per stream.
     */
    public @NotNull MaxPerUserPerStreamSetting maxPerUserPerStreamSetting() {
      return this.maxPerUserPerStreamSetting;
    }

    /**
     * The user-facing prompt for this reward. If no prompt exists, will be null.
     */
    public @Nullable String prompt() {
      return this.prompt;
    }

    /**
     * The value of redemptions of the reward for the current stream.
     * This field will only have a value if the max per user per stream is enabled and has been recently redeemed.
     */
    public @Nullable Integer redemptionsRedeemedCurrentStream() {
      return this.redemptionsRedeemedCurrentStream;
    }

    /**
     * Whether redemptions for this reward should skip the broadcaster's request queue and get
     * automatically fulfilled.
     */
    public boolean shouldRedemptionsSkipRequestQueue() {
      return this.shouldRedemptionsSkipRequestQueue;
    }

    /**
     * The short title displayed for this reward.
     */
    public @NotNull String title() {
      return this.title;
    }

    /**
     * Time that this reward was last updated in a way that should show a new content indicator to viewers.
     */
    public @NotNull Object updatedForIndicatorAt() {
      return this.updatedForIndicatorAt;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeString($responseFields[1], backgroundColor);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], cooldownExpiresAt);
          writer.writeInt($responseFields[3], cost);
          writer.writeObject($responseFields[4], defaultImage.marshaller());
          writer.writeObject($responseFields[5], globalCooldownSetting.marshaller());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[6], id);
          writer.writeObject($responseFields[7], image != null ? image.marshaller() : null);
          writer.writeBoolean($responseFields[8], isEnabled);
          writer.writeBoolean($responseFields[9], isInStock);
          writer.writeBoolean($responseFields[10], isPaused);
          writer.writeBoolean($responseFields[11], isSubOnly);
          writer.writeBoolean($responseFields[12], isUserInputRequired);
          writer.writeObject($responseFields[13], maxPerStreamSetting.marshaller());
          writer.writeObject($responseFields[14], maxPerUserPerStreamSetting.marshaller());
          writer.writeString($responseFields[15], prompt);
          writer.writeInt($responseFields[16], redemptionsRedeemedCurrentStream);
          writer.writeBoolean($responseFields[17], shouldRedemptionsSkipRequestQueue);
          writer.writeString($responseFields[18], title);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[19], updatedForIndicatorAt);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "CustomReward{"
          + "__typename=" + __typename + ", "
          + "backgroundColor=" + backgroundColor + ", "
          + "cooldownExpiresAt=" + cooldownExpiresAt + ", "
          + "cost=" + cost + ", "
          + "defaultImage=" + defaultImage + ", "
          + "globalCooldownSetting=" + globalCooldownSetting + ", "
          + "id=" + id + ", "
          + "image=" + image + ", "
          + "isEnabled=" + isEnabled + ", "
          + "isInStock=" + isInStock + ", "
          + "isPaused=" + isPaused + ", "
          + "isSubOnly=" + isSubOnly + ", "
          + "isUserInputRequired=" + isUserInputRequired + ", "
          + "maxPerStreamSetting=" + maxPerStreamSetting + ", "
          + "maxPerUserPerStreamSetting=" + maxPerUserPerStreamSetting + ", "
          + "prompt=" + prompt + ", "
          + "redemptionsRedeemedCurrentStream=" + redemptionsRedeemedCurrentStream + ", "
          + "shouldRedemptionsSkipRequestQueue=" + shouldRedemptionsSkipRequestQueue + ", "
          + "title=" + title + ", "
          + "updatedForIndicatorAt=" + updatedForIndicatorAt
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof CustomReward) {
        CustomReward that = (CustomReward) o;
        return this.__typename.equals(that.__typename)
         && ((this.backgroundColor == null) ? (that.backgroundColor == null) : this.backgroundColor.equals(that.backgroundColor))
         && ((this.cooldownExpiresAt == null) ? (that.cooldownExpiresAt == null) : this.cooldownExpiresAt.equals(that.cooldownExpiresAt))
         && this.cost == that.cost
         && this.defaultImage.equals(that.defaultImage)
         && this.globalCooldownSetting.equals(that.globalCooldownSetting)
         && this.id.equals(that.id)
         && ((this.image == null) ? (that.image == null) : this.image.equals(that.image))
         && this.isEnabled == that.isEnabled
         && this.isInStock == that.isInStock
         && this.isPaused == that.isPaused
         && this.isSubOnly == that.isSubOnly
         && this.isUserInputRequired == that.isUserInputRequired
         && this.maxPerStreamSetting.equals(that.maxPerStreamSetting)
         && this.maxPerUserPerStreamSetting.equals(that.maxPerUserPerStreamSetting)
         && ((this.prompt == null) ? (that.prompt == null) : this.prompt.equals(that.prompt))
         && ((this.redemptionsRedeemedCurrentStream == null) ? (that.redemptionsRedeemedCurrentStream == null) : this.redemptionsRedeemedCurrentStream.equals(that.redemptionsRedeemedCurrentStream))
         && this.shouldRedemptionsSkipRequestQueue == that.shouldRedemptionsSkipRequestQueue
         && this.title.equals(that.title)
         && this.updatedForIndicatorAt.equals(that.updatedForIndicatorAt);
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= (backgroundColor == null) ? 0 : backgroundColor.hashCode();
        h *= 1000003;
        h ^= (cooldownExpiresAt == null) ? 0 : cooldownExpiresAt.hashCode();
        h *= 1000003;
        h ^= cost;
        h *= 1000003;
        h ^= defaultImage.hashCode();
        h *= 1000003;
        h ^= globalCooldownSetting.hashCode();
        h *= 1000003;
        h ^= id.hashCode();
        h *= 1000003;
        h ^= (image == null) ? 0 : image.hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isEnabled).hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isInStock).hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isPaused).hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isSubOnly).hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isUserInputRequired).hashCode();
        h *= 1000003;
        h ^= maxPerStreamSetting.hashCode();
        h *= 1000003;
        h ^= maxPerUserPerStreamSetting.hashCode();
        h *= 1000003;
        h ^= (prompt == null) ? 0 : prompt.hashCode();
        h *= 1000003;
        h ^= (redemptionsRedeemedCurrentStream == null) ? 0 : redemptionsRedeemedCurrentStream.hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(shouldRedemptionsSkipRequestQueue).hashCode();
        h *= 1000003;
        h ^= title.hashCode();
        h *= 1000003;
        h ^= updatedForIndicatorAt.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final DefaultImage1.Mapper defaultImage1FieldMapper = new DefaultImage1.Mapper();

      final GlobalCooldownSetting.Mapper globalCooldownSettingFieldMapper = new GlobalCooldownSetting.Mapper();

      final Image2.Mapper image2FieldMapper = new Image2.Mapper();

      final MaxPerStreamSetting.Mapper maxPerStreamSettingFieldMapper = new MaxPerStreamSetting.Mapper();

      final MaxPerUserPerStreamSetting.Mapper maxPerUserPerStreamSettingFieldMapper = new MaxPerUserPerStreamSetting.Mapper();

      @Override
      public CustomReward map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String backgroundColor = reader.readString($responseFields[1]);
        final Object cooldownExpiresAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final int cost = reader.readInt($responseFields[3]);
        final DefaultImage1 defaultImage = reader.readObject($responseFields[4], new ResponseReader.ObjectReader() {
          @Override
          public DefaultImage1 read(ResponseReader reader) {
            return defaultImage1FieldMapper.map(reader);
          }
        });
        final GlobalCooldownSetting globalCooldownSetting = reader.readObject($responseFields[5], new ResponseReader.ObjectReader() {
          @Override
          public GlobalCooldownSetting read(ResponseReader reader) {
            return globalCooldownSettingFieldMapper.map(reader);
          }
        });
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[6]);
        final Image2 image = reader.readObject($responseFields[7], new ResponseReader.ObjectReader() {
          @Override
          public Image2 read(ResponseReader reader) {
            return image2FieldMapper.map(reader);
          }
        });
        final boolean isEnabled = reader.readBoolean($responseFields[8]);
        final boolean isInStock = reader.readBoolean($responseFields[9]);
        final boolean isPaused = reader.readBoolean($responseFields[10]);
        final boolean isSubOnly = reader.readBoolean($responseFields[11]);
        final boolean isUserInputRequired = reader.readBoolean($responseFields[12]);
        final MaxPerStreamSetting maxPerStreamSetting = reader.readObject($responseFields[13], new ResponseReader.ObjectReader() {
          @Override
          public MaxPerStreamSetting read(ResponseReader reader) {
            return maxPerStreamSettingFieldMapper.map(reader);
          }
        });
        final MaxPerUserPerStreamSetting maxPerUserPerStreamSetting = reader.readObject($responseFields[14], new ResponseReader.ObjectReader() {
          @Override
          public MaxPerUserPerStreamSetting read(ResponseReader reader) {
            return maxPerUserPerStreamSettingFieldMapper.map(reader);
          }
        });
        final String prompt = reader.readString($responseFields[15]);
        final Integer redemptionsRedeemedCurrentStream = reader.readInt($responseFields[16]);
        final boolean shouldRedemptionsSkipRequestQueue = reader.readBoolean($responseFields[17]);
        final String title = reader.readString($responseFields[18]);
        final Object updatedForIndicatorAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[19]);
        return new CustomReward(__typename, backgroundColor, cooldownExpiresAt, cost, defaultImage, globalCooldownSetting, id, image, isEnabled, isInStock, isPaused, isSubOnly, isUserInputRequired, maxPerStreamSetting, maxPerUserPerStreamSetting, prompt, redemptionsRedeemedCurrentStream, shouldRedemptionsSkipRequestQueue, title, updatedForIndicatorAt);
      }
    }
  }

  /**
   * Image URLs of different sizes for community points rewards.
   */
  public static class DefaultImage1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("url", "url", null, false, Collections.emptyList()),
      ResponseField.forString("url2x", "url2x", null, false, Collections.emptyList()),
      ResponseField.forString("url4x", "url4x", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String url;

    final @NotNull String url2x;

    final @NotNull String url4x;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public DefaultImage1(@NotNull String __typename, @NotNull String url, @NotNull String url2x,
        @NotNull String url4x) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.url = Utils.checkNotNull(url, "url == null");
      this.url2x = Utils.checkNotNull(url2x, "url2x == null");
      this.url4x = Utils.checkNotNull(url4x, "url4x == null");
    }

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

    /**
     * The URL for the small size image.
     */
    public @NotNull String url() {
      return this.url;
    }

    /**
     * The URL for the medium size image.
     */
    public @NotNull String url2x() {
      return this.url2x;
    }

    /**
     * The URL for the large size image.
     */
    public @NotNull String url4x() {
      return this.url4x;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "DefaultImage1{"
          + "__typename=" + __typename + ", "
          + "url=" + url + ", "
          + "url2x=" + url2x + ", "
          + "url4x=" + url4x
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof DefaultImage1) {
        DefaultImage1 that = (DefaultImage1) o;
        return this.__typename.equals(that.__typename)
         && this.url.equals(that.url)
         && this.url2x.equals(that.url2x)
         && this.url4x.equals(that.url4x);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public DefaultImage1 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String url = reader.readString($responseFields[1]);
        final String url2x = reader.readString($responseFields[2]);
        final String url4x = reader.readString($responseFields[3]);
        return new DefaultImage1(__typename, url, url2x, url4x);
      }
    }
  }

  /**
   * Settings for how often a custom reward may be redeemed per stream.
   */
  public static class GlobalCooldownSetting {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isEnabled", "isEnabled", null, false, Collections.emptyList()),
      ResponseField.forInt("globalCooldownSeconds", "globalCooldownSeconds", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final boolean isEnabled;

    final int globalCooldownSeconds;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

    /**
     * Whether the cooldown is being enforced.
     */
    public boolean isEnabled() {
      return this.isEnabled;
    }

    /**
     * The most rewards of this type that can be redeemed per the global cooldown.
     */
    public int globalCooldownSeconds() {
      return this.globalCooldownSeconds;
    }

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

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

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

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

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

  /**
   * Image URLs of different sizes for community points rewards.
   */
  public static class Image2 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("url", "url", null, false, Collections.emptyList()),
      ResponseField.forString("url2x", "url2x", null, false, Collections.emptyList()),
      ResponseField.forString("url4x", "url4x", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String url;

    final @NotNull String url2x;

    final @NotNull String url4x;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Image2(@NotNull String __typename, @NotNull String url, @NotNull String url2x,
        @NotNull String url4x) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.url = Utils.checkNotNull(url, "url == null");
      this.url2x = Utils.checkNotNull(url2x, "url2x == null");
      this.url4x = Utils.checkNotNull(url4x, "url4x == null");
    }

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

    /**
     * The URL for the small size image.
     */
    public @NotNull String url() {
      return this.url;
    }

    /**
     * The URL for the medium size image.
     */
    public @NotNull String url2x() {
      return this.url2x;
    }

    /**
     * The URL for the large size image.
     */
    public @NotNull String url4x() {
      return this.url4x;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Image2{"
          + "__typename=" + __typename + ", "
          + "url=" + url + ", "
          + "url2x=" + url2x + ", "
          + "url4x=" + url4x
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Image2) {
        Image2 that = (Image2) o;
        return this.__typename.equals(that.__typename)
         && this.url.equals(that.url)
         && this.url2x.equals(that.url2x)
         && this.url4x.equals(that.url4x);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Image2 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String url = reader.readString($responseFields[1]);
        final String url2x = reader.readString($responseFields[2]);
        final String url4x = reader.readString($responseFields[3]);
        return new Image2(__typename, url, url2x, url4x);
      }
    }
  }

  /**
   * Settings for how often a custom reward may be redeemed per stream.
   */
  public static class MaxPerStreamSetting {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isEnabled", "isEnabled", null, false, Collections.emptyList()),
      ResponseField.forInt("maxPerStream", "maxPerStream", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final boolean isEnabled;

    final int maxPerStream;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

    /**
     * Whether the maximum is being enforced.
     */
    public boolean isEnabled() {
      return this.isEnabled;
    }

    /**
     * The most rewards of this type that can be redeemed per stream.
     */
    public int maxPerStream() {
      return this.maxPerStream;
    }

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

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

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

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

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

  /**
   * Settings for how often a custom reward may be redeemed per stream.
   */
  public static class MaxPerUserPerStreamSetting {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forBoolean("isEnabled", "isEnabled", null, false, Collections.emptyList()),
      ResponseField.forInt("maxPerUserPerStream", "maxPerUserPerStream", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final boolean isEnabled;

    final int maxPerUserPerStream;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

    /**
     * Whether the maximum is being enforced.
     */
    public boolean isEnabled() {
      return this.isEnabled;
    }

    /**
     * The most rewards of this type that can be redeemed per user per stream.
     */
    public int maxPerUserPerStream() {
      return this.maxPerUserPerStream;
    }

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

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

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

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

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

  /**
   * Community goal.
   */
  public static class Goal {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forInt("amountNeeded", "amountNeeded", null, false, Collections.emptyList()),
      ResponseField.forString("backgroundColor", "backgroundColor", null, false, Collections.emptyList()),
      ResponseField.forObject("defaultImage", "defaultImage", null, false, Collections.emptyList()),
      ResponseField.forString("description", "description", null, true, Collections.emptyList()),
      ResponseField.forInt("durationDays", "durationDays", null, false, Collections.emptyList()),
      ResponseField.forCustomType("endedAt", "endedAt", null, true, CustomType.TIME, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("image", "image", null, true, Collections.emptyList()),
      ResponseField.forBoolean("isInStock", "isInStock", null, false, Collections.emptyList()),
      ResponseField.forInt("perStreamUserMaximumContribution", "perStreamUserMaximumContribution", null, false, Collections.emptyList()),
      ResponseField.forInt("pointsContributed", "pointsContributed", null, false, Collections.emptyList()),
      ResponseField.forInt("smallContribution", "smallContribution", null, false, Collections.emptyList()),
      ResponseField.forCustomType("startedAt", "startedAt", null, true, CustomType.TIME, Collections.emptyList()),
      ResponseField.forString("status", "status", null, false, Collections.emptyList()),
      ResponseField.forString("title", "title", null, false, Collections.emptyList()),
      ResponseField.forString("type", "type", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final int amountNeeded;

    final @NotNull String backgroundColor;

    final @NotNull DefaultImage2 defaultImage;

    final @Nullable String description;

    final int durationDays;

    final @Nullable Object endedAt;

    final @NotNull String id;

    final @Nullable Image3 image;

    final boolean isInStock;

    final int perStreamUserMaximumContribution;

    final int pointsContributed;

    final int smallContribution;

    final @Nullable Object startedAt;

    final @NotNull CommunityPointsCommunityGoalStatus status;

    final @NotNull String title;

    final @NotNull CommunityPointsCommunityGoalType type;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Goal(@NotNull String __typename, int amountNeeded, @NotNull String backgroundColor,
        @NotNull DefaultImage2 defaultImage, @Nullable String description, int durationDays,
        @Nullable Object endedAt, @NotNull String id, @Nullable Image3 image, boolean isInStock,
        int perStreamUserMaximumContribution, int pointsContributed, int smallContribution,
        @Nullable Object startedAt, @NotNull CommunityPointsCommunityGoalStatus status,
        @NotNull String title, @NotNull CommunityPointsCommunityGoalType type) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.amountNeeded = amountNeeded;
      this.backgroundColor = Utils.checkNotNull(backgroundColor, "backgroundColor == null");
      this.defaultImage = Utils.checkNotNull(defaultImage, "defaultImage == null");
      this.description = description;
      this.durationDays = durationDays;
      this.endedAt = endedAt;
      this.id = Utils.checkNotNull(id, "id == null");
      this.image = image;
      this.isInStock = isInStock;
      this.perStreamUserMaximumContribution = perStreamUserMaximumContribution;
      this.pointsContributed = pointsContributed;
      this.smallContribution = smallContribution;
      this.startedAt = startedAt;
      this.status = Utils.checkNotNull(status, "status == null");
      this.title = Utils.checkNotNull(title, "title == null");
      this.type = Utils.checkNotNull(type, "type == null");
    }

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

    /**
     * The amount of community points that this goal needs to succeed.
     */
    public int amountNeeded() {
      return this.amountNeeded;
    }

    /**
     * The background color of this goal. Should be a hex color string, for example "FF0000".
     */
    public @NotNull String backgroundColor() {
      return this.backgroundColor;
    }

    /**
     * The default image of community goals.
     */
    public @NotNull DefaultImage2 defaultImage() {
      return this.defaultImage;
    }

    /**
     * The description of this goal.
     */
    public @Nullable String description() {
      return this.description;
    }

    /**
     * The *initial* duration the streamer set for the goal.
     * Only really used during the UNSTARTED state; once the goal is started
     * the endedAt timestamp is populated (and updated for extended deadlines).
     */
    public int durationDays() {
      return this.durationDays;
    }

    /**
     * When the goal ended / will end.
     */
    public @Nullable Object endedAt() {
      return this.endedAt;
    }

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

    /**
     * The image of the goal.
     */
    public @Nullable Image3 image() {
      return this.image;
    }

    /**
     * If this goal is available to be contributed to.
     * true when the goal is active and the streamer is live.
     * For MLP, this is just whether the channel is live.
     */
    public boolean isInStock() {
      return this.isInStock;
    }

    /**
     * The max per stream, per user contribution limit.
     */
    public int perStreamUserMaximumContribution() {
      return this.perStreamUserMaximumContribution;
    }

    /**
     * The total points contributed to this goal.
     */
    public int pointsContributed() {
      return this.pointsContributed;
    }

    /**
     * The small contribution needed to contribute to the goal. Contribution can only be
     * less than this amount if the goal has less than this amount left to complete or if
     * the viewer has less than this amount to be able to contribute.
     */
    public int smallContribution() {
      return this.smallContribution;
    }

    /**
     * When the goal started.
     */
    public @Nullable Object startedAt() {
      return this.startedAt;
    }

    /**
     * The current status of this goal.
     */
    public @NotNull CommunityPointsCommunityGoalStatus status() {
      return this.status;
    }

    /**
     * The title of this goal.
     */
    public @NotNull String title() {
      return this.title;
    }

    /**
     * The type of this goal.
     */
    public @NotNull CommunityPointsCommunityGoalType type() {
      return this.type;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeInt($responseFields[1], amountNeeded);
          writer.writeString($responseFields[2], backgroundColor);
          writer.writeObject($responseFields[3], defaultImage.marshaller());
          writer.writeString($responseFields[4], description);
          writer.writeInt($responseFields[5], durationDays);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[6], endedAt);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[7], id);
          writer.writeObject($responseFields[8], image != null ? image.marshaller() : null);
          writer.writeBoolean($responseFields[9], isInStock);
          writer.writeInt($responseFields[10], perStreamUserMaximumContribution);
          writer.writeInt($responseFields[11], pointsContributed);
          writer.writeInt($responseFields[12], smallContribution);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[13], startedAt);
          writer.writeString($responseFields[14], status.rawValue());
          writer.writeString($responseFields[15], title);
          writer.writeString($responseFields[16], type.rawValue());
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Goal{"
          + "__typename=" + __typename + ", "
          + "amountNeeded=" + amountNeeded + ", "
          + "backgroundColor=" + backgroundColor + ", "
          + "defaultImage=" + defaultImage + ", "
          + "description=" + description + ", "
          + "durationDays=" + durationDays + ", "
          + "endedAt=" + endedAt + ", "
          + "id=" + id + ", "
          + "image=" + image + ", "
          + "isInStock=" + isInStock + ", "
          + "perStreamUserMaximumContribution=" + perStreamUserMaximumContribution + ", "
          + "pointsContributed=" + pointsContributed + ", "
          + "smallContribution=" + smallContribution + ", "
          + "startedAt=" + startedAt + ", "
          + "status=" + status + ", "
          + "title=" + title + ", "
          + "type=" + type
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Goal) {
        Goal that = (Goal) o;
        return this.__typename.equals(that.__typename)
         && this.amountNeeded == that.amountNeeded
         && this.backgroundColor.equals(that.backgroundColor)
         && this.defaultImage.equals(that.defaultImage)
         && ((this.description == null) ? (that.description == null) : this.description.equals(that.description))
         && this.durationDays == that.durationDays
         && ((this.endedAt == null) ? (that.endedAt == null) : this.endedAt.equals(that.endedAt))
         && this.id.equals(that.id)
         && ((this.image == null) ? (that.image == null) : this.image.equals(that.image))
         && this.isInStock == that.isInStock
         && this.perStreamUserMaximumContribution == that.perStreamUserMaximumContribution
         && this.pointsContributed == that.pointsContributed
         && this.smallContribution == that.smallContribution
         && ((this.startedAt == null) ? (that.startedAt == null) : this.startedAt.equals(that.startedAt))
         && this.status.equals(that.status)
         && this.title.equals(that.title)
         && this.type.equals(that.type);
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= amountNeeded;
        h *= 1000003;
        h ^= backgroundColor.hashCode();
        h *= 1000003;
        h ^= defaultImage.hashCode();
        h *= 1000003;
        h ^= (description == null) ? 0 : description.hashCode();
        h *= 1000003;
        h ^= durationDays;
        h *= 1000003;
        h ^= (endedAt == null) ? 0 : endedAt.hashCode();
        h *= 1000003;
        h ^= id.hashCode();
        h *= 1000003;
        h ^= (image == null) ? 0 : image.hashCode();
        h *= 1000003;
        h ^= Boolean.valueOf(isInStock).hashCode();
        h *= 1000003;
        h ^= perStreamUserMaximumContribution;
        h *= 1000003;
        h ^= pointsContributed;
        h *= 1000003;
        h ^= smallContribution;
        h *= 1000003;
        h ^= (startedAt == null) ? 0 : startedAt.hashCode();
        h *= 1000003;
        h ^= status.hashCode();
        h *= 1000003;
        h ^= title.hashCode();
        h *= 1000003;
        h ^= type.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final DefaultImage2.Mapper defaultImage2FieldMapper = new DefaultImage2.Mapper();

      final Image3.Mapper image3FieldMapper = new Image3.Mapper();

      @Override
      public Goal map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final int amountNeeded = reader.readInt($responseFields[1]);
        final String backgroundColor = reader.readString($responseFields[2]);
        final DefaultImage2 defaultImage = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
          @Override
          public DefaultImage2 read(ResponseReader reader) {
            return defaultImage2FieldMapper.map(reader);
          }
        });
        final String description = reader.readString($responseFields[4]);
        final int durationDays = reader.readInt($responseFields[5]);
        final Object endedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[6]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[7]);
        final Image3 image = reader.readObject($responseFields[8], new ResponseReader.ObjectReader() {
          @Override
          public Image3 read(ResponseReader reader) {
            return image3FieldMapper.map(reader);
          }
        });
        final boolean isInStock = reader.readBoolean($responseFields[9]);
        final int perStreamUserMaximumContribution = reader.readInt($responseFields[10]);
        final int pointsContributed = reader.readInt($responseFields[11]);
        final int smallContribution = reader.readInt($responseFields[12]);
        final Object startedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[13]);
        final String statusStr = reader.readString($responseFields[14]);
        final CommunityPointsCommunityGoalStatus status;
        if (statusStr != null) {
          status = CommunityPointsCommunityGoalStatus.safeValueOf(statusStr);
        } else {
          status = null;
        }
        final String title = reader.readString($responseFields[15]);
        final String typeStr = reader.readString($responseFields[16]);
        final CommunityPointsCommunityGoalType type;
        if (typeStr != null) {
          type = CommunityPointsCommunityGoalType.safeValueOf(typeStr);
        } else {
          type = null;
        }
        return new Goal(__typename, amountNeeded, backgroundColor, defaultImage, description, durationDays, endedAt, id, image, isInStock, perStreamUserMaximumContribution, pointsContributed, smallContribution, startedAt, status, title, type);
      }
    }
  }

  /**
   * Image URLs of different sizes for community points rewards.
   */
  public static class DefaultImage2 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("url", "url", null, false, Collections.emptyList()),
      ResponseField.forString("url2x", "url2x", null, false, Collections.emptyList()),
      ResponseField.forString("url4x", "url4x", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String url;

    final @NotNull String url2x;

    final @NotNull String url4x;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public DefaultImage2(@NotNull String __typename, @NotNull String url, @NotNull String url2x,
        @NotNull String url4x) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.url = Utils.checkNotNull(url, "url == null");
      this.url2x = Utils.checkNotNull(url2x, "url2x == null");
      this.url4x = Utils.checkNotNull(url4x, "url4x == null");
    }

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

    /**
     * The URL for the small size image.
     */
    public @NotNull String url() {
      return this.url;
    }

    /**
     * The URL for the medium size image.
     */
    public @NotNull String url2x() {
      return this.url2x;
    }

    /**
     * The URL for the large size image.
     */
    public @NotNull String url4x() {
      return this.url4x;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "DefaultImage2{"
          + "__typename=" + __typename + ", "
          + "url=" + url + ", "
          + "url2x=" + url2x + ", "
          + "url4x=" + url4x
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof DefaultImage2) {
        DefaultImage2 that = (DefaultImage2) o;
        return this.__typename.equals(that.__typename)
         && this.url.equals(that.url)
         && this.url2x.equals(that.url2x)
         && this.url4x.equals(that.url4x);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public DefaultImage2 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String url = reader.readString($responseFields[1]);
        final String url2x = reader.readString($responseFields[2]);
        final String url4x = reader.readString($responseFields[3]);
        return new DefaultImage2(__typename, url, url2x, url4x);
      }
    }
  }

  /**
   * Image URLs of different sizes for community points rewards.
   */
  public static class Image3 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("url", "url", null, false, Collections.emptyList()),
      ResponseField.forString("url2x", "url2x", null, false, Collections.emptyList()),
      ResponseField.forString("url4x", "url4x", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String url;

    final @NotNull String url2x;

    final @NotNull String url4x;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Image3(@NotNull String __typename, @NotNull String url, @NotNull String url2x,
        @NotNull String url4x) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.url = Utils.checkNotNull(url, "url == null");
      this.url2x = Utils.checkNotNull(url2x, "url2x == null");
      this.url4x = Utils.checkNotNull(url4x, "url4x == null");
    }

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

    /**
     * The URL for the small size image.
     */
    public @NotNull String url() {
      return this.url;
    }

    /**
     * The URL for the medium size image.
     */
    public @NotNull String url2x() {
      return this.url2x;
    }

    /**
     * The URL for the large size image.
     */
    public @NotNull String url4x() {
      return this.url4x;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Image3{"
          + "__typename=" + __typename + ", "
          + "url=" + url + ", "
          + "url2x=" + url2x + ", "
          + "url4x=" + url4x
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Image3) {
        Image3 that = (Image3) o;
        return this.__typename.equals(that.__typename)
         && this.url.equals(that.url)
         && this.url2x.equals(that.url2x)
         && this.url4x.equals(that.url4x);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Image3 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String url = reader.readString($responseFields[1]);
        final String url2x = reader.readString($responseFields[2]);
        final String url4x = reader.readString($responseFields[3]);
        return new Image3(__typename, url, url2x, url4x);
      }
    }
  }

  /**
   * A community points emote variant, includes base emote plus modifications.
   */
  public static class EmoteVariant {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("emote", "emote", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forBoolean("isUnlockable", "isUnlockable", null, false, Collections.emptyList()),
      ResponseField.forList("modifications", "modifications", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Emote emote;

    final @NotNull String id;

    final boolean isUnlockable;

    final @NotNull List modifications;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public EmoteVariant(@NotNull String __typename, @NotNull Emote emote, @NotNull String id,
        boolean isUnlockable, @NotNull List modifications) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.emote = Utils.checkNotNull(emote, "emote == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.isUnlockable = isUnlockable;
      this.modifications = Utils.checkNotNull(modifications, "modifications == null");
    }

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

    /**
     * The base emote for this variant.
     */
    public @NotNull Emote emote() {
      return this.emote;
    }

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

    /**
     * Whether community points can be used to unlock the base emote.
     */
    public boolean isUnlockable() {
      return this.isUnlockable;
    }

    /**
     * The modifications available to be unlocked for this emote.
     */
    public @NotNull List modifications() {
      return this.modifications;
    }

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

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof EmoteVariant) {
        EmoteVariant that = (EmoteVariant) o;
        return this.__typename.equals(that.__typename)
         && this.emote.equals(that.emote)
         && this.id.equals(that.id)
         && this.isUnlockable == that.isUnlockable
         && this.modifications.equals(that.modifications);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final Emote.Mapper emoteFieldMapper = new Emote.Mapper();

      final Modification.Mapper modificationFieldMapper = new Modification.Mapper();

      @Override
      public EmoteVariant map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Emote emote = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Emote read(ResponseReader reader) {
            return emoteFieldMapper.map(reader);
          }
        });
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final boolean isUnlockable = reader.readBoolean($responseFields[3]);
        final List modifications = reader.readList($responseFields[4], new ResponseReader.ListReader() {
          @Override
          public Modification read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Modification read(ResponseReader reader) {
                return modificationFieldMapper.map(reader);
              }
            });
          }
        });
        return new EmoteVariant(__typename, emote, id, isUnlockable, modifications);
      }
    }
  }

  /**
   * A community points emote.
   */
  public static class Emote {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forString("token", "token", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @NotNull String token;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

    /**
     * The text token of the emote.
     */
    public @NotNull String token() {
      return this.token;
    }

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

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

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

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

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

  /**
   * A community points emote modification.
   */
  public static class Modification {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("emote", "emote", null, false, Collections.emptyList()),
      ResponseField.forCustomType("globallyUpdatedForIndicatorAt", "globallyUpdatedForIndicatorAt", null, false, CustomType.TIME, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forObject("modifier", "modifier", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Emote1 emote;

    final @NotNull Object globallyUpdatedForIndicatorAt;

    final @NotNull String id;

    final @NotNull Modifier modifier;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Modification(@NotNull String __typename, @NotNull Emote1 emote,
        @NotNull Object globallyUpdatedForIndicatorAt, @NotNull String id,
        @NotNull Modifier modifier) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.emote = Utils.checkNotNull(emote, "emote == null");
      this.globallyUpdatedForIndicatorAt = Utils.checkNotNull(globallyUpdatedForIndicatorAt, "globallyUpdatedForIndicatorAt == null");
      this.id = Utils.checkNotNull(id, "id == null");
      this.modifier = Utils.checkNotNull(modifier, "modifier == null");
    }

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

    /**
     * The modified emote.
     */
    public @NotNull Emote1 emote() {
      return this.emote;
    }

    /**
     * Time that the modification was last updated globally in a way that should show a new content indicator to viewers.
     */
    public @NotNull Object globallyUpdatedForIndicatorAt() {
      return this.globallyUpdatedForIndicatorAt;
    }

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

    /**
     * The modifier of the emote.
     */
    public @NotNull Modifier modifier() {
      return this.modifier;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeObject($responseFields[1], emote.marshaller());
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], globallyUpdatedForIndicatorAt);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[3], id);
          writer.writeObject($responseFields[4], modifier.marshaller());
        }
      };
    }

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

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Modification) {
        Modification that = (Modification) o;
        return this.__typename.equals(that.__typename)
         && this.emote.equals(that.emote)
         && this.globallyUpdatedForIndicatorAt.equals(that.globallyUpdatedForIndicatorAt)
         && this.id.equals(that.id)
         && this.modifier.equals(that.modifier);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final Emote1.Mapper emote1FieldMapper = new Emote1.Mapper();

      final Modifier.Mapper modifierFieldMapper = new Modifier.Mapper();

      @Override
      public Modification map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Emote1 emote = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Emote1 read(ResponseReader reader) {
            return emote1FieldMapper.map(reader);
          }
        });
        final Object globallyUpdatedForIndicatorAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[3]);
        final Modifier modifier = reader.readObject($responseFields[4], new ResponseReader.ObjectReader() {
          @Override
          public Modifier read(ResponseReader reader) {
            return modifierFieldMapper.map(reader);
          }
        });
        return new Modification(__typename, emote, globallyUpdatedForIndicatorAt, id, modifier);
      }
    }
  }

  /**
   * A community points emote.
   */
  public static class Emote1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forString("token", "token", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    final @NotNull String token;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

    /**
     * The text token of the emote.
     */
    public @NotNull String token() {
      return this.token;
    }

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

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

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

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

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

  /**
   * A community points emote modifier.
   */
  public static class Modifier {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull String id;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

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

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

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

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

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

  /**
   * Information on how points are earned by viewers in a specific channel.
   */
  public static class Earning {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forInt("averagePointsPerHour", "averagePointsPerHour", null, false, Collections.emptyList()),
      ResponseField.forInt("cheerPoints", "cheerPoints", null, false, Collections.emptyList()),
      ResponseField.forInt("claimPoints", "claimPoints", null, false, Collections.emptyList()),
      ResponseField.forInt("followPoints", "followPoints", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
      ResponseField.forList("multipliers", "multipliers", null, false, Collections.emptyList()),
      ResponseField.forInt("passiveWatchPoints", "passiveWatchPoints", null, false, Collections.emptyList()),
      ResponseField.forInt("raidPoints", "raidPoints", null, false, Collections.emptyList()),
      ResponseField.forInt("subscriptionGiftPoints", "subscriptionGiftPoints", null, false, Collections.emptyList()),
      ResponseField.forList("watchStreakPoints", "watchStreakPoints", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final int averagePointsPerHour;

    final int cheerPoints;

    final int claimPoints;

    final int followPoints;

    final @NotNull String id;

    final @NotNull List multipliers;

    final int passiveWatchPoints;

    final int raidPoints;

    final int subscriptionGiftPoints;

    final @NotNull List watchStreakPoints;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Earning(@NotNull String __typename, int averagePointsPerHour, int cheerPoints,
        int claimPoints, int followPoints, @NotNull String id,
        @NotNull List multipliers, int passiveWatchPoints, int raidPoints,
        int subscriptionGiftPoints, @NotNull List watchStreakPoints) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.averagePointsPerHour = averagePointsPerHour;
      this.cheerPoints = cheerPoints;
      this.claimPoints = claimPoints;
      this.followPoints = followPoints;
      this.id = Utils.checkNotNull(id, "id == null");
      this.multipliers = Utils.checkNotNull(multipliers, "multipliers == null");
      this.passiveWatchPoints = passiveWatchPoints;
      this.raidPoints = raidPoints;
      this.subscriptionGiftPoints = subscriptionGiftPoints;
      this.watchStreakPoints = Utils.checkNotNull(watchStreakPoints, "watchStreakPoints == null");
    }

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

    /**
     * The average number of points per hour earned by a regular (non-sub) user on this channel.
     */
    public int averagePointsPerHour() {
      return this.averagePointsPerHour;
    }

    /**
     * How many points are earned for cheering in a channel.
     */
    public int cheerPoints() {
      return this.cheerPoints;
    }

    /**
     * How many points are earned for clicking a bonus claim.
     */
    public int claimPoints() {
      return this.claimPoints;
    }

    /**
     * How many points are earned for following the channel.
     */
    public int followPoints() {
      return this.followPoints;
    }

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

    /**
     * The possible multipliers users can have on earning points.
     */
    public @NotNull List multipliers() {
      return this.multipliers;
    }

    /**
     * How many points are earned for passively watching the channel.
     */
    public int passiveWatchPoints() {
      return this.passiveWatchPoints;
    }

    /**
     * How many points are earned for following a raid by the channel.
     */
    public int raidPoints() {
      return this.raidPoints;
    }

    /**
     * How many points are earned for gifting a subscription in a channel.
     */
    public int subscriptionGiftPoints() {
      return this.subscriptionGiftPoints;
    }

    /**
     * How many points are earned for watching consecutive streams.
     * This list will be sorted from shortest duration to longest duration.
     * Watch streaks beyond the longest duration here will be treated the same as watch streaks of the longest duration.
     */
    public @NotNull List watchStreakPoints() {
      return this.watchStreakPoints;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeInt($responseFields[1], averagePointsPerHour);
          writer.writeInt($responseFields[2], cheerPoints);
          writer.writeInt($responseFields[3], claimPoints);
          writer.writeInt($responseFields[4], followPoints);
          writer.writeCustom((ResponseField.CustomTypeField) $responseFields[5], id);
          writer.writeList($responseFields[6], multipliers, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((Multiplier) item).marshaller());
              }
            }
          });
          writer.writeInt($responseFields[7], passiveWatchPoints);
          writer.writeInt($responseFields[8], raidPoints);
          writer.writeInt($responseFields[9], subscriptionGiftPoints);
          writer.writeList($responseFields[10], watchStreakPoints, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((WatchStreakPoint) item).marshaller());
              }
            }
          });
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Earning{"
          + "__typename=" + __typename + ", "
          + "averagePointsPerHour=" + averagePointsPerHour + ", "
          + "cheerPoints=" + cheerPoints + ", "
          + "claimPoints=" + claimPoints + ", "
          + "followPoints=" + followPoints + ", "
          + "id=" + id + ", "
          + "multipliers=" + multipliers + ", "
          + "passiveWatchPoints=" + passiveWatchPoints + ", "
          + "raidPoints=" + raidPoints + ", "
          + "subscriptionGiftPoints=" + subscriptionGiftPoints + ", "
          + "watchStreakPoints=" + watchStreakPoints
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Earning) {
        Earning that = (Earning) o;
        return this.__typename.equals(that.__typename)
         && this.averagePointsPerHour == that.averagePointsPerHour
         && this.cheerPoints == that.cheerPoints
         && this.claimPoints == that.claimPoints
         && this.followPoints == that.followPoints
         && this.id.equals(that.id)
         && this.multipliers.equals(that.multipliers)
         && this.passiveWatchPoints == that.passiveWatchPoints
         && this.raidPoints == that.raidPoints
         && this.subscriptionGiftPoints == that.subscriptionGiftPoints
         && this.watchStreakPoints.equals(that.watchStreakPoints);
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= __typename.hashCode();
        h *= 1000003;
        h ^= averagePointsPerHour;
        h *= 1000003;
        h ^= cheerPoints;
        h *= 1000003;
        h ^= claimPoints;
        h *= 1000003;
        h ^= followPoints;
        h *= 1000003;
        h ^= id.hashCode();
        h *= 1000003;
        h ^= multipliers.hashCode();
        h *= 1000003;
        h ^= passiveWatchPoints;
        h *= 1000003;
        h ^= raidPoints;
        h *= 1000003;
        h ^= subscriptionGiftPoints;
        h *= 1000003;
        h ^= watchStreakPoints.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public static final class Mapper implements ResponseFieldMapper {
      final Multiplier.Mapper multiplierFieldMapper = new Multiplier.Mapper();

      final WatchStreakPoint.Mapper watchStreakPointFieldMapper = new WatchStreakPoint.Mapper();

      @Override
      public Earning map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final int averagePointsPerHour = reader.readInt($responseFields[1]);
        final int cheerPoints = reader.readInt($responseFields[2]);
        final int claimPoints = reader.readInt($responseFields[3]);
        final int followPoints = reader.readInt($responseFields[4]);
        final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[5]);
        final List multipliers = reader.readList($responseFields[6], new ResponseReader.ListReader() {
          @Override
          public Multiplier read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Multiplier read(ResponseReader reader) {
                return multiplierFieldMapper.map(reader);
              }
            });
          }
        });
        final int passiveWatchPoints = reader.readInt($responseFields[7]);
        final int raidPoints = reader.readInt($responseFields[8]);
        final int subscriptionGiftPoints = reader.readInt($responseFields[9]);
        final List watchStreakPoints = reader.readList($responseFields[10], new ResponseReader.ListReader() {
          @Override
          public WatchStreakPoint read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public WatchStreakPoint read(ResponseReader reader) {
                return watchStreakPointFieldMapper.map(reader);
              }
            });
          }
        });
        return new Earning(__typename, averagePointsPerHour, cheerPoints, claimPoints, followPoints, id, multipliers, passiveWatchPoints, raidPoints, subscriptionGiftPoints, watchStreakPoints);
      }
    }
  }

  /**
   * A multiplier affecting the rate of community points earned for a user in a channel.
   */
  public static class Multiplier {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forString("reasonCode", "reasonCode", null, false, Collections.emptyList()),
      ResponseField.forDouble("factor", "factor", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull CommunityPointsMultiplierReason reasonCode;

    final double factor;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Multiplier(@NotNull String __typename,
        @NotNull CommunityPointsMultiplierReason reasonCode, double factor) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.reasonCode = Utils.checkNotNull(reasonCode, "reasonCode == null");
      this.factor = factor;
    }

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

    /**
     * The reason that the multiplier is being applied.
     */
    public @NotNull CommunityPointsMultiplierReason reasonCode() {
      return this.reasonCode;
    }

    /**
     * The multiplying factor being applied.
     * Multipliers start at a base of 1.0, and are additive.
     * Two multipliers of [0.2] and [0.3] will give a final multiplier of 1.5x.
     */
    public double factor() {
      return this.factor;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Multiplier{"
          + "__typename=" + __typename + ", "
          + "reasonCode=" + reasonCode + ", "
          + "factor=" + factor
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Multiplier) {
        Multiplier that = (Multiplier) o;
        return this.__typename.equals(that.__typename)
         && this.reasonCode.equals(that.reasonCode)
         && Double.doubleToLongBits(this.factor) == Double.doubleToLongBits(that.factor);
      }
      return false;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Multiplier map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String reasonCodeStr = reader.readString($responseFields[1]);
        final CommunityPointsMultiplierReason reasonCode;
        if (reasonCodeStr != null) {
          reasonCode = CommunityPointsMultiplierReason.safeValueOf(reasonCodeStr);
        } else {
          reasonCode = null;
        }
        final double factor = reader.readDouble($responseFields[2]);
        return new Multiplier(__typename, reasonCode, factor);
      }
    }
  }

  /**
   * Settings for how many community points are awarded for a watch streak of a specific duration.
   */
  public static class WatchStreakPoint {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forInt("points", "points", null, false, Collections.emptyList()),
      ResponseField.forInt("streakLength", "streakLength", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final int points;

    final int streakLength;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public WatchStreakPoint(@NotNull String __typename, int points, int streakLength) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.points = points;
      this.streakLength = streakLength;
    }

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

    /**
     * How many points are awarded for a streak of this length.
     */
    public int points() {
      return this.points;
    }

    /**
     * How long of a streak a user has.
     */
    public int streakLength() {
      return this.streakLength;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "WatchStreakPoint{"
          + "__typename=" + __typename + ", "
          + "points=" + points + ", "
          + "streakLength=" + streakLength
          + "}";
      }
      return $toString;
    }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy