com.github.twitch4j.graphql.internal.DeleteChannelPermittedTermMutation 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.CustomType;
import com.github.twitch4j.graphql.internal.type.DeleteChannelPermittedTermErrorCode;
import com.github.twitch4j.graphql.internal.type.DeleteChannelPermittedTermInput;
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 DeleteChannelPermittedTermMutation implements Mutation {
public static final String OPERATION_ID = "2c117cffc017acc298b7c275a3e23095c7349e9a9819270f47700ef75ddfe481";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"mutation deleteChannelPermittedTerm($input: DeleteChannelPermittedTermInput!) {\n"
+ " deleteChannelPermittedTerm(input: $input) {\n"
+ " __typename\n"
+ " deletedAt\n"
+ " error {\n"
+ " __typename\n"
+ " code\n"
+ " }\n"
+ " phrases\n"
+ " }\n"
+ "}"
);
public static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "deleteChannelPermittedTerm";
}
};
private final DeleteChannelPermittedTermMutation.Variables variables;
public DeleteChannelPermittedTermMutation(@NotNull DeleteChannelPermittedTermInput input) {
Utils.checkNotNull(input, "input == null");
variables = new DeleteChannelPermittedTermMutation.Variables(input);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public DeleteChannelPermittedTermMutation.Data wrapData(DeleteChannelPermittedTermMutation.Data data) {
return data;
}
@Override
public DeleteChannelPermittedTermMutation.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 DeleteChannelPermittedTermInput input;
Builder() {
}
public Builder input(@NotNull DeleteChannelPermittedTermInput input) {
this.input = input;
return this;
}
public DeleteChannelPermittedTermMutation build() {
Utils.checkNotNull(input, "input == null");
return new DeleteChannelPermittedTermMutation(input);
}
}
public static final class Variables extends Operation.Variables {
private final @NotNull DeleteChannelPermittedTermInput input;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(@NotNull DeleteChannelPermittedTermInput input) {
this.input = input;
this.valueMap.put("input", input);
}
public @NotNull DeleteChannelPermittedTermInput 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("deleteChannelPermittedTerm", "deleteChannelPermittedTerm", new UnmodifiableMapBuilder(1)
.put("input", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "input")
.build())
.build(), true, Collections.emptyList())
};
final @Nullable DeleteChannelPermittedTerm deleteChannelPermittedTerm;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Data(@Nullable DeleteChannelPermittedTerm deleteChannelPermittedTerm) {
this.deleteChannelPermittedTerm = deleteChannelPermittedTerm;
}
/**
* Deletes a permitted term from a channel.
*/
public @Nullable DeleteChannelPermittedTerm deleteChannelPermittedTerm() {
return this.deleteChannelPermittedTerm;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeObject($responseFields[0], deleteChannelPermittedTerm != null ? deleteChannelPermittedTerm.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "deleteChannelPermittedTerm=" + deleteChannelPermittedTerm
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return ((this.deleteChannelPermittedTerm == null) ? (that.deleteChannelPermittedTerm == null) : this.deleteChannelPermittedTerm.equals(that.deleteChannelPermittedTerm));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (deleteChannelPermittedTerm == null) ? 0 : deleteChannelPermittedTerm.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final DeleteChannelPermittedTerm.Mapper deleteChannelPermittedTermFieldMapper = new DeleteChannelPermittedTerm.Mapper();
@Override
public Data map(ResponseReader reader) {
final DeleteChannelPermittedTerm deleteChannelPermittedTerm = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
@Override
public DeleteChannelPermittedTerm read(ResponseReader reader) {
return deleteChannelPermittedTermFieldMapper.map(reader);
}
});
return new Data(deleteChannelPermittedTerm);
}
}
}
/**
* Returned payload of the mutation.
*/
public static class DeleteChannelPermittedTerm {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forCustomType("deletedAt", "deletedAt", null, true, CustomType.TIME, Collections.emptyList()),
ResponseField.forObject("error", "error", null, true, Collections.emptyList()),
ResponseField.forList("phrases", "phrases", null, false, Collections.emptyList())
};
final @NotNull String __typename;
final @Nullable Object deletedAt;
final @Nullable Error error;
final @NotNull List phrases;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public DeleteChannelPermittedTerm(@NotNull String __typename, @Nullable Object deletedAt,
@Nullable Error error, @NotNull List phrases) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.deletedAt = deletedAt;
this.error = error;
this.phrases = Utils.checkNotNull(phrases, "phrases == null");
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The time term was deleted.
*/
public @Nullable Object deletedAt() {
return this.deletedAt;
}
/**
* Mutation error caused by the user input.
*/
public @Nullable Error error() {
return this.error;
}
/**
* The phrases that were deleted.
*/
public @NotNull List phrases() {
return this.phrases;
}
@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], deletedAt);
writer.writeObject($responseFields[2], error != null ? error.marshaller() : null);
writer.writeList($responseFields[3], phrases, new ResponseWriter.ListWriter() {
@Override
public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
for (Object item : items) {
listItemWriter.writeString((String) item);
}
}
});
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "DeleteChannelPermittedTerm{"
+ "__typename=" + __typename + ", "
+ "deletedAt=" + deletedAt + ", "
+ "error=" + error + ", "
+ "phrases=" + phrases
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof DeleteChannelPermittedTerm) {
DeleteChannelPermittedTerm that = (DeleteChannelPermittedTerm) o;
return this.__typename.equals(that.__typename)
&& ((this.deletedAt == null) ? (that.deletedAt == null) : this.deletedAt.equals(that.deletedAt))
&& ((this.error == null) ? (that.error == null) : this.error.equals(that.error))
&& this.phrases.equals(that.phrases);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= (deletedAt == null) ? 0 : deletedAt.hashCode();
h *= 1000003;
h ^= (error == null) ? 0 : error.hashCode();
h *= 1000003;
h ^= phrases.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final Error.Mapper errorFieldMapper = new Error.Mapper();
@Override
public DeleteChannelPermittedTerm map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final Object deletedAt = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
final Error error = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
@Override
public Error read(ResponseReader reader) {
return errorFieldMapper.map(reader);
}
});
final List phrases = reader.readList($responseFields[3], new ResponseReader.ListReader() {
@Override
public String read(ResponseReader.ListItemReader listItemReader) {
return listItemReader.readString();
}
});
return new DeleteChannelPermittedTerm(__typename, deletedAt, error, phrases);
}
}
}
/**
* The errors returned from this 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 DeleteChannelPermittedTermErrorCode code;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Error(@NotNull String __typename, @NotNull DeleteChannelPermittedTermErrorCode code) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.code = Utils.checkNotNull(code, "code == null");
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* Error code that was returned.
*/
public @NotNull DeleteChannelPermittedTermErrorCode 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 DeleteChannelPermittedTermErrorCode code;
if (codeStr != null) {
code = DeleteChannelPermittedTermErrorCode.safeValueOf(codeStr);
} else {
code = null;
}
return new Error(__typename, code);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy