// Code generated by Wire protocol buffer compiler, do not edit.
// Source: proto3.java.AllTypes in all_types.proto
package com.squareup.wire.proto3.java.all_types;

import com.squareup.wire.AnyMessage;
import com.squareup.wire.EnumAdapter;
import com.squareup.wire.FieldEncoding;
import com.squareup.wire.Message;
import com.squareup.wire.ProtoAdapter;
import com.squareup.wire.ProtoReader;
import com.squareup.wire.ProtoWriter;
import com.squareup.wire.ReverseProtoWriter;
import com.squareup.wire.Syntax;
import com.squareup.wire.WireEnum;
import com.squareup.wire.WireField;
import com.squareup.wire.internal.Internal;
import java.io.IOException;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.Float;
import java.lang.Integer;
import java.lang.Long;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.lang.Void;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import kotlin.Unit;
import okio.ByteString;

public final class AllTypes extends Message<AllTypes, AllTypes.Builder> {
  public static final ProtoAdapter<AllTypes> ADAPTER = new ProtoAdapter_AllTypes();

  private static final long serialVersionUID = 0L;

  public static final Integer DEFAULT_OPT_INT32 = 0;

  public static final Integer DEFAULT_OPT_UINT32 = 0;

  public static final Integer DEFAULT_OPT_SINT32 = 0;

  public static final Integer DEFAULT_OPT_FIXED32 = 0;

  public static final Integer DEFAULT_OPT_SFIXED32 = 0;

  public static final Long DEFAULT_OPT_INT64 = 0L;

  public static final Long DEFAULT_OPT_UINT64 = 0L;

  public static final Long DEFAULT_OPT_SINT64 = 0L;

  public static final Long DEFAULT_OPT_FIXED64 = 0L;

  public static final Long DEFAULT_OPT_SFIXED64 = 0L;

  public static final Boolean DEFAULT_OPT_BOOL = false;

  public static final Float DEFAULT_OPT_FLOAT = 0.0f;

  public static final Double DEFAULT_OPT_DOUBLE = 0.0d;

  public static final String DEFAULT_OPT_STRING = "";

  public static final ByteString DEFAULT_OPT_BYTES = ByteString.EMPTY;

  public static final String DEFAULT_ONEOF_STRING = "";

  public static final Integer DEFAULT_ONEOF_INT32 = 0;

  @WireField(
      tag = 1,
      adapter = "com.squareup.wire.ProtoAdapter#INT32",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final int int32;

  @WireField(
      tag = 2,
      adapter = "com.squareup.wire.ProtoAdapter#UINT32",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final int uint32;

  @WireField(
      tag = 3,
      adapter = "com.squareup.wire.ProtoAdapter#SINT32",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final int sint32;

  @WireField(
      tag = 4,
      adapter = "com.squareup.wire.ProtoAdapter#FIXED32",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final int fixed32;

  @WireField(
      tag = 5,
      adapter = "com.squareup.wire.ProtoAdapter#SFIXED32",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final int sfixed32;

  @WireField(
      tag = 6,
      adapter = "com.squareup.wire.ProtoAdapter#INT64",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final long int64;

  @WireField(
      tag = 7,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final long uint64;

  @WireField(
      tag = 8,
      adapter = "com.squareup.wire.ProtoAdapter#SINT64",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final long sint64;

  @WireField(
      tag = 9,
      adapter = "com.squareup.wire.ProtoAdapter#FIXED64",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final long fixed64;

  @WireField(
      tag = 10,
      adapter = "com.squareup.wire.ProtoAdapter#SFIXED64",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final long sfixed64;

  @WireField(
      tag = 11,
      adapter = "com.squareup.wire.ProtoAdapter#BOOL",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final boolean bool;

  @WireField(
      tag = 12,
      adapter = "com.squareup.wire.ProtoAdapter#FLOAT",
      label = WireField.Label.OMIT_IDENTITY,
      declaredName = "float"
  )
  public final float float_;

  @WireField(
      tag = 13,
      adapter = "com.squareup.wire.ProtoAdapter#DOUBLE",
      label = WireField.Label.OMIT_IDENTITY,
      declaredName = "double"
  )
  public final double double_;

  @WireField(
      tag = 14,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final String string;

  @WireField(
      tag = 15,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final ByteString bytes;

  @WireField(
      tag = 16,
      adapter = "com.squareup.wire.proto3.java.all_types.AllTypes$NestedEnum#ADAPTER",
      label = WireField.Label.OMIT_IDENTITY,
      jsonName = "nestedEnum"
  )
  public final NestedEnum nested_enum;

  @WireField(
      tag = 17,
      adapter = "com.squareup.wire.proto3.java.all_types.AllTypes$NestedMessage#ADAPTER",
      label = WireField.Label.OMIT_IDENTITY,
      jsonName = "nestedMessage"
  )
  public final NestedMessage nested_message;

  @WireField(
      tag = 18,
      adapter = "com.squareup.wire.AnyMessage#ADAPTER",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final AnyMessage any;

  @WireField(
      tag = 19,
      adapter = "com.squareup.wire.ProtoAdapter#DURATION",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final Duration duration;

  @WireField(
      tag = 20,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_MAP",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final Map<String, ?> struct;

  @WireField(
      tag = 21,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_LIST",
      label = WireField.Label.OMIT_IDENTITY,
      jsonName = "listValue"
  )
  public final List<?> list_value;

  @WireField(
      tag = 22,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_VALUE",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final Object value;

  @WireField(
      tag = 23,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_NULL",
      label = WireField.Label.OMIT_IDENTITY,
      jsonName = "nullValue"
  )
  public final Void null_value;

  @WireField(
      tag = 24,
      adapter = "com.squareup.wire.ProtoAdapter#EMPTY",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final Unit empty;

  @WireField(
      tag = 25,
      adapter = "com.squareup.wire.ProtoAdapter#INSTANT",
      label = WireField.Label.OMIT_IDENTITY
  )
  public final Instant timestamp;

  @WireField(
      tag = 101,
      adapter = "com.squareup.wire.ProtoAdapter#INT32",
      jsonName = "optInt32"
  )
  public final Integer opt_int32;

  @WireField(
      tag = 102,
      adapter = "com.squareup.wire.ProtoAdapter#UINT32",
      jsonName = "optUint32"
  )
  public final Integer opt_uint32;

  @WireField(
      tag = 103,
      adapter = "com.squareup.wire.ProtoAdapter#SINT32",
      jsonName = "optSint32"
  )
  public final Integer opt_sint32;

  @WireField(
      tag = 104,
      adapter = "com.squareup.wire.ProtoAdapter#FIXED32",
      jsonName = "optFixed32"
  )
  public final Integer opt_fixed32;

  @WireField(
      tag = 105,
      adapter = "com.squareup.wire.ProtoAdapter#SFIXED32",
      jsonName = "optSfixed32"
  )
  public final Integer opt_sfixed32;

  @WireField(
      tag = 106,
      adapter = "com.squareup.wire.ProtoAdapter#INT64",
      jsonName = "optInt64"
  )
  public final Long opt_int64;

  @WireField(
      tag = 107,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64",
      jsonName = "optUint64"
  )
  public final Long opt_uint64;

  @WireField(
      tag = 108,
      adapter = "com.squareup.wire.ProtoAdapter#SINT64",
      jsonName = "optSint64"
  )
  public final Long opt_sint64;

  @WireField(
      tag = 109,
      adapter = "com.squareup.wire.ProtoAdapter#FIXED64",
      jsonName = "optFixed64"
  )
  public final Long opt_fixed64;

  @WireField(
      tag = 110,
      adapter = "com.squareup.wire.ProtoAdapter#SFIXED64",
      jsonName = "optSfixed64"
  )
  public final Long opt_sfixed64;

  @WireField(
      tag = 111,
      adapter = "com.squareup.wire.ProtoAdapter#BOOL",
      jsonName = "optBool"
  )
  public final Boolean opt_bool;

  @WireField(
      tag = 112,
      adapter = "com.squareup.wire.ProtoAdapter#FLOAT",
      jsonName = "optFloat"
  )
  public final Float opt_float;

  @WireField(
      tag = 113,
      adapter = "com.squareup.wire.ProtoAdapter#DOUBLE",
      jsonName = "optDouble"
  )
  public final Double opt_double;

  @WireField(
      tag = 114,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
      jsonName = "optString"
  )
  public final String opt_string;

  @WireField(
      tag = 115,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES",
      jsonName = "optBytes"
  )
  public final ByteString opt_bytes;

  @WireField(
      tag = 201,
      adapter = "com.squareup.wire.ProtoAdapter#INT32",
      label = WireField.Label.REPEATED,
      jsonName = "repInt32"
  )
  public final List<Integer> rep_int32;

  @WireField(
      tag = 202,
      adapter = "com.squareup.wire.ProtoAdapter#UINT32",
      label = WireField.Label.REPEATED,
      jsonName = "repUint32"
  )
  public final List<Integer> rep_uint32;

  @WireField(
      tag = 203,
      adapter = "com.squareup.wire.ProtoAdapter#SINT32",
      label = WireField.Label.REPEATED,
      jsonName = "repSint32"
  )
  public final List<Integer> rep_sint32;

  @WireField(
      tag = 204,
      adapter = "com.squareup.wire.ProtoAdapter#FIXED32",
      label = WireField.Label.REPEATED,
      jsonName = "repFixed32"
  )
  public final List<Integer> rep_fixed32;

  @WireField(
      tag = 205,
      adapter = "com.squareup.wire.ProtoAdapter#SFIXED32",
      label = WireField.Label.REPEATED,
      jsonName = "repSfixed32"
  )
  public final List<Integer> rep_sfixed32;

  @WireField(
      tag = 206,
      adapter = "com.squareup.wire.ProtoAdapter#INT64",
      label = WireField.Label.REPEATED,
      jsonName = "repInt64"
  )
  public final List<Long> rep_int64;

  @WireField(
      tag = 207,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64",
      label = WireField.Label.REPEATED,
      jsonName = "repUint64"
  )
  public final List<Long> rep_uint64;

  @WireField(
      tag = 208,
      adapter = "com.squareup.wire.ProtoAdapter#SINT64",
      label = WireField.Label.REPEATED,
      jsonName = "repSint64"
  )
  public final List<Long> rep_sint64;

  @WireField(
      tag = 209,
      adapter = "com.squareup.wire.ProtoAdapter#FIXED64",
      label = WireField.Label.REPEATED,
      jsonName = "repFixed64"
  )
  public final List<Long> rep_fixed64;

  @WireField(
      tag = 210,
      adapter = "com.squareup.wire.ProtoAdapter#SFIXED64",
      label = WireField.Label.REPEATED,
      jsonName = "repSfixed64"
  )
  public final List<Long> rep_sfixed64;

  @WireField(
      tag = 211,
      adapter = "com.squareup.wire.ProtoAdapter#BOOL",
      label = WireField.Label.REPEATED,
      jsonName = "repBool"
  )
  public final List<Boolean> rep_bool;

  @WireField(
      tag = 212,
      adapter = "com.squareup.wire.ProtoAdapter#FLOAT",
      label = WireField.Label.REPEATED,
      jsonName = "repFloat"
  )
  public final List<Float> rep_float;

  @WireField(
      tag = 213,
      adapter = "com.squareup.wire.ProtoAdapter#DOUBLE",
      label = WireField.Label.REPEATED,
      jsonName = "repDouble"
  )
  public final List<Double> rep_double;

  @WireField(
      tag = 214,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
      label = WireField.Label.REPEATED,
      jsonName = "repString"
  )
  public final List<String> rep_string;

  @WireField(
      tag = 215,
      adapter = "com.squareup.wire.ProtoAdapter#BYTES",
      label = WireField.Label.REPEATED,
      jsonName = "repBytes"
  )
  public final List<ByteString> rep_bytes;

  @WireField(
      tag = 216,
      adapter = "com.squareup.wire.proto3.java.all_types.AllTypes$NestedEnum#ADAPTER",
      label = WireField.Label.REPEATED,
      jsonName = "repNestedEnum"
  )
  public final List<NestedEnum> rep_nested_enum;

  @WireField(
      tag = 217,
      adapter = "com.squareup.wire.proto3.java.all_types.AllTypes$NestedMessage#ADAPTER",
      label = WireField.Label.REPEATED,
      jsonName = "repNestedMessage"
  )
  public final List<NestedMessage> rep_nested_message;

  @WireField(
      tag = 218,
      adapter = "com.squareup.wire.AnyMessage#ADAPTER",
      label = WireField.Label.REPEATED,
      jsonName = "repAny"
  )
  public final List<AnyMessage> rep_any;

  @WireField(
      tag = 219,
      adapter = "com.squareup.wire.ProtoAdapter#DURATION",
      label = WireField.Label.REPEATED,
      jsonName = "repDuration"
  )
  public final List<Duration> rep_duration;

  @WireField(
      tag = 220,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_MAP",
      label = WireField.Label.REPEATED,
      jsonName = "repStruct"
  )
  public final List<Map<String, ?>> rep_struct;

  @WireField(
      tag = 221,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_LIST",
      label = WireField.Label.REPEATED,
      jsonName = "repListValue"
  )
  public final List<List<?>> rep_list_value;

  @WireField(
      tag = 222,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_VALUE",
      label = WireField.Label.REPEATED,
      jsonName = "repValue"
  )
  public final List<Object> rep_value;

  @WireField(
      tag = 223,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_NULL",
      label = WireField.Label.REPEATED,
      jsonName = "repNullValue"
  )
  public final List<Void> rep_null_value;

  @WireField(
      tag = 224,
      adapter = "com.squareup.wire.ProtoAdapter#EMPTY",
      label = WireField.Label.REPEATED,
      jsonName = "repEmpty"
  )
  public final List<Unit> rep_empty;

  @WireField(
      tag = 225,
      adapter = "com.squareup.wire.ProtoAdapter#INSTANT",
      label = WireField.Label.REPEATED,
      jsonName = "repTimestamp"
  )
  public final List<Instant> rep_timestamp;

  @WireField(
      tag = 301,
      adapter = "com.squareup.wire.ProtoAdapter#INT32",
      label = WireField.Label.PACKED,
      jsonName = "packInt32"
  )
  public final List<Integer> pack_int32;

  @WireField(
      tag = 302,
      adapter = "com.squareup.wire.ProtoAdapter#UINT32",
      label = WireField.Label.PACKED,
      jsonName = "packUint32"
  )
  public final List<Integer> pack_uint32;

  @WireField(
      tag = 303,
      adapter = "com.squareup.wire.ProtoAdapter#SINT32",
      label = WireField.Label.PACKED,
      jsonName = "packSint32"
  )
  public final List<Integer> pack_sint32;

  @WireField(
      tag = 304,
      adapter = "com.squareup.wire.ProtoAdapter#FIXED32",
      label = WireField.Label.PACKED,
      jsonName = "packFixed32"
  )
  public final List<Integer> pack_fixed32;

  @WireField(
      tag = 305,
      adapter = "com.squareup.wire.ProtoAdapter#SFIXED32",
      label = WireField.Label.PACKED,
      jsonName = "packSfixed32"
  )
  public final List<Integer> pack_sfixed32;

  @WireField(
      tag = 306,
      adapter = "com.squareup.wire.ProtoAdapter#INT64",
      label = WireField.Label.PACKED,
      jsonName = "packInt64"
  )
  public final List<Long> pack_int64;

  @WireField(
      tag = 307,
      adapter = "com.squareup.wire.ProtoAdapter#UINT64",
      label = WireField.Label.PACKED,
      jsonName = "packUint64"
  )
  public final List<Long> pack_uint64;

  @WireField(
      tag = 308,
      adapter = "com.squareup.wire.ProtoAdapter#SINT64",
      label = WireField.Label.PACKED,
      jsonName = "packSint64"
  )
  public final List<Long> pack_sint64;

  @WireField(
      tag = 309,
      adapter = "com.squareup.wire.ProtoAdapter#FIXED64",
      label = WireField.Label.PACKED,
      jsonName = "packFixed64"
  )
  public final List<Long> pack_fixed64;

  @WireField(
      tag = 310,
      adapter = "com.squareup.wire.ProtoAdapter#SFIXED64",
      label = WireField.Label.PACKED,
      jsonName = "packSfixed64"
  )
  public final List<Long> pack_sfixed64;

  @WireField(
      tag = 311,
      adapter = "com.squareup.wire.ProtoAdapter#BOOL",
      label = WireField.Label.PACKED,
      jsonName = "packBool"
  )
  public final List<Boolean> pack_bool;

  @WireField(
      tag = 312,
      adapter = "com.squareup.wire.ProtoAdapter#FLOAT",
      label = WireField.Label.PACKED,
      jsonName = "packFloat"
  )
  public final List<Float> pack_float;

  @WireField(
      tag = 313,
      adapter = "com.squareup.wire.ProtoAdapter#DOUBLE",
      label = WireField.Label.PACKED,
      jsonName = "packDouble"
  )
  public final List<Double> pack_double;

  @WireField(
      tag = 316,
      adapter = "com.squareup.wire.proto3.java.all_types.AllTypes$NestedEnum#ADAPTER",
      label = WireField.Label.PACKED,
      jsonName = "packNestedEnum"
  )
  public final List<NestedEnum> pack_nested_enum;

  @WireField(
      tag = 323,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_NULL",
      label = WireField.Label.PACKED,
      jsonName = "packNullValue"
  )
  public final List<Void> pack_null_value;

  @WireField(
      tag = 501,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.ProtoAdapter#INT32",
      jsonName = "mapInt32Int32"
  )
  public final Map<Integer, Integer> map_int32_int32;

  @WireField(
      tag = 502,
      keyAdapter = "com.squareup.wire.ProtoAdapter#STRING",
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
      jsonName = "mapStringString"
  )
  public final Map<String, String> map_string_string;

  @WireField(
      tag = 503,
      keyAdapter = "com.squareup.wire.ProtoAdapter#STRING",
      adapter = "com.squareup.wire.proto3.java.all_types.AllTypes$NestedMessage#ADAPTER",
      jsonName = "mapStringMessage"
  )
  public final Map<String, NestedMessage> map_string_message;

  @WireField(
      tag = 504,
      keyAdapter = "com.squareup.wire.ProtoAdapter#STRING",
      adapter = "com.squareup.wire.proto3.java.all_types.AllTypes$NestedEnum#ADAPTER",
      jsonName = "mapStringEnum"
  )
  public final Map<String, NestedEnum> map_string_enum;

  @WireField(
      tag = 518,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.AnyMessage#ADAPTER",
      jsonName = "mapInt32Any"
  )
  public final Map<Integer, AnyMessage> map_int32_any;

  @WireField(
      tag = 519,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.ProtoAdapter#DURATION",
      jsonName = "mapInt32Duration"
  )
  public final Map<Integer, Duration> map_int32_duration;

  @WireField(
      tag = 520,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_MAP",
      jsonName = "mapInt32Struct"
  )
  public final Map<Integer, Map<String, ?>> map_int32_struct;

  @WireField(
      tag = 521,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_LIST",
      jsonName = "mapInt32ListValue"
  )
  public final Map<Integer, List<?>> map_int32_list_value;

  @WireField(
      tag = 522,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_VALUE",
      jsonName = "mapInt32Value"
  )
  public final Map<Integer, Object> map_int32_value;

  @WireField(
      tag = 523,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_NULL",
      jsonName = "mapInt32NullValue"
  )
  public final Map<Integer, Void> map_int32_null_value;

  @WireField(
      tag = 524,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.ProtoAdapter#EMPTY",
      jsonName = "mapInt32Empty"
  )
  public final Map<Integer, Unit> map_int32_empty;

  @WireField(
      tag = 525,
      keyAdapter = "com.squareup.wire.ProtoAdapter#INT32",
      adapter = "com.squareup.wire.ProtoAdapter#INSTANT",
      jsonName = "mapInt32Timestamp"
  )
  public final Map<Integer, Instant> map_int32_timestamp;

  @WireField(
      tag = 601,
      adapter = "com.squareup.wire.ProtoAdapter#STRING",
      jsonName = "oneofString",
      oneofName = "choice"
  )
  public final String oneof_string;

  @WireField(
      tag = 602,
      adapter = "com.squareup.wire.ProtoAdapter#INT32",
      jsonName = "oneofInt32",
      oneofName = "choice"
  )
  public final Integer oneof_int32;

  @WireField(
      tag = 603,
      adapter = "com.squareup.wire.proto3.java.all_types.AllTypes$NestedMessage#ADAPTER",
      jsonName = "oneofNestedMessage",
      oneofName = "choice"
  )
  public final NestedMessage oneof_nested_message;

  @WireField(
      tag = 618,
      adapter = "com.squareup.wire.AnyMessage#ADAPTER",
      jsonName = "oneofAny",
      oneofName = "choice"
  )
  public final AnyMessage oneof_any;

  @WireField(
      tag = 619,
      adapter = "com.squareup.wire.ProtoAdapter#DURATION",
      jsonName = "oneofDuration",
      oneofName = "choice"
  )
  public final Duration oneof_duration;

  @WireField(
      tag = 620,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_MAP",
      jsonName = "oneofStruct",
      oneofName = "choice"
  )
  public final Map<String, ?> oneof_struct;

  @WireField(
      tag = 621,
      adapter = "com.squareup.wire.ProtoAdapter#STRUCT_LIST",
      jsonName = "oneofListValue",
      oneofName = "choice"
  )
  public final List<?> oneof_list_value;

  /**
   * google.protobuf.Value oneof_value = 622;
   * google.protobuf.NullValue oneof_null_value = 623;
   */
  @WireField(
      tag = 624,
      adapter = "com.squareup.wire.ProtoAdapter#EMPTY",
      jsonName = "oneofEmpty",
      oneofName = "choice"
  )
  public final Unit oneof_empty;

  @WireField(
      tag = 625,
      adapter = "com.squareup.wire.ProtoAdapter#INSTANT",
      jsonName = "oneofTimestamp",
      oneofName = "choice"
  )
  public final Instant oneof_timestamp;

  public AllTypes(Builder builder, ByteString unknownFields) {
    super(ADAPTER, unknownFields);
    if (Internal.countNonNull(builder.oneof_string, builder.oneof_int32, builder.oneof_nested_message, builder.oneof_any, builder.oneof_duration, builder.oneof_struct, builder.oneof_list_value, builder.oneof_empty, builder.oneof_timestamp) > 1) {
      throw new IllegalArgumentException("at most one of builder.oneof_string, builder.oneof_int32, builder.oneof_nested_message, builder.oneof_any, builder.oneof_duration, builder.oneof_struct, builder.oneof_list_value, builder.oneof_empty, builder.oneof_timestamp may be non-null");
    }
    this.int32 = builder.int32;
    this.uint32 = builder.uint32;
    this.sint32 = builder.sint32;
    this.fixed32 = builder.fixed32;
    this.sfixed32 = builder.sfixed32;
    this.int64 = builder.int64;
    this.uint64 = builder.uint64;
    this.sint64 = builder.sint64;
    this.fixed64 = builder.fixed64;
    this.sfixed64 = builder.sfixed64;
    this.bool = builder.bool;
    this.float_ = builder.float_;
    this.double_ = builder.double_;
    if (builder.string == null) {
      throw new IllegalArgumentException("builder.string == null");
    }
    this.string = builder.string;
    if (builder.bytes == null) {
      throw new IllegalArgumentException("builder.bytes == null");
    }
    this.bytes = builder.bytes;
    if (builder.nested_enum == null) {
      throw new IllegalArgumentException("builder.nested_enum == null");
    }
    this.nested_enum = builder.nested_enum;
    this.nested_message = builder.nested_message;
    this.any = builder.any;
    this.duration = builder.duration;
    this.struct = Internal.immutableCopyOfStruct("struct", builder.struct);
    this.list_value = Internal.immutableCopyOfStruct("list_value", builder.list_value);
    this.value = Internal.immutableCopyOfStruct("value", builder.value);
    this.null_value = Internal.immutableCopyOfStruct("null_value", builder.null_value);
    this.empty = builder.empty;
    this.timestamp = builder.timestamp;
    this.opt_int32 = builder.opt_int32;
    this.opt_uint32 = builder.opt_uint32;
    this.opt_sint32 = builder.opt_sint32;
    this.opt_fixed32 = builder.opt_fixed32;
    this.opt_sfixed32 = builder.opt_sfixed32;
    this.opt_int64 = builder.opt_int64;
    this.opt_uint64 = builder.opt_uint64;
    this.opt_sint64 = builder.opt_sint64;
    this.opt_fixed64 = builder.opt_fixed64;
    this.opt_sfixed64 = builder.opt_sfixed64;
    this.opt_bool = builder.opt_bool;
    this.opt_float = builder.opt_float;
    this.opt_double = builder.opt_double;
    this.opt_string = builder.opt_string;
    this.opt_bytes = builder.opt_bytes;
    this.rep_int32 = Internal.immutableCopyOf("rep_int32", builder.rep_int32);
    this.rep_uint32 = Internal.immutableCopyOf("rep_uint32", builder.rep_uint32);
    this.rep_sint32 = Internal.immutableCopyOf("rep_sint32", builder.rep_sint32);
    this.rep_fixed32 = Internal.immutableCopyOf("rep_fixed32", builder.rep_fixed32);
    this.rep_sfixed32 = Internal.immutableCopyOf("rep_sfixed32", builder.rep_sfixed32);
    this.rep_int64 = Internal.immutableCopyOf("rep_int64", builder.rep_int64);
    this.rep_uint64 = Internal.immutableCopyOf("rep_uint64", builder.rep_uint64);
    this.rep_sint64 = Internal.immutableCopyOf("rep_sint64", builder.rep_sint64);
    this.rep_fixed64 = Internal.immutableCopyOf("rep_fixed64", builder.rep_fixed64);
    this.rep_sfixed64 = Internal.immutableCopyOf("rep_sfixed64", builder.rep_sfixed64);
    this.rep_bool = Internal.immutableCopyOf("rep_bool", builder.rep_bool);
    this.rep_float = Internal.immutableCopyOf("rep_float", builder.rep_float);
    this.rep_double = Internal.immutableCopyOf("rep_double", builder.rep_double);
    this.rep_string = Internal.immutableCopyOf("rep_string", builder.rep_string);
    this.rep_bytes = Internal.immutableCopyOf("rep_bytes", builder.rep_bytes);
    this.rep_nested_enum = Internal.immutableCopyOf("rep_nested_enum", builder.rep_nested_enum);
    this.rep_nested_message = Internal.immutableCopyOf("rep_nested_message", builder.rep_nested_message);
    this.rep_any = Internal.immutableCopyOf("rep_any", builder.rep_any);
    this.rep_duration = Internal.immutableCopyOf("rep_duration", builder.rep_duration);
    this.rep_struct = Internal.immutableCopyOfStruct("rep_struct", builder.rep_struct);
    this.rep_list_value = Internal.immutableCopyOfStruct("rep_list_value", builder.rep_list_value);
    this.rep_value = Internal.immutableCopyOfStruct("rep_value", builder.rep_value);
    this.rep_null_value = Internal.immutableCopyOfStruct("rep_null_value", builder.rep_null_value);
    this.rep_empty = Internal.immutableCopyOf("rep_empty", builder.rep_empty);
    this.rep_timestamp = Internal.immutableCopyOf("rep_timestamp", builder.rep_timestamp);
    this.pack_int32 = Internal.immutableCopyOf("pack_int32", builder.pack_int32);
    this.pack_uint32 = Internal.immutableCopyOf("pack_uint32", builder.pack_uint32);
    this.pack_sint32 = Internal.immutableCopyOf("pack_sint32", builder.pack_sint32);
    this.pack_fixed32 = Internal.immutableCopyOf("pack_fixed32", builder.pack_fixed32);
    this.pack_sfixed32 = Internal.immutableCopyOf("pack_sfixed32", builder.pack_sfixed32);
    this.pack_int64 = Internal.immutableCopyOf("pack_int64", builder.pack_int64);
    this.pack_uint64 = Internal.immutableCopyOf("pack_uint64", builder.pack_uint64);
    this.pack_sint64 = Internal.immutableCopyOf("pack_sint64", builder.pack_sint64);
    this.pack_fixed64 = Internal.immutableCopyOf("pack_fixed64", builder.pack_fixed64);
    this.pack_sfixed64 = Internal.immutableCopyOf("pack_sfixed64", builder.pack_sfixed64);
    this.pack_bool = Internal.immutableCopyOf("pack_bool", builder.pack_bool);
    this.pack_float = Internal.immutableCopyOf("pack_float", builder.pack_float);
    this.pack_double = Internal.immutableCopyOf("pack_double", builder.pack_double);
    this.pack_nested_enum = Internal.immutableCopyOf("pack_nested_enum", builder.pack_nested_enum);
    this.pack_null_value = Internal.immutableCopyOfStruct("pack_null_value", builder.pack_null_value);
    this.map_int32_int32 = Internal.immutableCopyOf("map_int32_int32", builder.map_int32_int32);
    this.map_string_string = Internal.immutableCopyOf("map_string_string", builder.map_string_string);
    this.map_string_message = Internal.immutableCopyOf("map_string_message", builder.map_string_message);
    this.map_string_enum = Internal.immutableCopyOf("map_string_enum", builder.map_string_enum);
    this.map_int32_any = Internal.immutableCopyOf("map_int32_any", builder.map_int32_any);
    this.map_int32_duration = Internal.immutableCopyOf("map_int32_duration", builder.map_int32_duration);
    this.map_int32_struct = Internal.immutableCopyOfMapWithStructValues("map_int32_struct", builder.map_int32_struct);
    this.map_int32_list_value = Internal.immutableCopyOfMapWithStructValues("map_int32_list_value", builder.map_int32_list_value);
    this.map_int32_value = Internal.immutableCopyOfMapWithStructValues("map_int32_value", builder.map_int32_value);
    this.map_int32_null_value = Internal.immutableCopyOfMapWithStructValues("map_int32_null_value", builder.map_int32_null_value);
    this.map_int32_empty = Internal.immutableCopyOf("map_int32_empty", builder.map_int32_empty);
    this.map_int32_timestamp = Internal.immutableCopyOf("map_int32_timestamp", builder.map_int32_timestamp);
    this.oneof_string = builder.oneof_string;
    this.oneof_int32 = builder.oneof_int32;
    this.oneof_nested_message = builder.oneof_nested_message;
    this.oneof_any = builder.oneof_any;
    this.oneof_duration = builder.oneof_duration;
    this.oneof_struct = Internal.immutableCopyOfStruct("oneof_struct", builder.oneof_struct);
    this.oneof_list_value = Internal.immutableCopyOfStruct("oneof_list_value", builder.oneof_list_value);
    this.oneof_empty = builder.oneof_empty;
    this.oneof_timestamp = builder.oneof_timestamp;
  }

  @Override
  public Builder newBuilder() {
    Builder builder = new Builder();
    builder.int32 = int32;
    builder.uint32 = uint32;
    builder.sint32 = sint32;
    builder.fixed32 = fixed32;
    builder.sfixed32 = sfixed32;
    builder.int64 = int64;
    builder.uint64 = uint64;
    builder.sint64 = sint64;
    builder.fixed64 = fixed64;
    builder.sfixed64 = sfixed64;
    builder.bool = bool;
    builder.float_ = float_;
    builder.double_ = double_;
    builder.string = string;
    builder.bytes = bytes;
    builder.nested_enum = nested_enum;
    builder.nested_message = nested_message;
    builder.any = any;
    builder.duration = duration;
    builder.struct = struct;
    builder.list_value = list_value;
    builder.value = value;
    builder.null_value = null_value;
    builder.empty = empty;
    builder.timestamp = timestamp;
    builder.opt_int32 = opt_int32;
    builder.opt_uint32 = opt_uint32;
    builder.opt_sint32 = opt_sint32;
    builder.opt_fixed32 = opt_fixed32;
    builder.opt_sfixed32 = opt_sfixed32;
    builder.opt_int64 = opt_int64;
    builder.opt_uint64 = opt_uint64;
    builder.opt_sint64 = opt_sint64;
    builder.opt_fixed64 = opt_fixed64;
    builder.opt_sfixed64 = opt_sfixed64;
    builder.opt_bool = opt_bool;
    builder.opt_float = opt_float;
    builder.opt_double = opt_double;
    builder.opt_string = opt_string;
    builder.opt_bytes = opt_bytes;
    builder.rep_int32 = Internal.copyOf(rep_int32);
    builder.rep_uint32 = Internal.copyOf(rep_uint32);
    builder.rep_sint32 = Internal.copyOf(rep_sint32);
    builder.rep_fixed32 = Internal.copyOf(rep_fixed32);
    builder.rep_sfixed32 = Internal.copyOf(rep_sfixed32);
    builder.rep_int64 = Internal.copyOf(rep_int64);
    builder.rep_uint64 = Internal.copyOf(rep_uint64);
    builder.rep_sint64 = Internal.copyOf(rep_sint64);
    builder.rep_fixed64 = Internal.copyOf(rep_fixed64);
    builder.rep_sfixed64 = Internal.copyOf(rep_sfixed64);
    builder.rep_bool = Internal.copyOf(rep_bool);
    builder.rep_float = Internal.copyOf(rep_float);
    builder.rep_double = Internal.copyOf(rep_double);
    builder.rep_string = Internal.copyOf(rep_string);
    builder.rep_bytes = Internal.copyOf(rep_bytes);
    builder.rep_nested_enum = Internal.copyOf(rep_nested_enum);
    builder.rep_nested_message = Internal.copyOf(rep_nested_message);
    builder.rep_any = Internal.copyOf(rep_any);
    builder.rep_duration = Internal.copyOf(rep_duration);
    builder.rep_struct = Internal.copyOf(rep_struct);
    builder.rep_list_value = Internal.copyOf(rep_list_value);
    builder.rep_value = Internal.copyOf(rep_value);
    builder.rep_null_value = Internal.copyOf(rep_null_value);
    builder.rep_empty = Internal.copyOf(rep_empty);
    builder.rep_timestamp = Internal.copyOf(rep_timestamp);
    builder.pack_int32 = Internal.copyOf(pack_int32);
    builder.pack_uint32 = Internal.copyOf(pack_uint32);
    builder.pack_sint32 = Internal.copyOf(pack_sint32);
    builder.pack_fixed32 = Internal.copyOf(pack_fixed32);
    builder.pack_sfixed32 = Internal.copyOf(pack_sfixed32);
    builder.pack_int64 = Internal.copyOf(pack_int64);
    builder.pack_uint64 = Internal.copyOf(pack_uint64);
    builder.pack_sint64 = Internal.copyOf(pack_sint64);
    builder.pack_fixed64 = Internal.copyOf(pack_fixed64);
    builder.pack_sfixed64 = Internal.copyOf(pack_sfixed64);
    builder.pack_bool = Internal.copyOf(pack_bool);
    builder.pack_float = Internal.copyOf(pack_float);
    builder.pack_double = Internal.copyOf(pack_double);
    builder.pack_nested_enum = Internal.copyOf(pack_nested_enum);
    builder.pack_null_value = Internal.copyOf(pack_null_value);
    builder.map_int32_int32 = Internal.copyOf(map_int32_int32);
    builder.map_string_string = Internal.copyOf(map_string_string);
    builder.map_string_message = Internal.copyOf(map_string_message);
    builder.map_string_enum = Internal.copyOf(map_string_enum);
    builder.map_int32_any = Internal.copyOf(map_int32_any);
    builder.map_int32_duration = Internal.copyOf(map_int32_duration);
    builder.map_int32_struct = Internal.copyOf(map_int32_struct);
    builder.map_int32_list_value = Internal.copyOf(map_int32_list_value);
    builder.map_int32_value = Internal.copyOf(map_int32_value);
    builder.map_int32_null_value = Internal.copyOf(map_int32_null_value);
    builder.map_int32_empty = Internal.copyOf(map_int32_empty);
    builder.map_int32_timestamp = Internal.copyOf(map_int32_timestamp);
    builder.oneof_string = oneof_string;
    builder.oneof_int32 = oneof_int32;
    builder.oneof_nested_message = oneof_nested_message;
    builder.oneof_any = oneof_any;
    builder.oneof_duration = oneof_duration;
    builder.oneof_struct = oneof_struct;
    builder.oneof_list_value = oneof_list_value;
    builder.oneof_empty = oneof_empty;
    builder.oneof_timestamp = oneof_timestamp;
    builder.addUnknownFields(unknownFields());
    return builder;
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof AllTypes)) return false;
    AllTypes o = (AllTypes) other;
    return unknownFields().equals(o.unknownFields())
        && Internal.equals(int32, o.int32)
        && Internal.equals(uint32, o.uint32)
        && Internal.equals(sint32, o.sint32)
        && Internal.equals(fixed32, o.fixed32)
        && Internal.equals(sfixed32, o.sfixed32)
        && Internal.equals(int64, o.int64)
        && Internal.equals(uint64, o.uint64)
        && Internal.equals(sint64, o.sint64)
        && Internal.equals(fixed64, o.fixed64)
        && Internal.equals(sfixed64, o.sfixed64)
        && Internal.equals(bool, o.bool)
        && Internal.equals(float_, o.float_)
        && Internal.equals(double_, o.double_)
        && Internal.equals(string, o.string)
        && Internal.equals(bytes, o.bytes)
        && Internal.equals(nested_enum, o.nested_enum)
        && Internal.equals(nested_message, o.nested_message)
        && Internal.equals(any, o.any)
        && Internal.equals(duration, o.duration)
        && Internal.equals(struct, o.struct)
        && Internal.equals(list_value, o.list_value)
        && Internal.equals(value, o.value)
        && Internal.equals(null_value, o.null_value)
        && Internal.equals(empty, o.empty)
        && Internal.equals(timestamp, o.timestamp)
        && Internal.equals(opt_int32, o.opt_int32)
        && Internal.equals(opt_uint32, o.opt_uint32)
        && Internal.equals(opt_sint32, o.opt_sint32)
        && Internal.equals(opt_fixed32, o.opt_fixed32)
        && Internal.equals(opt_sfixed32, o.opt_sfixed32)
        && Internal.equals(opt_int64, o.opt_int64)
        && Internal.equals(opt_uint64, o.opt_uint64)
        && Internal.equals(opt_sint64, o.opt_sint64)
        && Internal.equals(opt_fixed64, o.opt_fixed64)
        && Internal.equals(opt_sfixed64, o.opt_sfixed64)
        && Internal.equals(opt_bool, o.opt_bool)
        && Internal.equals(opt_float, o.opt_float)
        && Internal.equals(opt_double, o.opt_double)
        && Internal.equals(opt_string, o.opt_string)
        && Internal.equals(opt_bytes, o.opt_bytes)
        && rep_int32.equals(o.rep_int32)
        && rep_uint32.equals(o.rep_uint32)
        && rep_sint32.equals(o.rep_sint32)
        && rep_fixed32.equals(o.rep_fixed32)
        && rep_sfixed32.equals(o.rep_sfixed32)
        && rep_int64.equals(o.rep_int64)
        && rep_uint64.equals(o.rep_uint64)
        && rep_sint64.equals(o.rep_sint64)
        && rep_fixed64.equals(o.rep_fixed64)
        && rep_sfixed64.equals(o.rep_sfixed64)
        && rep_bool.equals(o.rep_bool)
        && rep_float.equals(o.rep_float)
        && rep_double.equals(o.rep_double)
        && rep_string.equals(o.rep_string)
        && rep_bytes.equals(o.rep_bytes)
        && rep_nested_enum.equals(o.rep_nested_enum)
        && rep_nested_message.equals(o.rep_nested_message)
        && rep_any.equals(o.rep_any)
        && rep_duration.equals(o.rep_duration)
        && rep_struct.equals(o.rep_struct)
        && rep_list_value.equals(o.rep_list_value)
        && rep_value.equals(o.rep_value)
        && rep_null_value.equals(o.rep_null_value)
        && rep_empty.equals(o.rep_empty)
        && rep_timestamp.equals(o.rep_timestamp)
        && pack_int32.equals(o.pack_int32)
        && pack_uint32.equals(o.pack_uint32)
        && pack_sint32.equals(o.pack_sint32)
        && pack_fixed32.equals(o.pack_fixed32)
        && pack_sfixed32.equals(o.pack_sfixed32)
        && pack_int64.equals(o.pack_int64)
        && pack_uint64.equals(o.pack_uint64)
        && pack_sint64.equals(o.pack_sint64)
        && pack_fixed64.equals(o.pack_fixed64)
        && pack_sfixed64.equals(o.pack_sfixed64)
        && pack_bool.equals(o.pack_bool)
        && pack_float.equals(o.pack_float)
        && pack_double.equals(o.pack_double)
        && pack_nested_enum.equals(o.pack_nested_enum)
        && pack_null_value.equals(o.pack_null_value)
        && map_int32_int32.equals(o.map_int32_int32)
        && map_string_string.equals(o.map_string_string)
        && map_string_message.equals(o.map_string_message)
        && map_string_enum.equals(o.map_string_enum)
        && map_int32_any.equals(o.map_int32_any)
        && map_int32_duration.equals(o.map_int32_duration)
        && map_int32_struct.equals(o.map_int32_struct)
        && map_int32_list_value.equals(o.map_int32_list_value)
        && map_int32_value.equals(o.map_int32_value)
        && map_int32_null_value.equals(o.map_int32_null_value)
        && map_int32_empty.equals(o.map_int32_empty)
        && map_int32_timestamp.equals(o.map_int32_timestamp)
        && Internal.equals(oneof_string, o.oneof_string)
        && Internal.equals(oneof_int32, o.oneof_int32)
        && Internal.equals(oneof_nested_message, o.oneof_nested_message)
        && Internal.equals(oneof_any, o.oneof_any)
        && Internal.equals(oneof_duration, o.oneof_duration)
        && Internal.equals(oneof_struct, o.oneof_struct)
        && Internal.equals(oneof_list_value, o.oneof_list_value)
        && Internal.equals(oneof_empty, o.oneof_empty)
        && Internal.equals(oneof_timestamp, o.oneof_timestamp);
  }

  @Override
  public int hashCode() {
    int result = super.hashCode;
    if (result == 0) {
      result = unknownFields().hashCode();
      result = result * 37 + Integer.hashCode(int32);
      result = result * 37 + Integer.hashCode(uint32);
      result = result * 37 + Integer.hashCode(sint32);
      result = result * 37 + Integer.hashCode(fixed32);
      result = result * 37 + Integer.hashCode(sfixed32);
      result = result * 37 + Long.hashCode(int64);
      result = result * 37 + Long.hashCode(uint64);
      result = result * 37 + Long.hashCode(sint64);
      result = result * 37 + Long.hashCode(fixed64);
      result = result * 37 + Long.hashCode(sfixed64);
      result = result * 37 + Boolean.hashCode(bool);
      result = result * 37 + Float.hashCode(float_);
      result = result * 37 + Double.hashCode(double_);
      result = result * 37 + (string != null ? string.hashCode() : 0);
      result = result * 37 + (bytes != null ? bytes.hashCode() : 0);
      result = result * 37 + (nested_enum != null ? nested_enum.hashCode() : 0);
      result = result * 37 + (nested_message != null ? nested_message.hashCode() : 0);
      result = result * 37 + (any != null ? any.hashCode() : 0);
      result = result * 37 + (duration != null ? duration.hashCode() : 0);
      result = result * 37 + (struct != null ? struct.hashCode() : 0);
      result = result * 37 + (list_value != null ? list_value.hashCode() : 0);
      result = result * 37 + (value != null ? value.hashCode() : 0);
      result = result * 37 + (null_value != null ? null_value.hashCode() : 0);
      result = result * 37 + (empty != null ? empty.hashCode() : 0);
      result = result * 37 + (timestamp != null ? timestamp.hashCode() : 0);
      result = result * 37 + (opt_int32 != null ? opt_int32.hashCode() : 0);
      result = result * 37 + (opt_uint32 != null ? opt_uint32.hashCode() : 0);
      result = result * 37 + (opt_sint32 != null ? opt_sint32.hashCode() : 0);
      result = result * 37 + (opt_fixed32 != null ? opt_fixed32.hashCode() : 0);
      result = result * 37 + (opt_sfixed32 != null ? opt_sfixed32.hashCode() : 0);
      result = result * 37 + (opt_int64 != null ? opt_int64.hashCode() : 0);
      result = result * 37 + (opt_uint64 != null ? opt_uint64.hashCode() : 0);
      result = result * 37 + (opt_sint64 != null ? opt_sint64.hashCode() : 0);
      result = result * 37 + (opt_fixed64 != null ? opt_fixed64.hashCode() : 0);
      result = result * 37 + (opt_sfixed64 != null ? opt_sfixed64.hashCode() : 0);
      result = result * 37 + (opt_bool != null ? opt_bool.hashCode() : 0);
      result = result * 37 + (opt_float != null ? opt_float.hashCode() : 0);
      result = result * 37 + (opt_double != null ? opt_double.hashCode() : 0);
      result = result * 37 + (opt_string != null ? opt_string.hashCode() : 0);
      result = result * 37 + (opt_bytes != null ? opt_bytes.hashCode() : 0);
      result = result * 37 + rep_int32.hashCode();
      result = result * 37 + rep_uint32.hashCode();
      result = result * 37 + rep_sint32.hashCode();
      result = result * 37 + rep_fixed32.hashCode();
      result = result * 37 + rep_sfixed32.hashCode();
      result = result * 37 + rep_int64.hashCode();
      result = result * 37 + rep_uint64.hashCode();
      result = result * 37 + rep_sint64.hashCode();
      result = result * 37 + rep_fixed64.hashCode();
      result = result * 37 + rep_sfixed64.hashCode();
      result = result * 37 + rep_bool.hashCode();
      result = result * 37 + rep_float.hashCode();
      result = result * 37 + rep_double.hashCode();
      result = result * 37 + rep_string.hashCode();
      result = result * 37 + rep_bytes.hashCode();
      result = result * 37 + rep_nested_enum.hashCode();
      result = result * 37 + rep_nested_message.hashCode();
      result = result * 37 + rep_any.hashCode();
      result = result * 37 + rep_duration.hashCode();
      result = result * 37 + rep_struct.hashCode();
      result = result * 37 + rep_list_value.hashCode();
      result = result * 37 + rep_value.hashCode();
      result = result * 37 + rep_null_value.hashCode();
      result = result * 37 + rep_empty.hashCode();
      result = result * 37 + rep_timestamp.hashCode();
      result = result * 37 + pack_int32.hashCode();
      result = result * 37 + pack_uint32.hashCode();
      result = result * 37 + pack_sint32.hashCode();
      result = result * 37 + pack_fixed32.hashCode();
      result = result * 37 + pack_sfixed32.hashCode();
      result = result * 37 + pack_int64.hashCode();
      result = result * 37 + pack_uint64.hashCode();
      result = result * 37 + pack_sint64.hashCode();
      result = result * 37 + pack_fixed64.hashCode();
      result = result * 37 + pack_sfixed64.hashCode();
      result = result * 37 + pack_bool.hashCode();
      result = result * 37 + pack_float.hashCode();
      result = result * 37 + pack_double.hashCode();
      result = result * 37 + pack_nested_enum.hashCode();
      result = result * 37 + pack_null_value.hashCode();
      result = result * 37 + map_int32_int32.hashCode();
      result = result * 37 + map_string_string.hashCode();
      result = result * 37 + map_string_message.hashCode();
      result = result * 37 + map_string_enum.hashCode();
      result = result * 37 + map_int32_any.hashCode();
      result = result * 37 + map_int32_duration.hashCode();
      result = result * 37 + map_int32_struct.hashCode();
      result = result * 37 + map_int32_list_value.hashCode();
      result = result * 37 + map_int32_value.hashCode();
      result = result * 37 + map_int32_null_value.hashCode();
      result = result * 37 + map_int32_empty.hashCode();
      result = result * 37 + map_int32_timestamp.hashCode();
      result = result * 37 + (oneof_string != null ? oneof_string.hashCode() : 0);
      result = result * 37 + (oneof_int32 != null ? oneof_int32.hashCode() : 0);
      result = result * 37 + (oneof_nested_message != null ? oneof_nested_message.hashCode() : 0);
      result = result * 37 + (oneof_any != null ? oneof_any.hashCode() : 0);
      result = result * 37 + (oneof_duration != null ? oneof_duration.hashCode() : 0);
      result = result * 37 + (oneof_struct != null ? oneof_struct.hashCode() : 0);
      result = result * 37 + (oneof_list_value != null ? oneof_list_value.hashCode() : 0);
      result = result * 37 + (oneof_empty != null ? oneof_empty.hashCode() : 0);
      result = result * 37 + (oneof_timestamp != null ? oneof_timestamp.hashCode() : 0);
      super.hashCode = result;
    }
    return result;
  }

  @Override
  public String toString() {
    StringBuilder builder = new StringBuilder();
    builder.append(", int32=").append(int32);
    builder.append(", uint32=").append(uint32);
    builder.append(", sint32=").append(sint32);
    builder.append(", fixed32=").append(fixed32);
    builder.append(", sfixed32=").append(sfixed32);
    builder.append(", int64=").append(int64);
    builder.append(", uint64=").append(uint64);
    builder.append(", sint64=").append(sint64);
    builder.append(", fixed64=").append(fixed64);
    builder.append(", sfixed64=").append(sfixed64);
    builder.append(", bool=").append(bool);
    builder.append(", float=").append(float_);
    builder.append(", double=").append(double_);
    if (string != null) builder.append(", string=").append(Internal.sanitize(string));
    if (bytes != null) builder.append(", bytes=").append(bytes);
    if (nested_enum != null) builder.append(", nested_enum=").append(nested_enum);
    if (nested_message != null) builder.append(", nested_message=").append(nested_message);
    if (any != null) builder.append(", any=").append(any);
    if (duration != null) builder.append(", duration=").append(duration);
    if (struct != null) builder.append(", struct=").append(struct);
    if (list_value != null) builder.append(", list_value=").append(list_value);
    if (value != null) builder.append(", value=").append(value);
    if (null_value != null) builder.append(", null_value=").append(null_value);
    if (empty != null) builder.append(", empty=").append(empty);
    if (timestamp != null) builder.append(", timestamp=").append(timestamp);
    if (opt_int32 != null) builder.append(", opt_int32=").append(opt_int32);
    if (opt_uint32 != null) builder.append(", opt_uint32=").append(opt_uint32);
    if (opt_sint32 != null) builder.append(", opt_sint32=").append(opt_sint32);
    if (opt_fixed32 != null) builder.append(", opt_fixed32=").append(opt_fixed32);
    if (opt_sfixed32 != null) builder.append(", opt_sfixed32=").append(opt_sfixed32);
    if (opt_int64 != null) builder.append(", opt_int64=").append(opt_int64);
    if (opt_uint64 != null) builder.append(", opt_uint64=").append(opt_uint64);
    if (opt_sint64 != null) builder.append(", opt_sint64=").append(opt_sint64);
    if (opt_fixed64 != null) builder.append(", opt_fixed64=").append(opt_fixed64);
    if (opt_sfixed64 != null) builder.append(", opt_sfixed64=").append(opt_sfixed64);
    if (opt_bool != null) builder.append(", opt_bool=").append(opt_bool);
    if (opt_float != null) builder.append(", opt_float=").append(opt_float);
    if (opt_double != null) builder.append(", opt_double=").append(opt_double);
    if (opt_string != null) builder.append(", opt_string=").append(Internal.sanitize(opt_string));
    if (opt_bytes != null) builder.append(", opt_bytes=").append(opt_bytes);
    if (!rep_int32.isEmpty()) builder.append(", rep_int32=").append(rep_int32);
    if (!rep_uint32.isEmpty()) builder.append(", rep_uint32=").append(rep_uint32);
    if (!rep_sint32.isEmpty()) builder.append(", rep_sint32=").append(rep_sint32);
    if (!rep_fixed32.isEmpty()) builder.append(", rep_fixed32=").append(rep_fixed32);
    if (!rep_sfixed32.isEmpty()) builder.append(", rep_sfixed32=").append(rep_sfixed32);
    if (!rep_int64.isEmpty()) builder.append(", rep_int64=").append(rep_int64);
    if (!rep_uint64.isEmpty()) builder.append(", rep_uint64=").append(rep_uint64);
    if (!rep_sint64.isEmpty()) builder.append(", rep_sint64=").append(rep_sint64);
    if (!rep_fixed64.isEmpty()) builder.append(", rep_fixed64=").append(rep_fixed64);
    if (!rep_sfixed64.isEmpty()) builder.append(", rep_sfixed64=").append(rep_sfixed64);
    if (!rep_bool.isEmpty()) builder.append(", rep_bool=").append(rep_bool);
    if (!rep_float.isEmpty()) builder.append(", rep_float=").append(rep_float);
    if (!rep_double.isEmpty()) builder.append(", rep_double=").append(rep_double);
    if (!rep_string.isEmpty()) builder.append(", rep_string=").append(Internal.sanitize(rep_string));
    if (!rep_bytes.isEmpty()) builder.append(", rep_bytes=").append(rep_bytes);
    if (!rep_nested_enum.isEmpty()) builder.append(", rep_nested_enum=").append(rep_nested_enum);
    if (!rep_nested_message.isEmpty()) builder.append(", rep_nested_message=").append(rep_nested_message);
    if (!rep_any.isEmpty()) builder.append(", rep_any=").append(rep_any);
    if (!rep_duration.isEmpty()) builder.append(", rep_duration=").append(rep_duration);
    if (!rep_struct.isEmpty()) builder.append(", rep_struct=").append(rep_struct);
    if (!rep_list_value.isEmpty()) builder.append(", rep_list_value=").append(rep_list_value);
    if (!rep_value.isEmpty()) builder.append(", rep_value=").append(rep_value);
    if (!rep_null_value.isEmpty()) builder.append(", rep_null_value=").append(rep_null_value);
    if (!rep_empty.isEmpty()) builder.append(", rep_empty=").append(rep_empty);
    if (!rep_timestamp.isEmpty()) builder.append(", rep_timestamp=").append(rep_timestamp);
    if (!pack_int32.isEmpty()) builder.append(", pack_int32=").append(pack_int32);
    if (!pack_uint32.isEmpty()) builder.append(", pack_uint32=").append(pack_uint32);
    if (!pack_sint32.isEmpty()) builder.append(", pack_sint32=").append(pack_sint32);
    if (!pack_fixed32.isEmpty()) builder.append(", pack_fixed32=").append(pack_fixed32);
    if (!pack_sfixed32.isEmpty()) builder.append(", pack_sfixed32=").append(pack_sfixed32);
    if (!pack_int64.isEmpty()) builder.append(", pack_int64=").append(pack_int64);
    if (!pack_uint64.isEmpty()) builder.append(", pack_uint64=").append(pack_uint64);
    if (!pack_sint64.isEmpty()) builder.append(", pack_sint64=").append(pack_sint64);
    if (!pack_fixed64.isEmpty()) builder.append(", pack_fixed64=").append(pack_fixed64);
    if (!pack_sfixed64.isEmpty()) builder.append(", pack_sfixed64=").append(pack_sfixed64);
    if (!pack_bool.isEmpty()) builder.append(", pack_bool=").append(pack_bool);
    if (!pack_float.isEmpty()) builder.append(", pack_float=").append(pack_float);
    if (!pack_double.isEmpty()) builder.append(", pack_double=").append(pack_double);
    if (!pack_nested_enum.isEmpty()) builder.append(", pack_nested_enum=").append(pack_nested_enum);
    if (!pack_null_value.isEmpty()) builder.append(", pack_null_value=").append(pack_null_value);
    if (!map_int32_int32.isEmpty()) builder.append(", map_int32_int32=").append(map_int32_int32);
    if (!map_string_string.isEmpty()) builder.append(", map_string_string=").append(map_string_string);
    if (!map_string_message.isEmpty()) builder.append(", map_string_message=").append(map_string_message);
    if (!map_string_enum.isEmpty()) builder.append(", map_string_enum=").append(map_string_enum);
    if (!map_int32_any.isEmpty()) builder.append(", map_int32_any=").append(map_int32_any);
    if (!map_int32_duration.isEmpty()) builder.append(", map_int32_duration=").append(map_int32_duration);
    if (!map_int32_struct.isEmpty()) builder.append(", map_int32_struct=").append(map_int32_struct);
    if (!map_int32_list_value.isEmpty()) builder.append(", map_int32_list_value=").append(map_int32_list_value);
    if (!map_int32_value.isEmpty()) builder.append(", map_int32_value=").append(map_int32_value);
    if (!map_int32_null_value.isEmpty()) builder.append(", map_int32_null_value=").append(map_int32_null_value);
    if (!map_int32_empty.isEmpty()) builder.append(", map_int32_empty=").append(map_int32_empty);
    if (!map_int32_timestamp.isEmpty()) builder.append(", map_int32_timestamp=").append(map_int32_timestamp);
    if (oneof_string != null) builder.append(", oneof_string=").append(Internal.sanitize(oneof_string));
    if (oneof_int32 != null) builder.append(", oneof_int32=").append(oneof_int32);
    if (oneof_nested_message != null) builder.append(", oneof_nested_message=").append(oneof_nested_message);
    if (oneof_any != null) builder.append(", oneof_any=").append(oneof_any);
    if (oneof_duration != null) builder.append(", oneof_duration=").append(oneof_duration);
    if (oneof_struct != null) builder.append(", oneof_struct=").append(oneof_struct);
    if (oneof_list_value != null) builder.append(", oneof_list_value=").append(oneof_list_value);
    if (oneof_empty != null) builder.append(", oneof_empty=").append(oneof_empty);
    if (oneof_timestamp != null) builder.append(", oneof_timestamp=").append(oneof_timestamp);
    return builder.replace(0, 2, "AllTypes{").append('}').toString();
  }

  public static final class Builder extends Message.Builder<AllTypes, Builder> {
    public int int32;

    public int uint32;

    public int sint32;

    public int fixed32;

    public int sfixed32;

    public long int64;

    public long uint64;

    public long sint64;

    public long fixed64;

    public long sfixed64;

    public boolean bool;

    public float float_;

    public double double_;

    public String string;

    public ByteString bytes;

    public NestedEnum nested_enum;

    public NestedMessage nested_message;

    public AnyMessage any;

    public Duration duration;

    public Map<String, ?> struct;

    public List<?> list_value;

    public Object value;

    public Void null_value;

    public Unit empty;

    public Instant timestamp;

    public Integer opt_int32;

    public Integer opt_uint32;

    public Integer opt_sint32;

    public Integer opt_fixed32;

    public Integer opt_sfixed32;

    public Long opt_int64;

    public Long opt_uint64;

    public Long opt_sint64;

    public Long opt_fixed64;

    public Long opt_sfixed64;

    public Boolean opt_bool;

    public Float opt_float;

    public Double opt_double;

    public String opt_string;

    public ByteString opt_bytes;

    public List<Integer> rep_int32;

    public List<Integer> rep_uint32;

    public List<Integer> rep_sint32;

    public List<Integer> rep_fixed32;

    public List<Integer> rep_sfixed32;

    public List<Long> rep_int64;

    public List<Long> rep_uint64;

    public List<Long> rep_sint64;

    public List<Long> rep_fixed64;

    public List<Long> rep_sfixed64;

    public List<Boolean> rep_bool;

    public List<Float> rep_float;

    public List<Double> rep_double;

    public List<String> rep_string;

    public List<ByteString> rep_bytes;

    public List<NestedEnum> rep_nested_enum;

    public List<NestedMessage> rep_nested_message;

    public List<AnyMessage> rep_any;

    public List<Duration> rep_duration;

    public List<Map<String, ?>> rep_struct;

    public List<List<?>> rep_list_value;

    public List<Object> rep_value;

    public List<Void> rep_null_value;

    public List<Unit> rep_empty;

    public List<Instant> rep_timestamp;

    public List<Integer> pack_int32;

    public List<Integer> pack_uint32;

    public List<Integer> pack_sint32;

    public List<Integer> pack_fixed32;

    public List<Integer> pack_sfixed32;

    public List<Long> pack_int64;

    public List<Long> pack_uint64;

    public List<Long> pack_sint64;

    public List<Long> pack_fixed64;

    public List<Long> pack_sfixed64;

    public List<Boolean> pack_bool;

    public List<Float> pack_float;

    public List<Double> pack_double;

    public List<NestedEnum> pack_nested_enum;

    public List<Void> pack_null_value;

    public Map<Integer, Integer> map_int32_int32;

    public Map<String, String> map_string_string;

    public Map<String, NestedMessage> map_string_message;

    public Map<String, NestedEnum> map_string_enum;

    public Map<Integer, AnyMessage> map_int32_any;

    public Map<Integer, Duration> map_int32_duration;

    public Map<Integer, Map<String, ?>> map_int32_struct;

    public Map<Integer, List<?>> map_int32_list_value;

    public Map<Integer, Object> map_int32_value;

    public Map<Integer, Void> map_int32_null_value;

    public Map<Integer, Unit> map_int32_empty;

    public Map<Integer, Instant> map_int32_timestamp;

    public String oneof_string;

    public Integer oneof_int32;

    public NestedMessage oneof_nested_message;

    public AnyMessage oneof_any;

    public Duration oneof_duration;

    public Map<String, ?> oneof_struct;

    public List<?> oneof_list_value;

    public Unit oneof_empty;

    public Instant oneof_timestamp;

    public Builder() {
      int32 = 0;
      uint32 = 0;
      sint32 = 0;
      fixed32 = 0;
      sfixed32 = 0;
      int64 = 0L;
      uint64 = 0L;
      sint64 = 0L;
      fixed64 = 0L;
      sfixed64 = 0L;
      bool = false;
      float_ = 0f;
      double_ = 0.0;
      string = "";
      bytes = ByteString.EMPTY;
      nested_enum = NestedEnum.UNKNOWN;
      rep_int32 = Internal.newMutableList();
      rep_uint32 = Internal.newMutableList();
      rep_sint32 = Internal.newMutableList();
      rep_fixed32 = Internal.newMutableList();
      rep_sfixed32 = Internal.newMutableList();
      rep_int64 = Internal.newMutableList();
      rep_uint64 = Internal.newMutableList();
      rep_sint64 = Internal.newMutableList();
      rep_fixed64 = Internal.newMutableList();
      rep_sfixed64 = Internal.newMutableList();
      rep_bool = Internal.newMutableList();
      rep_float = Internal.newMutableList();
      rep_double = Internal.newMutableList();
      rep_string = Internal.newMutableList();
      rep_bytes = Internal.newMutableList();
      rep_nested_enum = Internal.newMutableList();
      rep_nested_message = Internal.newMutableList();
      rep_any = Internal.newMutableList();
      rep_duration = Internal.newMutableList();
      rep_struct = Internal.newMutableList();
      rep_list_value = Internal.newMutableList();
      rep_value = Internal.newMutableList();
      rep_null_value = Internal.newMutableList();
      rep_empty = Internal.newMutableList();
      rep_timestamp = Internal.newMutableList();
      pack_int32 = Internal.newMutableList();
      pack_uint32 = Internal.newMutableList();
      pack_sint32 = Internal.newMutableList();
      pack_fixed32 = Internal.newMutableList();
      pack_sfixed32 = Internal.newMutableList();
      pack_int64 = Internal.newMutableList();
      pack_uint64 = Internal.newMutableList();
      pack_sint64 = Internal.newMutableList();
      pack_fixed64 = Internal.newMutableList();
      pack_sfixed64 = Internal.newMutableList();
      pack_bool = Internal.newMutableList();
      pack_float = Internal.newMutableList();
      pack_double = Internal.newMutableList();
      pack_nested_enum = Internal.newMutableList();
      pack_null_value = Internal.newMutableList();
      map_int32_int32 = Internal.newMutableMap();
      map_string_string = Internal.newMutableMap();
      map_string_message = Internal.newMutableMap();
      map_string_enum = Internal.newMutableMap();
      map_int32_any = Internal.newMutableMap();
      map_int32_duration = Internal.newMutableMap();
      map_int32_struct = Internal.newMutableMap();
      map_int32_list_value = Internal.newMutableMap();
      map_int32_value = Internal.newMutableMap();
      map_int32_null_value = Internal.newMutableMap();
      map_int32_empty = Internal.newMutableMap();
      map_int32_timestamp = Internal.newMutableMap();
    }

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

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

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

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

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

    public Builder int64(long int64) {
      this.int64 = int64;
      return this;
    }

    public Builder uint64(long uint64) {
      this.uint64 = uint64;
      return this;
    }

    public Builder sint64(long sint64) {
      this.sint64 = sint64;
      return this;
    }

    public Builder fixed64(long fixed64) {
      this.fixed64 = fixed64;
      return this;
    }

    public Builder sfixed64(long sfixed64) {
      this.sfixed64 = sfixed64;
      return this;
    }

    public Builder bool(boolean bool) {
      this.bool = bool;
      return this;
    }

    public Builder float_(float float_) {
      this.float_ = float_;
      return this;
    }

    public Builder double_(double double_) {
      this.double_ = double_;
      return this;
    }

    public Builder string(String string) {
      this.string = string;
      return this;
    }

    public Builder bytes(ByteString bytes) {
      this.bytes = bytes;
      return this;
    }

    public Builder nested_enum(NestedEnum nested_enum) {
      this.nested_enum = nested_enum;
      return this;
    }

    public Builder nested_message(NestedMessage nested_message) {
      this.nested_message = nested_message;
      return this;
    }

    public Builder any(AnyMessage any) {
      this.any = any;
      return this;
    }

    public Builder duration(Duration duration) {
      this.duration = duration;
      return this;
    }

    public Builder struct(Map<String, ?> struct) {
      this.struct = struct;
      return this;
    }

    public Builder list_value(List<?> list_value) {
      this.list_value = list_value;
      return this;
    }

    public Builder value(Object value) {
      this.value = value;
      return this;
    }

    public Builder null_value(Void null_value) {
      this.null_value = null_value;
      return this;
    }

    public Builder empty(Unit empty) {
      this.empty = empty;
      return this;
    }

    public Builder timestamp(Instant timestamp) {
      this.timestamp = timestamp;
      return this;
    }

    public Builder opt_int32(Integer opt_int32) {
      this.opt_int32 = opt_int32;
      return this;
    }

    public Builder opt_uint32(Integer opt_uint32) {
      this.opt_uint32 = opt_uint32;
      return this;
    }

    public Builder opt_sint32(Integer opt_sint32) {
      this.opt_sint32 = opt_sint32;
      return this;
    }

    public Builder opt_fixed32(Integer opt_fixed32) {
      this.opt_fixed32 = opt_fixed32;
      return this;
    }

    public Builder opt_sfixed32(Integer opt_sfixed32) {
      this.opt_sfixed32 = opt_sfixed32;
      return this;
    }

    public Builder opt_int64(Long opt_int64) {
      this.opt_int64 = opt_int64;
      return this;
    }

    public Builder opt_uint64(Long opt_uint64) {
      this.opt_uint64 = opt_uint64;
      return this;
    }

    public Builder opt_sint64(Long opt_sint64) {
      this.opt_sint64 = opt_sint64;
      return this;
    }

    public Builder opt_fixed64(Long opt_fixed64) {
      this.opt_fixed64 = opt_fixed64;
      return this;
    }

    public Builder opt_sfixed64(Long opt_sfixed64) {
      this.opt_sfixed64 = opt_sfixed64;
      return this;
    }

    public Builder opt_bool(Boolean opt_bool) {
      this.opt_bool = opt_bool;
      return this;
    }

    public Builder opt_float(Float opt_float) {
      this.opt_float = opt_float;
      return this;
    }

    public Builder opt_double(Double opt_double) {
      this.opt_double = opt_double;
      return this;
    }

    public Builder opt_string(String opt_string) {
      this.opt_string = opt_string;
      return this;
    }

    public Builder opt_bytes(ByteString opt_bytes) {
      this.opt_bytes = opt_bytes;
      return this;
    }

    public Builder rep_int32(List<Integer> rep_int32) {
      Internal.checkElementsNotNull(rep_int32);
      this.rep_int32 = rep_int32;
      return this;
    }

    public Builder rep_uint32(List<Integer> rep_uint32) {
      Internal.checkElementsNotNull(rep_uint32);
      this.rep_uint32 = rep_uint32;
      return this;
    }

    public Builder rep_sint32(List<Integer> rep_sint32) {
      Internal.checkElementsNotNull(rep_sint32);
      this.rep_sint32 = rep_sint32;
      return this;
    }

    public Builder rep_fixed32(List<Integer> rep_fixed32) {
      Internal.checkElementsNotNull(rep_fixed32);
      this.rep_fixed32 = rep_fixed32;
      return this;
    }

    public Builder rep_sfixed32(List<Integer> rep_sfixed32) {
      Internal.checkElementsNotNull(rep_sfixed32);
      this.rep_sfixed32 = rep_sfixed32;
      return this;
    }

    public Builder rep_int64(List<Long> rep_int64) {
      Internal.checkElementsNotNull(rep_int64);
      this.rep_int64 = rep_int64;
      return this;
    }

    public Builder rep_uint64(List<Long> rep_uint64) {
      Internal.checkElementsNotNull(rep_uint64);
      this.rep_uint64 = rep_uint64;
      return this;
    }

    public Builder rep_sint64(List<Long> rep_sint64) {
      Internal.checkElementsNotNull(rep_sint64);
      this.rep_sint64 = rep_sint64;
      return this;
    }

    public Builder rep_fixed64(List<Long> rep_fixed64) {
      Internal.checkElementsNotNull(rep_fixed64);
      this.rep_fixed64 = rep_fixed64;
      return this;
    }

    public Builder rep_sfixed64(List<Long> rep_sfixed64) {
      Internal.checkElementsNotNull(rep_sfixed64);
      this.rep_sfixed64 = rep_sfixed64;
      return this;
    }

    public Builder rep_bool(List<Boolean> rep_bool) {
      Internal.checkElementsNotNull(rep_bool);
      this.rep_bool = rep_bool;
      return this;
    }

    public Builder rep_float(List<Float> rep_float) {
      Internal.checkElementsNotNull(rep_float);
      this.rep_float = rep_float;
      return this;
    }

    public Builder rep_double(List<Double> rep_double) {
      Internal.checkElementsNotNull(rep_double);
      this.rep_double = rep_double;
      return this;
    }

    public Builder rep_string(List<String> rep_string) {
      Internal.checkElementsNotNull(rep_string);
      this.rep_string = rep_string;
      return this;
    }

    public Builder rep_bytes(List<ByteString> rep_bytes) {
      Internal.checkElementsNotNull(rep_bytes);
      this.rep_bytes = rep_bytes;
      return this;
    }

    public Builder rep_nested_enum(List<NestedEnum> rep_nested_enum) {
      Internal.checkElementsNotNull(rep_nested_enum);
      this.rep_nested_enum = rep_nested_enum;
      return this;
    }

    public Builder rep_nested_message(List<NestedMessage> rep_nested_message) {
      Internal.checkElementsNotNull(rep_nested_message);
      this.rep_nested_message = rep_nested_message;
      return this;
    }

    public Builder rep_any(List<AnyMessage> rep_any) {
      Internal.checkElementsNotNull(rep_any);
      this.rep_any = rep_any;
      return this;
    }

    public Builder rep_duration(List<Duration> rep_duration) {
      Internal.checkElementsNotNull(rep_duration);
      this.rep_duration = rep_duration;
      return this;
    }

    public Builder rep_struct(List<Map<String, ?>> rep_struct) {
      Internal.checkElementsNotNull(rep_struct);
      this.rep_struct = rep_struct;
      return this;
    }

    public Builder rep_list_value(List<List<?>> rep_list_value) {
      Internal.checkElementsNotNull(rep_list_value);
      this.rep_list_value = rep_list_value;
      return this;
    }

    public Builder rep_value(List<Object> rep_value) {
      Internal.checkElementsNotNull(rep_value);
      this.rep_value = rep_value;
      return this;
    }

    public Builder rep_null_value(List<Void> rep_null_value) {
      Internal.checkElementsNotNull(rep_null_value);
      this.rep_null_value = rep_null_value;
      return this;
    }

    public Builder rep_empty(List<Unit> rep_empty) {
      Internal.checkElementsNotNull(rep_empty);
      this.rep_empty = rep_empty;
      return this;
    }

    public Builder rep_timestamp(List<Instant> rep_timestamp) {
      Internal.checkElementsNotNull(rep_timestamp);
      this.rep_timestamp = rep_timestamp;
      return this;
    }

    public Builder pack_int32(List<Integer> pack_int32) {
      Internal.checkElementsNotNull(pack_int32);
      this.pack_int32 = pack_int32;
      return this;
    }

    public Builder pack_uint32(List<Integer> pack_uint32) {
      Internal.checkElementsNotNull(pack_uint32);
      this.pack_uint32 = pack_uint32;
      return this;
    }

    public Builder pack_sint32(List<Integer> pack_sint32) {
      Internal.checkElementsNotNull(pack_sint32);
      this.pack_sint32 = pack_sint32;
      return this;
    }

    public Builder pack_fixed32(List<Integer> pack_fixed32) {
      Internal.checkElementsNotNull(pack_fixed32);
      this.pack_fixed32 = pack_fixed32;
      return this;
    }

    public Builder pack_sfixed32(List<Integer> pack_sfixed32) {
      Internal.checkElementsNotNull(pack_sfixed32);
      this.pack_sfixed32 = pack_sfixed32;
      return this;
    }

    public Builder pack_int64(List<Long> pack_int64) {
      Internal.checkElementsNotNull(pack_int64);
      this.pack_int64 = pack_int64;
      return this;
    }

    public Builder pack_uint64(List<Long> pack_uint64) {
      Internal.checkElementsNotNull(pack_uint64);
      this.pack_uint64 = pack_uint64;
      return this;
    }

    public Builder pack_sint64(List<Long> pack_sint64) {
      Internal.checkElementsNotNull(pack_sint64);
      this.pack_sint64 = pack_sint64;
      return this;
    }

    public Builder pack_fixed64(List<Long> pack_fixed64) {
      Internal.checkElementsNotNull(pack_fixed64);
      this.pack_fixed64 = pack_fixed64;
      return this;
    }

    public Builder pack_sfixed64(List<Long> pack_sfixed64) {
      Internal.checkElementsNotNull(pack_sfixed64);
      this.pack_sfixed64 = pack_sfixed64;
      return this;
    }

    public Builder pack_bool(List<Boolean> pack_bool) {
      Internal.checkElementsNotNull(pack_bool);
      this.pack_bool = pack_bool;
      return this;
    }

    public Builder pack_float(List<Float> pack_float) {
      Internal.checkElementsNotNull(pack_float);
      this.pack_float = pack_float;
      return this;
    }

    public Builder pack_double(List<Double> pack_double) {
      Internal.checkElementsNotNull(pack_double);
      this.pack_double = pack_double;
      return this;
    }

    public Builder pack_nested_enum(List<NestedEnum> pack_nested_enum) {
      Internal.checkElementsNotNull(pack_nested_enum);
      this.pack_nested_enum = pack_nested_enum;
      return this;
    }

    public Builder pack_null_value(List<Void> pack_null_value) {
      Internal.checkElementsNotNull(pack_null_value);
      this.pack_null_value = pack_null_value;
      return this;
    }

    public Builder map_int32_int32(Map<Integer, Integer> map_int32_int32) {
      Internal.checkElementsNotNull(map_int32_int32);
      this.map_int32_int32 = map_int32_int32;
      return this;
    }

    public Builder map_string_string(Map<String, String> map_string_string) {
      Internal.checkElementsNotNull(map_string_string);
      this.map_string_string = map_string_string;
      return this;
    }

    public Builder map_string_message(Map<String, NestedMessage> map_string_message) {
      Internal.checkElementsNotNull(map_string_message);
      this.map_string_message = map_string_message;
      return this;
    }

    public Builder map_string_enum(Map<String, NestedEnum> map_string_enum) {
      Internal.checkElementsNotNull(map_string_enum);
      this.map_string_enum = map_string_enum;
      return this;
    }

    public Builder map_int32_any(Map<Integer, AnyMessage> map_int32_any) {
      Internal.checkElementsNotNull(map_int32_any);
      this.map_int32_any = map_int32_any;
      return this;
    }

    public Builder map_int32_duration(Map<Integer, Duration> map_int32_duration) {
      Internal.checkElementsNotNull(map_int32_duration);
      this.map_int32_duration = map_int32_duration;
      return this;
    }

    public Builder map_int32_struct(Map<Integer, Map<String, ?>> map_int32_struct) {
      Internal.checkElementsNotNull(map_int32_struct);
      this.map_int32_struct = map_int32_struct;
      return this;
    }

    public Builder map_int32_list_value(Map<Integer, List<?>> map_int32_list_value) {
      Internal.checkElementsNotNull(map_int32_list_value);
      this.map_int32_list_value = map_int32_list_value;
      return this;
    }

    public Builder map_int32_value(Map<Integer, Object> map_int32_value) {
      Internal.checkElementsNotNull(map_int32_value);
      this.map_int32_value = map_int32_value;
      return this;
    }

    public Builder map_int32_null_value(Map<Integer, Void> map_int32_null_value) {
      Internal.checkElementsNotNull(map_int32_null_value);
      this.map_int32_null_value = map_int32_null_value;
      return this;
    }

    public Builder map_int32_empty(Map<Integer, Unit> map_int32_empty) {
      Internal.checkElementsNotNull(map_int32_empty);
      this.map_int32_empty = map_int32_empty;
      return this;
    }

    public Builder map_int32_timestamp(Map<Integer, Instant> map_int32_timestamp) {
      Internal.checkElementsNotNull(map_int32_timestamp);
      this.map_int32_timestamp = map_int32_timestamp;
      return this;
    }

    public Builder oneof_string(String oneof_string) {
      this.oneof_string = oneof_string;
      this.oneof_int32 = null;
      this.oneof_nested_message = null;
      this.oneof_any = null;
      this.oneof_duration = null;
      this.oneof_struct = null;
      this.oneof_list_value = null;
      this.oneof_empty = null;
      this.oneof_timestamp = null;
      return this;
    }

    public Builder oneof_int32(Integer oneof_int32) {
      this.oneof_int32 = oneof_int32;
      this.oneof_string = null;
      this.oneof_nested_message = null;
      this.oneof_any = null;
      this.oneof_duration = null;
      this.oneof_struct = null;
      this.oneof_list_value = null;
      this.oneof_empty = null;
      this.oneof_timestamp = null;
      return this;
    }

    public Builder oneof_nested_message(NestedMessage oneof_nested_message) {
      this.oneof_nested_message = oneof_nested_message;
      this.oneof_string = null;
      this.oneof_int32 = null;
      this.oneof_any = null;
      this.oneof_duration = null;
      this.oneof_struct = null;
      this.oneof_list_value = null;
      this.oneof_empty = null;
      this.oneof_timestamp = null;
      return this;
    }

    public Builder oneof_any(AnyMessage oneof_any) {
      this.oneof_any = oneof_any;
      this.oneof_string = null;
      this.oneof_int32 = null;
      this.oneof_nested_message = null;
      this.oneof_duration = null;
      this.oneof_struct = null;
      this.oneof_list_value = null;
      this.oneof_empty = null;
      this.oneof_timestamp = null;
      return this;
    }

    public Builder oneof_duration(Duration oneof_duration) {
      this.oneof_duration = oneof_duration;
      this.oneof_string = null;
      this.oneof_int32 = null;
      this.oneof_nested_message = null;
      this.oneof_any = null;
      this.oneof_struct = null;
      this.oneof_list_value = null;
      this.oneof_empty = null;
      this.oneof_timestamp = null;
      return this;
    }

    public Builder oneof_struct(Map<String, ?> oneof_struct) {
      this.oneof_struct = oneof_struct;
      this.oneof_string = null;
      this.oneof_int32 = null;
      this.oneof_nested_message = null;
      this.oneof_any = null;
      this.oneof_duration = null;
      this.oneof_list_value = null;
      this.oneof_empty = null;
      this.oneof_timestamp = null;
      return this;
    }

    public Builder oneof_list_value(List<?> oneof_list_value) {
      this.oneof_list_value = oneof_list_value;
      this.oneof_string = null;
      this.oneof_int32 = null;
      this.oneof_nested_message = null;
      this.oneof_any = null;
      this.oneof_duration = null;
      this.oneof_struct = null;
      this.oneof_empty = null;
      this.oneof_timestamp = null;
      return this;
    }

    /**
     * google.protobuf.Value oneof_value = 622;
     * google.protobuf.NullValue oneof_null_value = 623;
     */
    public Builder oneof_empty(Unit oneof_empty) {
      this.oneof_empty = oneof_empty;
      this.oneof_string = null;
      this.oneof_int32 = null;
      this.oneof_nested_message = null;
      this.oneof_any = null;
      this.oneof_duration = null;
      this.oneof_struct = null;
      this.oneof_list_value = null;
      this.oneof_timestamp = null;
      return this;
    }

    public Builder oneof_timestamp(Instant oneof_timestamp) {
      this.oneof_timestamp = oneof_timestamp;
      this.oneof_string = null;
      this.oneof_int32 = null;
      this.oneof_nested_message = null;
      this.oneof_any = null;
      this.oneof_duration = null;
      this.oneof_struct = null;
      this.oneof_list_value = null;
      this.oneof_empty = null;
      return this;
    }

    @Override
    public AllTypes build() {
      return new AllTypes(this, super.buildUnknownFields());
    }
  }

  public enum NestedEnum implements WireEnum {
    UNKNOWN(0),

    A(1);

    public static final ProtoAdapter<NestedEnum> ADAPTER = new ProtoAdapter_NestedEnum();

    private final int value;

    NestedEnum(int value) {
      this.value = value;
    }

    /**
     * Return the constant for {@code value} or null.
     */
    public static NestedEnum fromValue(int value) {
      switch (value) {
        case 0: return UNKNOWN;
        case 1: return A;
        default: return null;
      }
    }

    @Override
    public int getValue() {
      return value;
    }

    private static final class ProtoAdapter_NestedEnum extends EnumAdapter<NestedEnum> {
      ProtoAdapter_NestedEnum() {
        super(NestedEnum.class, Syntax.PROTO_3, NestedEnum.UNKNOWN);
      }

      @Override
      protected NestedEnum fromValue(int value) {
        return NestedEnum.fromValue(value);
      }
    }
  }

  public static final class NestedMessage extends Message<NestedMessage, NestedMessage.Builder> {
    public static final ProtoAdapter<NestedMessage> ADAPTER = new ProtoAdapter_NestedMessage();

    private static final long serialVersionUID = 0L;

    @WireField(
        tag = 1,
        adapter = "com.squareup.wire.ProtoAdapter#INT32",
        label = WireField.Label.OMIT_IDENTITY
    )
    public final int a;

    public NestedMessage(int a) {
      this(a, ByteString.EMPTY);
    }

    public NestedMessage(int a, ByteString unknownFields) {
      super(ADAPTER, unknownFields);
      this.a = a;
    }

    @Override
    public Builder newBuilder() {
      Builder builder = new Builder();
      builder.a = a;
      builder.addUnknownFields(unknownFields());
      return builder;
    }

    @Override
    public boolean equals(Object other) {
      if (other == this) return true;
      if (!(other instanceof NestedMessage)) return false;
      NestedMessage o = (NestedMessage) other;
      return unknownFields().equals(o.unknownFields())
          && Internal.equals(a, o.a);
    }

    @Override
    public int hashCode() {
      int result = super.hashCode;
      if (result == 0) {
        result = unknownFields().hashCode();
        result = result * 37 + Integer.hashCode(a);
        super.hashCode = result;
      }
      return result;
    }

    @Override
    public String toString() {
      StringBuilder builder = new StringBuilder();
      builder.append(", a=").append(a);
      return builder.replace(0, 2, "NestedMessage{").append('}').toString();
    }

    public static final class Builder extends Message.Builder<NestedMessage, Builder> {
      public int a;

      public Builder() {
        a = 0;
      }

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

      @Override
      public NestedMessage build() {
        return new NestedMessage(a, super.buildUnknownFields());
      }
    }

    private static final class ProtoAdapter_NestedMessage extends ProtoAdapter<NestedMessage> {
      public ProtoAdapter_NestedMessage() {
        super(FieldEncoding.LENGTH_DELIMITED, NestedMessage.class, "type.googleapis.com/proto3.java.AllTypes.NestedMessage", Syntax.PROTO_3, null, "all_types.proto");
      }

      @Override
      public int encodedSize(NestedMessage value) {
        int result = 0;
        if (!Objects.equals(value.a, 0)) {
          result += ProtoAdapter.INT32.encodedSizeWithTag(1, value.a);
        }
        result += value.unknownFields().size();
        return result;
      }

      @Override
      public void encode(ProtoWriter writer, NestedMessage value) throws IOException {
        if (!Objects.equals(value.a, 0)) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.a);
        writer.writeBytes(value.unknownFields());
      }

      @Override
      public void encode(ReverseProtoWriter writer, NestedMessage value) throws IOException {
        writer.writeBytes(value.unknownFields());
        if (!Objects.equals(value.a, 0)) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.a);
      }

      @Override
      public NestedMessage decode(ProtoReader reader) throws IOException {
        Builder builder = new Builder();
        long token = reader.beginMessage();
        for (int tag; (tag = reader.nextTag()) != -1;) {
          switch (tag) {
            case 1: builder.a(ProtoAdapter.INT32.decode(reader)); break;
            default: {
              reader.readUnknownField(tag);
            }
          }
        }
        builder.addUnknownFields(reader.endMessageAndGetUnknownFields(token));
        return builder.build();
      }

      @Override
      public NestedMessage redact(NestedMessage value) {
        Builder builder = value.newBuilder();
        builder.clearUnknownFields();
        return builder.build();
      }
    }
  }

  private static final class ProtoAdapter_AllTypes extends ProtoAdapter<AllTypes> {
    private ProtoAdapter<Map<Integer, Integer>> map_int32_int32;

    private ProtoAdapter<Map<String, String>> map_string_string;

    private ProtoAdapter<Map<String, NestedMessage>> map_string_message;

    private ProtoAdapter<Map<String, NestedEnum>> map_string_enum;

    private ProtoAdapter<Map<Integer, AnyMessage>> map_int32_any;

    private ProtoAdapter<Map<Integer, Duration>> map_int32_duration;

    private ProtoAdapter<Map<Integer, Map<String, ?>>> map_int32_struct;

    private ProtoAdapter<Map<Integer, List<?>>> map_int32_list_value;

    private ProtoAdapter<Map<Integer, Object>> map_int32_value;

    private ProtoAdapter<Map<Integer, Void>> map_int32_null_value;

    private ProtoAdapter<Map<Integer, Unit>> map_int32_empty;

    private ProtoAdapter<Map<Integer, Instant>> map_int32_timestamp;

    public ProtoAdapter_AllTypes() {
      super(FieldEncoding.LENGTH_DELIMITED, AllTypes.class, "type.googleapis.com/proto3.java.AllTypes", Syntax.PROTO_3, null, "all_types.proto");
    }

    @Override
    public int encodedSize(AllTypes value) {
      int result = 0;
      if (!Objects.equals(value.int32, 0)) {
        result += ProtoAdapter.INT32.encodedSizeWithTag(1, value.int32);
      }
      if (!Objects.equals(value.uint32, 0)) {
        result += ProtoAdapter.UINT32.encodedSizeWithTag(2, value.uint32);
      }
      if (!Objects.equals(value.sint32, 0)) {
        result += ProtoAdapter.SINT32.encodedSizeWithTag(3, value.sint32);
      }
      if (!Objects.equals(value.fixed32, 0)) {
        result += ProtoAdapter.FIXED32.encodedSizeWithTag(4, value.fixed32);
      }
      if (!Objects.equals(value.sfixed32, 0)) {
        result += ProtoAdapter.SFIXED32.encodedSizeWithTag(5, value.sfixed32);
      }
      if (!Objects.equals(value.int64, 0L)) {
        result += ProtoAdapter.INT64.encodedSizeWithTag(6, value.int64);
      }
      if (!Objects.equals(value.uint64, 0L)) {
        result += ProtoAdapter.UINT64.encodedSizeWithTag(7, value.uint64);
      }
      if (!Objects.equals(value.sint64, 0L)) {
        result += ProtoAdapter.SINT64.encodedSizeWithTag(8, value.sint64);
      }
      if (!Objects.equals(value.fixed64, 0L)) {
        result += ProtoAdapter.FIXED64.encodedSizeWithTag(9, value.fixed64);
      }
      if (!Objects.equals(value.sfixed64, 0L)) {
        result += ProtoAdapter.SFIXED64.encodedSizeWithTag(10, value.sfixed64);
      }
      if (!Objects.equals(value.bool, false)) {
        result += ProtoAdapter.BOOL.encodedSizeWithTag(11, value.bool);
      }
      if (!Objects.equals(value.float_, 0f)) {
        result += ProtoAdapter.FLOAT.encodedSizeWithTag(12, value.float_);
      }
      if (!Objects.equals(value.double_, 0.0)) {
        result += ProtoAdapter.DOUBLE.encodedSizeWithTag(13, value.double_);
      }
      if (!Objects.equals(value.string, "")) {
        result += ProtoAdapter.STRING.encodedSizeWithTag(14, value.string);
      }
      if (!Objects.equals(value.bytes, ByteString.EMPTY)) {
        result += ProtoAdapter.BYTES.encodedSizeWithTag(15, value.bytes);
      }
      if (!Objects.equals(value.nested_enum, NestedEnum.UNKNOWN)) {
        result += NestedEnum.ADAPTER.encodedSizeWithTag(16, value.nested_enum);
      }
      if (!Objects.equals(value.nested_message, null)) {
        result += NestedMessage.ADAPTER.encodedSizeWithTag(17, value.nested_message);
      }
      if (!Objects.equals(value.any, null)) {
        result += AnyMessage.ADAPTER.encodedSizeWithTag(18, value.any);
      }
      if (!Objects.equals(value.duration, null)) {
        result += ProtoAdapter.DURATION.encodedSizeWithTag(19, value.duration);
      }
      if (!Objects.equals(value.struct, null)) {
        result += ProtoAdapter.STRUCT_MAP.encodedSizeWithTag(20, value.struct);
      }
      if (!Objects.equals(value.list_value, null)) {
        result += ProtoAdapter.STRUCT_LIST.encodedSizeWithTag(21, value.list_value);
      }
      if (!Objects.equals(value.value, null)) {
        result += ProtoAdapter.STRUCT_VALUE.encodedSizeWithTag(22, value.value);
      }
      if (!Objects.equals(value.null_value, null)) {
        result += ProtoAdapter.STRUCT_NULL.encodedSizeWithTag(23, value.null_value);
      }
      if (!Objects.equals(value.empty, null)) {
        result += ProtoAdapter.EMPTY.encodedSizeWithTag(24, value.empty);
      }
      if (!Objects.equals(value.timestamp, null)) {
        result += ProtoAdapter.INSTANT.encodedSizeWithTag(25, value.timestamp);
      }
      result += ProtoAdapter.INT32.encodedSizeWithTag(101, value.opt_int32);
      result += ProtoAdapter.UINT32.encodedSizeWithTag(102, value.opt_uint32);
      result += ProtoAdapter.SINT32.encodedSizeWithTag(103, value.opt_sint32);
      result += ProtoAdapter.FIXED32.encodedSizeWithTag(104, value.opt_fixed32);
      result += ProtoAdapter.SFIXED32.encodedSizeWithTag(105, value.opt_sfixed32);
      result += ProtoAdapter.INT64.encodedSizeWithTag(106, value.opt_int64);
      result += ProtoAdapter.UINT64.encodedSizeWithTag(107, value.opt_uint64);
      result += ProtoAdapter.SINT64.encodedSizeWithTag(108, value.opt_sint64);
      result += ProtoAdapter.FIXED64.encodedSizeWithTag(109, value.opt_fixed64);
      result += ProtoAdapter.SFIXED64.encodedSizeWithTag(110, value.opt_sfixed64);
      result += ProtoAdapter.BOOL.encodedSizeWithTag(111, value.opt_bool);
      result += ProtoAdapter.FLOAT.encodedSizeWithTag(112, value.opt_float);
      result += ProtoAdapter.DOUBLE.encodedSizeWithTag(113, value.opt_double);
      result += ProtoAdapter.STRING.encodedSizeWithTag(114, value.opt_string);
      result += ProtoAdapter.BYTES.encodedSizeWithTag(115, value.opt_bytes);
      result += ProtoAdapter.INT32.asRepeated().encodedSizeWithTag(201, value.rep_int32);
      result += ProtoAdapter.UINT32.asRepeated().encodedSizeWithTag(202, value.rep_uint32);
      result += ProtoAdapter.SINT32.asRepeated().encodedSizeWithTag(203, value.rep_sint32);
      result += ProtoAdapter.FIXED32.asRepeated().encodedSizeWithTag(204, value.rep_fixed32);
      result += ProtoAdapter.SFIXED32.asRepeated().encodedSizeWithTag(205, value.rep_sfixed32);
      result += ProtoAdapter.INT64.asRepeated().encodedSizeWithTag(206, value.rep_int64);
      result += ProtoAdapter.UINT64.asRepeated().encodedSizeWithTag(207, value.rep_uint64);
      result += ProtoAdapter.SINT64.asRepeated().encodedSizeWithTag(208, value.rep_sint64);
      result += ProtoAdapter.FIXED64.asRepeated().encodedSizeWithTag(209, value.rep_fixed64);
      result += ProtoAdapter.SFIXED64.asRepeated().encodedSizeWithTag(210, value.rep_sfixed64);
      result += ProtoAdapter.BOOL.asRepeated().encodedSizeWithTag(211, value.rep_bool);
      result += ProtoAdapter.FLOAT.asRepeated().encodedSizeWithTag(212, value.rep_float);
      result += ProtoAdapter.DOUBLE.asRepeated().encodedSizeWithTag(213, value.rep_double);
      result += ProtoAdapter.STRING.asRepeated().encodedSizeWithTag(214, value.rep_string);
      result += ProtoAdapter.BYTES.asRepeated().encodedSizeWithTag(215, value.rep_bytes);
      result += NestedEnum.ADAPTER.asRepeated().encodedSizeWithTag(216, value.rep_nested_enum);
      result += NestedMessage.ADAPTER.asRepeated().encodedSizeWithTag(217, value.rep_nested_message);
      result += AnyMessage.ADAPTER.asRepeated().encodedSizeWithTag(218, value.rep_any);
      result += ProtoAdapter.DURATION.asRepeated().encodedSizeWithTag(219, value.rep_duration);
      result += ProtoAdapter.STRUCT_MAP.asRepeated().encodedSizeWithTag(220, value.rep_struct);
      result += ProtoAdapter.STRUCT_LIST.asRepeated().encodedSizeWithTag(221, value.rep_list_value);
      result += ProtoAdapter.STRUCT_VALUE.asRepeated().encodedSizeWithTag(222, value.rep_value);
      result += ProtoAdapter.STRUCT_NULL.asRepeated().encodedSizeWithTag(223, value.rep_null_value);
      result += ProtoAdapter.EMPTY.asRepeated().encodedSizeWithTag(224, value.rep_empty);
      result += ProtoAdapter.INSTANT.asRepeated().encodedSizeWithTag(225, value.rep_timestamp);
      result += ProtoAdapter.INT32.asPacked().encodedSizeWithTag(301, value.pack_int32);
      result += ProtoAdapter.UINT32.asPacked().encodedSizeWithTag(302, value.pack_uint32);
      result += ProtoAdapter.SINT32.asPacked().encodedSizeWithTag(303, value.pack_sint32);
      result += ProtoAdapter.FIXED32.asPacked().encodedSizeWithTag(304, value.pack_fixed32);
      result += ProtoAdapter.SFIXED32.asPacked().encodedSizeWithTag(305, value.pack_sfixed32);
      result += ProtoAdapter.INT64.asPacked().encodedSizeWithTag(306, value.pack_int64);
      result += ProtoAdapter.UINT64.asPacked().encodedSizeWithTag(307, value.pack_uint64);
      result += ProtoAdapter.SINT64.asPacked().encodedSizeWithTag(308, value.pack_sint64);
      result += ProtoAdapter.FIXED64.asPacked().encodedSizeWithTag(309, value.pack_fixed64);
      result += ProtoAdapter.SFIXED64.asPacked().encodedSizeWithTag(310, value.pack_sfixed64);
      result += ProtoAdapter.BOOL.asPacked().encodedSizeWithTag(311, value.pack_bool);
      result += ProtoAdapter.FLOAT.asPacked().encodedSizeWithTag(312, value.pack_float);
      result += ProtoAdapter.DOUBLE.asPacked().encodedSizeWithTag(313, value.pack_double);
      result += NestedEnum.ADAPTER.asPacked().encodedSizeWithTag(316, value.pack_nested_enum);
      result += ProtoAdapter.STRUCT_NULL.asPacked().encodedSizeWithTag(323, value.pack_null_value);
      result += map_int32_int32Adapter().encodedSizeWithTag(501, value.map_int32_int32);
      result += map_string_stringAdapter().encodedSizeWithTag(502, value.map_string_string);
      result += map_string_messageAdapter().encodedSizeWithTag(503, value.map_string_message);
      result += map_string_enumAdapter().encodedSizeWithTag(504, value.map_string_enum);
      result += map_int32_anyAdapter().encodedSizeWithTag(518, value.map_int32_any);
      result += map_int32_durationAdapter().encodedSizeWithTag(519, value.map_int32_duration);
      result += map_int32_structAdapter().encodedSizeWithTag(520, value.map_int32_struct);
      result += map_int32_list_valueAdapter().encodedSizeWithTag(521, value.map_int32_list_value);
      result += map_int32_valueAdapter().encodedSizeWithTag(522, value.map_int32_value);
      result += map_int32_null_valueAdapter().encodedSizeWithTag(523, value.map_int32_null_value);
      result += map_int32_emptyAdapter().encodedSizeWithTag(524, value.map_int32_empty);
      result += map_int32_timestampAdapter().encodedSizeWithTag(525, value.map_int32_timestamp);
      result += ProtoAdapter.STRING.encodedSizeWithTag(601, value.oneof_string);
      result += ProtoAdapter.INT32.encodedSizeWithTag(602, value.oneof_int32);
      result += NestedMessage.ADAPTER.encodedSizeWithTag(603, value.oneof_nested_message);
      result += AnyMessage.ADAPTER.encodedSizeWithTag(618, value.oneof_any);
      result += ProtoAdapter.DURATION.encodedSizeWithTag(619, value.oneof_duration);
      result += ProtoAdapter.STRUCT_MAP.encodedSizeWithTag(620, value.oneof_struct);
      result += ProtoAdapter.STRUCT_LIST.encodedSizeWithTag(621, value.oneof_list_value);
      result += ProtoAdapter.EMPTY.encodedSizeWithTag(624, value.oneof_empty);
      result += ProtoAdapter.INSTANT.encodedSizeWithTag(625, value.oneof_timestamp);
      result += value.unknownFields().size();
      return result;
    }

    @Override
    public void encode(ProtoWriter writer, AllTypes value) throws IOException {
      if (!Objects.equals(value.int32, 0)) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.int32);
      if (!Objects.equals(value.uint32, 0)) ProtoAdapter.UINT32.encodeWithTag(writer, 2, value.uint32);
      if (!Objects.equals(value.sint32, 0)) ProtoAdapter.SINT32.encodeWithTag(writer, 3, value.sint32);
      if (!Objects.equals(value.fixed32, 0)) ProtoAdapter.FIXED32.encodeWithTag(writer, 4, value.fixed32);
      if (!Objects.equals(value.sfixed32, 0)) ProtoAdapter.SFIXED32.encodeWithTag(writer, 5, value.sfixed32);
      if (!Objects.equals(value.int64, 0L)) ProtoAdapter.INT64.encodeWithTag(writer, 6, value.int64);
      if (!Objects.equals(value.uint64, 0L)) ProtoAdapter.UINT64.encodeWithTag(writer, 7, value.uint64);
      if (!Objects.equals(value.sint64, 0L)) ProtoAdapter.SINT64.encodeWithTag(writer, 8, value.sint64);
      if (!Objects.equals(value.fixed64, 0L)) ProtoAdapter.FIXED64.encodeWithTag(writer, 9, value.fixed64);
      if (!Objects.equals(value.sfixed64, 0L)) ProtoAdapter.SFIXED64.encodeWithTag(writer, 10, value.sfixed64);
      if (!Objects.equals(value.bool, false)) ProtoAdapter.BOOL.encodeWithTag(writer, 11, value.bool);
      if (!Objects.equals(value.float_, 0f)) ProtoAdapter.FLOAT.encodeWithTag(writer, 12, value.float_);
      if (!Objects.equals(value.double_, 0.0)) ProtoAdapter.DOUBLE.encodeWithTag(writer, 13, value.double_);
      if (!Objects.equals(value.string, "")) ProtoAdapter.STRING.encodeWithTag(writer, 14, value.string);
      if (!Objects.equals(value.bytes, ByteString.EMPTY)) ProtoAdapter.BYTES.encodeWithTag(writer, 15, value.bytes);
      if (!Objects.equals(value.nested_enum, NestedEnum.UNKNOWN)) NestedEnum.ADAPTER.encodeWithTag(writer, 16, value.nested_enum);
      if (!Objects.equals(value.nested_message, null)) NestedMessage.ADAPTER.encodeWithTag(writer, 17, value.nested_message);
      if (!Objects.equals(value.any, null)) AnyMessage.ADAPTER.encodeWithTag(writer, 18, value.any);
      if (!Objects.equals(value.duration, null)) ProtoAdapter.DURATION.encodeWithTag(writer, 19, value.duration);
      if (!Objects.equals(value.struct, null)) ProtoAdapter.STRUCT_MAP.encodeWithTag(writer, 20, value.struct);
      if (!Objects.equals(value.list_value, null)) ProtoAdapter.STRUCT_LIST.encodeWithTag(writer, 21, value.list_value);
      if (!Objects.equals(value.value, null)) ProtoAdapter.STRUCT_VALUE.encodeWithTag(writer, 22, value.value);
      if (!Objects.equals(value.null_value, null)) ProtoAdapter.STRUCT_NULL.encodeWithTag(writer, 23, value.null_value);
      if (!Objects.equals(value.empty, null)) ProtoAdapter.EMPTY.encodeWithTag(writer, 24, value.empty);
      if (!Objects.equals(value.timestamp, null)) ProtoAdapter.INSTANT.encodeWithTag(writer, 25, value.timestamp);
      ProtoAdapter.INT32.encodeWithTag(writer, 101, value.opt_int32);
      ProtoAdapter.UINT32.encodeWithTag(writer, 102, value.opt_uint32);
      ProtoAdapter.SINT32.encodeWithTag(writer, 103, value.opt_sint32);
      ProtoAdapter.FIXED32.encodeWithTag(writer, 104, value.opt_fixed32);
      ProtoAdapter.SFIXED32.encodeWithTag(writer, 105, value.opt_sfixed32);
      ProtoAdapter.INT64.encodeWithTag(writer, 106, value.opt_int64);
      ProtoAdapter.UINT64.encodeWithTag(writer, 107, value.opt_uint64);
      ProtoAdapter.SINT64.encodeWithTag(writer, 108, value.opt_sint64);
      ProtoAdapter.FIXED64.encodeWithTag(writer, 109, value.opt_fixed64);
      ProtoAdapter.SFIXED64.encodeWithTag(writer, 110, value.opt_sfixed64);
      ProtoAdapter.BOOL.encodeWithTag(writer, 111, value.opt_bool);
      ProtoAdapter.FLOAT.encodeWithTag(writer, 112, value.opt_float);
      ProtoAdapter.DOUBLE.encodeWithTag(writer, 113, value.opt_double);
      ProtoAdapter.STRING.encodeWithTag(writer, 114, value.opt_string);
      ProtoAdapter.BYTES.encodeWithTag(writer, 115, value.opt_bytes);
      ProtoAdapter.INT32.asRepeated().encodeWithTag(writer, 201, value.rep_int32);
      ProtoAdapter.UINT32.asRepeated().encodeWithTag(writer, 202, value.rep_uint32);
      ProtoAdapter.SINT32.asRepeated().encodeWithTag(writer, 203, value.rep_sint32);
      ProtoAdapter.FIXED32.asRepeated().encodeWithTag(writer, 204, value.rep_fixed32);
      ProtoAdapter.SFIXED32.asRepeated().encodeWithTag(writer, 205, value.rep_sfixed32);
      ProtoAdapter.INT64.asRepeated().encodeWithTag(writer, 206, value.rep_int64);
      ProtoAdapter.UINT64.asRepeated().encodeWithTag(writer, 207, value.rep_uint64);
      ProtoAdapter.SINT64.asRepeated().encodeWithTag(writer, 208, value.rep_sint64);
      ProtoAdapter.FIXED64.asRepeated().encodeWithTag(writer, 209, value.rep_fixed64);
      ProtoAdapter.SFIXED64.asRepeated().encodeWithTag(writer, 210, value.rep_sfixed64);
      ProtoAdapter.BOOL.asRepeated().encodeWithTag(writer, 211, value.rep_bool);
      ProtoAdapter.FLOAT.asRepeated().encodeWithTag(writer, 212, value.rep_float);
      ProtoAdapter.DOUBLE.asRepeated().encodeWithTag(writer, 213, value.rep_double);
      ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 214, value.rep_string);
      ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 215, value.rep_bytes);
      NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 216, value.rep_nested_enum);
      NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 217, value.rep_nested_message);
      AnyMessage.ADAPTER.asRepeated().encodeWithTag(writer, 218, value.rep_any);
      ProtoAdapter.DURATION.asRepeated().encodeWithTag(writer, 219, value.rep_duration);
      ProtoAdapter.STRUCT_MAP.asRepeated().encodeWithTag(writer, 220, value.rep_struct);
      ProtoAdapter.STRUCT_LIST.asRepeated().encodeWithTag(writer, 221, value.rep_list_value);
      ProtoAdapter.STRUCT_VALUE.asRepeated().encodeWithTag(writer, 222, value.rep_value);
      ProtoAdapter.STRUCT_NULL.asRepeated().encodeWithTag(writer, 223, value.rep_null_value);
      ProtoAdapter.EMPTY.asRepeated().encodeWithTag(writer, 224, value.rep_empty);
      ProtoAdapter.INSTANT.asRepeated().encodeWithTag(writer, 225, value.rep_timestamp);
      ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 301, value.pack_int32);
      ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 302, value.pack_uint32);
      ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 303, value.pack_sint32);
      ProtoAdapter.FIXED32.asPacked().encodeWithTag(writer, 304, value.pack_fixed32);
      ProtoAdapter.SFIXED32.asPacked().encodeWithTag(writer, 305, value.pack_sfixed32);
      ProtoAdapter.INT64.asPacked().encodeWithTag(writer, 306, value.pack_int64);
      ProtoAdapter.UINT64.asPacked().encodeWithTag(writer, 307, value.pack_uint64);
      ProtoAdapter.SINT64.asPacked().encodeWithTag(writer, 308, value.pack_sint64);
      ProtoAdapter.FIXED64.asPacked().encodeWithTag(writer, 309, value.pack_fixed64);
      ProtoAdapter.SFIXED64.asPacked().encodeWithTag(writer, 310, value.pack_sfixed64);
      ProtoAdapter.BOOL.asPacked().encodeWithTag(writer, 311, value.pack_bool);
      ProtoAdapter.FLOAT.asPacked().encodeWithTag(writer, 312, value.pack_float);
      ProtoAdapter.DOUBLE.asPacked().encodeWithTag(writer, 313, value.pack_double);
      NestedEnum.ADAPTER.asPacked().encodeWithTag(writer, 316, value.pack_nested_enum);
      ProtoAdapter.STRUCT_NULL.asPacked().encodeWithTag(writer, 323, value.pack_null_value);
      map_int32_int32Adapter().encodeWithTag(writer, 501, value.map_int32_int32);
      map_string_stringAdapter().encodeWithTag(writer, 502, value.map_string_string);
      map_string_messageAdapter().encodeWithTag(writer, 503, value.map_string_message);
      map_string_enumAdapter().encodeWithTag(writer, 504, value.map_string_enum);
      map_int32_anyAdapter().encodeWithTag(writer, 518, value.map_int32_any);
      map_int32_durationAdapter().encodeWithTag(writer, 519, value.map_int32_duration);
      map_int32_structAdapter().encodeWithTag(writer, 520, value.map_int32_struct);
      map_int32_list_valueAdapter().encodeWithTag(writer, 521, value.map_int32_list_value);
      map_int32_valueAdapter().encodeWithTag(writer, 522, value.map_int32_value);
      map_int32_null_valueAdapter().encodeWithTag(writer, 523, value.map_int32_null_value);
      map_int32_emptyAdapter().encodeWithTag(writer, 524, value.map_int32_empty);
      map_int32_timestampAdapter().encodeWithTag(writer, 525, value.map_int32_timestamp);
      ProtoAdapter.STRING.encodeWithTag(writer, 601, value.oneof_string);
      ProtoAdapter.INT32.encodeWithTag(writer, 602, value.oneof_int32);
      NestedMessage.ADAPTER.encodeWithTag(writer, 603, value.oneof_nested_message);
      AnyMessage.ADAPTER.encodeWithTag(writer, 618, value.oneof_any);
      ProtoAdapter.DURATION.encodeWithTag(writer, 619, value.oneof_duration);
      ProtoAdapter.STRUCT_MAP.encodeWithTag(writer, 620, value.oneof_struct);
      ProtoAdapter.STRUCT_LIST.encodeWithTag(writer, 621, value.oneof_list_value);
      ProtoAdapter.EMPTY.encodeWithTag(writer, 624, value.oneof_empty);
      ProtoAdapter.INSTANT.encodeWithTag(writer, 625, value.oneof_timestamp);
      writer.writeBytes(value.unknownFields());
    }

    @Override
    public void encode(ReverseProtoWriter writer, AllTypes value) throws IOException {
      writer.writeBytes(value.unknownFields());
      ProtoAdapter.INSTANT.encodeWithTag(writer, 625, value.oneof_timestamp);
      ProtoAdapter.EMPTY.encodeWithTag(writer, 624, value.oneof_empty);
      ProtoAdapter.STRUCT_LIST.encodeWithTag(writer, 621, value.oneof_list_value);
      ProtoAdapter.STRUCT_MAP.encodeWithTag(writer, 620, value.oneof_struct);
      ProtoAdapter.DURATION.encodeWithTag(writer, 619, value.oneof_duration);
      AnyMessage.ADAPTER.encodeWithTag(writer, 618, value.oneof_any);
      NestedMessage.ADAPTER.encodeWithTag(writer, 603, value.oneof_nested_message);
      ProtoAdapter.INT32.encodeWithTag(writer, 602, value.oneof_int32);
      ProtoAdapter.STRING.encodeWithTag(writer, 601, value.oneof_string);
      map_int32_timestampAdapter().encodeWithTag(writer, 525, value.map_int32_timestamp);
      map_int32_emptyAdapter().encodeWithTag(writer, 524, value.map_int32_empty);
      map_int32_null_valueAdapter().encodeWithTag(writer, 523, value.map_int32_null_value);
      map_int32_valueAdapter().encodeWithTag(writer, 522, value.map_int32_value);
      map_int32_list_valueAdapter().encodeWithTag(writer, 521, value.map_int32_list_value);
      map_int32_structAdapter().encodeWithTag(writer, 520, value.map_int32_struct);
      map_int32_durationAdapter().encodeWithTag(writer, 519, value.map_int32_duration);
      map_int32_anyAdapter().encodeWithTag(writer, 518, value.map_int32_any);
      map_string_enumAdapter().encodeWithTag(writer, 504, value.map_string_enum);
      map_string_messageAdapter().encodeWithTag(writer, 503, value.map_string_message);
      map_string_stringAdapter().encodeWithTag(writer, 502, value.map_string_string);
      map_int32_int32Adapter().encodeWithTag(writer, 501, value.map_int32_int32);
      ProtoAdapter.STRUCT_NULL.asPacked().encodeWithTag(writer, 323, value.pack_null_value);
      NestedEnum.ADAPTER.asPacked().encodeWithTag(writer, 316, value.pack_nested_enum);
      ProtoAdapter.DOUBLE.asPacked().encodeWithTag(writer, 313, value.pack_double);
      ProtoAdapter.FLOAT.asPacked().encodeWithTag(writer, 312, value.pack_float);
      ProtoAdapter.BOOL.asPacked().encodeWithTag(writer, 311, value.pack_bool);
      ProtoAdapter.SFIXED64.asPacked().encodeWithTag(writer, 310, value.pack_sfixed64);
      ProtoAdapter.FIXED64.asPacked().encodeWithTag(writer, 309, value.pack_fixed64);
      ProtoAdapter.SINT64.asPacked().encodeWithTag(writer, 308, value.pack_sint64);
      ProtoAdapter.UINT64.asPacked().encodeWithTag(writer, 307, value.pack_uint64);
      ProtoAdapter.INT64.asPacked().encodeWithTag(writer, 306, value.pack_int64);
      ProtoAdapter.SFIXED32.asPacked().encodeWithTag(writer, 305, value.pack_sfixed32);
      ProtoAdapter.FIXED32.asPacked().encodeWithTag(writer, 304, value.pack_fixed32);
      ProtoAdapter.SINT32.asPacked().encodeWithTag(writer, 303, value.pack_sint32);
      ProtoAdapter.UINT32.asPacked().encodeWithTag(writer, 302, value.pack_uint32);
      ProtoAdapter.INT32.asPacked().encodeWithTag(writer, 301, value.pack_int32);
      ProtoAdapter.INSTANT.asRepeated().encodeWithTag(writer, 225, value.rep_timestamp);
      ProtoAdapter.EMPTY.asRepeated().encodeWithTag(writer, 224, value.rep_empty);
      ProtoAdapter.STRUCT_NULL.asRepeated().encodeWithTag(writer, 223, value.rep_null_value);
      ProtoAdapter.STRUCT_VALUE.asRepeated().encodeWithTag(writer, 222, value.rep_value);
      ProtoAdapter.STRUCT_LIST.asRepeated().encodeWithTag(writer, 221, value.rep_list_value);
      ProtoAdapter.STRUCT_MAP.asRepeated().encodeWithTag(writer, 220, value.rep_struct);
      ProtoAdapter.DURATION.asRepeated().encodeWithTag(writer, 219, value.rep_duration);
      AnyMessage.ADAPTER.asRepeated().encodeWithTag(writer, 218, value.rep_any);
      NestedMessage.ADAPTER.asRepeated().encodeWithTag(writer, 217, value.rep_nested_message);
      NestedEnum.ADAPTER.asRepeated().encodeWithTag(writer, 216, value.rep_nested_enum);
      ProtoAdapter.BYTES.asRepeated().encodeWithTag(writer, 215, value.rep_bytes);
      ProtoAdapter.STRING.asRepeated().encodeWithTag(writer, 214, value.rep_string);
      ProtoAdapter.DOUBLE.asRepeated().encodeWithTag(writer, 213, value.rep_double);
      ProtoAdapter.FLOAT.asRepeated().encodeWithTag(writer, 212, value.rep_float);
      ProtoAdapter.BOOL.asRepeated().encodeWithTag(writer, 211, value.rep_bool);
      ProtoAdapter.SFIXED64.asRepeated().encodeWithTag(writer, 210, value.rep_sfixed64);
      ProtoAdapter.FIXED64.asRepeated().encodeWithTag(writer, 209, value.rep_fixed64);
      ProtoAdapter.SINT64.asRepeated().encodeWithTag(writer, 208, value.rep_sint64);
      ProtoAdapter.UINT64.asRepeated().encodeWithTag(writer, 207, value.rep_uint64);
      ProtoAdapter.INT64.asRepeated().encodeWithTag(writer, 206, value.rep_int64);
      ProtoAdapter.SFIXED32.asRepeated().encodeWithTag(writer, 205, value.rep_sfixed32);
      ProtoAdapter.FIXED32.asRepeated().encodeWithTag(writer, 204, value.rep_fixed32);
      ProtoAdapter.SINT32.asRepeated().encodeWithTag(writer, 203, value.rep_sint32);
      ProtoAdapter.UINT32.asRepeated().encodeWithTag(writer, 202, value.rep_uint32);
      ProtoAdapter.INT32.asRepeated().encodeWithTag(writer, 201, value.rep_int32);
      ProtoAdapter.BYTES.encodeWithTag(writer, 115, value.opt_bytes);
      ProtoAdapter.STRING.encodeWithTag(writer, 114, value.opt_string);
      ProtoAdapter.DOUBLE.encodeWithTag(writer, 113, value.opt_double);
      ProtoAdapter.FLOAT.encodeWithTag(writer, 112, value.opt_float);
      ProtoAdapter.BOOL.encodeWithTag(writer, 111, value.opt_bool);
      ProtoAdapter.SFIXED64.encodeWithTag(writer, 110, value.opt_sfixed64);
      ProtoAdapter.FIXED64.encodeWithTag(writer, 109, value.opt_fixed64);
      ProtoAdapter.SINT64.encodeWithTag(writer, 108, value.opt_sint64);
      ProtoAdapter.UINT64.encodeWithTag(writer, 107, value.opt_uint64);
      ProtoAdapter.INT64.encodeWithTag(writer, 106, value.opt_int64);
      ProtoAdapter.SFIXED32.encodeWithTag(writer, 105, value.opt_sfixed32);
      ProtoAdapter.FIXED32.encodeWithTag(writer, 104, value.opt_fixed32);
      ProtoAdapter.SINT32.encodeWithTag(writer, 103, value.opt_sint32);
      ProtoAdapter.UINT32.encodeWithTag(writer, 102, value.opt_uint32);
      ProtoAdapter.INT32.encodeWithTag(writer, 101, value.opt_int32);
      if (!Objects.equals(value.timestamp, null)) ProtoAdapter.INSTANT.encodeWithTag(writer, 25, value.timestamp);
      if (!Objects.equals(value.empty, null)) ProtoAdapter.EMPTY.encodeWithTag(writer, 24, value.empty);
      if (!Objects.equals(value.null_value, null)) ProtoAdapter.STRUCT_NULL.encodeWithTag(writer, 23, value.null_value);
      if (!Objects.equals(value.value, null)) ProtoAdapter.STRUCT_VALUE.encodeWithTag(writer, 22, value.value);
      if (!Objects.equals(value.list_value, null)) ProtoAdapter.STRUCT_LIST.encodeWithTag(writer, 21, value.list_value);
      if (!Objects.equals(value.struct, null)) ProtoAdapter.STRUCT_MAP.encodeWithTag(writer, 20, value.struct);
      if (!Objects.equals(value.duration, null)) ProtoAdapter.DURATION.encodeWithTag(writer, 19, value.duration);
      if (!Objects.equals(value.any, null)) AnyMessage.ADAPTER.encodeWithTag(writer, 18, value.any);
      if (!Objects.equals(value.nested_message, null)) NestedMessage.ADAPTER.encodeWithTag(writer, 17, value.nested_message);
      if (!Objects.equals(value.nested_enum, NestedEnum.UNKNOWN)) NestedEnum.ADAPTER.encodeWithTag(writer, 16, value.nested_enum);
      if (!Objects.equals(value.bytes, ByteString.EMPTY)) ProtoAdapter.BYTES.encodeWithTag(writer, 15, value.bytes);
      if (!Objects.equals(value.string, "")) ProtoAdapter.STRING.encodeWithTag(writer, 14, value.string);
      if (!Objects.equals(value.double_, 0.0)) ProtoAdapter.DOUBLE.encodeWithTag(writer, 13, value.double_);
      if (!Objects.equals(value.float_, 0f)) ProtoAdapter.FLOAT.encodeWithTag(writer, 12, value.float_);
      if (!Objects.equals(value.bool, false)) ProtoAdapter.BOOL.encodeWithTag(writer, 11, value.bool);
      if (!Objects.equals(value.sfixed64, 0L)) ProtoAdapter.SFIXED64.encodeWithTag(writer, 10, value.sfixed64);
      if (!Objects.equals(value.fixed64, 0L)) ProtoAdapter.FIXED64.encodeWithTag(writer, 9, value.fixed64);
      if (!Objects.equals(value.sint64, 0L)) ProtoAdapter.SINT64.encodeWithTag(writer, 8, value.sint64);
      if (!Objects.equals(value.uint64, 0L)) ProtoAdapter.UINT64.encodeWithTag(writer, 7, value.uint64);
      if (!Objects.equals(value.int64, 0L)) ProtoAdapter.INT64.encodeWithTag(writer, 6, value.int64);
      if (!Objects.equals(value.sfixed32, 0)) ProtoAdapter.SFIXED32.encodeWithTag(writer, 5, value.sfixed32);
      if (!Objects.equals(value.fixed32, 0)) ProtoAdapter.FIXED32.encodeWithTag(writer, 4, value.fixed32);
      if (!Objects.equals(value.sint32, 0)) ProtoAdapter.SINT32.encodeWithTag(writer, 3, value.sint32);
      if (!Objects.equals(value.uint32, 0)) ProtoAdapter.UINT32.encodeWithTag(writer, 2, value.uint32);
      if (!Objects.equals(value.int32, 0)) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.int32);
    }

    @Override
    public AllTypes decode(ProtoReader reader) throws IOException {
      Builder builder = new Builder();
      long token = reader.beginMessage();
      for (int tag; (tag = reader.nextTag()) != -1;) {
        switch (tag) {
          case 1: builder.int32(ProtoAdapter.INT32.decode(reader)); break;
          case 2: builder.uint32(ProtoAdapter.UINT32.decode(reader)); break;
          case 3: builder.sint32(ProtoAdapter.SINT32.decode(reader)); break;
          case 4: builder.fixed32(ProtoAdapter.FIXED32.decode(reader)); break;
          case 5: builder.sfixed32(ProtoAdapter.SFIXED32.decode(reader)); break;
          case 6: builder.int64(ProtoAdapter.INT64.decode(reader)); break;
          case 7: builder.uint64(ProtoAdapter.UINT64.decode(reader)); break;
          case 8: builder.sint64(ProtoAdapter.SINT64.decode(reader)); break;
          case 9: builder.fixed64(ProtoAdapter.FIXED64.decode(reader)); break;
          case 10: builder.sfixed64(ProtoAdapter.SFIXED64.decode(reader)); break;
          case 11: builder.bool(ProtoAdapter.BOOL.decode(reader)); break;
          case 12: builder.float_(ProtoAdapter.FLOAT.decode(reader)); break;
          case 13: builder.double_(ProtoAdapter.DOUBLE.decode(reader)); break;
          case 14: builder.string(ProtoAdapter.STRING.decode(reader)); break;
          case 15: builder.bytes(ProtoAdapter.BYTES.decode(reader)); break;
          case 16: {
            try {
              builder.nested_enum(NestedEnum.ADAPTER.decode(reader));
            } catch (ProtoAdapter.EnumConstantNotFoundException e) {
              builder.addUnknownField(tag, FieldEncoding.VARINT, (long) e.value);
            }
            break;
          }
          case 17: builder.nested_message(NestedMessage.ADAPTER.decode(reader)); break;
          case 18: builder.any(AnyMessage.ADAPTER.decode(reader)); break;
          case 19: builder.duration(ProtoAdapter.DURATION.decode(reader)); break;
          case 20: builder.struct(ProtoAdapter.STRUCT_MAP.decode(reader)); break;
          case 21: builder.list_value(ProtoAdapter.STRUCT_LIST.decode(reader)); break;
          case 22: builder.value(ProtoAdapter.STRUCT_VALUE.decode(reader)); break;
          case 23: builder.null_value((Void) ProtoAdapter.STRUCT_NULL.decode(reader)); break;
          case 24: builder.empty(ProtoAdapter.EMPTY.decode(reader)); break;
          case 25: builder.timestamp(ProtoAdapter.INSTANT.decode(reader)); break;
          case 101: builder.opt_int32(ProtoAdapter.INT32.decode(reader)); break;
          case 102: builder.opt_uint32(ProtoAdapter.UINT32.decode(reader)); break;
          case 103: builder.opt_sint32(ProtoAdapter.SINT32.decode(reader)); break;
          case 104: builder.opt_fixed32(ProtoAdapter.FIXED32.decode(reader)); break;
          case 105: builder.opt_sfixed32(ProtoAdapter.SFIXED32.decode(reader)); break;
          case 106: builder.opt_int64(ProtoAdapter.INT64.decode(reader)); break;
          case 107: builder.opt_uint64(ProtoAdapter.UINT64.decode(reader)); break;
          case 108: builder.opt_sint64(ProtoAdapter.SINT64.decode(reader)); break;
          case 109: builder.opt_fixed64(ProtoAdapter.FIXED64.decode(reader)); break;
          case 110: builder.opt_sfixed64(ProtoAdapter.SFIXED64.decode(reader)); break;
          case 111: builder.opt_bool(ProtoAdapter.BOOL.decode(reader)); break;
          case 112: builder.opt_float(ProtoAdapter.FLOAT.decode(reader)); break;
          case 113: builder.opt_double(ProtoAdapter.DOUBLE.decode(reader)); break;
          case 114: builder.opt_string(ProtoAdapter.STRING.decode(reader)); break;
          case 115: builder.opt_bytes(ProtoAdapter.BYTES.decode(reader)); break;
          case 201: builder.rep_int32.add(ProtoAdapter.INT32.decode(reader)); break;
          case 202: builder.rep_uint32.add(ProtoAdapter.UINT32.decode(reader)); break;
          case 203: builder.rep_sint32.add(ProtoAdapter.SINT32.decode(reader)); break;
          case 204: builder.rep_fixed32.add(ProtoAdapter.FIXED32.decode(reader)); break;
          case 205: builder.rep_sfixed32.add(ProtoAdapter.SFIXED32.decode(reader)); break;
          case 206: builder.rep_int64.add(ProtoAdapter.INT64.decode(reader)); break;
          case 207: builder.rep_uint64.add(ProtoAdapter.UINT64.decode(reader)); break;
          case 208: builder.rep_sint64.add(ProtoAdapter.SINT64.decode(reader)); break;
          case 209: builder.rep_fixed64.add(ProtoAdapter.FIXED64.decode(reader)); break;
          case 210: builder.rep_sfixed64.add(ProtoAdapter.SFIXED64.decode(reader)); break;
          case 211: builder.rep_bool.add(ProtoAdapter.BOOL.decode(reader)); break;
          case 212: builder.rep_float.add(ProtoAdapter.FLOAT.decode(reader)); break;
          case 213: builder.rep_double.add(ProtoAdapter.DOUBLE.decode(reader)); break;
          case 214: builder.rep_string.add(ProtoAdapter.STRING.decode(reader)); break;
          case 215: builder.rep_bytes.add(ProtoAdapter.BYTES.decode(reader)); break;
          case 216: {
            try {
              builder.rep_nested_enum.add(NestedEnum.ADAPTER.decode(reader));
            } catch (ProtoAdapter.EnumConstantNotFoundException e) {
              builder.addUnknownField(tag, FieldEncoding.VARINT, (long) e.value);
            }
            break;
          }
          case 217: builder.rep_nested_message.add(NestedMessage.ADAPTER.decode(reader)); break;
          case 218: builder.rep_any.add(AnyMessage.ADAPTER.decode(reader)); break;
          case 219: builder.rep_duration.add(ProtoAdapter.DURATION.decode(reader)); break;
          case 220: builder.rep_struct.add(ProtoAdapter.STRUCT_MAP.decode(reader)); break;
          case 221: builder.rep_list_value.add(ProtoAdapter.STRUCT_LIST.decode(reader)); break;
          case 222: builder.rep_value.add(ProtoAdapter.STRUCT_VALUE.decode(reader)); break;
          case 223: builder.rep_null_value.add((Void) ProtoAdapter.STRUCT_NULL.decode(reader)); break;
          case 224: builder.rep_empty.add(ProtoAdapter.EMPTY.decode(reader)); break;
          case 225: builder.rep_timestamp.add(ProtoAdapter.INSTANT.decode(reader)); break;
          case 301: builder.pack_int32.add(ProtoAdapter.INT32.decode(reader)); break;
          case 302: builder.pack_uint32.add(ProtoAdapter.UINT32.decode(reader)); break;
          case 303: builder.pack_sint32.add(ProtoAdapter.SINT32.decode(reader)); break;
          case 304: builder.pack_fixed32.add(ProtoAdapter.FIXED32.decode(reader)); break;
          case 305: builder.pack_sfixed32.add(ProtoAdapter.SFIXED32.decode(reader)); break;
          case 306: builder.pack_int64.add(ProtoAdapter.INT64.decode(reader)); break;
          case 307: builder.pack_uint64.add(ProtoAdapter.UINT64.decode(reader)); break;
          case 308: builder.pack_sint64.add(ProtoAdapter.SINT64.decode(reader)); break;
          case 309: builder.pack_fixed64.add(ProtoAdapter.FIXED64.decode(reader)); break;
          case 310: builder.pack_sfixed64.add(ProtoAdapter.SFIXED64.decode(reader)); break;
          case 311: builder.pack_bool.add(ProtoAdapter.BOOL.decode(reader)); break;
          case 312: builder.pack_float.add(ProtoAdapter.FLOAT.decode(reader)); break;
          case 313: builder.pack_double.add(ProtoAdapter.DOUBLE.decode(reader)); break;
          case 316: {
            try {
              builder.pack_nested_enum.add(NestedEnum.ADAPTER.decode(reader));
            } catch (ProtoAdapter.EnumConstantNotFoundException e) {
              builder.addUnknownField(tag, FieldEncoding.VARINT, (long) e.value);
            }
            break;
          }
          case 323: builder.pack_null_value.add((Void) ProtoAdapter.STRUCT_NULL.decode(reader)); break;
          case 501: builder.map_int32_int32.putAll(map_int32_int32Adapter().decode(reader)); break;
          case 502: builder.map_string_string.putAll(map_string_stringAdapter().decode(reader)); break;
          case 503: builder.map_string_message.putAll(map_string_messageAdapter().decode(reader)); break;
          case 504: builder.map_string_enum.putAll(map_string_enumAdapter().decode(reader)); break;
          case 518: builder.map_int32_any.putAll(map_int32_anyAdapter().decode(reader)); break;
          case 519: builder.map_int32_duration.putAll(map_int32_durationAdapter().decode(reader)); break;
          case 520: builder.map_int32_struct.putAll(map_int32_structAdapter().decode(reader)); break;
          case 521: builder.map_int32_list_value.putAll(map_int32_list_valueAdapter().decode(reader)); break;
          case 522: builder.map_int32_value.putAll(map_int32_valueAdapter().decode(reader)); break;
          case 523: builder.map_int32_null_value.putAll(map_int32_null_valueAdapter().decode(reader)); break;
          case 524: builder.map_int32_empty.putAll(map_int32_emptyAdapter().decode(reader)); break;
          case 525: builder.map_int32_timestamp.putAll(map_int32_timestampAdapter().decode(reader)); break;
          case 601: builder.oneof_string(ProtoAdapter.STRING.decode(reader)); break;
          case 602: builder.oneof_int32(ProtoAdapter.INT32.decode(reader)); break;
          case 603: builder.oneof_nested_message(NestedMessage.ADAPTER.decode(reader)); break;
          case 618: builder.oneof_any(AnyMessage.ADAPTER.decode(reader)); break;
          case 619: builder.oneof_duration(ProtoAdapter.DURATION.decode(reader)); break;
          case 620: builder.oneof_struct(ProtoAdapter.STRUCT_MAP.decode(reader)); break;
          case 621: builder.oneof_list_value(ProtoAdapter.STRUCT_LIST.decode(reader)); break;
          case 624: builder.oneof_empty(ProtoAdapter.EMPTY.decode(reader)); break;
          case 625: builder.oneof_timestamp(ProtoAdapter.INSTANT.decode(reader)); break;
          default: {
            reader.readUnknownField(tag);
          }
        }
      }
      builder.addUnknownFields(reader.endMessageAndGetUnknownFields(token));
      return builder.build();
    }

    @Override
    public AllTypes redact(AllTypes value) {
      Builder builder = value.newBuilder();
      if (builder.nested_message != null) builder.nested_message = NestedMessage.ADAPTER.redact(builder.nested_message);
      if (builder.any != null) builder.any = AnyMessage.ADAPTER.redact(builder.any);
      if (builder.duration != null) builder.duration = ProtoAdapter.DURATION.redact(builder.duration);
      if (builder.struct != null) builder.struct = ProtoAdapter.STRUCT_MAP.redact(builder.struct);
      if (builder.list_value != null) builder.list_value = ProtoAdapter.STRUCT_LIST.redact(builder.list_value);
      if (builder.value != null) builder.value = ProtoAdapter.STRUCT_VALUE.redact(builder.value);
      if (builder.empty != null) builder.empty = ProtoAdapter.EMPTY.redact(builder.empty);
      if (builder.timestamp != null) builder.timestamp = ProtoAdapter.INSTANT.redact(builder.timestamp);
      Internal.redactElements(builder.rep_nested_message, NestedMessage.ADAPTER);
      Internal.redactElements(builder.rep_any, AnyMessage.ADAPTER);
      Internal.redactElements(builder.rep_duration, ProtoAdapter.DURATION);
      Internal.redactElements(builder.rep_struct, ProtoAdapter.STRUCT_MAP);
      Internal.redactElements(builder.rep_list_value, ProtoAdapter.STRUCT_LIST);
      Internal.redactElements(builder.rep_value, ProtoAdapter.STRUCT_VALUE);
      Internal.redactElements(builder.rep_empty, ProtoAdapter.EMPTY);
      Internal.redactElements(builder.rep_timestamp, ProtoAdapter.INSTANT);
      Internal.redactElements(builder.map_string_message, NestedMessage.ADAPTER);
      Internal.redactElements(builder.map_int32_any, AnyMessage.ADAPTER);
      Internal.redactElements(builder.map_int32_duration, ProtoAdapter.DURATION);
      Internal.redactElements(builder.map_int32_struct, ProtoAdapter.STRUCT_MAP);
      Internal.redactElements(builder.map_int32_list_value, ProtoAdapter.STRUCT_LIST);
      Internal.redactElements(builder.map_int32_value, ProtoAdapter.STRUCT_VALUE);
      Internal.redactElements(builder.map_int32_empty, ProtoAdapter.EMPTY);
      Internal.redactElements(builder.map_int32_timestamp, ProtoAdapter.INSTANT);
      if (builder.oneof_nested_message != null) builder.oneof_nested_message = NestedMessage.ADAPTER.redact(builder.oneof_nested_message);
      if (builder.oneof_any != null) builder.oneof_any = AnyMessage.ADAPTER.redact(builder.oneof_any);
      if (builder.oneof_duration != null) builder.oneof_duration = ProtoAdapter.DURATION.redact(builder.oneof_duration);
      if (builder.oneof_struct != null) builder.oneof_struct = ProtoAdapter.STRUCT_MAP.redact(builder.oneof_struct);
      if (builder.oneof_list_value != null) builder.oneof_list_value = ProtoAdapter.STRUCT_LIST.redact(builder.oneof_list_value);
      if (builder.oneof_empty != null) builder.oneof_empty = ProtoAdapter.EMPTY.redact(builder.oneof_empty);
      if (builder.oneof_timestamp != null) builder.oneof_timestamp = ProtoAdapter.INSTANT.redact(builder.oneof_timestamp);
      builder.clearUnknownFields();
      return builder.build();
    }

    private ProtoAdapter<Map<Integer, Integer>> map_int32_int32Adapter() {
      ProtoAdapter<Map<Integer, Integer>> result = map_int32_int32;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INT32);
        map_int32_int32 = result;
      }
      return result;
    }

    private ProtoAdapter<Map<String, String>> map_string_stringAdapter() {
      ProtoAdapter<Map<String, String>> result = map_string_string;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, ProtoAdapter.STRING);
        map_string_string = result;
      }
      return result;
    }

    private ProtoAdapter<Map<String, NestedMessage>> map_string_messageAdapter() {
      ProtoAdapter<Map<String, NestedMessage>> result = map_string_message;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedMessage.ADAPTER);
        map_string_message = result;
      }
      return result;
    }

    private ProtoAdapter<Map<String, NestedEnum>> map_string_enumAdapter() {
      ProtoAdapter<Map<String, NestedEnum>> result = map_string_enum;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.STRING, NestedEnum.ADAPTER);
        map_string_enum = result;
      }
      return result;
    }

    private ProtoAdapter<Map<Integer, AnyMessage>> map_int32_anyAdapter() {
      ProtoAdapter<Map<Integer, AnyMessage>> result = map_int32_any;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, AnyMessage.ADAPTER);
        map_int32_any = result;
      }
      return result;
    }

    private ProtoAdapter<Map<Integer, Duration>> map_int32_durationAdapter() {
      ProtoAdapter<Map<Integer, Duration>> result = map_int32_duration;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.DURATION);
        map_int32_duration = result;
      }
      return result;
    }

    private ProtoAdapter<Map<Integer, Map<String, ?>>> map_int32_structAdapter() {
      ProtoAdapter<Map<Integer, Map<String, ?>>> result = map_int32_struct;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_MAP);
        map_int32_struct = result;
      }
      return result;
    }

    private ProtoAdapter<Map<Integer, List<?>>> map_int32_list_valueAdapter() {
      ProtoAdapter<Map<Integer, List<?>>> result = map_int32_list_value;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_LIST);
        map_int32_list_value = result;
      }
      return result;
    }

    private ProtoAdapter<Map<Integer, Object>> map_int32_valueAdapter() {
      ProtoAdapter<Map<Integer, Object>> result = map_int32_value;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_VALUE);
        map_int32_value = result;
      }
      return result;
    }

    private ProtoAdapter<Map<Integer, Void>> map_int32_null_valueAdapter() {
      ProtoAdapter<Map<Integer, Void>> result = map_int32_null_value;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.STRUCT_NULL);
        map_int32_null_value = result;
      }
      return result;
    }

    private ProtoAdapter<Map<Integer, Unit>> map_int32_emptyAdapter() {
      ProtoAdapter<Map<Integer, Unit>> result = map_int32_empty;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.EMPTY);
        map_int32_empty = result;
      }
      return result;
    }

    private ProtoAdapter<Map<Integer, Instant>> map_int32_timestampAdapter() {
      ProtoAdapter<Map<Integer, Instant>> result = map_int32_timestamp;
      if (result == null) {
        result = ProtoAdapter.newMapAdapter(ProtoAdapter.INT32, ProtoAdapter.INSTANT);
        map_int32_timestamp = result;
      }
      return result;
    }
  }
}
