com.github.twitch4j.graphql.internal.FetchBanStatusQuery 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.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 FetchBanStatusQuery implements Query {
public static final String OPERATION_ID = "e7f8e40997fcc15a9697d72c99d845583461f9805dc5102595167c15eaa8741c";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"query fetchBanStatus($channelID: ID!, $userID: ID!) {\n"
+ " chatRoomBanStatus(channelID: $channelID, userID: $userID) {\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"
+ "}"
);
public static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "fetchBanStatus";
}
};
private final FetchBanStatusQuery.Variables variables;
public FetchBanStatusQuery(@NotNull String channelID, @NotNull String userID) {
Utils.checkNotNull(channelID, "channelID == null");
Utils.checkNotNull(userID, "userID == null");
variables = new FetchBanStatusQuery.Variables(channelID, userID);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public FetchBanStatusQuery.Data wrapData(FetchBanStatusQuery.Data data) {
return data;
}
@Override
public FetchBanStatusQuery.Variables variables() {
return variables;
}
@Override
public ResponseFieldMapper responseFieldMapper() {
return new Data.Mapper();
}
public static Builder builder() {
return new Builder();
}
@Override
public OperationName name() {
return OPERATION_NAME;
}
@Override
@NotNull
public Response parse(@NotNull final BufferedSource source,
@NotNull final ScalarTypeAdapters scalarTypeAdapters) throws IOException {
return SimpleOperationResponseParser.parse(source, this, scalarTypeAdapters);
}
@Override
@NotNull
public Response parse(@NotNull final ByteString byteString,
@NotNull final ScalarTypeAdapters scalarTypeAdapters) throws IOException {
return parse(new Buffer().write(byteString), scalarTypeAdapters);
}
@Override
@NotNull
public Response parse(@NotNull final BufferedSource source) throws
IOException {
return parse(source, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public Response parse(@NotNull final ByteString byteString) throws
IOException {
return parse(byteString, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public ByteString composeRequestBody(@NotNull final ScalarTypeAdapters scalarTypeAdapters) {
return OperationRequestBodyComposer.compose(this, false, true, scalarTypeAdapters);
}
@NotNull
@Override
public ByteString composeRequestBody() {
return OperationRequestBodyComposer.compose(this, false, true, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public ByteString composeRequestBody(final boolean autoPersistQueries,
final boolean withQueryDocument, @NotNull final ScalarTypeAdapters scalarTypeAdapters) {
return OperationRequestBodyComposer.compose(this, autoPersistQueries, withQueryDocument, scalarTypeAdapters);
}
public static final class Builder {
private @NotNull String channelID;
private @NotNull String userID;
Builder() {
}
public Builder channelID(@NotNull String channelID) {
this.channelID = channelID;
return this;
}
public Builder userID(@NotNull String userID) {
this.userID = userID;
return this;
}
public FetchBanStatusQuery build() {
Utils.checkNotNull(channelID, "channelID == null");
Utils.checkNotNull(userID, "userID == null");
return new FetchBanStatusQuery(channelID, userID);
}
}
public static final class Variables extends Operation.Variables {
private final @NotNull String channelID;
private final @NotNull String userID;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(@NotNull String channelID, @NotNull String userID) {
this.channelID = channelID;
this.userID = userID;
this.valueMap.put("channelID", channelID);
this.valueMap.put("userID", userID);
}
public @NotNull String channelID() {
return channelID;
}
public @NotNull String userID() {
return userID;
}
@Override
public Map valueMap() {
return Collections.unmodifiableMap(valueMap);
}
@Override
public InputFieldMarshaller marshaller() {
return new InputFieldMarshaller() {
@Override
public void marshal(InputFieldWriter writer) throws IOException {
writer.writeCustom("channelID", com.github.twitch4j.graphql.internal.type.CustomType.ID, channelID);
writer.writeCustom("userID", com.github.twitch4j.graphql.internal.type.CustomType.ID, userID);
}
};
}
}
/**
* Data from the response after executing this GraphQL operation
*/
public static class Data implements Operation.Data {
static final ResponseField[] $responseFields = {
ResponseField.forObject("chatRoomBanStatus", "chatRoomBanStatus", new UnmodifiableMapBuilder(2)
.put("channelID", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "channelID")
.build())
.put("userID", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "userID")
.build())
.build(), true, Collections.emptyList())
};
final @Nullable ChatRoomBanStatus chatRoomBanStatus;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Data(@Nullable ChatRoomBanStatus chatRoomBanStatus) {
this.chatRoomBanStatus = chatRoomBanStatus;
}
/**
* Get the ban status of a usser with respect to a channel's chat room.
*/
public @Nullable ChatRoomBanStatus chatRoomBanStatus() {
return this.chatRoomBanStatus;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeObject($responseFields[0], chatRoomBanStatus != null ? chatRoomBanStatus.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "chatRoomBanStatus=" + chatRoomBanStatus
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return ((this.chatRoomBanStatus == null) ? (that.chatRoomBanStatus == null) : this.chatRoomBanStatus.equals(that.chatRoomBanStatus));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (chatRoomBanStatus == null) ? 0 : chatRoomBanStatus.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final ChatRoomBanStatus.Mapper chatRoomBanStatusFieldMapper = new ChatRoomBanStatus.Mapper();
@Override
public Data map(ResponseReader reader) {
final ChatRoomBanStatus chatRoomBanStatus = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
@Override
public ChatRoomBanStatus read(ResponseReader reader) {
return chatRoomBanStatusFieldMapper.map(reader);
}
});
return new Data(chatRoomBanStatus);
}
}
}
public static class ChatRoomBanStatus {
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 ChatRoomBanStatus(@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 = "ChatRoomBanStatus{"
+ "__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 ChatRoomBanStatus) {
ChatRoomBanStatus that = (ChatRoomBanStatus) 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 ChatRoomBanStatus 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 ChatRoomBanStatus(__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);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy