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

com.example.graphql.client.betterbotz.udts.GetUdtsQuery 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.betterbotz.udts;

import com.apollographql.apollo.api.Input;
import com.apollographql.apollo.api.Operation;
import com.apollographql.apollo.api.OperationName;
import com.apollographql.apollo.api.Query;
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.example.graphql.client.betterbotz.type.UdtsInput;
import java.io.IOException;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
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 GetUdtsQuery implements Query, GetUdtsQuery.Variables> {
  public static final String OPERATION_ID = "990f92a7bf68279fd37b696cd50d44b0517238058f9ecd6c6e7a1d093cc269c8";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query GetUdts($value: UdtsInput) {\n"
        + "  Udts(value: $value) {\n"
        + "    __typename\n"
        + "    pageState\n"
        + "    values {\n"
        + "      __typename\n"
        + "      a {\n"
        + "        __typename\n"
        + "        b {\n"
        + "          __typename\n"
        + "          i\n"
        + "        }\n"
        + "      }\n"
        + "      bs {\n"
        + "        __typename\n"
        + "        i\n"
        + "      }\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

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

  private final GetUdtsQuery.Variables variables;

  public GetUdtsQuery(@NotNull Input value) {
    Utils.checkNotNull(value, "value == null");
    variables = new GetUdtsQuery.Variables(value);
  }

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

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

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

  @Override
  public GetUdtsQuery.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 Input value = Input.absent();

    Builder() {
    }

    public Builder value(@Nullable UdtsInput value) {
      this.value = Input.fromNullable(value);
      return this;
    }

    public Builder valueInput(@NotNull Input value) {
      this.value = Utils.checkNotNull(value, "value == null");
      return this;
    }

    public GetUdtsQuery build() {
      return new GetUdtsQuery(value);
    }
  }

  public static final class Variables extends Operation.Variables {
    private final Input value;

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

    Variables(Input value) {
      this.value = value;
      if (value.defined) {
        this.valueMap.put("value", value.value);
      }
    }

    public Input value() {
      return value;
    }

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

    @Override
    public InputFieldMarshaller marshaller() {
      return new InputFieldMarshaller() {
        @Override
        public void marshal(InputFieldWriter writer) throws IOException {
          if (value.defined) {
            writer.writeObject("value", value.value != null ? value.value.marshaller() : null);
          }
        }
      };
    }
  }

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

    final Optional Udts;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

    /**
     * Query for the table 'Udts'.
     * Note that 'a' is the field that corresponds to the table primary key.
     */
    public Optional getUdts() {
      return this.Udts;
    }

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

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

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Udts.Mapper udtsFieldMapper = new Udts.Mapper();

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

    public static final class Builder {
      private @Nullable Udts Udts;

      Builder() {
      }

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

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

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

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

    final @NotNull String __typename;

    final Optional pageState;

    final Optional> values;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Udts(@NotNull String __typename, @Nullable String pageState,
        @Nullable List values) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.pageState = Optional.ofNullable(pageState);
      this.values = Optional.ofNullable(values);
    }

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

    public Optional getPageState() {
      return this.pageState;
    }

    public Optional> getValues() {
      return this.values;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeString($responseFields[1], pageState.isPresent() ? pageState.get() : null);
          writer.writeList($responseFields[2], values.isPresent() ? values.get() : null, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((Value) item).marshaller());
              }
            }
          });
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Udts{"
          + "__typename=" + __typename + ", "
          + "pageState=" + pageState + ", "
          + "values=" + values
          + "}";
      }
      return $toString;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Value.Mapper valueFieldMapper = new Value.Mapper();

      @Override
      public Udts map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final String pageState = reader.readString($responseFields[1]);
        final List values = reader.readList($responseFields[2], new ResponseReader.ListReader() {
          @Override
          public Value read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Value read(ResponseReader reader) {
                return valueFieldMapper.map(reader);
              }
            });
          }
        });
        return new Udts(__typename, pageState, values);
      }
    }

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

      private @Nullable String pageState;

      private @Nullable List values;

      Builder() {
      }

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

      public Builder pageState(@Nullable String pageState) {
        this.pageState = pageState;
        return this;
      }

      public Builder values(@Nullable List values) {
        this.values = values;
        return this;
      }

      public Builder values(@NotNull Mutator> mutator) {
        Utils.checkNotNull(mutator, "mutator == null");
        List builders = new ArrayList<>();
        if (this.values != null) {
          for (Value item : this.values) {
            builders.add(item != null ? item.toBuilder() : null);
          }
        }
        mutator.accept(builders);
        List values = new ArrayList<>();
        for (Value.Builder item : builders) {
          values.add(item != null ? item.build() : null);
        }
        this.values = values;
        return this;
      }

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

  /**
   * The type used to represent results of a query for the table 'Udts'.
   */
  public static class Value {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forObject("a", "a", null, true, Collections.emptyList()),
      ResponseField.forList("bs", "bs", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final Optional a;

    final Optional> bs;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Value(@NotNull String __typename, @Nullable A a, @Nullable List bs) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.a = Optional.ofNullable(a);
      this.bs = Optional.ofNullable(bs);
    }

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

    public Optional getA() {
      return this.a;
    }

    public Optional> getBs() {
      return this.bs;
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    public ResponseFieldMarshaller marshaller() {
      return new ResponseFieldMarshaller() {
        @Override
        public void marshal(ResponseWriter writer) {
          writer.writeString($responseFields[0], __typename);
          writer.writeObject($responseFields[1], a.isPresent() ? a.get().marshaller() : null);
          writer.writeList($responseFields[2], bs.isPresent() ? bs.get() : null, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((B1) item).marshaller());
              }
            }
          });
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Value{"
          + "__typename=" + __typename + ", "
          + "a=" + a + ", "
          + "bs=" + bs
          + "}";
      }
      return $toString;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final A.Mapper aFieldMapper = new A.Mapper();

      final B1.Mapper b1FieldMapper = new B1.Mapper();

      @Override
      public Value map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final A a = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public A read(ResponseReader reader) {
            return aFieldMapper.map(reader);
          }
        });
        final List bs = reader.readList($responseFields[2], new ResponseReader.ListReader() {
          @Override
          public B1 read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public B1 read(ResponseReader reader) {
                return b1FieldMapper.map(reader);
              }
            });
          }
        });
        return new Value(__typename, a, bs);
      }
    }

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

      private @Nullable A a;

      private @Nullable List bs;

      Builder() {
      }

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

      public Builder a(@Nullable A a) {
        this.a = a;
        return this;
      }

      public Builder bs(@Nullable List bs) {
        this.bs = bs;
        return this;
      }

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

      public Builder bs(@NotNull Mutator> mutator) {
        Utils.checkNotNull(mutator, "mutator == null");
        List builders = new ArrayList<>();
        if (this.bs != null) {
          for (B1 item : this.bs) {
            builders.add(item != null ? item.toBuilder() : null);
          }
        }
        mutator.accept(builders);
        List bs = new ArrayList<>();
        for (B1.Builder item : builders) {
          bs.add(item != null ? item.build() : null);
        }
        this.bs = bs;
        return this;
      }

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

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

    final @NotNull String __typename;

    final Optional b;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public A(@NotNull String __typename, @Nullable B b) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.b = Optional.ofNullable(b);
    }

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

    public Optional getB() {
      return this.b;
    }

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

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

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final B.Mapper bFieldMapper = new B.Mapper();

      @Override
      public A map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final B b = reader.readObject($responseFields[1], new ResponseReader.ObjectReader() {
          @Override
          public B read(ResponseReader reader) {
            return bFieldMapper.map(reader);
          }
        });
        return new A(__typename, b);
      }
    }

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

      private @Nullable B b;

      Builder() {
      }

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

      public Builder b(@Nullable B b) {
        this.b = b;
        return this;
      }

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

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

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

    final @NotNull String __typename;

    final Optional i;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public B(@NotNull String __typename, @Nullable Integer i) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.i = Optional.ofNullable(i);
    }

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

    public Optional getI() {
      return this.i;
    }

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

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

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

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

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

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

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

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

      private @Nullable Integer i;

      Builder() {
      }

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

      public Builder i(@Nullable Integer i) {
        this.i = i;
        return this;
      }

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

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

    final @NotNull String __typename;

    final Optional i;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public B1(@NotNull String __typename, @Nullable Integer i) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.i = Optional.ofNullable(i);
    }

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

    public Optional getI() {
      return this.i;
    }

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

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

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

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

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

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

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

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

      private @Nullable Integer i;

      Builder() {
      }

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

      public Builder i(@Nullable Integer i) {
        this.i = i;
        return this;
      }

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