com.github.twitch4j.graphql.internal.DeleteClipsMutation 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.DeleteClipsInput;
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 DeleteClipsMutation implements Mutation {
public static final String OPERATION_ID = "9c48a68bfa375bc83af7caddc8c6d61441ba4b5f484fc5934dc53df50d7e5a40";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"mutation deleteClips($deleteClipsInput: DeleteClipsInput!) {\n"
+ " deleteClips(input: $deleteClipsInput) {\n"
+ " __typename\n"
+ " clips {\n"
+ " __typename\n"
+ " id\n"
+ " slug\n"
+ " }\n"
+ " count\n"
+ " }\n"
+ "}"
);
public static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "deleteClips";
}
};
private final DeleteClipsMutation.Variables variables;
public DeleteClipsMutation(@NotNull DeleteClipsInput deleteClipsInput) {
Utils.checkNotNull(deleteClipsInput, "deleteClipsInput == null");
variables = new DeleteClipsMutation.Variables(deleteClipsInput);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public DeleteClipsMutation.Data wrapData(DeleteClipsMutation.Data data) {
return data;
}
@Override
public DeleteClipsMutation.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 DeleteClipsInput deleteClipsInput;
Builder() {
}
public Builder deleteClipsInput(@NotNull DeleteClipsInput deleteClipsInput) {
this.deleteClipsInput = deleteClipsInput;
return this;
}
public DeleteClipsMutation build() {
Utils.checkNotNull(deleteClipsInput, "deleteClipsInput == null");
return new DeleteClipsMutation(deleteClipsInput);
}
}
public static final class Variables extends Operation.Variables {
private final @NotNull DeleteClipsInput deleteClipsInput;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(@NotNull DeleteClipsInput deleteClipsInput) {
this.deleteClipsInput = deleteClipsInput;
this.valueMap.put("deleteClipsInput", deleteClipsInput);
}
public @NotNull DeleteClipsInput deleteClipsInput() {
return deleteClipsInput;
}
@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("deleteClipsInput", deleteClipsInput.marshaller());
}
};
}
}
/**
* Data from the response after executing this GraphQL operation
*/
public static class Data implements Operation.Data {
static final ResponseField[] $responseFields = {
ResponseField.forObject("deleteClips", "deleteClips", new UnmodifiableMapBuilder(1)
.put("input", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "deleteClipsInput")
.build())
.build(), true, Collections.emptyList())
};
final @Nullable DeleteClips deleteClips;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Data(@Nullable DeleteClips deleteClips) {
this.deleteClips = deleteClips;
}
/**
* deleteClips allows a user to delete clips by slugs, video id, or broadcast id.
* Only the slug and id can be accessed from the list of deleted clips.
*/
public @Nullable DeleteClips deleteClips() {
return this.deleteClips;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeObject($responseFields[0], deleteClips != null ? deleteClips.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "deleteClips=" + deleteClips
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return ((this.deleteClips == null) ? (that.deleteClips == null) : this.deleteClips.equals(that.deleteClips));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (deleteClips == null) ? 0 : deleteClips.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final DeleteClips.Mapper deleteClipsFieldMapper = new DeleteClips.Mapper();
@Override
public Data map(ResponseReader reader) {
final DeleteClips deleteClips = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
@Override
public DeleteClips read(ResponseReader reader) {
return deleteClipsFieldMapper.map(reader);
}
});
return new Data(deleteClips);
}
}
}
/**
* DeleteClipsPayload returns the deleted clips. Only the slug and id can be accessed
* from the returned list of deleted clips.
*/
public static class DeleteClips {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forList("clips", "clips", null, false, Collections.emptyList()),
ResponseField.forInt("count", "count", null, false, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull List clips;
final int count;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public DeleteClips(@NotNull String __typename, @NotNull List clips, int count) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.clips = Utils.checkNotNull(clips, "clips == null");
this.count = count;
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The clips that were deleted. Only Slug and ID can be accessed.
*/
public @NotNull List clips() {
return this.clips;
}
/**
* The amount of clips that were deleted.
*/
public int count() {
return this.count;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeList($responseFields[1], clips, new ResponseWriter.ListWriter() {
@Override
public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
for (Object item : items) {
listItemWriter.writeObject(((Clip) item).marshaller());
}
}
});
writer.writeInt($responseFields[2], count);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "DeleteClips{"
+ "__typename=" + __typename + ", "
+ "clips=" + clips + ", "
+ "count=" + count
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof DeleteClips) {
DeleteClips that = (DeleteClips) o;
return this.__typename.equals(that.__typename)
&& this.clips.equals(that.clips)
&& this.count == that.count;
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= clips.hashCode();
h *= 1000003;
h ^= count;
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final Clip.Mapper clipFieldMapper = new Clip.Mapper();
@Override
public DeleteClips map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final List clips = reader.readList($responseFields[1], new ResponseReader.ListReader() {
@Override
public Clip read(ResponseReader.ListItemReader listItemReader) {
return listItemReader.readObject(new ResponseReader.ObjectReader() {
@Override
public Clip read(ResponseReader reader) {
return clipFieldMapper.map(reader);
}
});
}
});
final int count = reader.readInt($responseFields[2]);
return new DeleteClips(__typename, clips, count);
}
}
}
/**
* A recorded, replayable part of a live broadcast.
*/
public static class Clip {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
ResponseField.forString("slug", "slug", null, false, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String id;
final @NotNull String slug;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Clip(@NotNull String __typename, @NotNull String id, @NotNull String slug) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.id = Utils.checkNotNull(id, "id == null");
this.slug = Utils.checkNotNull(slug, "slug == null");
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The clip's unique identifier.
*/
public @NotNull String id() {
return this.id;
}
/**
* A URL-friendly identifier.
*/
public @NotNull String slug() {
return this.slug;
}
@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], slug);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Clip{"
+ "__typename=" + __typename + ", "
+ "id=" + id + ", "
+ "slug=" + slug
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Clip) {
Clip that = (Clip) o;
return this.__typename.equals(that.__typename)
&& this.id.equals(that.id)
&& this.slug.equals(that.slug);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= id.hashCode();
h *= 1000003;
h ^= slug.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public Clip map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
final String slug = reader.readString($responseFields[2]);
return new Clip(__typename, id, slug);
}
}
}
}