com.github.twitch4j.graphql.internal.BulkApproveUnbanRequestMutation 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.BulkApproveUnbanRequestInput;
import com.github.twitch4j.graphql.internal.type.CustomType;
import com.github.twitch4j.graphql.internal.type.UnbanRequestErrorCode;
import com.github.twitch4j.graphql.internal.type.UnbanRequestStatus;
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.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 BulkApproveUnbanRequestMutation implements Mutation {
public static final String OPERATION_ID = "31103179e90f8eab610a17ba3637e497747db746fa26886e8fa4f98982c422b6";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"mutation bulkApproveUnbanRequest($input: BulkApproveUnbanRequestInput!) {\n"
+ " bulkApproveUnbanRequest(input: $input) {\n"
+ " __typename\n"
+ " error {\n"
+ " __typename\n"
+ " code\n"
+ " }\n"
+ " unbanRequests {\n"
+ " __typename\n"
+ " id\n"
+ " status\n"
+ " resolvedAt\n"
+ " }\n"
+ " }\n"
+ "}"
);
public static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "bulkApproveUnbanRequest";
}
};
private final BulkApproveUnbanRequestMutation.Variables variables;
public BulkApproveUnbanRequestMutation(@NotNull BulkApproveUnbanRequestInput input) {
Utils.checkNotNull(input, "input == null");
variables = new BulkApproveUnbanRequestMutation.Variables(input);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public BulkApproveUnbanRequestMutation.Data wrapData(BulkApproveUnbanRequestMutation.Data data) {
return data;
}
@Override
public BulkApproveUnbanRequestMutation.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 BulkApproveUnbanRequestInput input;
Builder() {
}
public Builder input(@NotNull BulkApproveUnbanRequestInput input) {
this.input = input;
return this;
}
public BulkApproveUnbanRequestMutation build() {
Utils.checkNotNull(input, "input == null");
return new BulkApproveUnbanRequestMutation(input);
}
}
public static final class Variables extends Operation.Variables {
private final @NotNull BulkApproveUnbanRequestInput input;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(@NotNull BulkApproveUnbanRequestInput input) {
this.input = input;
this.valueMap.put("input", input);
}
public @NotNull BulkApproveUnbanRequestInput 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("bulkApproveUnbanRequest", "bulkApproveUnbanRequest", new UnmodifiableMapBuilder(1)
.put("input", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "input")
.build())
.build(), true, Collections.emptyList())
};
final @Nullable BulkApproveUnbanRequest bulkApproveUnbanRequest;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Data(@Nullable BulkApproveUnbanRequest bulkApproveUnbanRequest) {
this.bulkApproveUnbanRequest = bulkApproveUnbanRequest;
}
/**
* Approve a list of unban requests on a channel.
*/
public @Nullable BulkApproveUnbanRequest bulkApproveUnbanRequest() {
return this.bulkApproveUnbanRequest;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeObject($responseFields[0], bulkApproveUnbanRequest != null ? bulkApproveUnbanRequest.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "bulkApproveUnbanRequest=" + bulkApproveUnbanRequest
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return ((this.bulkApproveUnbanRequest == null) ? (that.bulkApproveUnbanRequest == null) : this.bulkApproveUnbanRequest.equals(that.bulkApproveUnbanRequest));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (bulkApproveUnbanRequest == null) ? 0 : bulkApproveUnbanRequest.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final BulkApproveUnbanRequest.Mapper bulkApproveUnbanRequestFieldMapper = new BulkApproveUnbanRequest.Mapper();
@Override
public Data map(ResponseReader reader) {
final BulkApproveUnbanRequest bulkApproveUnbanRequest = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
@Override
public BulkApproveUnbanRequest read(ResponseReader reader) {
return bulkApproveUnbanRequestFieldMapper.map(reader);
}
});
return new Data(bulkApproveUnbanRequest);
}
}
}
/**
* Result of bulk approving unban requests.
*/
public static class BulkApproveUnbanRequest {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forObject("error", "error", null, true, Collections.emptyList()),
ResponseField.forList("unbanRequests", "unbanRequests", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @Nullable Error error;
final @Nullable List unbanRequests;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public BulkApproveUnbanRequest(@NotNull String __typename, @Nullable Error error,
@Nullable List unbanRequests) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.error = error;
this.unbanRequests = unbanRequests;
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* Used for errors arising from bulk approving unban requests.
*/
public @Nullable Error error() {
return this.error;
}
/**
* The approved unban requests.
*/
public @Nullable List unbanRequests() {
return this.unbanRequests;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeObject($responseFields[1], error != null ? error.marshaller() : null);
writer.writeList($responseFields[2], unbanRequests, new ResponseWriter.ListWriter() {
@Override
public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
for (Object item : items) {
listItemWriter.writeObject(((UnbanRequest) item).marshaller());
}
}
});
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "BulkApproveUnbanRequest{"
+ "__typename=" + __typename + ", "
+ "error=" + error + ", "
+ "unbanRequests=" + unbanRequests
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof BulkApproveUnbanRequest) {
BulkApproveUnbanRequest that = (BulkApproveUnbanRequest) o;
return this.__typename.equals(that.__typename)
&& ((this.error == null) ? (that.error == null) : this.error.equals(that.error))
&& ((this.unbanRequests == null) ? (that.unbanRequests == null) : this.unbanRequests.equals(that.unbanRequests));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= (error == null) ? 0 : error.hashCode();
h *= 1000003;
h ^= (unbanRequests == null) ? 0 : unbanRequests.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final Error.Mapper errorFieldMapper = new Error.Mapper();
final UnbanRequest.Mapper unbanRequestFieldMapper = new UnbanRequest.Mapper();
@Override
public BulkApproveUnbanRequest map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final Error error = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
@Override
public Error read(ResponseReader reader) {
return errorFieldMapper.map(reader);
}
});
final List unbanRequests = reader.readList($responseFields[2], new ResponseReader.ListReader() {
@Override
public UnbanRequest read(ResponseReader.ListItemReader listItemReader) {
return listItemReader.readObject(new ResponseReader.ObjectReader() {
@Override
public UnbanRequest read(ResponseReader reader) {
return unbanRequestFieldMapper.map(reader);
}
});
}
});
return new BulkApproveUnbanRequest(__typename, error, unbanRequests);
}
}
}
/**
* Error returned from an update mutation.
*/
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 UnbanRequestErrorCode code;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Error(@NotNull String __typename, @NotNull UnbanRequestErrorCode code) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.code = Utils.checkNotNull(code, "code == null");
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The error code returned from an update mutation.
*/
public @NotNull UnbanRequestErrorCode 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 UnbanRequestErrorCode code;
if (codeStr != null) {
code = UnbanRequestErrorCode.safeValueOf(codeStr);
} else {
code = null;
}
return new Error(__typename, code);
}
}
}
/**
* A request from a channel-banned user to the channel moderators to be unbanned
* from the channel.
*/
public static class UnbanRequest {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
ResponseField.forString("status", "status", null, false, Collections.emptyList()),
ResponseField.forCustomType("resolvedAt", "resolvedAt", null, true, CustomType.TIME, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String id;
final @NotNull UnbanRequestStatus status;
final @Nullable Object resolvedAt;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public UnbanRequest(@NotNull String __typename, @NotNull String id,
@NotNull UnbanRequestStatus status, @Nullable Object resolvedAt) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.id = Utils.checkNotNull(id, "id == null");
this.status = Utils.checkNotNull(status, "status == null");
this.resolvedAt = resolvedAt;
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* UUID of the Unban Request.
*/
public @NotNull String id() {
return this.id;
}
/**
* The status of the unban request.
*/
public @NotNull UnbanRequestStatus status() {
return this.status;
}
/**
* The time at which the unban request was resolved (approved or denied).
*/
public @Nullable Object resolvedAt() {
return this.resolvedAt;
}
@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], status.rawValue());
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[3], resolvedAt);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "UnbanRequest{"
+ "__typename=" + __typename + ", "
+ "id=" + id + ", "
+ "status=" + status + ", "
+ "resolvedAt=" + resolvedAt
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof UnbanRequest) {
UnbanRequest that = (UnbanRequest) o;
return this.__typename.equals(that.__typename)
&& this.id.equals(that.id)
&& this.status.equals(that.status)
&& ((this.resolvedAt == null) ? (that.resolvedAt == null) : this.resolvedAt.equals(that.resolvedAt));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= id.hashCode();
h *= 1000003;
h ^= status.hashCode();
h *= 1000003;
h ^= (resolvedAt == null) ? 0 : resolvedAt.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public UnbanRequest map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
final String statusStr = reader.readString($responseFields[2]);
final UnbanRequestStatus status;
if (statusStr != null) {
status = UnbanRequestStatus.safeValueOf(statusStr);
} else {
status = null;
}
final Object resolvedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[3]);
return new UnbanRequest(__typename, id, status, resolvedAt);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy