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

com.expediagroup.streamplatform.streamregistry.state.graphql.ProducerSpecificationMutation 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.expediagroup.streamplatform.streamregistry.state.graphql;

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.Mutator;
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.expediagroup.streamplatform.streamregistry.state.graphql.type.ProducerKeyInput;
import com.expediagroup.streamplatform.streamregistry.state.graphql.type.SpecificationInput;
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 java.util.Optional;
import okio.Buffer;
import okio.BufferedSource;
import okio.ByteString;
import org.jetbrains.annotations.NotNull;

public final class ProducerSpecificationMutation implements Mutation, ProducerSpecificationMutation.Variables> {
  public static final String OPERATION_ID = "7aeb497de2716496c526a7d3269397ffbcdef75e1d68d625260a8c11ae9eeae4";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "mutation ProducerSpecification($key: ProducerKeyInput!, $specification: SpecificationInput!) {\n"
        + "  producer {\n"
        + "    __typename\n"
        + "    upsert(key: $key, specification: $specification) {\n"
        + "      __typename\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

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

  private final ProducerSpecificationMutation.Variables variables;

  public ProducerSpecificationMutation(@NotNull ProducerKeyInput key,
      @NotNull SpecificationInput specification) {
    Utils.checkNotNull(key, "key == null");
    Utils.checkNotNull(specification, "specification == null");
    variables = new ProducerSpecificationMutation.Variables(key, specification);
  }

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

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

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

  @Override
  public ProducerSpecificationMutation.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 ProducerKeyInput key;

    private @NotNull SpecificationInput specification;

    Builder() {
    }

    public Builder key(@NotNull ProducerKeyInput key) {
      this.key = key;
      return this;
    }

    public Builder specification(@NotNull SpecificationInput specification) {
      this.specification = specification;
      return this;
    }

    public ProducerSpecificationMutation build() {
      Utils.checkNotNull(key, "key == null");
      Utils.checkNotNull(specification, "specification == null");
      return new ProducerSpecificationMutation(key, specification);
    }
  }

  public static final class Variables extends Operation.Variables {
    private final @NotNull ProducerKeyInput key;

    private final @NotNull SpecificationInput specification;

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

    Variables(@NotNull ProducerKeyInput key, @NotNull SpecificationInput specification) {
      this.key = key;
      this.specification = specification;
      this.valueMap.put("key", key);
      this.valueMap.put("specification", specification);
    }

    public @NotNull ProducerKeyInput key() {
      return key;
    }

    public @NotNull SpecificationInput specification() {
      return specification;
    }

    @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("key", key.marshaller());
          writer.writeObject("specification", specification.marshaller());
        }
      };
    }
  }

  /**
   * Data from the response after executing this GraphQL operation
   */
  public static class Data implements Operation.Data {
    static final ResponseField[] $responseFields = {
      ResponseField.forObject("producer", "producer", null, false, Collections.emptyList())
    };

    final @NotNull Producer producer;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Data(@NotNull Producer producer) {
      this.producer = Utils.checkNotNull(producer, "producer == null");
    }

    public @NotNull Producer getProducer() {
      return this.producer;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeObject($responseFields[0], producer.marshaller());
        }
      };
    }

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

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

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

    public Builder toBuilder() {
      Builder builder = new Builder();
      builder.producer = producer;
      return builder;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final Producer.Mapper producerFieldMapper = new Producer.Mapper();

      @Override
      public Data map(ResponseReader reader) {
        final Producer producer = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
          @Override
          public Producer read(ResponseReader reader) {
            return producerFieldMapper.map(reader);
          }
        });
        return new Data(producer);
      }
    }

    public static final class Builder {
      private @NotNull Producer producer;

      Builder() {
      }

      public Builder producer(@NotNull Producer producer) {
        this.producer = producer;
        return this;
      }

      public Builder producer(@NotNull Mutator mutator) {
        Utils.checkNotNull(mutator, "mutator == null");
        Producer.Builder builder = this.producer != null ? this.producer.toBuilder() : Producer.builder();
        mutator.accept(builder);
        this.producer = builder.build();
        return this;
      }

      public Data build() {
        Utils.checkNotNull(producer, "producer == null");
        return new Data(producer);
      }
    }
  }

  public static class Producer {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("upsert", "upsert", new UnmodifiableMapBuilder(2)
      .put("key", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "key")
        .build())
      .put("specification", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "specification")
        .build())
      .build(), false, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Upsert upsert;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Producer(@NotNull String __typename, @NotNull Upsert upsert) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.upsert = Utils.checkNotNull(upsert, "upsert == null");
    }

    public @NotNull String get__typename() {
      return this.__typename;
    }

    public @NotNull Upsert getUpsert() {
      return this.upsert;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeObject($responseFields[1], upsert.marshaller());
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Producer{"
          + "__typename=" + __typename + ", "
          + "upsert=" + upsert
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof Producer) {
        Producer that = (Producer) o;
        return this.__typename.equals(that.__typename)
         && this.upsert.equals(that.upsert);
      }
      return false;
    }

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

    public Builder toBuilder() {
      Builder builder = new Builder();
      builder.__typename = __typename;
      builder.upsert = upsert;
      return builder;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final Upsert.Mapper upsertFieldMapper = new Upsert.Mapper();

      @Override
      public Producer map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Upsert upsert = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public Upsert read(ResponseReader reader) {
            return upsertFieldMapper.map(reader);
          }
        });
        return new Producer(__typename, upsert);
      }
    }

    public static final class Builder {
      private @NotNull String __typename;

      private @NotNull Upsert upsert;

      Builder() {
      }

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

      public Builder upsert(@NotNull Upsert upsert) {
        this.upsert = upsert;
        return this;
      }

      public Builder upsert(@NotNull Mutator mutator) {
        Utils.checkNotNull(mutator, "mutator == null");
        Upsert.Builder builder = this.upsert != null ? this.upsert.toBuilder() : Upsert.builder();
        mutator.accept(builder);
        this.upsert = builder.build();
        return this;
      }

      public Producer build() {
        Utils.checkNotNull(__typename, "__typename == null");
        Utils.checkNotNull(upsert, "upsert == null");
        return new Producer(__typename, upsert);
      }
    }
  }

  public static class Upsert {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList())
    };

    final @NotNull String __typename;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Upsert(@NotNull String __typename) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
    }

    public @NotNull String get__typename() {
      return this.__typename;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
        }
      };
    }

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

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

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

    public Builder toBuilder() {
      Builder builder = new Builder();
      builder.__typename = __typename;
      return builder;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Upsert map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        return new Upsert(__typename);
      }
    }

    public static final class Builder {
      private @NotNull String __typename;

      Builder() {
      }

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

      public Upsert build() {
        Utils.checkNotNull(__typename, "__typename == null");
        return new Upsert(__typename);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy