All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.example.graphql.client.schema.AlterTableDropMutation Maven / Gradle / Ivy

There is a newer version: 2.1.0-BETA-19
Show 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.example.graphql.client.schema;

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 java.io.IOException;
import java.lang.Boolean;
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 java.util.Optional;
import okio.Buffer;
import okio.BufferedSource;
import okio.ByteString;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public final class AlterTableDropMutation implements Mutation, AlterTableDropMutation.Variables> {
  public static final String OPERATION_ID = "e8c427f6f18830d038117b6aea996da28a29d60697c9c8fb6c8b4b498b14222b";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "mutation AlterTableDrop($keyspaceName: String!, $tableName: String!, $toDrop: [String]!) {\n"
        + "  alterTableDrop(keyspaceName: $keyspaceName, tableName: $tableName, toDrop: $toDrop)\n"
        + "}"
  );

  public static final OperationName OPERATION_NAME = new OperationName() {
    @Override
    public String name() {
      return "AlterTableDrop";
    }
  };

  private final AlterTableDropMutation.Variables variables;

  public AlterTableDropMutation(@NotNull String keyspaceName, @NotNull String tableName,
      @NotNull List toDrop) {
    Utils.checkNotNull(keyspaceName, "keyspaceName == null");
    Utils.checkNotNull(tableName, "tableName == null");
    Utils.checkNotNull(toDrop, "toDrop == null");
    variables = new AlterTableDropMutation.Variables(keyspaceName, tableName, toDrop);
  }

  @Override
  public String operationId() {
    return OPERATION_ID;
  }

  @Override
  public String queryDocument() {
    return QUERY_DOCUMENT;
  }

  @Override
  public Optional wrapData(AlterTableDropMutation.Data data) {
    return Optional.ofNullable(data);
  }

  @Override
  public AlterTableDropMutation.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 keyspaceName;

    private @NotNull String tableName;

    private @NotNull List toDrop;

    Builder() {
    }

    public Builder keyspaceName(@NotNull String keyspaceName) {
      this.keyspaceName = keyspaceName;
      return this;
    }

    public Builder tableName(@NotNull String tableName) {
      this.tableName = tableName;
      return this;
    }

    public Builder toDrop(@NotNull List toDrop) {
      this.toDrop = toDrop;
      return this;
    }

    public AlterTableDropMutation build() {
      Utils.checkNotNull(keyspaceName, "keyspaceName == null");
      Utils.checkNotNull(tableName, "tableName == null");
      Utils.checkNotNull(toDrop, "toDrop == null");
      return new AlterTableDropMutation(keyspaceName, tableName, toDrop);
    }
  }

  public static final class Variables extends Operation.Variables {
    private final @NotNull String keyspaceName;

    private final @NotNull String tableName;

    private final @NotNull List toDrop;

    private final transient Map valueMap = new LinkedHashMap<>();

    Variables(@NotNull String keyspaceName, @NotNull String tableName,
        @NotNull List toDrop) {
      this.keyspaceName = keyspaceName;
      this.tableName = tableName;
      this.toDrop = toDrop;
      this.valueMap.put("keyspaceName", keyspaceName);
      this.valueMap.put("tableName", tableName);
      this.valueMap.put("toDrop", toDrop);
    }

    public @NotNull String keyspaceName() {
      return keyspaceName;
    }

    public @NotNull String tableName() {
      return tableName;
    }

    public @NotNull List toDrop() {
      return toDrop;
    }

    @Override
    public Map valueMap() {
      return Collections.unmodifiableMap(valueMap);
    }

    @Override
    public InputFieldMarshaller marshaller() {
      return new InputFieldMarshaller() {
        @Override
        public void marshal(InputFieldWriter writer) throws IOException {
          writer.writeString("keyspaceName", keyspaceName);
          writer.writeString("tableName", tableName);
          writer.writeList("toDrop", new InputFieldWriter.ListWriter() {
            @Override
            public void write(InputFieldWriter.ListItemWriter listItemWriter) throws IOException {
              for (final String $item : toDrop) {
                listItemWriter.writeString($item);
              }
            }
          });
        }
      };
    }
  }

  /**
   * Data from the response after executing this GraphQL operation
   */
  public static class Data implements Operation.Data {
    static final ResponseField[] $responseFields = {
      ResponseField.forBoolean("alterTableDrop", "alterTableDrop", new UnmodifiableMapBuilder(3)
      .put("keyspaceName", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "keyspaceName")
        .build())
      .put("tableName", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "tableName")
        .build())
      .put("toDrop", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "toDrop")
        .build())
      .build(), true, Collections.emptyList())
    };

    final Optional alterTableDrop;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Data(@Nullable Boolean alterTableDrop) {
      this.alterTableDrop = Optional.ofNullable(alterTableDrop);
    }

    public Optional getAlterTableDrop() {
      return this.alterTableDrop;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeBoolean($responseFields[0], alterTableDrop.isPresent() ? alterTableDrop.get() : null);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Data{"
          + "alterTableDrop=" + alterTableDrop
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Data) {
        Data that = (Data) o;
        return this.alterTableDrop.equals(that.alterTableDrop);
      }
      return false;
    }

    @Override
    public int hashCode() {
      if (!$hashCodeMemoized) {
        int h = 1;
        h *= 1000003;
        h ^= alterTableDrop.hashCode();
        $hashCode = h;
        $hashCodeMemoized = true;
      }
      return $hashCode;
    }

    public Builder toBuilder() {
      Builder builder = new Builder();
      builder.alterTableDrop = alterTableDrop.isPresent() ? alterTableDrop.get() : null;
      return builder;
    }

    public static Builder builder() {
      return new Builder();
    }

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Data map(ResponseReader reader) {
        final Boolean alterTableDrop = reader.readBoolean($responseFields[0]);
        return new Data(alterTableDrop);
      }
    }

    public static final class Builder {
      private @Nullable Boolean alterTableDrop;

      Builder() {
      }

      public Builder alterTableDrop(@Nullable Boolean alterTableDrop) {
        this.alterTableDrop = alterTableDrop;
        return this;
      }

      public Data build() {
        return new Data(alterTableDrop);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy