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

com.example.graphql.client.betterbotz.collections.GetCollectionsNestedQuery 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.collections;

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.CollectionsNestedInput;
import com.example.graphql.client.betterbotz.type.CustomType;
import java.io.IOException;
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 GetCollectionsNestedQuery implements Query, GetCollectionsNestedQuery.Variables> {
  public static final String OPERATION_ID = "8fe0480180bb5f609cb04bf0ca8781c33d96bddb98b7193b9537e365d0a8fc3b";

  public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
    "query GetCollectionsNested($value: CollectionsNestedInput) {\n"
        + "  CollectionsNested(value: $value) {\n"
        + "    __typename\n"
        + "    pageState\n"
        + "    values {\n"
        + "      __typename\n"
        + "      id\n"
        + "      listValue1 {\n"
        + "        __typename\n"
        + "        key\n"
        + "        value\n"
        + "      }\n"
        + "      setValue1\n"
        + "      mapValue1 {\n"
        + "        __typename\n"
        + "        key\n"
        + "        value {\n"
        + "          __typename\n"
        + "          key\n"
        + "          value\n"
        + "        }\n"
        + "      }\n"
        + "    }\n"
        + "  }\n"
        + "}"
  );

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

  private final GetCollectionsNestedQuery.Variables variables;

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

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

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

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

  @Override
  public GetCollectionsNestedQuery.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 CollectionsNestedInput value) {
      this.value = Input.fromNullable(value);
      return this;
    }

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

    public GetCollectionsNestedQuery build() {
      return new GetCollectionsNestedQuery(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("CollectionsNested", "CollectionsNested", new UnmodifiableMapBuilder(1)
      .put("value", new UnmodifiableMapBuilder(2)
        .put("kind", "Variable")
        .put("variableName", "value")
        .build())
      .build(), true, Collections.emptyList())
    };

    final Optional CollectionsNested;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

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

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

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

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

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final CollectionsNested.Mapper collectionsNestedFieldMapper = new CollectionsNested.Mapper();

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

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

      Builder() {
      }

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

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

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

  public static class CollectionsNested {
    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 CollectionsNested(@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 = "CollectionsNested{"
          + "__typename=" + __typename + ", "
          + "pageState=" + pageState + ", "
          + "values=" + values
          + "}";
      }
      return $toString;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (o instanceof CollectionsNested) {
        CollectionsNested that = (CollectionsNested) 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 CollectionsNested 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 CollectionsNested(__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 CollectionsNested build() {
        Utils.checkNotNull(__typename, "__typename == null");
        return new CollectionsNested(__typename, pageState, values);
      }
    }
  }

  /**
   * The type used to represent results of a query for the table 'CollectionsNested'.
   */
  public static class Value {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("id", "id", null, true, CustomType.UUID, Collections.emptyList()),
      ResponseField.forList("listValue1", "listValue1", null, true, Collections.emptyList()),
      ResponseField.forList("setValue1", "setValue1", null, true, Collections.emptyList()),
      ResponseField.forList("mapValue1", "mapValue1", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final Optional id;

    final Optional>> listValue1;

    final Optional>> setValue1;

    final Optional> mapValue1;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Value(@NotNull String __typename, @Nullable Object id,
        @Nullable List> listValue1, @Nullable List> setValue1,
        @Nullable List mapValue1) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.id = Optional.ofNullable(id);
      this.listValue1 = Optional.ofNullable(listValue1);
      this.setValue1 = Optional.ofNullable(setValue1);
      this.mapValue1 = Optional.ofNullable(mapValue1);
    }

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

    public Optional getId() {
      return this.id;
    }

    public Optional>> getListValue1() {
      return this.listValue1;
    }

    public Optional>> getSetValue1() {
      return this.setValue1;
    }

    public Optional> getMapValue1() {
      return this.mapValue1;
    }

    @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.isPresent() ? id.get() : null);
          writer.writeList($responseFields[2], listValue1.isPresent() ? listValue1.get() : null, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeList((List) item, new ResponseWriter.ListWriter() {
                  @Override
                  public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
                    for (Object item : items) {
                      listItemWriter.writeObject(((ListValue1) item).marshaller());
                    }
                  }
                });
              }
            }
          });
          writer.writeList($responseFields[3], setValue1.isPresent() ? setValue1.get() : null, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeList((List) item, new ResponseWriter.ListWriter() {
                  @Override
                  public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
                    for (Object item : items) {
                      listItemWriter.writeCustom(CustomType.UUID, item);
                    }
                  }
                });
              }
            }
          });
          writer.writeList($responseFields[4], mapValue1.isPresent() ? mapValue1.get() : null, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((MapValue1) item).marshaller());
              }
            }
          });
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Value{"
          + "__typename=" + __typename + ", "
          + "id=" + id + ", "
          + "listValue1=" + listValue1 + ", "
          + "setValue1=" + setValue1 + ", "
          + "mapValue1=" + mapValue1
          + "}";
      }
      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.id.equals(that.id)
         && this.listValue1.equals(that.listValue1)
         && this.setValue1.equals(that.setValue1)
         && this.mapValue1.equals(that.mapValue1);
      }
      return false;
    }

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

    public Builder toBuilder() {
      Builder builder = new Builder();
      builder.__typename = __typename;
      builder.id = id.isPresent() ? id.get() : null;
      builder.listValue1 = listValue1.isPresent() ? listValue1.get() : null;
      builder.setValue1 = setValue1.isPresent() ? setValue1.get() : null;
      builder.mapValue1 = mapValue1.isPresent() ? mapValue1.get() : null;
      return builder;
    }

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

    public static final class Mapper implements ResponseFieldMapper {
      final ListValue1.Mapper listValue1FieldMapper = new ListValue1.Mapper();

      final MapValue1.Mapper mapValue1FieldMapper = new MapValue1.Mapper();

      @Override
      public Value map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final List> listValue1 = reader.readList($responseFields[2], new ResponseReader.ListReader>() {
          @Override
          public List read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readList(new ResponseReader.ListReader() {
              @Override
              public ListValue1 read(ResponseReader.ListItemReader listItemReader) {
                return listItemReader.readObject(new ResponseReader.ObjectReader() {
                  @Override
                  public ListValue1 read(ResponseReader reader) {
                    return listValue1FieldMapper.map(reader);
                  }
                });
              }
            });
          }
        });
        final List> setValue1 = reader.readList($responseFields[3], new ResponseReader.ListReader>() {
          @Override
          public List read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readList(new ResponseReader.ListReader() {
              @Override
              public Object read(ResponseReader.ListItemReader listItemReader) {
                return listItemReader.readCustomType(CustomType.UUID);
              }
            });
          }
        });
        final List mapValue1 = reader.readList($responseFields[4], new ResponseReader.ListReader() {
          @Override
          public MapValue1 read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public MapValue1 read(ResponseReader reader) {
                return mapValue1FieldMapper.map(reader);
              }
            });
          }
        });
        return new Value(__typename, id, listValue1, setValue1, mapValue1);
      }
    }

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

      private @Nullable Object id;

      private @Nullable List> listValue1;

      private @Nullable List> setValue1;

      private @Nullable List mapValue1;

      Builder() {
      }

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

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

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

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

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

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

      public Value build() {
        Utils.checkNotNull(__typename, "__typename == null");
        return new Value(__typename, id, listValue1, setValue1, mapValue1);
      }
    }
  }

  /**
   * Represents a key/value type for a Map
   */
  public static class ListValue1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forInt("key", "key", null, false, Collections.emptyList()),
      ResponseField.forString("value", "value", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final int key;

    final Optional value;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public ListValue1(@NotNull String __typename, int key, @Nullable String value) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.key = key;
      this.value = Optional.ofNullable(value);
    }

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

    public int getKey() {
      return this.key;
    }

    public Optional getValue() {
      return this.value;
    }

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

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "ListValue1{"
          + "__typename=" + __typename + ", "
          + "key=" + key + ", "
          + "value=" + value
          + "}";
      }
      return $toString;
    }

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

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

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

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

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

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

      private int key;

      private @Nullable String value;

      Builder() {
      }

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

      public Builder key(int key) {
        this.key = key;
        return this;
      }

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

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

  /**
   * Represents a key/value type for a Map
   */
  public static class MapValue1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("key", "key", null, false, CustomType.UUID, Collections.emptyList()),
      ResponseField.forList("value", "value", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Object key;

    final Optional> value;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public MapValue1(@NotNull String __typename, @NotNull Object key,
        @Nullable List value) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.key = Utils.checkNotNull(key, "key == null");
      this.value = Optional.ofNullable(value);
    }

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

    public @NotNull Object getKey() {
      return this.key;
    }

    public Optional> getValue() {
      return this.value;
    }

    @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], key);
          writer.writeList($responseFields[2], value.isPresent() ? value.get() : null, new ResponseWriter.ListWriter() {
            @Override
            public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
              for (Object item : items) {
                listItemWriter.writeObject(((Value1) item).marshaller());
              }
            }
          });
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "MapValue1{"
          + "__typename=" + __typename + ", "
          + "key=" + key + ", "
          + "value=" + value
          + "}";
      }
      return $toString;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      final Value1.Mapper value1FieldMapper = new Value1.Mapper();

      @Override
      public MapValue1 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object key = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final List value = reader.readList($responseFields[2], new ResponseReader.ListReader() {
          @Override
          public Value1 read(ResponseReader.ListItemReader listItemReader) {
            return listItemReader.readObject(new ResponseReader.ObjectReader() {
              @Override
              public Value1 read(ResponseReader reader) {
                return value1FieldMapper.map(reader);
              }
            });
          }
        });
        return new MapValue1(__typename, key, value);
      }
    }

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

      private @NotNull Object key;

      private @Nullable List value;

      Builder() {
      }

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

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

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

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

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

  /**
   * Represents a key/value type for a Map
   */
  public static class Value1 {
    static final ResponseField[] $responseFields = {
      ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
      ResponseField.forCustomType("key", "key", null, false, CustomType.BIGINT, Collections.emptyList()),
      ResponseField.forString("value", "value", null, true, Collections.emptyList())
    };

    final @NotNull String __typename;

    final @NotNull Object key;

    final Optional value;

    private transient volatile String $toString;

    private transient volatile int $hashCode;

    private transient volatile boolean $hashCodeMemoized;

    public Value1(@NotNull String __typename, @NotNull Object key, @Nullable String value) {
      this.__typename = Utils.checkNotNull(__typename, "__typename == null");
      this.key = Utils.checkNotNull(key, "key == null");
      this.value = Optional.ofNullable(value);
    }

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

    public @NotNull Object getKey() {
      return this.key;
    }

    public Optional getValue() {
      return this.value;
    }

    @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], key);
          writer.writeString($responseFields[2], value.isPresent() ? value.get() : null);
        }
      };
    }

    @Override
    public String toString() {
      if ($toString == null) {
        $toString = "Value1{"
          + "__typename=" + __typename + ", "
          + "key=" + key + ", "
          + "value=" + value
          + "}";
      }
      return $toString;
    }

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

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

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

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

    public static final class Mapper implements ResponseFieldMapper {
      @Override
      public Value1 map(ResponseReader reader) {
        final String __typename = reader.readString($responseFields[0]);
        final Object key = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
        final String value = reader.readString($responseFields[2]);
        return new Value1(__typename, key, value);
      }
    }

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

      private @NotNull Object key;

      private @Nullable String value;

      Builder() {
      }

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

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

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

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