com.github.twitch4j.graphql.internal.BanUserFromChatRoomMutation 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.Mutation;
import com.apollographql.apollo.api.Operation;
import com.apollographql.apollo.api.OperationName;
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.BanUserFromChatRoomErrorCode;
import com.github.twitch4j.graphql.internal.type.BanUserFromChatRoomInput;
import com.github.twitch4j.graphql.internal.type.CustomType;
import java.io.IOException;
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.Map;
import okio.Buffer;
import okio.BufferedSource;
import okio.ByteString;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public final class BanUserFromChatRoomMutation implements Mutation {
public static final String OPERATION_ID = "1ca28bda309d4ddf3fc4c1f7738eb3e53cb76c71eb1c64f3d29564520e530952";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"mutation banUserFromChatRoom($input: BanUserFromChatRoomInput!) {\n"
+ " banUserFromChatRoom(input: $input) {\n"
+ " __typename\n"
+ " ban {\n"
+ " __typename\n"
+ " bannedUser {\n"
+ " __typename\n"
+ " id\n"
+ " login\n"
+ " displayName\n"
+ " }\n"
+ " createdAt\n"
+ " expiresAt\n"
+ " isPermanent\n"
+ " moderator {\n"
+ " __typename\n"
+ " id\n"
+ " login\n"
+ " displayName\n"
+ " }\n"
+ " reason\n"
+ " }\n"
+ " error {\n"
+ " __typename\n"
+ " code\n"
+ " }\n"
+ " }\n"
+ "}"
);
public static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "banUserFromChatRoom";
}
};
private final BanUserFromChatRoomMutation.Variables variables;
public BanUserFromChatRoomMutation(@NotNull BanUserFromChatRoomInput input) {
Utils.checkNotNull(input, "input == null");
variables = new BanUserFromChatRoomMutation.Variables(input);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public BanUserFromChatRoomMutation.Data wrapData(BanUserFromChatRoomMutation.Data data) {
return data;
}
@Override
public BanUserFromChatRoomMutation.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 BanUserFromChatRoomInput input;
Builder() {
}
public Builder input(@NotNull BanUserFromChatRoomInput input) {
this.input = input;
return this;
}
public BanUserFromChatRoomMutation build() {
Utils.checkNotNull(input, "input == null");
return new BanUserFromChatRoomMutation(input);
}
}
public static final class Variables extends Operation.Variables {
private final @NotNull BanUserFromChatRoomInput input;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(@NotNull BanUserFromChatRoomInput input) {
this.input = input;
this.valueMap.put("input", input);
}
public @NotNull BanUserFromChatRoomInput input() {
return input;
}
@Override
public Map valueMap() {
return Collections.unmodifiableMap(valueMap);
}
@Override
public InputFieldMarshaller marshaller() {
return new InputFieldMarshaller() {
@Override
public void marshal(InputFieldWriter writer) throws IOException {
writer.writeObject("input", input.marshaller());
}
};
}
}
/**
* Data from the response after executing this GraphQL operation
*/
public static class Data implements Operation.Data {
static final ResponseField[] $responseFields = {
ResponseField.forObject("banUserFromChatRoom", "banUserFromChatRoom", new UnmodifiableMapBuilder(1)
.put("input", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "input")
.build())
.build(), true, Collections.emptyList())
};
final @Nullable BanUserFromChatRoom banUserFromChatRoom;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Data(@Nullable BanUserFromChatRoom banUserFromChatRoom) {
this.banUserFromChatRoom = banUserFromChatRoom;
}
/**
* Bans a user from chat room permanently or for an specified period of time.
*/
public @Nullable BanUserFromChatRoom banUserFromChatRoom() {
return this.banUserFromChatRoom;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeObject($responseFields[0], banUserFromChatRoom != null ? banUserFromChatRoom.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "banUserFromChatRoom=" + banUserFromChatRoom
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return ((this.banUserFromChatRoom == null) ? (that.banUserFromChatRoom == null) : this.banUserFromChatRoom.equals(that.banUserFromChatRoom));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (banUserFromChatRoom == null) ? 0 : banUserFromChatRoom.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final BanUserFromChatRoom.Mapper banUserFromChatRoomFieldMapper = new BanUserFromChatRoom.Mapper();
@Override
public Data map(ResponseReader reader) {
final BanUserFromChatRoom banUserFromChatRoom = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
@Override
public BanUserFromChatRoom read(ResponseReader reader) {
return banUserFromChatRoomFieldMapper.map(reader);
}
});
return new Data(banUserFromChatRoom);
}
}
}
public static class BanUserFromChatRoom {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forObject("ban", "ban", null, true, Collections.emptyList()),
ResponseField.forObject("error", "error", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @Nullable Ban ban;
final @Nullable Error error;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public BanUserFromChatRoom(@NotNull String __typename, @Nullable Ban ban,
@Nullable Error error) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.ban = ban;
this.error = error;
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The new ban status of this user regarding the specified channel.
*/
public @Nullable Ban ban() {
return this.ban;
}
/**
* Mutation error caused by the user input.
*/
public @Nullable Error error() {
return this.error;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeObject($responseFields[1], ban != null ? ban.marshaller() : null);
writer.writeObject($responseFields[2], error != null ? error.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "BanUserFromChatRoom{"
+ "__typename=" + __typename + ", "
+ "ban=" + ban + ", "
+ "error=" + error
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof BanUserFromChatRoom) {
BanUserFromChatRoom that = (BanUserFromChatRoom) o;
return this.__typename.equals(that.__typename)
&& ((this.ban == null) ? (that.ban == null) : this.ban.equals(that.ban))
&& ((this.error == null) ? (that.error == null) : this.error.equals(that.error));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= (ban == null) ? 0 : ban.hashCode();
h *= 1000003;
h ^= (error == null) ? 0 : error.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final Ban.Mapper banFieldMapper = new Ban.Mapper();
final Error.Mapper errorFieldMapper = new Error.Mapper();
@Override
public BanUserFromChatRoom map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final Ban ban = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
@Override
public Ban read(ResponseReader reader) {
return banFieldMapper.map(reader);
}
});
final Error error = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
@Override
public Error read(ResponseReader reader) {
return errorFieldMapper.map(reader);
}
});
return new BanUserFromChatRoom(__typename, ban, error);
}
}
}
public static class Ban {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forObject("bannedUser", "bannedUser", null, true, Collections.emptyList()),
ResponseField.forCustomType("createdAt", "createdAt", null, false, CustomType.TIME, Collections.emptyList()),
ResponseField.forCustomType("expiresAt", "expiresAt", null, true, CustomType.TIME, Collections.emptyList()),
ResponseField.forBoolean("isPermanent", "isPermanent", null, false, Collections.emptyList()),
ResponseField.forObject("moderator", "moderator", null, true, Collections.emptyList()),
ResponseField.forString("reason", "reason", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @Nullable BannedUser bannedUser;
final @NotNull Object createdAt;
final @Nullable Object expiresAt;
final boolean isPermanent;
final @Nullable Moderator moderator;
final @Nullable String reason;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Ban(@NotNull String __typename, @Nullable BannedUser bannedUser,
@NotNull Object createdAt, @Nullable Object expiresAt, boolean isPermanent,
@Nullable Moderator moderator, @Nullable String reason) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.bannedUser = bannedUser;
this.createdAt = Utils.checkNotNull(createdAt, "createdAt == null");
this.expiresAt = expiresAt;
this.isPermanent = isPermanent;
this.moderator = moderator;
this.reason = reason;
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The user being banned of this chat.
*/
public @Nullable BannedUser bannedUser() {
return this.bannedUser;
}
/**
* The time the ban was imposed.
*/
public @NotNull Object createdAt() {
return this.createdAt;
}
/**
* The time at which the ban will automatically expire.
*/
public @Nullable Object expiresAt() {
return this.expiresAt;
}
/**
* Conveys if the ban is permanent.
*/
public boolean isPermanent() {
return this.isPermanent;
}
/**
* The moderator that carried out the action.
*/
public @Nullable Moderator moderator() {
return this.moderator;
}
/**
* The reason the user was banned.
*/
public @Nullable String reason() {
return this.reason;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeObject($responseFields[1], bannedUser != null ? bannedUser.marshaller() : null);
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[2], createdAt);
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[3], expiresAt);
writer.writeBoolean($responseFields[4], isPermanent);
writer.writeObject($responseFields[5], moderator != null ? moderator.marshaller() : null);
writer.writeString($responseFields[6], reason);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Ban{"
+ "__typename=" + __typename + ", "
+ "bannedUser=" + bannedUser + ", "
+ "createdAt=" + createdAt + ", "
+ "expiresAt=" + expiresAt + ", "
+ "isPermanent=" + isPermanent + ", "
+ "moderator=" + moderator + ", "
+ "reason=" + reason
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Ban) {
Ban that = (Ban) o;
return this.__typename.equals(that.__typename)
&& ((this.bannedUser == null) ? (that.bannedUser == null) : this.bannedUser.equals(that.bannedUser))
&& this.createdAt.equals(that.createdAt)
&& ((this.expiresAt == null) ? (that.expiresAt == null) : this.expiresAt.equals(that.expiresAt))
&& this.isPermanent == that.isPermanent
&& ((this.moderator == null) ? (that.moderator == null) : this.moderator.equals(that.moderator))
&& ((this.reason == null) ? (that.reason == null) : this.reason.equals(that.reason));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= (bannedUser == null) ? 0 : bannedUser.hashCode();
h *= 1000003;
h ^= createdAt.hashCode();
h *= 1000003;
h ^= (expiresAt == null) ? 0 : expiresAt.hashCode();
h *= 1000003;
h ^= Boolean.valueOf(isPermanent).hashCode();
h *= 1000003;
h ^= (moderator == null) ? 0 : moderator.hashCode();
h *= 1000003;
h ^= (reason == null) ? 0 : reason.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final BannedUser.Mapper bannedUserFieldMapper = new BannedUser.Mapper();
final Moderator.Mapper moderatorFieldMapper = new Moderator.Mapper();
@Override
public Ban map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final BannedUser bannedUser = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
@Override
public BannedUser read(ResponseReader reader) {
return bannedUserFieldMapper.map(reader);
}
});
final Object createdAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[2]);
final Object expiresAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[3]);
final boolean isPermanent = reader.readBoolean($responseFields[4]);
final Moderator moderator = reader.readObject($responseFields[5], new ResponseReader.ObjectReader() {
@Override
public Moderator read(ResponseReader reader) {
return moderatorFieldMapper.map(reader);
}
});
final String reason = reader.readString($responseFields[6]);
return new Ban(__typename, bannedUser, createdAt, expiresAt, isPermanent, moderator, reason);
}
}
}
/**
* Twitch user.
*/
public static class BannedUser {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
ResponseField.forString("login", "login", null, false, Collections.emptyList()),
ResponseField.forString("displayName", "displayName", null, false, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String id;
final @NotNull String login;
final @NotNull String displayName;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public BannedUser(@NotNull String __typename, @NotNull String id, @NotNull String login,
@NotNull String displayName) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.id = Utils.checkNotNull(id, "id == null");
this.login = Utils.checkNotNull(login, "login == null");
this.displayName = Utils.checkNotNull(displayName, "displayName == null");
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The user's unique identifier.
*/
public @NotNull String id() {
return this.id;
}
/**
* The user's standard alphanumeric Twitch name.
*/
public @NotNull String login() {
return this.login;
}
/**
* A user-styled version of their login.
* For international users, this could be the user's login with localized characters.
*/
public @NotNull String displayName() {
return this.displayName;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[1], id);
writer.writeString($responseFields[2], login);
writer.writeString($responseFields[3], displayName);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "BannedUser{"
+ "__typename=" + __typename + ", "
+ "id=" + id + ", "
+ "login=" + login + ", "
+ "displayName=" + displayName
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof BannedUser) {
BannedUser that = (BannedUser) o;
return this.__typename.equals(that.__typename)
&& this.id.equals(that.id)
&& this.login.equals(that.login)
&& this.displayName.equals(that.displayName);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= id.hashCode();
h *= 1000003;
h ^= login.hashCode();
h *= 1000003;
h ^= displayName.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public BannedUser map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
final String login = reader.readString($responseFields[2]);
final String displayName = reader.readString($responseFields[3]);
return new BannedUser(__typename, id, login, displayName);
}
}
}
/**
* Twitch user.
*/
public static class Moderator {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
ResponseField.forString("login", "login", null, false, Collections.emptyList()),
ResponseField.forString("displayName", "displayName", null, false, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String id;
final @NotNull String login;
final @NotNull String displayName;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Moderator(@NotNull String __typename, @NotNull String id, @NotNull String login,
@NotNull String displayName) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.id = Utils.checkNotNull(id, "id == null");
this.login = Utils.checkNotNull(login, "login == null");
this.displayName = Utils.checkNotNull(displayName, "displayName == null");
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The user's unique identifier.
*/
public @NotNull String id() {
return this.id;
}
/**
* The user's standard alphanumeric Twitch name.
*/
public @NotNull String login() {
return this.login;
}
/**
* A user-styled version of their login.
* For international users, this could be the user's login with localized characters.
*/
public @NotNull String displayName() {
return this.displayName;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[1], id);
writer.writeString($responseFields[2], login);
writer.writeString($responseFields[3], displayName);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Moderator{"
+ "__typename=" + __typename + ", "
+ "id=" + id + ", "
+ "login=" + login + ", "
+ "displayName=" + displayName
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Moderator) {
Moderator that = (Moderator) o;
return this.__typename.equals(that.__typename)
&& this.id.equals(that.id)
&& this.login.equals(that.login)
&& this.displayName.equals(that.displayName);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= id.hashCode();
h *= 1000003;
h ^= login.hashCode();
h *= 1000003;
h ^= displayName.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public Moderator map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
final String login = reader.readString($responseFields[2]);
final String displayName = reader.readString($responseFields[3]);
return new Moderator(__typename, id, login, displayName);
}
}
}
public static class Error {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forString("code", "code", null, false, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull BanUserFromChatRoomErrorCode code;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Error(@NotNull String __typename, @NotNull BanUserFromChatRoomErrorCode code) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.code = Utils.checkNotNull(code, "code == null");
}
public @NotNull String __typename() {
return this.__typename;
}
public @NotNull BanUserFromChatRoomErrorCode code() {
return this.code;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], code.rawValue());
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Error{"
+ "__typename=" + __typename + ", "
+ "code=" + code
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Error) {
Error that = (Error) o;
return this.__typename.equals(that.__typename)
&& this.code.equals(that.code);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= code.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public Error map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String codeStr = reader.readString($responseFields[1]);
final BanUserFromChatRoomErrorCode code;
if (codeStr != null) {
code = BanUserFromChatRoomErrorCode.safeValueOf(codeStr);
} else {
code = null;
}
return new Error(__typename, code);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy