com.github.twitch4j.graphql.internal.UpdateCommunityPointsCustomRewardRedemptionStatusMutation Maven / Gradle / Ivy
// 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.CommunityPointsCustomRewardRedemptionStatus;
import com.github.twitch4j.graphql.internal.type.CustomType;
import com.github.twitch4j.graphql.internal.type.UpdateCommunityPointsCustomRewardRedemptionStatusErrorCode;
import com.github.twitch4j.graphql.internal.type.UpdateCommunityPointsCustomRewardRedemptionStatusInput;
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 UpdateCommunityPointsCustomRewardRedemptionStatusMutation implements Mutation {
public static final String OPERATION_ID = "30ddfa0c8c41bfbffb68d389c655a3981a4ad99d6134d19fb121e7f368e81550";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"mutation updateCommunityPointsCustomRewardRedemptionStatus($input: UpdateCommunityPointsCustomRewardRedemptionStatusInput!) {\n"
+ " updateCommunityPointsCustomRewardRedemptionStatus(input: $input) {\n"
+ " __typename\n"
+ " error {\n"
+ " __typename\n"
+ " code\n"
+ " }\n"
+ " redemption {\n"
+ " __typename\n"
+ " id\n"
+ " input\n"
+ " status\n"
+ " rewardID\n"
+ " }\n"
+ " }\n"
+ "}"
);
public static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "updateCommunityPointsCustomRewardRedemptionStatus";
}
};
private final UpdateCommunityPointsCustomRewardRedemptionStatusMutation.Variables variables;
public UpdateCommunityPointsCustomRewardRedemptionStatusMutation(@NotNull UpdateCommunityPointsCustomRewardRedemptionStatusInput input) {
Utils.checkNotNull(input, "input == null");
variables = new UpdateCommunityPointsCustomRewardRedemptionStatusMutation.Variables(input);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public UpdateCommunityPointsCustomRewardRedemptionStatusMutation.Data wrapData(UpdateCommunityPointsCustomRewardRedemptionStatusMutation.Data data) {
return data;
}
@Override
public UpdateCommunityPointsCustomRewardRedemptionStatusMutation.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 UpdateCommunityPointsCustomRewardRedemptionStatusInput input;
Builder() {
}
public Builder input(@NotNull UpdateCommunityPointsCustomRewardRedemptionStatusInput input) {
this.input = input;
return this;
}
public UpdateCommunityPointsCustomRewardRedemptionStatusMutation build() {
Utils.checkNotNull(input, "input == null");
return new UpdateCommunityPointsCustomRewardRedemptionStatusMutation(input);
}
}
public static final class Variables extends Operation.Variables {
private final @NotNull UpdateCommunityPointsCustomRewardRedemptionStatusInput input;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(@NotNull UpdateCommunityPointsCustomRewardRedemptionStatusInput input) {
this.input = input;
this.valueMap.put("input", input);
}
public @NotNull UpdateCommunityPointsCustomRewardRedemptionStatusInput 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("updateCommunityPointsCustomRewardRedemptionStatus", "updateCommunityPointsCustomRewardRedemptionStatus", new UnmodifiableMapBuilder(1)
.put("input", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "input")
.build())
.build(), true, Collections.emptyList())
};
final @Nullable UpdateCommunityPointsCustomRewardRedemptionStatus updateCommunityPointsCustomRewardRedemptionStatus;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Data(@Nullable UpdateCommunityPointsCustomRewardRedemptionStatus updateCommunityPointsCustomRewardRedemptionStatus) {
this.updateCommunityPointsCustomRewardRedemptionStatus = updateCommunityPointsCustomRewardRedemptionStatus;
}
/**
* Update the status of a Community Points redemption (for example, from unfulfilled to fulfilled).
*/
public @Nullable UpdateCommunityPointsCustomRewardRedemptionStatus updateCommunityPointsCustomRewardRedemptionStatus() {
return this.updateCommunityPointsCustomRewardRedemptionStatus;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeObject($responseFields[0], updateCommunityPointsCustomRewardRedemptionStatus != null ? updateCommunityPointsCustomRewardRedemptionStatus.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "updateCommunityPointsCustomRewardRedemptionStatus=" + updateCommunityPointsCustomRewardRedemptionStatus
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return ((this.updateCommunityPointsCustomRewardRedemptionStatus == null) ? (that.updateCommunityPointsCustomRewardRedemptionStatus == null) : this.updateCommunityPointsCustomRewardRedemptionStatus.equals(that.updateCommunityPointsCustomRewardRedemptionStatus));
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= (updateCommunityPointsCustomRewardRedemptionStatus == null) ? 0 : updateCommunityPointsCustomRewardRedemptionStatus.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final UpdateCommunityPointsCustomRewardRedemptionStatus.Mapper updateCommunityPointsCustomRewardRedemptionStatusFieldMapper = new UpdateCommunityPointsCustomRewardRedemptionStatus.Mapper();
@Override
public Data map(ResponseReader reader) {
final UpdateCommunityPointsCustomRewardRedemptionStatus updateCommunityPointsCustomRewardRedemptionStatus = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
@Override
public UpdateCommunityPointsCustomRewardRedemptionStatus read(ResponseReader reader) {
return updateCommunityPointsCustomRewardRedemptionStatusFieldMapper.map(reader);
}
});
return new Data(updateCommunityPointsCustomRewardRedemptionStatus);
}
}
}
/**
* The response from acting on a Community Points redemption.
*/
public static class UpdateCommunityPointsCustomRewardRedemptionStatus {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forObject("error", "error", null, true, Collections.emptyList()),
ResponseField.forObject("redemption", "redemption", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @Nullable Error error;
final @Nullable Redemption redemption;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public UpdateCommunityPointsCustomRewardRedemptionStatus(@NotNull String __typename,
@Nullable Error error, @Nullable Redemption redemption) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.error = error;
this.redemption = redemption;
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* An error that occurred while updating the redemption status.
*/
public @Nullable Error error() {
return this.error;
}
/**
* The updated redemption.
*/
public @Nullable Redemption redemption() {
return this.redemption;
}
@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.writeObject($responseFields[2], redemption != null ? redemption.marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "UpdateCommunityPointsCustomRewardRedemptionStatus{"
+ "__typename=" + __typename + ", "
+ "error=" + error + ", "
+ "redemption=" + redemption
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof UpdateCommunityPointsCustomRewardRedemptionStatus) {
UpdateCommunityPointsCustomRewardRedemptionStatus that = (UpdateCommunityPointsCustomRewardRedemptionStatus) o;
return this.__typename.equals(that.__typename)
&& ((this.error == null) ? (that.error == null) : this.error.equals(that.error))
&& ((this.redemption == null) ? (that.redemption == null) : this.redemption.equals(that.redemption));
}
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 ^= (redemption == null) ? 0 : redemption.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
final Error.Mapper errorFieldMapper = new Error.Mapper();
final Redemption.Mapper redemptionFieldMapper = new Redemption.Mapper();
@Override
public UpdateCommunityPointsCustomRewardRedemptionStatus 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 Redemption redemption = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
@Override
public Redemption read(ResponseReader reader) {
return redemptionFieldMapper.map(reader);
}
});
return new UpdateCommunityPointsCustomRewardRedemptionStatus(__typename, error, redemption);
}
}
}
/**
* An error from acting on a Community Points redemption.
*/
public static class Error {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forString("code", "code", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @Nullable UpdateCommunityPointsCustomRewardRedemptionStatusErrorCode code;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Error(@NotNull String __typename,
@Nullable UpdateCommunityPointsCustomRewardRedemptionStatusErrorCode code) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.code = code;
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* An identifier for the error that occurred.
*/
public @Nullable UpdateCommunityPointsCustomRewardRedemptionStatusErrorCode 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 != null ? code.rawValue() : null);
}
};
}
@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 == null) ? (that.code == null) : 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 == null) ? 0 : 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 UpdateCommunityPointsCustomRewardRedemptionStatusErrorCode code;
if (codeStr != null) {
code = UpdateCommunityPointsCustomRewardRedemptionStatusErrorCode.safeValueOf(codeStr);
} else {
code = null;
}
return new Error(__typename, code);
}
}
}
/**
* A community points custom reward that has been redeemed in a channel.
*/
public static class Redemption {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.emptyList()),
ResponseField.forString("input", "input", null, true, Collections.emptyList()),
ResponseField.forString("status", "status", null, false, Collections.emptyList()),
ResponseField.forCustomType("rewardID", "rewardID", null, false, CustomType.ID, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String id;
final @Nullable String input;
final @NotNull CommunityPointsCustomRewardRedemptionStatus status;
final @NotNull String rewardID;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Redemption(@NotNull String __typename, @NotNull String id, @Nullable String input,
@NotNull CommunityPointsCustomRewardRedemptionStatus status, @NotNull String rewardID) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.id = Utils.checkNotNull(id, "id == null");
this.input = input;
this.status = Utils.checkNotNull(status, "status == null");
this.rewardID = Utils.checkNotNull(rewardID, "rewardID == null");
}
public @NotNull String __typename() {
return this.__typename;
}
/**
* The unique ID of this redemption.
*/
public @NotNull String id() {
return this.id;
}
/**
* The user-provided text input, if it exists.
*/
public @Nullable String input() {
return this.input;
}
/**
* The status of this redemption.
*/
public @NotNull CommunityPointsCustomRewardRedemptionStatus status() {
return this.status;
}
/**
* The unique ID of the reward that was redeemed.
*/
public @NotNull String rewardID() {
return this.rewardID;
}
@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], input);
writer.writeString($responseFields[3], status.rawValue());
writer.writeCustom((ResponseField.CustomTypeField) $responseFields[4], rewardID);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Redemption{"
+ "__typename=" + __typename + ", "
+ "id=" + id + ", "
+ "input=" + input + ", "
+ "status=" + status + ", "
+ "rewardID=" + rewardID
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Redemption) {
Redemption that = (Redemption) o;
return this.__typename.equals(that.__typename)
&& this.id.equals(that.id)
&& ((this.input == null) ? (that.input == null) : this.input.equals(that.input))
&& this.status.equals(that.status)
&& this.rewardID.equals(that.rewardID);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= id.hashCode();
h *= 1000003;
h ^= (input == null) ? 0 : input.hashCode();
h *= 1000003;
h ^= status.hashCode();
h *= 1000003;
h ^= rewardID.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public Redemption map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
final String input = reader.readString($responseFields[2]);
final String statusStr = reader.readString($responseFields[3]);
final CommunityPointsCustomRewardRedemptionStatus status;
if (statusStr != null) {
status = CommunityPointsCustomRewardRedemptionStatus.safeValueOf(statusStr);
} else {
status = null;
}
final String rewardID = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[4]);
return new Redemption(__typename, id, input, status, rewardID);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy