From 18e0a2e5ec883d665a4e8fe57a1eb3e603340de7 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 1 Oct 2015 10:38:01 +0100 Subject: Generated code from previous commit. --- csharp/src/AddressBook/Addressbook.cs | 13 + .../src/Google.Protobuf.Conformance/Conformance.cs | 128 ++++ .../TestProtos/MapUnittestProto3.cs | 51 ++ .../TestProtos/UnittestImportProto3.cs | 1 + .../TestProtos/UnittestImportPublicProto3.cs | 1 + .../TestProtos/UnittestIssues.cs | 40 ++ .../TestProtos/UnittestProto3.cs | 224 +++++++ .../TestProtos/UnittestWellKnownTypes.cs | 88 +++ .../Reflection/DescriptorProtoFile.cs | 641 +++++++++++++++++++++ csharp/src/Google.Protobuf/WellKnownTypes/Any.cs | 50 ++ csharp/src/Google.Protobuf/WellKnownTypes/Api.cs | 154 +++++ .../src/Google.Protobuf/WellKnownTypes/Duration.cs | 48 ++ csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs | 9 + .../Google.Protobuf/WellKnownTypes/FieldMask.cs | 101 ++++ .../WellKnownTypes/SourceContext.cs | 9 + .../src/Google.Protobuf/WellKnownTypes/Struct.cs | 60 ++ .../Google.Protobuf/WellKnownTypes/Timestamp.cs | 54 ++ csharp/src/Google.Protobuf/WellKnownTypes/Type.cs | 201 +++++++ .../src/Google.Protobuf/WellKnownTypes/Wrappers.cs | 72 +++ 19 files changed, 1945 insertions(+) diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index 1f210c7f..a830418a 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -73,6 +73,7 @@ namespace Google.Protobuf.Examples.AddressBook { return new Person(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -82,8 +83,12 @@ namespace Google.Protobuf.Examples.AddressBook { } } + /// Field number for the "id" field. public const int IdFieldNumber = 2; private int id_; + /// + /// Unique ID number for this person. + /// public int Id { get { return id_; } set { @@ -91,6 +96,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } + /// Field number for the "email" field. public const int EmailFieldNumber = 3; private string email_ = ""; public string Email { @@ -100,6 +106,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } + /// Field number for the "phones" field. public const int PhonesFieldNumber = 4; private static readonly pb::FieldCodec _repeated_phones_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser); @@ -251,6 +258,7 @@ namespace Google.Protobuf.Examples.AddressBook { return new PhoneNumber(this); } + /// Field number for the "number" field. public const int NumberFieldNumber = 1; private string number_ = ""; public string Number { @@ -260,6 +268,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } + /// Field number for the "type" field. public const int TypeFieldNumber = 2; private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE; public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { @@ -356,6 +365,9 @@ namespace Google.Protobuf.Examples.AddressBook { } + /// + /// Our address book file is just one of these. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class AddressBook : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressBook()); @@ -383,6 +395,7 @@ namespace Google.Protobuf.Examples.AddressBook { return new AddressBook(this); } + /// Field number for the "people" field. public const int PeopleFieldNumber = 1; private static readonly pb::FieldCodec _repeated_people_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser); diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.cs index f05d03b2..dfd331ae 100644 --- a/csharp/src/Google.Protobuf.Conformance/Conformance.cs +++ b/csharp/src/Google.Protobuf.Conformance/Conformance.cs @@ -163,6 +163,12 @@ namespace Conformance { #endregion #region Messages + /// + /// Represents a single test case's input. The testee should: + /// 1. parse this proto (which should always succeed) + /// 2. parse the protobuf or JSON payload in "payload" (which may fail) + /// 3. if the parse succeeded, serialize the message in the requested format. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ConformanceRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceRequest()); @@ -199,6 +205,7 @@ namespace Conformance { return new ConformanceRequest(this); } + /// Field number for the "protobuf_payload" field. public const int ProtobufPayloadFieldNumber = 1; public pb::ByteString ProtobufPayload { get { return payloadCase_ == PayloadOneofCase.ProtobufPayload ? (pb::ByteString) payload_ : pb::ByteString.Empty; } @@ -208,6 +215,7 @@ namespace Conformance { } } + /// Field number for the "json_payload" field. public const int JsonPayloadFieldNumber = 2; public string JsonPayload { get { return payloadCase_ == PayloadOneofCase.JsonPayload ? (string) payload_ : ""; } @@ -217,8 +225,12 @@ namespace Conformance { } } + /// Field number for the "requested_output_format" field. public const int RequestedOutputFormatFieldNumber = 3; private global::Conformance.WireFormat requestedOutputFormat_ = global::Conformance.WireFormat.UNSPECIFIED; + /// + /// Which format should the testee serialize its message to? + /// public global::Conformance.WireFormat RequestedOutputFormat { get { return requestedOutputFormat_; } set { @@ -344,6 +356,9 @@ namespace Conformance { } + /// + /// Represents a single test case's output. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ConformanceResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConformanceResponse()); @@ -388,7 +403,14 @@ namespace Conformance { return new ConformanceResponse(this); } + /// Field number for the "parse_error" field. public const int ParseErrorFieldNumber = 1; + /// + /// This string should be set to indicate parsing failed. The string can + /// provide more information about the parse error if it is available. + /// Setting this string does not necessarily mean the testee failed the + /// test. Some of the test cases are intentionally invalid input. + /// public string ParseError { get { return resultCase_ == ResultOneofCase.ParseError ? (string) result_ : ""; } set { @@ -397,7 +419,13 @@ namespace Conformance { } } + /// Field number for the "runtime_error" field. public const int RuntimeErrorFieldNumber = 2; + /// + /// This should be set if some other error occurred. This will always + /// indicate that the test failed. The string can provide more information + /// about the failure. + /// public string RuntimeError { get { return resultCase_ == ResultOneofCase.RuntimeError ? (string) result_ : ""; } set { @@ -406,7 +434,12 @@ namespace Conformance { } } + /// Field number for the "protobuf_payload" field. public const int ProtobufPayloadFieldNumber = 3; + /// + /// If the input was successfully parsed and the requested output was + /// protobuf, serialize it to protobuf and set it in this field. + /// public pb::ByteString ProtobufPayload { get { return resultCase_ == ResultOneofCase.ProtobufPayload ? (pb::ByteString) result_ : pb::ByteString.Empty; } set { @@ -415,7 +448,12 @@ namespace Conformance { } } + /// Field number for the "json_payload" field. public const int JsonPayloadFieldNumber = 4; + /// + /// If the input was successfully parsed and the requested output was JSON, + /// serialize to JSON and set it in this field. + /// public string JsonPayload { get { return resultCase_ == ResultOneofCase.JsonPayload ? (string) result_ : ""; } set { @@ -424,7 +462,12 @@ namespace Conformance { } } + /// Field number for the "skipped" field. public const int SkippedFieldNumber = 5; + /// + /// For when the testee skipped the test, likely because a certain feature + /// wasn't supported, like JSON input/output. + /// public string Skipped { get { return resultCase_ == ResultOneofCase.Skipped ? (string) result_ : ""; } set { @@ -586,6 +629,10 @@ namespace Conformance { } + /// + /// This proto includes every type of field in both singular and repeated + /// forms. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestAllTypes : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); @@ -689,8 +736,12 @@ namespace Conformance { return new TestAllTypes(this); } + /// Field number for the "optional_int32" field. public const int OptionalInt32FieldNumber = 1; private int optionalInt32_; + /// + /// Singular + /// public int OptionalInt32 { get { return optionalInt32_; } set { @@ -698,6 +749,7 @@ namespace Conformance { } } + /// Field number for the "optional_int64" field. public const int OptionalInt64FieldNumber = 2; private long optionalInt64_; public long OptionalInt64 { @@ -707,6 +759,7 @@ namespace Conformance { } } + /// Field number for the "optional_uint32" field. public const int OptionalUint32FieldNumber = 3; private uint optionalUint32_; public uint OptionalUint32 { @@ -716,6 +769,7 @@ namespace Conformance { } } + /// Field number for the "optional_uint64" field. public const int OptionalUint64FieldNumber = 4; private ulong optionalUint64_; public ulong OptionalUint64 { @@ -725,6 +779,7 @@ namespace Conformance { } } + /// Field number for the "optional_sint32" field. public const int OptionalSint32FieldNumber = 5; private int optionalSint32_; public int OptionalSint32 { @@ -734,6 +789,7 @@ namespace Conformance { } } + /// Field number for the "optional_sint64" field. public const int OptionalSint64FieldNumber = 6; private long optionalSint64_; public long OptionalSint64 { @@ -743,6 +799,7 @@ namespace Conformance { } } + /// Field number for the "optional_fixed32" field. public const int OptionalFixed32FieldNumber = 7; private uint optionalFixed32_; public uint OptionalFixed32 { @@ -752,6 +809,7 @@ namespace Conformance { } } + /// Field number for the "optional_fixed64" field. public const int OptionalFixed64FieldNumber = 8; private ulong optionalFixed64_; public ulong OptionalFixed64 { @@ -761,6 +819,7 @@ namespace Conformance { } } + /// Field number for the "optional_sfixed32" field. public const int OptionalSfixed32FieldNumber = 9; private int optionalSfixed32_; public int OptionalSfixed32 { @@ -770,6 +829,7 @@ namespace Conformance { } } + /// Field number for the "optional_sfixed64" field. public const int OptionalSfixed64FieldNumber = 10; private long optionalSfixed64_; public long OptionalSfixed64 { @@ -779,6 +839,7 @@ namespace Conformance { } } + /// Field number for the "optional_float" field. public const int OptionalFloatFieldNumber = 11; private float optionalFloat_; public float OptionalFloat { @@ -788,6 +849,7 @@ namespace Conformance { } } + /// Field number for the "optional_double" field. public const int OptionalDoubleFieldNumber = 12; private double optionalDouble_; public double OptionalDouble { @@ -797,6 +859,7 @@ namespace Conformance { } } + /// Field number for the "optional_bool" field. public const int OptionalBoolFieldNumber = 13; private bool optionalBool_; public bool OptionalBool { @@ -806,6 +869,7 @@ namespace Conformance { } } + /// Field number for the "optional_string" field. public const int OptionalStringFieldNumber = 14; private string optionalString_ = ""; public string OptionalString { @@ -815,6 +879,7 @@ namespace Conformance { } } + /// Field number for the "optional_bytes" field. public const int OptionalBytesFieldNumber = 15; private pb::ByteString optionalBytes_ = pb::ByteString.Empty; public pb::ByteString OptionalBytes { @@ -824,6 +889,7 @@ namespace Conformance { } } + /// Field number for the "optional_nested_message" field. public const int OptionalNestedMessageFieldNumber = 18; private global::Conformance.TestAllTypes.Types.NestedMessage optionalNestedMessage_; public global::Conformance.TestAllTypes.Types.NestedMessage OptionalNestedMessage { @@ -833,6 +899,7 @@ namespace Conformance { } } + /// Field number for the "optional_foreign_message" field. public const int OptionalForeignMessageFieldNumber = 19; private global::Conformance.ForeignMessage optionalForeignMessage_; public global::Conformance.ForeignMessage OptionalForeignMessage { @@ -842,6 +909,7 @@ namespace Conformance { } } + /// Field number for the "optional_nested_enum" field. public const int OptionalNestedEnumFieldNumber = 21; private global::Conformance.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Conformance.TestAllTypes.Types.NestedEnum.FOO; public global::Conformance.TestAllTypes.Types.NestedEnum OptionalNestedEnum { @@ -851,6 +919,7 @@ namespace Conformance { } } + /// Field number for the "optional_foreign_enum" field. public const int OptionalForeignEnumFieldNumber = 22; private global::Conformance.ForeignEnum optionalForeignEnum_ = global::Conformance.ForeignEnum.FOREIGN_FOO; public global::Conformance.ForeignEnum OptionalForeignEnum { @@ -860,6 +929,7 @@ namespace Conformance { } } + /// Field number for the "optional_string_piece" field. public const int OptionalStringPieceFieldNumber = 24; private string optionalStringPiece_ = ""; public string OptionalStringPiece { @@ -869,6 +939,7 @@ namespace Conformance { } } + /// Field number for the "optional_cord" field. public const int OptionalCordFieldNumber = 25; private string optionalCord_ = ""; public string OptionalCord { @@ -878,6 +949,7 @@ namespace Conformance { } } + /// Field number for the "recursive_message" field. public const int RecursiveMessageFieldNumber = 27; private global::Conformance.TestAllTypes recursiveMessage_; public global::Conformance.TestAllTypes RecursiveMessage { @@ -887,14 +959,19 @@ namespace Conformance { } } + /// Field number for the "repeated_int32" field. public const int RepeatedInt32FieldNumber = 31; private static readonly pb::FieldCodec _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(250); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); + /// + /// Repeated + /// public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } + /// Field number for the "repeated_int64" field. public const int RepeatedInt64FieldNumber = 32; private static readonly pb::FieldCodec _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(258); @@ -903,6 +980,7 @@ namespace Conformance { get { return repeatedInt64_; } } + /// Field number for the "repeated_uint32" field. public const int RepeatedUint32FieldNumber = 33; private static readonly pb::FieldCodec _repeated_repeatedUint32_codec = pb::FieldCodec.ForUInt32(266); @@ -911,6 +989,7 @@ namespace Conformance { get { return repeatedUint32_; } } + /// Field number for the "repeated_uint64" field. public const int RepeatedUint64FieldNumber = 34; private static readonly pb::FieldCodec _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(274); @@ -919,6 +998,7 @@ namespace Conformance { get { return repeatedUint64_; } } + /// Field number for the "repeated_sint32" field. public const int RepeatedSint32FieldNumber = 35; private static readonly pb::FieldCodec _repeated_repeatedSint32_codec = pb::FieldCodec.ForSInt32(282); @@ -927,6 +1007,7 @@ namespace Conformance { get { return repeatedSint32_; } } + /// Field number for the "repeated_sint64" field. public const int RepeatedSint64FieldNumber = 36; private static readonly pb::FieldCodec _repeated_repeatedSint64_codec = pb::FieldCodec.ForSInt64(290); @@ -935,6 +1016,7 @@ namespace Conformance { get { return repeatedSint64_; } } + /// Field number for the "repeated_fixed32" field. public const int RepeatedFixed32FieldNumber = 37; private static readonly pb::FieldCodec _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(298); @@ -943,6 +1025,7 @@ namespace Conformance { get { return repeatedFixed32_; } } + /// Field number for the "repeated_fixed64" field. public const int RepeatedFixed64FieldNumber = 38; private static readonly pb::FieldCodec _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(306); @@ -951,6 +1034,7 @@ namespace Conformance { get { return repeatedFixed64_; } } + /// Field number for the "repeated_sfixed32" field. public const int RepeatedSfixed32FieldNumber = 39; private static readonly pb::FieldCodec _repeated_repeatedSfixed32_codec = pb::FieldCodec.ForSFixed32(314); @@ -959,6 +1043,7 @@ namespace Conformance { get { return repeatedSfixed32_; } } + /// Field number for the "repeated_sfixed64" field. public const int RepeatedSfixed64FieldNumber = 40; private static readonly pb::FieldCodec _repeated_repeatedSfixed64_codec = pb::FieldCodec.ForSFixed64(322); @@ -967,6 +1052,7 @@ namespace Conformance { get { return repeatedSfixed64_; } } + /// Field number for the "repeated_float" field. public const int RepeatedFloatFieldNumber = 41; private static readonly pb::FieldCodec _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(330); @@ -975,6 +1061,7 @@ namespace Conformance { get { return repeatedFloat_; } } + /// Field number for the "repeated_double" field. public const int RepeatedDoubleFieldNumber = 42; private static readonly pb::FieldCodec _repeated_repeatedDouble_codec = pb::FieldCodec.ForDouble(338); @@ -983,6 +1070,7 @@ namespace Conformance { get { return repeatedDouble_; } } + /// Field number for the "repeated_bool" field. public const int RepeatedBoolFieldNumber = 43; private static readonly pb::FieldCodec _repeated_repeatedBool_codec = pb::FieldCodec.ForBool(346); @@ -991,6 +1079,7 @@ namespace Conformance { get { return repeatedBool_; } } + /// Field number for the "repeated_string" field. public const int RepeatedStringFieldNumber = 44; private static readonly pb::FieldCodec _repeated_repeatedString_codec = pb::FieldCodec.ForString(354); @@ -999,6 +1088,7 @@ namespace Conformance { get { return repeatedString_; } } + /// Field number for the "repeated_bytes" field. public const int RepeatedBytesFieldNumber = 45; private static readonly pb::FieldCodec _repeated_repeatedBytes_codec = pb::FieldCodec.ForBytes(362); @@ -1007,6 +1097,7 @@ namespace Conformance { get { return repeatedBytes_; } } + /// Field number for the "repeated_nested_message" field. public const int RepeatedNestedMessageFieldNumber = 48; private static readonly pb::FieldCodec _repeated_repeatedNestedMessage_codec = pb::FieldCodec.ForMessage(386, global::Conformance.TestAllTypes.Types.NestedMessage.Parser); @@ -1015,6 +1106,7 @@ namespace Conformance { get { return repeatedNestedMessage_; } } + /// Field number for the "repeated_foreign_message" field. public const int RepeatedForeignMessageFieldNumber = 49; private static readonly pb::FieldCodec _repeated_repeatedForeignMessage_codec = pb::FieldCodec.ForMessage(394, global::Conformance.ForeignMessage.Parser); @@ -1023,6 +1115,7 @@ namespace Conformance { get { return repeatedForeignMessage_; } } + /// Field number for the "repeated_nested_enum" field. public const int RepeatedNestedEnumFieldNumber = 51; private static readonly pb::FieldCodec _repeated_repeatedNestedEnum_codec = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Conformance.TestAllTypes.Types.NestedEnum) x); @@ -1031,6 +1124,7 @@ namespace Conformance { get { return repeatedNestedEnum_; } } + /// Field number for the "repeated_foreign_enum" field. public const int RepeatedForeignEnumFieldNumber = 52; private static readonly pb::FieldCodec _repeated_repeatedForeignEnum_codec = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Conformance.ForeignEnum) x); @@ -1039,6 +1133,7 @@ namespace Conformance { get { return repeatedForeignEnum_; } } + /// Field number for the "repeated_string_piece" field. public const int RepeatedStringPieceFieldNumber = 54; private static readonly pb::FieldCodec _repeated_repeatedStringPiece_codec = pb::FieldCodec.ForString(434); @@ -1047,6 +1142,7 @@ namespace Conformance { get { return repeatedStringPiece_; } } + /// Field number for the "repeated_cord" field. public const int RepeatedCordFieldNumber = 55; private static readonly pb::FieldCodec _repeated_repeatedCord_codec = pb::FieldCodec.ForString(442); @@ -1055,14 +1151,19 @@ namespace Conformance { get { return repeatedCord_; } } + /// Field number for the "map_int32_int32" field. public const int MapInt32Int32FieldNumber = 56; private static readonly pbc::MapField.Codec _map_mapInt32Int32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 450); private readonly pbc::MapField mapInt32Int32_ = new pbc::MapField(); + /// + /// Map + /// public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } + /// Field number for the "map_int64_int64" field. public const int MapInt64Int64FieldNumber = 57; private static readonly pbc::MapField.Codec _map_mapInt64Int64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 458); @@ -1071,6 +1172,7 @@ namespace Conformance { get { return mapInt64Int64_; } } + /// Field number for the "map_uint32_uint32" field. public const int MapUint32Uint32FieldNumber = 58; private static readonly pbc::MapField.Codec _map_mapUint32Uint32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 466); @@ -1079,6 +1181,7 @@ namespace Conformance { get { return mapUint32Uint32_; } } + /// Field number for the "map_uint64_uint64" field. public const int MapUint64Uint64FieldNumber = 59; private static readonly pbc::MapField.Codec _map_mapUint64Uint64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 474); @@ -1087,6 +1190,7 @@ namespace Conformance { get { return mapUint64Uint64_; } } + /// Field number for the "map_sint32_sint32" field. public const int MapSint32Sint32FieldNumber = 60; private static readonly pbc::MapField.Codec _map_mapSint32Sint32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 482); @@ -1095,6 +1199,7 @@ namespace Conformance { get { return mapSint32Sint32_; } } + /// Field number for the "map_sint64_sint64" field. public const int MapSint64Sint64FieldNumber = 61; private static readonly pbc::MapField.Codec _map_mapSint64Sint64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 490); @@ -1103,6 +1208,7 @@ namespace Conformance { get { return mapSint64Sint64_; } } + /// Field number for the "map_fixed32_fixed32" field. public const int MapFixed32Fixed32FieldNumber = 62; private static readonly pbc::MapField.Codec _map_mapFixed32Fixed32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 498); @@ -1111,6 +1217,7 @@ namespace Conformance { get { return mapFixed32Fixed32_; } } + /// Field number for the "map_fixed64_fixed64" field. public const int MapFixed64Fixed64FieldNumber = 63; private static readonly pbc::MapField.Codec _map_mapFixed64Fixed64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 506); @@ -1119,6 +1226,7 @@ namespace Conformance { get { return mapFixed64Fixed64_; } } + /// Field number for the "map_sfixed32_sfixed32" field. public const int MapSfixed32Sfixed32FieldNumber = 64; private static readonly pbc::MapField.Codec _map_mapSfixed32Sfixed32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 514); @@ -1127,6 +1235,7 @@ namespace Conformance { get { return mapSfixed32Sfixed32_; } } + /// Field number for the "map_sfixed64_sfixed64" field. public const int MapSfixed64Sfixed64FieldNumber = 65; private static readonly pbc::MapField.Codec _map_mapSfixed64Sfixed64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 522); @@ -1135,6 +1244,7 @@ namespace Conformance { get { return mapSfixed64Sfixed64_; } } + /// Field number for the "map_int32_float" field. public const int MapInt32FloatFieldNumber = 66; private static readonly pbc::MapField.Codec _map_mapInt32Float_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 530); @@ -1143,6 +1253,7 @@ namespace Conformance { get { return mapInt32Float_; } } + /// Field number for the "map_int32_double" field. public const int MapInt32DoubleFieldNumber = 67; private static readonly pbc::MapField.Codec _map_mapInt32Double_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 538); @@ -1151,6 +1262,7 @@ namespace Conformance { get { return mapInt32Double_; } } + /// Field number for the "map_bool_bool" field. public const int MapBoolBoolFieldNumber = 68; private static readonly pbc::MapField.Codec _map_mapBoolBool_codec = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 546); @@ -1159,6 +1271,7 @@ namespace Conformance { get { return mapBoolBool_; } } + /// Field number for the "map_string_string" field. public const int MapStringStringFieldNumber = 69; private static readonly pbc::MapField.Codec _map_mapStringString_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 554); @@ -1167,6 +1280,7 @@ namespace Conformance { get { return mapStringString_; } } + /// Field number for the "map_string_bytes" field. public const int MapStringBytesFieldNumber = 70; private static readonly pbc::MapField.Codec _map_mapStringBytes_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForBytes(18), 562); @@ -1175,6 +1289,7 @@ namespace Conformance { get { return mapStringBytes_; } } + /// Field number for the "map_string_nested_message" field. public const int MapStringNestedMessageFieldNumber = 71; private static readonly pbc::MapField.Codec _map_mapStringNestedMessage_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Conformance.TestAllTypes.Types.NestedMessage.Parser), 570); @@ -1183,6 +1298,7 @@ namespace Conformance { get { return mapStringNestedMessage_; } } + /// Field number for the "map_string_foreign_message" field. public const int MapStringForeignMessageFieldNumber = 72; private static readonly pbc::MapField.Codec _map_mapStringForeignMessage_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Conformance.ForeignMessage.Parser), 578); @@ -1191,6 +1307,7 @@ namespace Conformance { get { return mapStringForeignMessage_; } } + /// Field number for the "map_string_nested_enum" field. public const int MapStringNestedEnumFieldNumber = 73; private static readonly pbc::MapField.Codec _map_mapStringNestedEnum_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Conformance.TestAllTypes.Types.NestedEnum) x), 586); @@ -1199,6 +1316,7 @@ namespace Conformance { get { return mapStringNestedEnum_; } } + /// Field number for the "map_string_foreign_enum" field. public const int MapStringForeignEnumFieldNumber = 74; private static readonly pbc::MapField.Codec _map_mapStringForeignEnum_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Conformance.ForeignEnum) x), 594); @@ -1207,6 +1325,7 @@ namespace Conformance { get { return mapStringForeignEnum_; } } + /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; public uint OneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } @@ -1216,6 +1335,7 @@ namespace Conformance { } } + /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; public global::Conformance.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Conformance.TestAllTypes.Types.NestedMessage) oneofField_ : null; } @@ -1225,6 +1345,7 @@ namespace Conformance { } } + /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; public string OneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } @@ -1234,6 +1355,7 @@ namespace Conformance { } } + /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; public pb::ByteString OneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } @@ -2135,6 +2257,9 @@ namespace Conformance { FOO = 0, BAR = 1, BAZ = 2, + /// + /// Intentionally negative. + /// NEG = -1, } @@ -2166,6 +2291,7 @@ namespace Conformance { return new NestedMessage(this); } + /// Field number for the "a" field. public const int AFieldNumber = 1; private int a_; public int A { @@ -2175,6 +2301,7 @@ namespace Conformance { } } + /// Field number for the "corecursive" field. public const int CorecursiveFieldNumber = 2; private global::Conformance.TestAllTypes corecursive_; public global::Conformance.TestAllTypes Corecursive { @@ -2304,6 +2431,7 @@ namespace Conformance { return new ForeignMessage(this); } + /// Field number for the "c" field. public const int CFieldNumber = 1; private int c_; public int C { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs index 60565363..e3991bc8 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs @@ -172,6 +172,9 @@ namespace Google.Protobuf.TestProtos { #endregion #region Messages + /// + /// Tests maps. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestMap : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMap()); @@ -215,6 +218,7 @@ namespace Google.Protobuf.TestProtos { return new TestMap(this); } + /// Field number for the "map_int32_int32" field. public const int MapInt32Int32FieldNumber = 1; private static readonly pbc::MapField.Codec _map_mapInt32Int32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); @@ -223,6 +227,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Int32_; } } + /// Field number for the "map_int64_int64" field. public const int MapInt64Int64FieldNumber = 2; private static readonly pbc::MapField.Codec _map_mapInt64Int64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 18); @@ -231,6 +236,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt64Int64_; } } + /// Field number for the "map_uint32_uint32" field. public const int MapUint32Uint32FieldNumber = 3; private static readonly pbc::MapField.Codec _map_mapUint32Uint32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 26); @@ -239,6 +245,7 @@ namespace Google.Protobuf.TestProtos { get { return mapUint32Uint32_; } } + /// Field number for the "map_uint64_uint64" field. public const int MapUint64Uint64FieldNumber = 4; private static readonly pbc::MapField.Codec _map_mapUint64Uint64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 34); @@ -247,6 +254,7 @@ namespace Google.Protobuf.TestProtos { get { return mapUint64Uint64_; } } + /// Field number for the "map_sint32_sint32" field. public const int MapSint32Sint32FieldNumber = 5; private static readonly pbc::MapField.Codec _map_mapSint32Sint32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 42); @@ -255,6 +263,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSint32Sint32_; } } + /// Field number for the "map_sint64_sint64" field. public const int MapSint64Sint64FieldNumber = 6; private static readonly pbc::MapField.Codec _map_mapSint64Sint64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 50); @@ -263,6 +272,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSint64Sint64_; } } + /// Field number for the "map_fixed32_fixed32" field. public const int MapFixed32Fixed32FieldNumber = 7; private static readonly pbc::MapField.Codec _map_mapFixed32Fixed32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 58); @@ -271,6 +281,7 @@ namespace Google.Protobuf.TestProtos { get { return mapFixed32Fixed32_; } } + /// Field number for the "map_fixed64_fixed64" field. public const int MapFixed64Fixed64FieldNumber = 8; private static readonly pbc::MapField.Codec _map_mapFixed64Fixed64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 66); @@ -279,6 +290,7 @@ namespace Google.Protobuf.TestProtos { get { return mapFixed64Fixed64_; } } + /// Field number for the "map_sfixed32_sfixed32" field. public const int MapSfixed32Sfixed32FieldNumber = 9; private static readonly pbc::MapField.Codec _map_mapSfixed32Sfixed32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 74); @@ -287,6 +299,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSfixed32Sfixed32_; } } + /// Field number for the "map_sfixed64_sfixed64" field. public const int MapSfixed64Sfixed64FieldNumber = 10; private static readonly pbc::MapField.Codec _map_mapSfixed64Sfixed64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 82); @@ -295,6 +308,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSfixed64Sfixed64_; } } + /// Field number for the "map_int32_float" field. public const int MapInt32FloatFieldNumber = 11; private static readonly pbc::MapField.Codec _map_mapInt32Float_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 90); @@ -303,6 +317,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Float_; } } + /// Field number for the "map_int32_double" field. public const int MapInt32DoubleFieldNumber = 12; private static readonly pbc::MapField.Codec _map_mapInt32Double_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 98); @@ -311,6 +326,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Double_; } } + /// Field number for the "map_bool_bool" field. public const int MapBoolBoolFieldNumber = 13; private static readonly pbc::MapField.Codec _map_mapBoolBool_codec = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 106); @@ -319,6 +335,7 @@ namespace Google.Protobuf.TestProtos { get { return mapBoolBool_; } } + /// Field number for the "map_string_string" field. public const int MapStringStringFieldNumber = 14; private static readonly pbc::MapField.Codec _map_mapStringString_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 114); @@ -327,6 +344,7 @@ namespace Google.Protobuf.TestProtos { get { return mapStringString_; } } + /// Field number for the "map_int32_bytes" field. public const int MapInt32BytesFieldNumber = 15; private static readonly pbc::MapField.Codec _map_mapInt32Bytes_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForBytes(18), 122); @@ -335,6 +353,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Bytes_; } } + /// Field number for the "map_int32_enum" field. public const int MapInt32EnumFieldNumber = 16; private static readonly pbc::MapField.Codec _map_mapInt32Enum_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x), 130); @@ -343,6 +362,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Enum_; } } + /// Field number for the "map_int32_foreign_message" field. public const int MapInt32ForeignMessageFieldNumber = 17; private static readonly pbc::MapField.Codec _map_mapInt32ForeignMessage_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 138); @@ -581,6 +601,7 @@ namespace Google.Protobuf.TestProtos { return new TestMapSubmessage(this); } + /// Field number for the "test_map" field. public const int TestMapFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMap testMap_; public global::Google.Protobuf.TestProtos.TestMap TestMap { @@ -689,6 +710,7 @@ namespace Google.Protobuf.TestProtos { return new TestMessageMap(this); } + /// Field number for the "map_int32_message" field. public const int MapInt32MessageFieldNumber = 1; private static readonly pbc::MapField.Codec _map_mapInt32Message_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.TestAllTypes.Parser), 10); @@ -756,6 +778,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Two map fields share the same entry default instance. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestSameTypeMap : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestSameTypeMap()); @@ -784,6 +809,7 @@ namespace Google.Protobuf.TestProtos { return new TestSameTypeMap(this); } + /// Field number for the "map1" field. public const int Map1FieldNumber = 1; private static readonly pbc::MapField.Codec _map_map1_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); @@ -792,6 +818,7 @@ namespace Google.Protobuf.TestProtos { get { return map1_; } } + /// Field number for the "map2" field. public const int Map2FieldNumber = 2; private static readonly pbc::MapField.Codec _map_map2_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 18); @@ -909,6 +936,7 @@ namespace Google.Protobuf.TestProtos { return new TestArenaMap(this); } + /// Field number for the "map_int32_int32" field. public const int MapInt32Int32FieldNumber = 1; private static readonly pbc::MapField.Codec _map_mapInt32Int32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); @@ -917,6 +945,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Int32_; } } + /// Field number for the "map_int64_int64" field. public const int MapInt64Int64FieldNumber = 2; private static readonly pbc::MapField.Codec _map_mapInt64Int64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 18); @@ -925,6 +954,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt64Int64_; } } + /// Field number for the "map_uint32_uint32" field. public const int MapUint32Uint32FieldNumber = 3; private static readonly pbc::MapField.Codec _map_mapUint32Uint32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 26); @@ -933,6 +963,7 @@ namespace Google.Protobuf.TestProtos { get { return mapUint32Uint32_; } } + /// Field number for the "map_uint64_uint64" field. public const int MapUint64Uint64FieldNumber = 4; private static readonly pbc::MapField.Codec _map_mapUint64Uint64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 34); @@ -941,6 +972,7 @@ namespace Google.Protobuf.TestProtos { get { return mapUint64Uint64_; } } + /// Field number for the "map_sint32_sint32" field. public const int MapSint32Sint32FieldNumber = 5; private static readonly pbc::MapField.Codec _map_mapSint32Sint32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 42); @@ -949,6 +981,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSint32Sint32_; } } + /// Field number for the "map_sint64_sint64" field. public const int MapSint64Sint64FieldNumber = 6; private static readonly pbc::MapField.Codec _map_mapSint64Sint64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 50); @@ -957,6 +990,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSint64Sint64_; } } + /// Field number for the "map_fixed32_fixed32" field. public const int MapFixed32Fixed32FieldNumber = 7; private static readonly pbc::MapField.Codec _map_mapFixed32Fixed32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 58); @@ -965,6 +999,7 @@ namespace Google.Protobuf.TestProtos { get { return mapFixed32Fixed32_; } } + /// Field number for the "map_fixed64_fixed64" field. public const int MapFixed64Fixed64FieldNumber = 8; private static readonly pbc::MapField.Codec _map_mapFixed64Fixed64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 66); @@ -973,6 +1008,7 @@ namespace Google.Protobuf.TestProtos { get { return mapFixed64Fixed64_; } } + /// Field number for the "map_sfixed32_sfixed32" field. public const int MapSfixed32Sfixed32FieldNumber = 9; private static readonly pbc::MapField.Codec _map_mapSfixed32Sfixed32_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 74); @@ -981,6 +1017,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSfixed32Sfixed32_; } } + /// Field number for the "map_sfixed64_sfixed64" field. public const int MapSfixed64Sfixed64FieldNumber = 10; private static readonly pbc::MapField.Codec _map_mapSfixed64Sfixed64_codec = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 82); @@ -989,6 +1026,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSfixed64Sfixed64_; } } + /// Field number for the "map_int32_float" field. public const int MapInt32FloatFieldNumber = 11; private static readonly pbc::MapField.Codec _map_mapInt32Float_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 90); @@ -997,6 +1035,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Float_; } } + /// Field number for the "map_int32_double" field. public const int MapInt32DoubleFieldNumber = 12; private static readonly pbc::MapField.Codec _map_mapInt32Double_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 98); @@ -1005,6 +1044,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Double_; } } + /// Field number for the "map_bool_bool" field. public const int MapBoolBoolFieldNumber = 13; private static readonly pbc::MapField.Codec _map_mapBoolBool_codec = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 106); @@ -1013,6 +1053,7 @@ namespace Google.Protobuf.TestProtos { get { return mapBoolBool_; } } + /// Field number for the "map_int32_enum" field. public const int MapInt32EnumFieldNumber = 14; private static readonly pbc::MapField.Codec _map_mapInt32Enum_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x), 114); @@ -1021,6 +1062,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Enum_; } } + /// Field number for the "map_int32_foreign_message" field. public const int MapInt32ForeignMessageFieldNumber = 15; private static readonly pbc::MapField.Codec _map_mapInt32ForeignMessage_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 122); @@ -1214,6 +1256,10 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Previously, message containing enum called Type cannot be used as value of + /// map field. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class MessageContainingEnumCalledType : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingEnumCalledType()); @@ -1241,6 +1287,7 @@ namespace Google.Protobuf.TestProtos { return new MessageContainingEnumCalledType(this); } + /// Field number for the "type" field. public const int TypeFieldNumber = 1; private static readonly pbc::MapField.Codec _map_type_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Parser), 10); @@ -1319,6 +1366,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Previously, message cannot contain map field called "entry". + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class MessageContainingMapCalledEntry : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingMapCalledEntry()); @@ -1346,6 +1396,7 @@ namespace Google.Protobuf.TestProtos { return new MessageContainingMapCalledEntry(this); } + /// Field number for the "entry" field. public const int EntryFieldNumber = 1; private static readonly pbc::MapField.Codec _map_entry_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs index dd7fb456..a55c66e0 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs @@ -78,6 +78,7 @@ namespace Google.Protobuf.TestProtos { return new ImportMessage(this); } + /// Field number for the "d" field. public const int DFieldNumber = 1; private int d_; public int D { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs index 0be4e9d8..81696d70 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs @@ -64,6 +64,7 @@ namespace Google.Protobuf.TestProtos { return new PublicImportMessage(this); } + /// Field number for the "e" field. public const int EFieldNumber = 1; private int e_; public int E { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs index 6c1a594f..addec057 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs @@ -76,6 +76,10 @@ namespace UnitTest.Issues.TestProtos { #endregion #region Messages + /// + /// Issue 307: when generating doubly-nested types, any references + /// should be of the form A.Types.B.Types.C. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Issue307 : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Issue307()); @@ -347,6 +351,7 @@ namespace UnitTest.Issues.TestProtos { return new NegativeEnumMessage(this); } + /// Field number for the "value" field. public const int ValueFieldNumber = 1; private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO; public global::UnitTest.Issues.TestProtos.NegativeEnum Value { @@ -356,6 +361,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "values" field. public const int ValuesFieldNumber = 2; private static readonly pb::FieldCodec _repeated_values_codec = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); @@ -364,6 +370,7 @@ namespace UnitTest.Issues.TestProtos { get { return values_; } } + /// Field number for the "packed_values" field. public const int PackedValuesFieldNumber = 3; private static readonly pb::FieldCodec _repeated_packedValues_codec = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); @@ -566,6 +573,7 @@ namespace UnitTest.Issues.TestProtos { return new DeprecatedFieldsMessage(this); } + /// Field number for the "PrimitiveValue" field. public const int PrimitiveValueFieldNumber = 1; private int primitiveValue_; [global::System.ObsoleteAttribute()] @@ -576,6 +584,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "PrimitiveArray" field. public const int PrimitiveArrayFieldNumber = 2; private static readonly pb::FieldCodec _repeated_primitiveArray_codec = pb::FieldCodec.ForInt32(18); @@ -585,6 +594,7 @@ namespace UnitTest.Issues.TestProtos { get { return primitiveArray_; } } + /// Field number for the "MessageValue" field. public const int MessageValueFieldNumber = 3; private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; [global::System.ObsoleteAttribute()] @@ -595,6 +605,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "MessageArray" field. public const int MessageArrayFieldNumber = 4; private static readonly pb::FieldCodec _repeated_messageArray_codec = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser); @@ -604,6 +615,7 @@ namespace UnitTest.Issues.TestProtos { get { return messageArray_; } } + /// Field number for the "EnumValue" field. public const int EnumValueFieldNumber = 5; private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO; [global::System.ObsoleteAttribute()] @@ -614,6 +626,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "EnumArray" field. public const int EnumArrayFieldNumber = 6; private static readonly pb::FieldCodec _repeated_enumArray_codec = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x); @@ -756,6 +769,9 @@ namespace UnitTest.Issues.TestProtos { } + /// + /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ItemField : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ItemField()); @@ -783,6 +799,7 @@ namespace UnitTest.Issues.TestProtos { return new ItemField(this); } + /// Field number for the "item" field. public const int ItemFieldNumber = 1; private int item_; public int Item { @@ -886,6 +903,7 @@ namespace UnitTest.Issues.TestProtos { return new ReservedNames(this); } + /// Field number for the "types" field. public const int Types_FieldNumber = 1; private int types_; public int Types_ { @@ -895,6 +913,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "descriptor" field. public const int Descriptor_FieldNumber = 2; private int descriptor_; public int Descriptor_ { @@ -988,6 +1007,9 @@ namespace UnitTest.Issues.TestProtos { /// Container for nested types declared in the ReservedNames message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// + /// Force a nested type called Types + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class SomeNestedType : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SomeNestedType()); @@ -1069,6 +1091,18 @@ namespace UnitTest.Issues.TestProtos { } + /// + /// These fields are deliberately not declared in numeric + /// order, and the oneof fields aren't contiguous either. + /// This allows for reasonably robust tests of JSON output + /// ordering. + /// TestFieldOrderings in unittest_proto3.proto is similar, + /// but doesn't include oneofs. + /// TODO: Consider adding oneofs to TestFieldOrderings, although + /// that will require fixing other tests in multiple platforms. + /// Alternatively, consider just adding this to + /// unittest_proto3.proto if multiple platforms want it. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestJsonFieldOrdering : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestJsonFieldOrdering()); @@ -1115,6 +1149,7 @@ namespace UnitTest.Issues.TestProtos { return new TestJsonFieldOrdering(this); } + /// Field number for the "plain_int32" field. public const int PlainInt32FieldNumber = 4; private int plainInt32_; public int PlainInt32 { @@ -1124,6 +1159,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "o1_string" field. public const int O1StringFieldNumber = 2; public string O1String { get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; } @@ -1133,6 +1169,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "o1_int32" field. public const int O1Int32FieldNumber = 5; public int O1Int32 { get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; } @@ -1142,6 +1179,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "plain_string" field. public const int PlainStringFieldNumber = 1; private string plainString_ = ""; public string PlainString { @@ -1151,6 +1189,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "o2_int32" field. public const int O2Int32FieldNumber = 6; public int O2Int32 { get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; } @@ -1160,6 +1199,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// Field number for the "o2_string" field. public const int O2StringFieldNumber = 3; public string O2String { get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; } diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs index f7ad620c..0c7b5279 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs @@ -199,6 +199,9 @@ namespace Google.Protobuf.TestProtos { FOREIGN_BAZ = 6, } + /// + /// Test an enum that has multiple values with the same number. + /// public enum TestEnumWithDupValue { TEST_ENUM_WITH_DUP_VALUE_UNSPECIFIED = 0, FOO1 = 1, @@ -208,6 +211,9 @@ namespace Google.Protobuf.TestProtos { BAR2 = 2, } + /// + /// Test an enum with large, unordered values. + /// public enum TestSparseEnum { TEST_SPARSE_ENUM_UNSPECIFIED = 0, SPARSE_A = 123, @@ -215,12 +221,20 @@ namespace Google.Protobuf.TestProtos { SPARSE_C = 12589234, SPARSE_D = -15, SPARSE_E = -53452, + /// + /// In proto3, value 0 must be the first one specified + /// SPARSE_F = 0; + /// SPARSE_G = 2, } #endregion #region Messages + /// + /// This proto includes every type of field in both singular and repeated + /// forms. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestAllTypes : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); @@ -306,8 +320,12 @@ namespace Google.Protobuf.TestProtos { return new TestAllTypes(this); } + /// Field number for the "single_int32" field. public const int SingleInt32FieldNumber = 1; private int singleInt32_; + /// + /// Singular + /// public int SingleInt32 { get { return singleInt32_; } set { @@ -315,6 +333,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_int64" field. public const int SingleInt64FieldNumber = 2; private long singleInt64_; public long SingleInt64 { @@ -324,6 +343,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_uint32" field. public const int SingleUint32FieldNumber = 3; private uint singleUint32_; public uint SingleUint32 { @@ -333,6 +353,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_uint64" field. public const int SingleUint64FieldNumber = 4; private ulong singleUint64_; public ulong SingleUint64 { @@ -342,6 +363,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_sint32" field. public const int SingleSint32FieldNumber = 5; private int singleSint32_; public int SingleSint32 { @@ -351,6 +373,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_sint64" field. public const int SingleSint64FieldNumber = 6; private long singleSint64_; public long SingleSint64 { @@ -360,6 +383,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_fixed32" field. public const int SingleFixed32FieldNumber = 7; private uint singleFixed32_; public uint SingleFixed32 { @@ -369,6 +393,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_fixed64" field. public const int SingleFixed64FieldNumber = 8; private ulong singleFixed64_; public ulong SingleFixed64 { @@ -378,6 +403,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_sfixed32" field. public const int SingleSfixed32FieldNumber = 9; private int singleSfixed32_; public int SingleSfixed32 { @@ -387,6 +413,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_sfixed64" field. public const int SingleSfixed64FieldNumber = 10; private long singleSfixed64_; public long SingleSfixed64 { @@ -396,6 +423,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_float" field. public const int SingleFloatFieldNumber = 11; private float singleFloat_; public float SingleFloat { @@ -405,6 +433,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_double" field. public const int SingleDoubleFieldNumber = 12; private double singleDouble_; public double SingleDouble { @@ -414,6 +443,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_bool" field. public const int SingleBoolFieldNumber = 13; private bool singleBool_; public bool SingleBool { @@ -423,6 +453,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_string" field. public const int SingleStringFieldNumber = 14; private string singleString_ = ""; public string SingleString { @@ -432,6 +463,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_bytes" field. public const int SingleBytesFieldNumber = 15; private pb::ByteString singleBytes_ = pb::ByteString.Empty; public pb::ByteString SingleBytes { @@ -441,6 +473,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_nested_message" field. public const int SingleNestedMessageFieldNumber = 18; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage singleNestedMessage_; public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage SingleNestedMessage { @@ -450,6 +483,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_foreign_message" field. public const int SingleForeignMessageFieldNumber = 19; private global::Google.Protobuf.TestProtos.ForeignMessage singleForeignMessage_; public global::Google.Protobuf.TestProtos.ForeignMessage SingleForeignMessage { @@ -459,6 +493,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_import_message" field. public const int SingleImportMessageFieldNumber = 20; private global::Google.Protobuf.TestProtos.ImportMessage singleImportMessage_; public global::Google.Protobuf.TestProtos.ImportMessage SingleImportMessage { @@ -468,6 +503,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_nested_enum" field. public const int SingleNestedEnumFieldNumber = 21; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum singleNestedEnum_ = global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum.NESTED_ENUM_UNSPECIFIED; public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum SingleNestedEnum { @@ -477,6 +513,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_foreign_enum" field. public const int SingleForeignEnumFieldNumber = 22; private global::Google.Protobuf.TestProtos.ForeignEnum singleForeignEnum_ = global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED; public global::Google.Protobuf.TestProtos.ForeignEnum SingleForeignEnum { @@ -486,6 +523,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_import_enum" field. public const int SingleImportEnumFieldNumber = 23; private global::Google.Protobuf.TestProtos.ImportEnum singleImportEnum_ = global::Google.Protobuf.TestProtos.ImportEnum.IMPORT_ENUM_UNSPECIFIED; public global::Google.Protobuf.TestProtos.ImportEnum SingleImportEnum { @@ -495,8 +533,12 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_public_import_message" field. public const int SinglePublicImportMessageFieldNumber = 26; private global::Google.Protobuf.TestProtos.PublicImportMessage singlePublicImportMessage_; + /// + /// Defined in unittest_import_public.proto + /// public global::Google.Protobuf.TestProtos.PublicImportMessage SinglePublicImportMessage { get { return singlePublicImportMessage_; } set { @@ -504,14 +546,19 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "repeated_int32" field. public const int RepeatedInt32FieldNumber = 31; private static readonly pb::FieldCodec _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(250); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); + /// + /// Repeated + /// public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } + /// Field number for the "repeated_int64" field. public const int RepeatedInt64FieldNumber = 32; private static readonly pb::FieldCodec _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(258); @@ -520,6 +567,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedInt64_; } } + /// Field number for the "repeated_uint32" field. public const int RepeatedUint32FieldNumber = 33; private static readonly pb::FieldCodec _repeated_repeatedUint32_codec = pb::FieldCodec.ForUInt32(266); @@ -528,6 +576,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedUint32_; } } + /// Field number for the "repeated_uint64" field. public const int RepeatedUint64FieldNumber = 34; private static readonly pb::FieldCodec _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(274); @@ -536,6 +585,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedUint64_; } } + /// Field number for the "repeated_sint32" field. public const int RepeatedSint32FieldNumber = 35; private static readonly pb::FieldCodec _repeated_repeatedSint32_codec = pb::FieldCodec.ForSInt32(282); @@ -544,6 +594,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedSint32_; } } + /// Field number for the "repeated_sint64" field. public const int RepeatedSint64FieldNumber = 36; private static readonly pb::FieldCodec _repeated_repeatedSint64_codec = pb::FieldCodec.ForSInt64(290); @@ -552,6 +603,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedSint64_; } } + /// Field number for the "repeated_fixed32" field. public const int RepeatedFixed32FieldNumber = 37; private static readonly pb::FieldCodec _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(298); @@ -560,6 +612,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedFixed32_; } } + /// Field number for the "repeated_fixed64" field. public const int RepeatedFixed64FieldNumber = 38; private static readonly pb::FieldCodec _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(306); @@ -568,6 +621,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedFixed64_; } } + /// Field number for the "repeated_sfixed32" field. public const int RepeatedSfixed32FieldNumber = 39; private static readonly pb::FieldCodec _repeated_repeatedSfixed32_codec = pb::FieldCodec.ForSFixed32(314); @@ -576,6 +630,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedSfixed32_; } } + /// Field number for the "repeated_sfixed64" field. public const int RepeatedSfixed64FieldNumber = 40; private static readonly pb::FieldCodec _repeated_repeatedSfixed64_codec = pb::FieldCodec.ForSFixed64(322); @@ -584,6 +639,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedSfixed64_; } } + /// Field number for the "repeated_float" field. public const int RepeatedFloatFieldNumber = 41; private static readonly pb::FieldCodec _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(330); @@ -592,6 +648,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedFloat_; } } + /// Field number for the "repeated_double" field. public const int RepeatedDoubleFieldNumber = 42; private static readonly pb::FieldCodec _repeated_repeatedDouble_codec = pb::FieldCodec.ForDouble(338); @@ -600,6 +657,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedDouble_; } } + /// Field number for the "repeated_bool" field. public const int RepeatedBoolFieldNumber = 43; private static readonly pb::FieldCodec _repeated_repeatedBool_codec = pb::FieldCodec.ForBool(346); @@ -608,6 +666,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedBool_; } } + /// Field number for the "repeated_string" field. public const int RepeatedStringFieldNumber = 44; private static readonly pb::FieldCodec _repeated_repeatedString_codec = pb::FieldCodec.ForString(354); @@ -616,6 +675,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedString_; } } + /// Field number for the "repeated_bytes" field. public const int RepeatedBytesFieldNumber = 45; private static readonly pb::FieldCodec _repeated_repeatedBytes_codec = pb::FieldCodec.ForBytes(362); @@ -624,6 +684,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedBytes_; } } + /// Field number for the "repeated_nested_message" field. public const int RepeatedNestedMessageFieldNumber = 48; private static readonly pb::FieldCodec _repeated_repeatedNestedMessage_codec = pb::FieldCodec.ForMessage(386, global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage.Parser); @@ -632,6 +693,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedNestedMessage_; } } + /// Field number for the "repeated_foreign_message" field. public const int RepeatedForeignMessageFieldNumber = 49; private static readonly pb::FieldCodec _repeated_repeatedForeignMessage_codec = pb::FieldCodec.ForMessage(394, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); @@ -640,6 +702,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedForeignMessage_; } } + /// Field number for the "repeated_import_message" field. public const int RepeatedImportMessageFieldNumber = 50; private static readonly pb::FieldCodec _repeated_repeatedImportMessage_codec = pb::FieldCodec.ForMessage(402, global::Google.Protobuf.TestProtos.ImportMessage.Parser); @@ -648,6 +711,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedImportMessage_; } } + /// Field number for the "repeated_nested_enum" field. public const int RepeatedNestedEnumFieldNumber = 51; private static readonly pb::FieldCodec _repeated_repeatedNestedEnum_codec = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x); @@ -656,6 +720,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedNestedEnum_; } } + /// Field number for the "repeated_foreign_enum" field. public const int RepeatedForeignEnumFieldNumber = 52; private static readonly pb::FieldCodec _repeated_repeatedForeignEnum_codec = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); @@ -664,6 +729,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedForeignEnum_; } } + /// Field number for the "repeated_import_enum" field. public const int RepeatedImportEnumFieldNumber = 53; private static readonly pb::FieldCodec _repeated_repeatedImportEnum_codec = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x); @@ -672,14 +738,19 @@ namespace Google.Protobuf.TestProtos { get { return repeatedImportEnum_; } } + /// Field number for the "repeated_public_import_message" field. public const int RepeatedPublicImportMessageFieldNumber = 54; private static readonly pb::FieldCodec _repeated_repeatedPublicImportMessage_codec = pb::FieldCodec.ForMessage(434, global::Google.Protobuf.TestProtos.PublicImportMessage.Parser); private readonly pbc::RepeatedField repeatedPublicImportMessage_ = new pbc::RepeatedField(); + /// + /// Defined in unittest_import_public.proto + /// public pbc::RepeatedField RepeatedPublicImportMessage { get { return repeatedPublicImportMessage_; } } + /// Field number for the "oneof_uint32" field. public const int OneofUint32FieldNumber = 111; public uint OneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } @@ -689,6 +760,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "oneof_nested_message" field. public const int OneofNestedMessageFieldNumber = 112; public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage) oneofField_ : null; } @@ -698,6 +770,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "oneof_string" field. public const int OneofStringFieldNumber = 113; public string OneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } @@ -707,6 +780,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "oneof_bytes" field. public const int OneofBytesFieldNumber = 114; public pb::ByteString OneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } @@ -1454,6 +1528,9 @@ namespace Google.Protobuf.TestProtos { FOO = 1, BAR = 2, BAZ = 3, + /// + /// Intentionally negative. + /// NEG = -1, } @@ -1484,8 +1561,14 @@ namespace Google.Protobuf.TestProtos { return new NestedMessage(this); } + /// Field number for the "bb" field. public const int BbFieldNumber = 1; private int bb_; + /// + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + /// public int Bb { get { return bb_; } set { @@ -1564,6 +1647,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// This proto includes a recusively nested message. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class NestedTestAllTypes : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes()); @@ -1593,6 +1679,7 @@ namespace Google.Protobuf.TestProtos { return new NestedTestAllTypes(this); } + /// Field number for the "child" field. public const int ChildFieldNumber = 1; private global::Google.Protobuf.TestProtos.NestedTestAllTypes child_; public global::Google.Protobuf.TestProtos.NestedTestAllTypes Child { @@ -1602,6 +1689,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "payload" field. public const int PayloadFieldNumber = 2; private global::Google.Protobuf.TestProtos.TestAllTypes payload_; public global::Google.Protobuf.TestProtos.TestAllTypes Payload { @@ -1611,6 +1699,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "repeated_child" field. public const int RepeatedChildFieldNumber = 3; private static readonly pb::FieldCodec _repeated_repeatedChild_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.NestedTestAllTypes.Parser); @@ -1749,6 +1838,7 @@ namespace Google.Protobuf.TestProtos { return new TestDeprecatedFields(this); } + /// Field number for the "deprecated_int32" field. public const int DeprecatedInt32FieldNumber = 1; private int deprecatedInt32_; [global::System.ObsoleteAttribute()] @@ -1825,6 +1915,10 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Define these after TestAllTypes to make sure the compiler can handle + /// that. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ForeignMessage : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); @@ -1852,6 +1946,7 @@ namespace Google.Protobuf.TestProtos { return new ForeignMessage(this); } + /// Field number for the "c" field. public const int CFieldNumber = 1; private int c_; public int C { @@ -2003,6 +2098,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Test that we can use NestedMessage from outside TestAllTypes. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestForeignNested : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested()); @@ -2030,6 +2128,7 @@ namespace Google.Protobuf.TestProtos { return new TestForeignNested(this); } + /// Field number for the "foreign_nested" field. public const int ForeignNestedFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { @@ -2111,6 +2210,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Test that really large tag numbers don't break anything. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestReallyLargeTagNumber : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReallyLargeTagNumber()); @@ -2139,8 +2241,13 @@ namespace Google.Protobuf.TestProtos { return new TestReallyLargeTagNumber(this); } + /// Field number for the "a" field. public const int AFieldNumber = 1; private int a_; + /// + /// The largest possible tag number is 2^28 - 1, since the wire format uses + /// three bits to communicate wire type. + /// public int A { get { return a_; } set { @@ -2148,6 +2255,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "bb" field. public const int BbFieldNumber = 268435455; private int bb_; public int Bb { @@ -2267,6 +2375,7 @@ namespace Google.Protobuf.TestProtos { return new TestRecursiveMessage(this); } + /// Field number for the "a" field. public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestRecursiveMessage a_; public global::Google.Protobuf.TestProtos.TestRecursiveMessage A { @@ -2276,6 +2385,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "i" field. public const int IFieldNumber = 2; private int i_; public int I { @@ -2373,6 +2483,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Test that mutual recursion works. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestMutualRecursionA : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA()); @@ -2400,6 +2513,7 @@ namespace Google.Protobuf.TestProtos { return new TestMutualRecursionA(this); } + /// Field number for the "bb" field. public const int BbFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionB bb_; public global::Google.Protobuf.TestProtos.TestMutualRecursionB Bb { @@ -2509,6 +2623,7 @@ namespace Google.Protobuf.TestProtos { return new TestMutualRecursionB(this); } + /// Field number for the "a" field. public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionA a_; public global::Google.Protobuf.TestProtos.TestMutualRecursionA A { @@ -2518,6 +2633,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "optional_int32" field. public const int OptionalInt32FieldNumber = 2; private int optionalInt32_; public int OptionalInt32 { @@ -2615,6 +2731,10 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Test message with CamelCase field names. This violates Protocol Buffer + /// standard style. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestCamelCaseFieldNames : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCamelCaseFieldNames()); @@ -2649,6 +2769,7 @@ namespace Google.Protobuf.TestProtos { return new TestCamelCaseFieldNames(this); } + /// Field number for the "PrimitiveField" field. public const int PrimitiveFieldFieldNumber = 1; private int primitiveField_; public int PrimitiveField { @@ -2658,6 +2779,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "StringField" field. public const int StringFieldFieldNumber = 2; private string stringField_ = ""; public string StringField { @@ -2667,6 +2789,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "EnumField" field. public const int EnumFieldFieldNumber = 3; private global::Google.Protobuf.TestProtos.ForeignEnum enumField_ = global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED; public global::Google.Protobuf.TestProtos.ForeignEnum EnumField { @@ -2676,6 +2799,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "MessageField" field. public const int MessageFieldFieldNumber = 4; private global::Google.Protobuf.TestProtos.ForeignMessage messageField_; public global::Google.Protobuf.TestProtos.ForeignMessage MessageField { @@ -2685,6 +2809,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "RepeatedPrimitiveField" field. public const int RepeatedPrimitiveFieldFieldNumber = 7; private static readonly pb::FieldCodec _repeated_repeatedPrimitiveField_codec = pb::FieldCodec.ForInt32(58); @@ -2693,6 +2818,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedPrimitiveField_; } } + /// Field number for the "RepeatedStringField" field. public const int RepeatedStringFieldFieldNumber = 8; private static readonly pb::FieldCodec _repeated_repeatedStringField_codec = pb::FieldCodec.ForString(66); @@ -2701,6 +2827,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedStringField_; } } + /// Field number for the "RepeatedEnumField" field. public const int RepeatedEnumFieldFieldNumber = 9; private static readonly pb::FieldCodec _repeated_repeatedEnumField_codec = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); @@ -2709,6 +2836,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedEnumField_; } } + /// Field number for the "RepeatedMessageField" field. public const int RepeatedMessageFieldFieldNumber = 10; private static readonly pb::FieldCodec _repeated_repeatedMessageField_codec = pb::FieldCodec.ForMessage(82, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); @@ -2875,6 +3003,10 @@ namespace Google.Protobuf.TestProtos { } + /// + /// We list fields out of order, to ensure that we're using field number and not + /// field index to determine serialization order. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestFieldOrderings : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestFieldOrderings()); @@ -2905,6 +3037,7 @@ namespace Google.Protobuf.TestProtos { return new TestFieldOrderings(this); } + /// Field number for the "my_string" field. public const int MyStringFieldNumber = 11; private string myString_ = ""; public string MyString { @@ -2914,6 +3047,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "my_int" field. public const int MyIntFieldNumber = 1; private long myInt_; public long MyInt { @@ -2923,6 +3057,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "my_float" field. public const int MyFloatFieldNumber = 101; private float myFloat_; public float MyFloat { @@ -2932,6 +3067,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "single_nested_message" field. public const int SingleNestedMessageFieldNumber = 200; private global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage singleNestedMessage_; public global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage SingleNestedMessage { @@ -3091,6 +3227,7 @@ namespace Google.Protobuf.TestProtos { return new NestedMessage(this); } + /// Field number for the "oo" field. public const int OoFieldNumber = 2; private long oo_; public long Oo { @@ -3100,8 +3237,14 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "bb" field. public const int BbFieldNumber = 1; private int bb_; + /// + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + /// public int Bb { get { return bb_; } set { @@ -3223,6 +3366,7 @@ namespace Google.Protobuf.TestProtos { return new SparseEnumMessage(this); } + /// Field number for the "sparse_enum" field. public const int SparseEnumFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestSparseEnum sparseEnum_ = global::Google.Protobuf.TestProtos.TestSparseEnum.TEST_SPARSE_ENUM_UNSPECIFIED; public global::Google.Protobuf.TestProtos.TestSparseEnum SparseEnum { @@ -3298,6 +3442,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Test String and Bytes: string is for valid UTF-8 strings + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class OneString : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneString()); @@ -3325,6 +3472,7 @@ namespace Google.Protobuf.TestProtos { return new OneString(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private string data_ = ""; public string Data { @@ -3427,6 +3575,7 @@ namespace Google.Protobuf.TestProtos { return new MoreString(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private static readonly pb::FieldCodec _repeated_data_codec = pb::FieldCodec.ForString(10); @@ -3521,6 +3670,7 @@ namespace Google.Protobuf.TestProtos { return new OneBytes(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; public pb::ByteString Data { @@ -3623,6 +3773,7 @@ namespace Google.Protobuf.TestProtos { return new MoreBytes(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; public pb::ByteString Data { @@ -3698,6 +3849,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Test int32, uint32, int64, uint64, and bool are all compatible + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Int32Message : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int32Message()); @@ -3725,6 +3879,7 @@ namespace Google.Protobuf.TestProtos { return new Int32Message(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private int data_; public int Data { @@ -3827,6 +3982,7 @@ namespace Google.Protobuf.TestProtos { return new Uint32Message(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private uint data_; public uint Data { @@ -3929,6 +4085,7 @@ namespace Google.Protobuf.TestProtos { return new Int64Message(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private long data_; public long Data { @@ -4031,6 +4188,7 @@ namespace Google.Protobuf.TestProtos { return new Uint64Message(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private ulong data_; public ulong Data { @@ -4133,6 +4291,7 @@ namespace Google.Protobuf.TestProtos { return new BoolMessage(this); } + /// Field number for the "data" field. public const int DataFieldNumber = 1; private bool data_; public bool Data { @@ -4208,6 +4367,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Test oneofs. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestOneof : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof()); @@ -4246,6 +4408,7 @@ namespace Google.Protobuf.TestProtos { return new TestOneof(this); } + /// Field number for the "foo_int" field. public const int FooIntFieldNumber = 1; public int FooInt { get { return fooCase_ == FooOneofCase.FooInt ? (int) foo_ : 0; } @@ -4255,6 +4418,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "foo_string" field. public const int FooStringFieldNumber = 2; public string FooString { get { return fooCase_ == FooOneofCase.FooString ? (string) foo_ : ""; } @@ -4264,6 +4428,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "foo_message" field. public const int FooMessageFieldNumber = 3; public global::Google.Protobuf.TestProtos.TestAllTypes FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes) foo_ : null; } @@ -4437,6 +4602,7 @@ namespace Google.Protobuf.TestProtos { return new TestPackedTypes(this); } + /// Field number for the "packed_int32" field. public const int PackedInt32FieldNumber = 90; private static readonly pb::FieldCodec _repeated_packedInt32_codec = pb::FieldCodec.ForInt32(722); @@ -4445,6 +4611,7 @@ namespace Google.Protobuf.TestProtos { get { return packedInt32_; } } + /// Field number for the "packed_int64" field. public const int PackedInt64FieldNumber = 91; private static readonly pb::FieldCodec _repeated_packedInt64_codec = pb::FieldCodec.ForInt64(730); @@ -4453,6 +4620,7 @@ namespace Google.Protobuf.TestProtos { get { return packedInt64_; } } + /// Field number for the "packed_uint32" field. public const int PackedUint32FieldNumber = 92; private static readonly pb::FieldCodec _repeated_packedUint32_codec = pb::FieldCodec.ForUInt32(738); @@ -4461,6 +4629,7 @@ namespace Google.Protobuf.TestProtos { get { return packedUint32_; } } + /// Field number for the "packed_uint64" field. public const int PackedUint64FieldNumber = 93; private static readonly pb::FieldCodec _repeated_packedUint64_codec = pb::FieldCodec.ForUInt64(746); @@ -4469,6 +4638,7 @@ namespace Google.Protobuf.TestProtos { get { return packedUint64_; } } + /// Field number for the "packed_sint32" field. public const int PackedSint32FieldNumber = 94; private static readonly pb::FieldCodec _repeated_packedSint32_codec = pb::FieldCodec.ForSInt32(754); @@ -4477,6 +4647,7 @@ namespace Google.Protobuf.TestProtos { get { return packedSint32_; } } + /// Field number for the "packed_sint64" field. public const int PackedSint64FieldNumber = 95; private static readonly pb::FieldCodec _repeated_packedSint64_codec = pb::FieldCodec.ForSInt64(762); @@ -4485,6 +4656,7 @@ namespace Google.Protobuf.TestProtos { get { return packedSint64_; } } + /// Field number for the "packed_fixed32" field. public const int PackedFixed32FieldNumber = 96; private static readonly pb::FieldCodec _repeated_packedFixed32_codec = pb::FieldCodec.ForFixed32(770); @@ -4493,6 +4665,7 @@ namespace Google.Protobuf.TestProtos { get { return packedFixed32_; } } + /// Field number for the "packed_fixed64" field. public const int PackedFixed64FieldNumber = 97; private static readonly pb::FieldCodec _repeated_packedFixed64_codec = pb::FieldCodec.ForFixed64(778); @@ -4501,6 +4674,7 @@ namespace Google.Protobuf.TestProtos { get { return packedFixed64_; } } + /// Field number for the "packed_sfixed32" field. public const int PackedSfixed32FieldNumber = 98; private static readonly pb::FieldCodec _repeated_packedSfixed32_codec = pb::FieldCodec.ForSFixed32(786); @@ -4509,6 +4683,7 @@ namespace Google.Protobuf.TestProtos { get { return packedSfixed32_; } } + /// Field number for the "packed_sfixed64" field. public const int PackedSfixed64FieldNumber = 99; private static readonly pb::FieldCodec _repeated_packedSfixed64_codec = pb::FieldCodec.ForSFixed64(794); @@ -4517,6 +4692,7 @@ namespace Google.Protobuf.TestProtos { get { return packedSfixed64_; } } + /// Field number for the "packed_float" field. public const int PackedFloatFieldNumber = 100; private static readonly pb::FieldCodec _repeated_packedFloat_codec = pb::FieldCodec.ForFloat(802); @@ -4525,6 +4701,7 @@ namespace Google.Protobuf.TestProtos { get { return packedFloat_; } } + /// Field number for the "packed_double" field. public const int PackedDoubleFieldNumber = 101; private static readonly pb::FieldCodec _repeated_packedDouble_codec = pb::FieldCodec.ForDouble(810); @@ -4533,6 +4710,7 @@ namespace Google.Protobuf.TestProtos { get { return packedDouble_; } } + /// Field number for the "packed_bool" field. public const int PackedBoolFieldNumber = 102; private static readonly pb::FieldCodec _repeated_packedBool_codec = pb::FieldCodec.ForBool(818); @@ -4541,6 +4719,7 @@ namespace Google.Protobuf.TestProtos { get { return packedBool_; } } + /// Field number for the "packed_enum" field. public const int PackedEnumFieldNumber = 103; private static readonly pb::FieldCodec _repeated_packedEnum_codec = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); @@ -4739,6 +4918,10 @@ namespace Google.Protobuf.TestProtos { } + /// + /// A message with the same fields as TestPackedTypes, but without packing. Used + /// to test packed <-> unpacked wire compatibility. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestUnpackedTypes : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedTypes()); @@ -4779,6 +4962,7 @@ namespace Google.Protobuf.TestProtos { return new TestUnpackedTypes(this); } + /// Field number for the "unpacked_int32" field. public const int UnpackedInt32FieldNumber = 90; private static readonly pb::FieldCodec _repeated_unpackedInt32_codec = pb::FieldCodec.ForInt32(720); @@ -4787,6 +4971,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedInt32_; } } + /// Field number for the "unpacked_int64" field. public const int UnpackedInt64FieldNumber = 91; private static readonly pb::FieldCodec _repeated_unpackedInt64_codec = pb::FieldCodec.ForInt64(728); @@ -4795,6 +4980,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedInt64_; } } + /// Field number for the "unpacked_uint32" field. public const int UnpackedUint32FieldNumber = 92; private static readonly pb::FieldCodec _repeated_unpackedUint32_codec = pb::FieldCodec.ForUInt32(736); @@ -4803,6 +4989,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedUint32_; } } + /// Field number for the "unpacked_uint64" field. public const int UnpackedUint64FieldNumber = 93; private static readonly pb::FieldCodec _repeated_unpackedUint64_codec = pb::FieldCodec.ForUInt64(744); @@ -4811,6 +4998,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedUint64_; } } + /// Field number for the "unpacked_sint32" field. public const int UnpackedSint32FieldNumber = 94; private static readonly pb::FieldCodec _repeated_unpackedSint32_codec = pb::FieldCodec.ForSInt32(752); @@ -4819,6 +5007,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedSint32_; } } + /// Field number for the "unpacked_sint64" field. public const int UnpackedSint64FieldNumber = 95; private static readonly pb::FieldCodec _repeated_unpackedSint64_codec = pb::FieldCodec.ForSInt64(760); @@ -4827,6 +5016,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedSint64_; } } + /// Field number for the "unpacked_fixed32" field. public const int UnpackedFixed32FieldNumber = 96; private static readonly pb::FieldCodec _repeated_unpackedFixed32_codec = pb::FieldCodec.ForFixed32(773); @@ -4835,6 +5025,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedFixed32_; } } + /// Field number for the "unpacked_fixed64" field. public const int UnpackedFixed64FieldNumber = 97; private static readonly pb::FieldCodec _repeated_unpackedFixed64_codec = pb::FieldCodec.ForFixed64(777); @@ -4843,6 +5034,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedFixed64_; } } + /// Field number for the "unpacked_sfixed32" field. public const int UnpackedSfixed32FieldNumber = 98; private static readonly pb::FieldCodec _repeated_unpackedSfixed32_codec = pb::FieldCodec.ForSFixed32(789); @@ -4851,6 +5043,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedSfixed32_; } } + /// Field number for the "unpacked_sfixed64" field. public const int UnpackedSfixed64FieldNumber = 99; private static readonly pb::FieldCodec _repeated_unpackedSfixed64_codec = pb::FieldCodec.ForSFixed64(793); @@ -4859,6 +5052,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedSfixed64_; } } + /// Field number for the "unpacked_float" field. public const int UnpackedFloatFieldNumber = 100; private static readonly pb::FieldCodec _repeated_unpackedFloat_codec = pb::FieldCodec.ForFloat(805); @@ -4867,6 +5061,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedFloat_; } } + /// Field number for the "unpacked_double" field. public const int UnpackedDoubleFieldNumber = 101; private static readonly pb::FieldCodec _repeated_unpackedDouble_codec = pb::FieldCodec.ForDouble(809); @@ -4875,6 +5070,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedDouble_; } } + /// Field number for the "unpacked_bool" field. public const int UnpackedBoolFieldNumber = 102; private static readonly pb::FieldCodec _repeated_unpackedBool_codec = pb::FieldCodec.ForBool(816); @@ -4883,6 +5079,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedBool_; } } + /// Field number for the "unpacked_enum" field. public const int UnpackedEnumFieldNumber = 103; private static readonly pb::FieldCodec _repeated_unpackedEnum_codec = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); @@ -5113,30 +5310,45 @@ namespace Google.Protobuf.TestProtos { return new TestRepeatedScalarDifferentTagSizes(this); } + /// Field number for the "repeated_fixed32" field. public const int RepeatedFixed32FieldNumber = 12; private static readonly pb::FieldCodec _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(98); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); + /// + /// Parsing repeated fixed size values used to fail. This message needs to be + /// used in order to get a tag of the right size; all of the repeated fields + /// in TestAllTypes didn't trigger the check. + /// public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } + /// Field number for the "repeated_int32" field. public const int RepeatedInt32FieldNumber = 13; private static readonly pb::FieldCodec _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(106); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); + /// + /// Check for a varint type, just for good measure. + /// public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } + /// Field number for the "repeated_fixed64" field. public const int RepeatedFixed64FieldNumber = 2046; private static readonly pb::FieldCodec _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(16370); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); + /// + /// These have two-byte tags. + /// public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } + /// Field number for the "repeated_int64" field. public const int RepeatedInt64FieldNumber = 2047; private static readonly pb::FieldCodec _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(16378); @@ -5145,14 +5357,19 @@ namespace Google.Protobuf.TestProtos { get { return repeatedInt64_; } } + /// Field number for the "repeated_float" field. public const int RepeatedFloatFieldNumber = 262142; private static readonly pb::FieldCodec _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(2097138); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); + /// + /// Three byte tags. + /// public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } + /// Field number for the "repeated_uint64" field. public const int RepeatedUint64FieldNumber = 262143; private static readonly pb::FieldCodec _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(2097146); @@ -5298,8 +5515,12 @@ namespace Google.Protobuf.TestProtos { return new TestCommentInjectionMessage(this); } + /// Field number for the "a" field. public const int AFieldNumber = 1; private string a_ = ""; + /// + /// */ <- This should not close the generated doc comment + /// public string A { get { return a_; } set { @@ -5373,6 +5594,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// Test that RPC services work. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class FooRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooRequest()); diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs index 126bc265..bd90ddd8 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs @@ -172,6 +172,11 @@ namespace Google.Protobuf.TestProtos { } #region Messages + /// + /// Test that we can include all well-known types. + /// Each wrapper type is included separately, as languages + /// map handle different wrappers in different ways. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestWellKnownTypes : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestWellKnownTypes()); @@ -216,6 +221,7 @@ namespace Google.Protobuf.TestProtos { return new TestWellKnownTypes(this); } + /// Field number for the "any_field" field. public const int AnyFieldFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Any anyField_; public global::Google.Protobuf.WellKnownTypes.Any AnyField { @@ -225,6 +231,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "api_field" field. public const int ApiFieldFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Api apiField_; public global::Google.Protobuf.WellKnownTypes.Api ApiField { @@ -234,6 +241,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "duration_field" field. public const int DurationFieldFieldNumber = 3; private global::Google.Protobuf.WellKnownTypes.Duration durationField_; public global::Google.Protobuf.WellKnownTypes.Duration DurationField { @@ -243,6 +251,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "empty_field" field. public const int EmptyFieldFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.Empty emptyField_; public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { @@ -252,6 +261,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "field_mask_field" field. public const int FieldMaskFieldFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.FieldMask fieldMaskField_; public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { @@ -261,6 +271,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "source_context_field" field. public const int SourceContextFieldFieldNumber = 6; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContextField_; public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { @@ -270,6 +281,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "struct_field" field. public const int StructFieldFieldNumber = 7; private global::Google.Protobuf.WellKnownTypes.Struct structField_; public global::Google.Protobuf.WellKnownTypes.Struct StructField { @@ -279,6 +291,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "timestamp_field" field. public const int TimestampFieldFieldNumber = 8; private global::Google.Protobuf.WellKnownTypes.Timestamp timestampField_; public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { @@ -288,6 +301,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "type_field" field. public const int TypeFieldFieldNumber = 9; private global::Google.Protobuf.WellKnownTypes.Type typeField_; public global::Google.Protobuf.WellKnownTypes.Type TypeField { @@ -297,6 +311,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "double_field" field. public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _single_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); private double? doubleField_; @@ -307,6 +322,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "float_field" field. public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _single_floatField_codec = pb::FieldCodec.ForStructWrapper(90); private float? floatField_; @@ -317,6 +333,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "int64_field" field. public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _single_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); private long? int64Field_; @@ -327,6 +344,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "uint64_field" field. public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _single_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); private ulong? uint64Field_; @@ -337,6 +355,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "int32_field" field. public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _single_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); private int? int32Field_; @@ -347,6 +366,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "uint32_field" field. public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _single_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); private uint? uint32Field_; @@ -357,6 +377,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "bool_field" field. public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _single_boolField_codec = pb::FieldCodec.ForStructWrapper(130); private bool? boolField_; @@ -367,6 +388,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "string_field" field. public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _single_stringField_codec = pb::FieldCodec.ForClassWrapper(138); private string stringField_; @@ -377,6 +399,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "bytes_field" field. public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _single_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); private pb::ByteString bytesField_; @@ -815,6 +838,9 @@ namespace Google.Protobuf.TestProtos { } + /// + /// A repeated field for each well-known type. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class RepeatedWellKnownTypes : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedWellKnownTypes()); @@ -859,6 +885,7 @@ namespace Google.Protobuf.TestProtos { return new RepeatedWellKnownTypes(this); } + /// Field number for the "any_field" field. public const int AnyFieldFieldNumber = 1; private static readonly pb::FieldCodec _repeated_anyField_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Any.Parser); @@ -867,6 +894,7 @@ namespace Google.Protobuf.TestProtos { get { return anyField_; } } + /// Field number for the "api_field" field. public const int ApiFieldFieldNumber = 2; private static readonly pb::FieldCodec _repeated_apiField_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser); @@ -875,6 +903,7 @@ namespace Google.Protobuf.TestProtos { get { return apiField_; } } + /// Field number for the "duration_field" field. public const int DurationFieldFieldNumber = 3; private static readonly pb::FieldCodec _repeated_durationField_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Duration.Parser); @@ -883,6 +912,7 @@ namespace Google.Protobuf.TestProtos { get { return durationField_; } } + /// Field number for the "empty_field" field. public const int EmptyFieldFieldNumber = 4; private static readonly pb::FieldCodec _repeated_emptyField_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Empty.Parser); @@ -891,6 +921,7 @@ namespace Google.Protobuf.TestProtos { get { return emptyField_; } } + /// Field number for the "field_mask_field" field. public const int FieldMaskFieldFieldNumber = 5; private static readonly pb::FieldCodec _repeated_fieldMaskField_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser); @@ -899,6 +930,7 @@ namespace Google.Protobuf.TestProtos { get { return fieldMaskField_; } } + /// Field number for the "source_context_field" field. public const int SourceContextFieldFieldNumber = 6; private static readonly pb::FieldCodec _repeated_sourceContextField_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser); @@ -907,6 +939,7 @@ namespace Google.Protobuf.TestProtos { get { return sourceContextField_; } } + /// Field number for the "struct_field" field. public const int StructFieldFieldNumber = 7; private static readonly pb::FieldCodec _repeated_structField_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.WellKnownTypes.Struct.Parser); @@ -915,6 +948,7 @@ namespace Google.Protobuf.TestProtos { get { return structField_; } } + /// Field number for the "timestamp_field" field. public const int TimestampFieldFieldNumber = 8; private static readonly pb::FieldCodec _repeated_timestampField_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser); @@ -923,6 +957,7 @@ namespace Google.Protobuf.TestProtos { get { return timestampField_; } } + /// Field number for the "type_field" field. public const int TypeFieldFieldNumber = 9; private static readonly pb::FieldCodec _repeated_typeField_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Type.Parser); @@ -931,14 +966,19 @@ namespace Google.Protobuf.TestProtos { get { return typeField_; } } + /// Field number for the "double_field" field. public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _repeated_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); private readonly pbc::RepeatedField doubleField_ = new pbc::RepeatedField(); + /// + /// These don't actually make a lot of sense, but they're not prohibited... + /// public pbc::RepeatedField DoubleField { get { return doubleField_; } } + /// Field number for the "float_field" field. public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _repeated_floatField_codec = pb::FieldCodec.ForStructWrapper(90); @@ -947,6 +987,7 @@ namespace Google.Protobuf.TestProtos { get { return floatField_; } } + /// Field number for the "int64_field" field. public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _repeated_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); @@ -955,6 +996,7 @@ namespace Google.Protobuf.TestProtos { get { return int64Field_; } } + /// Field number for the "uint64_field" field. public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _repeated_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); @@ -963,6 +1005,7 @@ namespace Google.Protobuf.TestProtos { get { return uint64Field_; } } + /// Field number for the "int32_field" field. public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _repeated_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); @@ -971,6 +1014,7 @@ namespace Google.Protobuf.TestProtos { get { return int32Field_; } } + /// Field number for the "uint32_field" field. public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _repeated_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); @@ -979,6 +1023,7 @@ namespace Google.Protobuf.TestProtos { get { return uint32Field_; } } + /// Field number for the "bool_field" field. public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _repeated_boolField_codec = pb::FieldCodec.ForStructWrapper(130); @@ -987,6 +1032,7 @@ namespace Google.Protobuf.TestProtos { get { return boolField_; } } + /// Field number for the "string_field" field. public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _repeated_stringField_codec = pb::FieldCodec.ForClassWrapper(138); @@ -995,6 +1041,7 @@ namespace Google.Protobuf.TestProtos { get { return stringField_; } } + /// Field number for the "bytes_field" field. public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _repeated_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); @@ -1298,6 +1345,7 @@ namespace Google.Protobuf.TestProtos { return new OneofWellKnownTypes(this); } + /// Field number for the "any_field" field. public const int AnyFieldFieldNumber = 1; public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return oneofFieldCase_ == OneofFieldOneofCase.AnyField ? (global::Google.Protobuf.WellKnownTypes.Any) oneofField_ : null; } @@ -1307,6 +1355,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "api_field" field. public const int ApiFieldFieldNumber = 2; public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return oneofFieldCase_ == OneofFieldOneofCase.ApiField ? (global::Google.Protobuf.WellKnownTypes.Api) oneofField_ : null; } @@ -1316,6 +1365,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "duration_field" field. public const int DurationFieldFieldNumber = 3; public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return oneofFieldCase_ == OneofFieldOneofCase.DurationField ? (global::Google.Protobuf.WellKnownTypes.Duration) oneofField_ : null; } @@ -1325,6 +1375,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "empty_field" field. public const int EmptyFieldFieldNumber = 4; public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return oneofFieldCase_ == OneofFieldOneofCase.EmptyField ? (global::Google.Protobuf.WellKnownTypes.Empty) oneofField_ : null; } @@ -1334,6 +1385,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "field_mask_field" field. public const int FieldMaskFieldFieldNumber = 5; public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField ? (global::Google.Protobuf.WellKnownTypes.FieldMask) oneofField_ : null; } @@ -1343,6 +1395,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "source_context_field" field. public const int SourceContextFieldFieldNumber = 6; public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return oneofFieldCase_ == OneofFieldOneofCase.SourceContextField ? (global::Google.Protobuf.WellKnownTypes.SourceContext) oneofField_ : null; } @@ -1352,6 +1405,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "struct_field" field. public const int StructFieldFieldNumber = 7; public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return oneofFieldCase_ == OneofFieldOneofCase.StructField ? (global::Google.Protobuf.WellKnownTypes.Struct) oneofField_ : null; } @@ -1361,6 +1415,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "timestamp_field" field. public const int TimestampFieldFieldNumber = 8; public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return oneofFieldCase_ == OneofFieldOneofCase.TimestampField ? (global::Google.Protobuf.WellKnownTypes.Timestamp) oneofField_ : null; } @@ -1370,6 +1425,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "type_field" field. public const int TypeFieldFieldNumber = 9; public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return oneofFieldCase_ == OneofFieldOneofCase.TypeField ? (global::Google.Protobuf.WellKnownTypes.Type) oneofField_ : null; } @@ -1379,6 +1435,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "double_field" field. public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _oneof_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); public double? DoubleField { @@ -1389,6 +1446,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "float_field" field. public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _oneof_floatField_codec = pb::FieldCodec.ForStructWrapper(90); public float? FloatField { @@ -1399,6 +1457,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "int64_field" field. public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _oneof_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); public long? Int64Field { @@ -1409,6 +1468,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "uint64_field" field. public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _oneof_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); public ulong? Uint64Field { @@ -1419,6 +1479,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "int32_field" field. public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _oneof_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); public int? Int32Field { @@ -1429,6 +1490,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "uint32_field" field. public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _oneof_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); public uint? Uint32Field { @@ -1439,6 +1501,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "bool_field" field. public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _oneof_boolField_codec = pb::FieldCodec.ForStructWrapper(130); public bool? BoolField { @@ -1449,6 +1512,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "string_field" field. public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _oneof_stringField_codec = pb::FieldCodec.ForClassWrapper(138); public string StringField { @@ -1459,6 +1523,7 @@ namespace Google.Protobuf.TestProtos { } } + /// Field number for the "bytes_field" field. public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _oneof_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); public pb::ByteString BytesField { @@ -1879,6 +1944,11 @@ namespace Google.Protobuf.TestProtos { } + /// + /// A map field for each well-known type. We only + /// need to worry about the value part of the map being the + /// well-known types, as messages can't be map keys. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class MapWellKnownTypes : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapWellKnownTypes()); @@ -1923,6 +1993,7 @@ namespace Google.Protobuf.TestProtos { return new MapWellKnownTypes(this); } + /// Field number for the "any_field" field. public const int AnyFieldFieldNumber = 1; private static readonly pbc::MapField.Codec _map_anyField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Any.Parser), 10); @@ -1931,6 +2002,7 @@ namespace Google.Protobuf.TestProtos { get { return anyField_; } } + /// Field number for the "api_field" field. public const int ApiFieldFieldNumber = 2; private static readonly pbc::MapField.Codec _map_apiField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser), 18); @@ -1939,6 +2011,7 @@ namespace Google.Protobuf.TestProtos { get { return apiField_; } } + /// Field number for the "duration_field" field. public const int DurationFieldFieldNumber = 3; private static readonly pbc::MapField.Codec _map_durationField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Duration.Parser), 26); @@ -1947,6 +2020,7 @@ namespace Google.Protobuf.TestProtos { get { return durationField_; } } + /// Field number for the "empty_field" field. public const int EmptyFieldFieldNumber = 4; private static readonly pbc::MapField.Codec _map_emptyField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Empty.Parser), 34); @@ -1955,6 +2029,7 @@ namespace Google.Protobuf.TestProtos { get { return emptyField_; } } + /// Field number for the "field_mask_field" field. public const int FieldMaskFieldFieldNumber = 5; private static readonly pbc::MapField.Codec _map_fieldMaskField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser), 42); @@ -1963,6 +2038,7 @@ namespace Google.Protobuf.TestProtos { get { return fieldMaskField_; } } + /// Field number for the "source_context_field" field. public const int SourceContextFieldFieldNumber = 6; private static readonly pbc::MapField.Codec _map_sourceContextField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser), 50); @@ -1971,6 +2047,7 @@ namespace Google.Protobuf.TestProtos { get { return sourceContextField_; } } + /// Field number for the "struct_field" field. public const int StructFieldFieldNumber = 7; private static readonly pbc::MapField.Codec _map_structField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Struct.Parser), 58); @@ -1979,6 +2056,7 @@ namespace Google.Protobuf.TestProtos { get { return structField_; } } + /// Field number for the "timestamp_field" field. public const int TimestampFieldFieldNumber = 8; private static readonly pbc::MapField.Codec _map_timestampField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser), 66); @@ -1987,6 +2065,7 @@ namespace Google.Protobuf.TestProtos { get { return timestampField_; } } + /// Field number for the "type_field" field. public const int TypeFieldFieldNumber = 9; private static readonly pbc::MapField.Codec _map_typeField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Type.Parser), 74); @@ -1995,6 +2074,7 @@ namespace Google.Protobuf.TestProtos { get { return typeField_; } } + /// Field number for the "double_field" field. public const int DoubleFieldFieldNumber = 10; private static readonly pbc::MapField.Codec _map_doubleField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 82); @@ -2003,6 +2083,7 @@ namespace Google.Protobuf.TestProtos { get { return doubleField_; } } + /// Field number for the "float_field" field. public const int FloatFieldFieldNumber = 11; private static readonly pbc::MapField.Codec _map_floatField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 90); @@ -2011,6 +2092,7 @@ namespace Google.Protobuf.TestProtos { get { return floatField_; } } + /// Field number for the "int64_field" field. public const int Int64FieldFieldNumber = 12; private static readonly pbc::MapField.Codec _map_int64Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 98); @@ -2019,6 +2101,7 @@ namespace Google.Protobuf.TestProtos { get { return int64Field_; } } + /// Field number for the "uint64_field" field. public const int Uint64FieldFieldNumber = 13; private static readonly pbc::MapField.Codec _map_uint64Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 106); @@ -2027,6 +2110,7 @@ namespace Google.Protobuf.TestProtos { get { return uint64Field_; } } + /// Field number for the "int32_field" field. public const int Int32FieldFieldNumber = 14; private static readonly pbc::MapField.Codec _map_int32Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 114); @@ -2035,6 +2119,7 @@ namespace Google.Protobuf.TestProtos { get { return int32Field_; } } + /// Field number for the "uint32_field" field. public const int Uint32FieldFieldNumber = 15; private static readonly pbc::MapField.Codec _map_uint32Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 122); @@ -2043,6 +2128,7 @@ namespace Google.Protobuf.TestProtos { get { return uint32Field_; } } + /// Field number for the "bool_field" field. public const int BoolFieldFieldNumber = 16; private static readonly pbc::MapField.Codec _map_boolField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 130); @@ -2051,6 +2137,7 @@ namespace Google.Protobuf.TestProtos { get { return boolField_; } } + /// Field number for the "string_field" field. public const int StringFieldFieldNumber = 17; private static readonly pbc::MapField.Codec _map_stringField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper(18), 138); @@ -2059,6 +2146,7 @@ namespace Google.Protobuf.TestProtos { get { return stringField_; } } + /// Field number for the "bytes_field" field. public const int BytesFieldFieldNumber = 18; private static readonly pbc::MapField.Codec _map_bytesField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper(18), 146); diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs index 410df3c5..1e6a77ab 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs @@ -162,6 +162,10 @@ namespace Google.Protobuf.Reflection { } #region Messages + /// + /// The protocol compiler can output a FileDescriptorSet containing the .proto + /// files it parses. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class FileDescriptorSet : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorSet()); @@ -189,6 +193,7 @@ namespace Google.Protobuf.Reflection { return new FileDescriptorSet(this); } + /// Field number for the "file" field. public const int FileFieldNumber = 1; private static readonly pb::FieldCodec _repeated_file_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser); @@ -256,6 +261,9 @@ namespace Google.Protobuf.Reflection { } + /// + /// Describes a complete .proto file. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class FileDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorProto()); @@ -294,8 +302,12 @@ namespace Google.Protobuf.Reflection { return new FileDescriptorProto(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + /// + /// file name, relative to root of source tree + /// public string Name { get { return name_; } set { @@ -303,8 +315,12 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "package" field. public const int PackageFieldNumber = 2; private string package_ = ""; + /// + /// e.g. "foo", "foo.bar", etc. + /// public string Package { get { return package_; } set { @@ -312,38 +328,56 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "dependency" field. public const int DependencyFieldNumber = 3; private static readonly pb::FieldCodec _repeated_dependency_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField dependency_ = new pbc::RepeatedField(); + /// + /// Names of files imported by this file. + /// public pbc::RepeatedField Dependency { get { return dependency_; } } + /// Field number for the "public_dependency" field. public const int PublicDependencyFieldNumber = 10; private static readonly pb::FieldCodec _repeated_publicDependency_codec = pb::FieldCodec.ForInt32(80); private readonly pbc::RepeatedField publicDependency_ = new pbc::RepeatedField(); + /// + /// Indexes of the public imported files in the dependency list above. + /// public pbc::RepeatedField PublicDependency { get { return publicDependency_; } } + /// Field number for the "weak_dependency" field. public const int WeakDependencyFieldNumber = 11; private static readonly pb::FieldCodec _repeated_weakDependency_codec = pb::FieldCodec.ForInt32(88); private readonly pbc::RepeatedField weakDependency_ = new pbc::RepeatedField(); + /// + /// Indexes of the weak imported files in the dependency list. + /// For Google-internal migration only. Do not use. + /// public pbc::RepeatedField WeakDependency { get { return weakDependency_; } } + /// Field number for the "message_type" field. public const int MessageTypeFieldNumber = 4; private static readonly pb::FieldCodec _repeated_messageType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.DescriptorProto.Parser); private readonly pbc::RepeatedField messageType_ = new pbc::RepeatedField(); + /// + /// All top-level definitions in this file. + /// public pbc::RepeatedField MessageType { get { return messageType_; } } + /// Field number for the "enum_type" field. public const int EnumTypeFieldNumber = 5; private static readonly pb::FieldCodec _repeated_enumType_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); @@ -352,6 +386,7 @@ namespace Google.Protobuf.Reflection { get { return enumType_; } } + /// Field number for the "service" field. public const int ServiceFieldNumber = 6; private static readonly pb::FieldCodec _repeated_service_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser); @@ -360,6 +395,7 @@ namespace Google.Protobuf.Reflection { get { return service_; } } + /// Field number for the "extension" field. public const int ExtensionFieldNumber = 7; private static readonly pb::FieldCodec _repeated_extension_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); @@ -368,6 +404,7 @@ namespace Google.Protobuf.Reflection { get { return extension_; } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FileOptions options_; public global::Google.Protobuf.Reflection.FileOptions Options { @@ -377,8 +414,15 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "source_code_info" field. public const int SourceCodeInfoFieldNumber = 9; private global::Google.Protobuf.Reflection.SourceCodeInfo sourceCodeInfo_; + /// + /// This field contains optional information about the original source code. + /// You may safely remove this entire field without harming runtime + /// functionality of the descriptors -- the information is needed only by + /// development tools. + /// public global::Google.Protobuf.Reflection.SourceCodeInfo SourceCodeInfo { get { return sourceCodeInfo_; } set { @@ -386,8 +430,13 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "syntax" field. public const int SyntaxFieldNumber = 12; private string syntax_ = ""; + /// + /// The syntax of the proto file. + /// The supported values are "proto2" and "proto3". + /// public string Syntax { get { return syntax_; } set { @@ -602,6 +651,9 @@ namespace Google.Protobuf.Reflection { } + /// + /// Describes a message type. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class DescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DescriptorProto()); @@ -638,6 +690,7 @@ namespace Google.Protobuf.Reflection { return new DescriptorProto(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -647,6 +700,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "field" field. public const int FieldFieldNumber = 2; private static readonly pb::FieldCodec _repeated_field_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); @@ -655,6 +709,7 @@ namespace Google.Protobuf.Reflection { get { return field_; } } + /// Field number for the "extension" field. public const int ExtensionFieldNumber = 6; private static readonly pb::FieldCodec _repeated_extension_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); @@ -663,6 +718,7 @@ namespace Google.Protobuf.Reflection { get { return extension_; } } + /// Field number for the "nested_type" field. public const int NestedTypeFieldNumber = 3; private static readonly pb::FieldCodec _repeated_nestedType_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.Reflection.DescriptorProto.Parser); @@ -671,6 +727,7 @@ namespace Google.Protobuf.Reflection { get { return nestedType_; } } + /// Field number for the "enum_type" field. public const int EnumTypeFieldNumber = 4; private static readonly pb::FieldCodec _repeated_enumType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); @@ -679,6 +736,7 @@ namespace Google.Protobuf.Reflection { get { return enumType_; } } + /// Field number for the "extension_range" field. public const int ExtensionRangeFieldNumber = 5; private static readonly pb::FieldCodec _repeated_extensionRange_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange.Parser); @@ -687,6 +745,7 @@ namespace Google.Protobuf.Reflection { get { return extensionRange_; } } + /// Field number for the "oneof_decl" field. public const int OneofDeclFieldNumber = 8; private static readonly pb::FieldCodec _repeated_oneofDecl_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser); @@ -695,6 +754,7 @@ namespace Google.Protobuf.Reflection { get { return oneofDecl_; } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 7; private global::Google.Protobuf.Reflection.MessageOptions options_; public global::Google.Protobuf.Reflection.MessageOptions Options { @@ -704,6 +764,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "reserved_range" field. public const int ReservedRangeFieldNumber = 9; private static readonly pb::FieldCodec _repeated_reservedRange_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange.Parser); @@ -712,10 +773,15 @@ namespace Google.Protobuf.Reflection { get { return reservedRange_; } } + /// Field number for the "reserved_name" field. public const int ReservedNameFieldNumber = 10; private static readonly pb::FieldCodec _repeated_reservedName_codec = pb::FieldCodec.ForString(82); private readonly pbc::RepeatedField reservedName_ = new pbc::RepeatedField(); + /// + /// Reserved field names, which may not be used by fields in the same message. + /// A given name may only be reserved once. + /// public pbc::RepeatedField ReservedName { get { return reservedName_; } } @@ -910,6 +976,7 @@ namespace Google.Protobuf.Reflection { return new ExtensionRange(this); } + /// Field number for the "start" field. public const int StartFieldNumber = 1; private int start_; public int Start { @@ -919,6 +986,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "end" field. public const int EndFieldNumber = 2; private int end_; public int End { @@ -1010,6 +1078,11 @@ namespace Google.Protobuf.Reflection { } + /// + /// Range of reserved tag numbers. Reserved tag numbers may not be used by + /// fields or extension ranges in the same message. Reserved ranges may + /// not overlap. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class ReservedRange : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedRange()); @@ -1038,8 +1111,12 @@ namespace Google.Protobuf.Reflection { return new ReservedRange(this); } + /// Field number for the "start" field. public const int StartFieldNumber = 1; private int start_; + /// + /// Inclusive. + /// public int Start { get { return start_; } set { @@ -1047,8 +1124,12 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "end" field. public const int EndFieldNumber = 2; private int end_; + /// + /// Exclusive. + /// public int End { get { return end_; } set { @@ -1143,6 +1224,9 @@ namespace Google.Protobuf.Reflection { } + /// + /// Describes a field within a message. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class FieldDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldDescriptorProto()); @@ -1178,6 +1262,7 @@ namespace Google.Protobuf.Reflection { return new FieldDescriptorProto(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1187,6 +1272,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "number" field. public const int NumberFieldNumber = 3; private int number_; public int Number { @@ -1196,6 +1282,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "label" field. public const int LabelFieldNumber = 4; private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label label_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label Label { @@ -1205,8 +1292,13 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "type" field. public const int TypeFieldNumber = 5; private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type type_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; + /// + /// If type_name is set, this need not be set. If both this and type_name + /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + /// public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type Type { get { return type_; } set { @@ -1214,8 +1306,16 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "type_name" field. public const int TypeNameFieldNumber = 6; private string typeName_ = ""; + /// + /// For message and enum types, this is the name of the type. If the name + /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + /// rules are used to find the type (i.e. first the nested types within this + /// message are searched, then within the parent, on up to the root + /// namespace). + /// public string TypeName { get { return typeName_; } set { @@ -1223,8 +1323,13 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "extendee" field. public const int ExtendeeFieldNumber = 2; private string extendee_ = ""; + /// + /// For extensions, this is the name of the type being extended. It is + /// resolved in the same manner as type_name. + /// public string Extendee { get { return extendee_; } set { @@ -1232,8 +1337,16 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "default_value" field. public const int DefaultValueFieldNumber = 7; private string defaultValue_ = ""; + /// + /// For numeric types, contains the original text representation of the value. + /// For booleans, "true" or "false". + /// For strings, contains the default text contents (not escaped in any way). + /// For bytes, contains the C escaped value. All bytes >= 128 are escaped. + /// TODO(kenton): Base-64 encode? + /// public string DefaultValue { get { return defaultValue_; } set { @@ -1241,8 +1354,13 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "oneof_index" field. public const int OneofIndexFieldNumber = 9; private int oneofIndex_; + /// + /// If set, gives the index of a oneof in the containing type's oneof_decl + /// list. This field is a member of that oneof. + /// public int OneofIndex { get { return oneofIndex_; } set { @@ -1250,6 +1368,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FieldOptions options_; public global::Google.Protobuf.Reflection.FieldOptions Options { @@ -1462,29 +1581,62 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { internal enum Type { + /// + /// 0 is reserved for errors. + /// Order is weird for historical reasons. + /// TYPE_DOUBLE = 1, TYPE_FLOAT = 2, + /// + /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + /// negative values are likely. + /// TYPE_INT64 = 3, TYPE_UINT64 = 4, + /// + /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + /// negative values are likely. + /// TYPE_INT32 = 5, TYPE_FIXED64 = 6, TYPE_FIXED32 = 7, TYPE_BOOL = 8, TYPE_STRING = 9, + /// + /// Tag-delimited aggregate. + /// TYPE_GROUP = 10, + /// + /// Length-delimited aggregate. + /// TYPE_MESSAGE = 11, + /// + /// New in version 2. + /// TYPE_BYTES = 12, TYPE_UINT32 = 13, TYPE_ENUM = 14, TYPE_SFIXED32 = 15, TYPE_SFIXED64 = 16, + /// + /// Uses ZigZag encoding. + /// TYPE_SINT32 = 17, + /// + /// Uses ZigZag encoding. + /// TYPE_SINT64 = 18, } internal enum Label { + /// + /// 0 is reserved for errors + /// LABEL_OPTIONAL = 1, LABEL_REQUIRED = 2, + /// + /// TODO(sanjay): Should we add LABEL_MAP? + /// LABEL_REPEATED = 3, } @@ -1493,6 +1645,9 @@ namespace Google.Protobuf.Reflection { } + /// + /// Describes a oneof. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class OneofDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofDescriptorProto()); @@ -1520,6 +1675,7 @@ namespace Google.Protobuf.Reflection { return new OneofDescriptorProto(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1595,6 +1751,9 @@ namespace Google.Protobuf.Reflection { } + /// + /// Describes an enum type. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class EnumDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumDescriptorProto()); @@ -1624,6 +1783,7 @@ namespace Google.Protobuf.Reflection { return new EnumDescriptorProto(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1633,6 +1793,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "value" field. public const int ValueFieldNumber = 2; private static readonly pb::FieldCodec _repeated_value_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser); @@ -1641,6 +1802,7 @@ namespace Google.Protobuf.Reflection { get { return value_; } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumOptions options_; public global::Google.Protobuf.Reflection.EnumOptions Options { @@ -1747,6 +1909,9 @@ namespace Google.Protobuf.Reflection { } + /// + /// Describes a value within an enum. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class EnumValueDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueDescriptorProto()); @@ -1776,6 +1941,7 @@ namespace Google.Protobuf.Reflection { return new EnumValueDescriptorProto(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1785,6 +1951,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "number" field. public const int NumberFieldNumber = 2; private int number_; public int Number { @@ -1794,6 +1961,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumValueOptions options_; public global::Google.Protobuf.Reflection.EnumValueOptions Options { @@ -1907,6 +2075,9 @@ namespace Google.Protobuf.Reflection { } + /// + /// Describes a service. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class ServiceDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceDescriptorProto()); @@ -1936,6 +2107,7 @@ namespace Google.Protobuf.Reflection { return new ServiceDescriptorProto(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1945,6 +2117,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "method" field. public const int MethodFieldNumber = 2; private static readonly pb::FieldCodec _repeated_method_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser); @@ -1953,6 +2126,7 @@ namespace Google.Protobuf.Reflection { get { return method_; } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.ServiceOptions options_; public global::Google.Protobuf.Reflection.ServiceOptions Options { @@ -2059,6 +2233,9 @@ namespace Google.Protobuf.Reflection { } + /// + /// Describes a method of a service. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class MethodDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodDescriptorProto()); @@ -2091,6 +2268,7 @@ namespace Google.Protobuf.Reflection { return new MethodDescriptorProto(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -2100,8 +2278,13 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "input_type" field. public const int InputTypeFieldNumber = 2; private string inputType_ = ""; + /// + /// Input and output type names. These are resolved in the same way as + /// FieldDescriptorProto.type_name, but must refer to a message type. + /// public string InputType { get { return inputType_; } set { @@ -2109,6 +2292,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "output_type" field. public const int OutputTypeFieldNumber = 3; private string outputType_ = ""; public string OutputType { @@ -2118,6 +2302,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 4; private global::Google.Protobuf.Reflection.MethodOptions options_; public global::Google.Protobuf.Reflection.MethodOptions Options { @@ -2127,8 +2312,12 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "client_streaming" field. public const int ClientStreamingFieldNumber = 5; private bool clientStreaming_; + /// + /// Identifies if client streams multiple client messages + /// public bool ClientStreaming { get { return clientStreaming_; } set { @@ -2136,8 +2325,12 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "server_streaming" field. public const int ServerStreamingFieldNumber = 6; private bool serverStreaming_; + /// + /// Identifies if server streams multiple server messages + /// public bool ServerStreaming { get { return serverStreaming_; } set { @@ -2339,8 +2532,15 @@ namespace Google.Protobuf.Reflection { return new FileOptions(this); } + /// Field number for the "java_package" field. public const int JavaPackageFieldNumber = 1; private string javaPackage_ = ""; + /// + /// Sets the Java package where classes generated from this .proto will be + /// placed. By default, the proto package is used, but this is often + /// inappropriate because proto packages do not normally start with backwards + /// domain names. + /// public string JavaPackage { get { return javaPackage_; } set { @@ -2348,8 +2548,16 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "java_outer_classname" field. public const int JavaOuterClassnameFieldNumber = 8; private string javaOuterClassname_ = ""; + /// + /// If set, all the classes from the .proto file are wrapped in a single + /// outer class with the given name. This applies to both Proto1 + /// (equivalent to the old "--one_java_file" option) and Proto2 (where + /// a .proto always translates to a single class, but you may want to + /// explicitly choose the class name). + /// public string JavaOuterClassname { get { return javaOuterClassname_; } set { @@ -2357,8 +2565,17 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "java_multiple_files" field. public const int JavaMultipleFilesFieldNumber = 10; private bool javaMultipleFiles_; + /// + /// If set true, then the Java code generator will generate a separate .java + /// file for each top-level message, enum, and service defined in the .proto + /// file. Thus, these types will *not* be nested inside the outer class + /// named by java_outer_classname. However, the outer class will still be + /// generated to contain the file's getDescriptor() method as well as any + /// top-level extensions defined in the file. + /// public bool JavaMultipleFiles { get { return javaMultipleFiles_; } set { @@ -2366,8 +2583,23 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "java_generate_equals_and_hash" field. public const int JavaGenerateEqualsAndHashFieldNumber = 20; private bool javaGenerateEqualsAndHash_; + /// + /// If set true, then the Java code generator will generate equals() and + /// hashCode() methods for all messages defined in the .proto file. + /// This increases generated code size, potentially substantially for large + /// protos, which may harm a memory-constrained application. + /// - In the full runtime this is a speed optimization, as the + /// AbstractMessage base class includes reflection-based implementations of + /// these methods. + /// - In the lite runtime, setting this option changes the semantics of + /// equals() and hashCode() to more closely match those of the full runtime; + /// the generated methods compute their results based on field values rather + /// than object identity. (Implementations should not assume that hashcodes + /// will be consistent across runtimes or versions of the protocol compiler.) + /// public bool JavaGenerateEqualsAndHash { get { return javaGenerateEqualsAndHash_; } set { @@ -2375,8 +2607,17 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "java_string_check_utf8" field. public const int JavaStringCheckUtf8FieldNumber = 27; private bool javaStringCheckUtf8_; + /// + /// If set true, then the Java2 code generator will generate code that + /// throws an exception whenever an attempt is made to assign a non-UTF-8 + /// byte sequence to a string field. + /// Message reflection will do the same. + /// However, an extension field still accepts non-UTF-8 byte sequences. + /// This option has no effect on when used with the lite runtime. + /// public bool JavaStringCheckUtf8 { get { return javaStringCheckUtf8_; } set { @@ -2384,6 +2625,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "optimize_for" field. public const int OptimizeForFieldNumber = 9; private global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED; public global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode OptimizeFor { @@ -2393,8 +2635,16 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "go_package" field. public const int GoPackageFieldNumber = 11; private string goPackage_ = ""; + /// + /// Sets the Go package where structs generated from this .proto will be + /// placed. If omitted, the Go package will be derived from the following: + /// - The basename of the package import path, if provided. + /// - Otherwise, the package statement in the .proto file, if present. + /// - Otherwise, the basename of the .proto file, without extension. + /// public string GoPackage { get { return goPackage_; } set { @@ -2402,8 +2652,20 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "cc_generic_services" field. public const int CcGenericServicesFieldNumber = 16; private bool ccGenericServices_; + /// + /// Should generic services be generated in each language? "Generic" services + /// are not specific to any particular RPC system. They are generated by the + /// main code generators in each language (without additional plugins). + /// Generic services were the only kind of service generation supported by + /// early versions of google.protobuf. + /// Generic services are now considered deprecated in favor of using plugins + /// that generate code specific to your particular RPC system. Therefore, + /// these default to false. Old code which depends on generic services should + /// explicitly set them to true. + /// public bool CcGenericServices { get { return ccGenericServices_; } set { @@ -2411,6 +2673,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "java_generic_services" field. public const int JavaGenericServicesFieldNumber = 17; private bool javaGenericServices_; public bool JavaGenericServices { @@ -2420,6 +2683,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "py_generic_services" field. public const int PyGenericServicesFieldNumber = 18; private bool pyGenericServices_; public bool PyGenericServices { @@ -2429,8 +2693,15 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "deprecated" field. public const int DeprecatedFieldNumber = 23; private bool deprecated_; + /// + /// Is this file deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for everything in the file, or it will be completely ignored; in the very + /// least, this is a formalization for deprecating files. + /// public bool Deprecated { get { return deprecated_; } set { @@ -2438,8 +2709,13 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "cc_enable_arenas" field. public const int CcEnableArenasFieldNumber = 31; private bool ccEnableArenas_; + /// + /// Enables the use of arenas for the proto messages in this file. This applies + /// only to generated classes for C++. + /// public bool CcEnableArenas { get { return ccEnableArenas_; } set { @@ -2447,8 +2723,13 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "objc_class_prefix" field. public const int ObjcClassPrefixFieldNumber = 36; private string objcClassPrefix_ = ""; + /// + /// Sets the objective c class prefix which is prepended to all objective c + /// generated classes from this .proto. There is no default. + /// public string ObjcClassPrefix { get { return objcClassPrefix_; } set { @@ -2456,8 +2737,12 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "csharp_namespace" field. public const int CsharpNamespaceFieldNumber = 37; private string csharpNamespace_ = ""; + /// + /// Namespace for generated classes; defaults to the package. + /// public string CsharpNamespace { get { return csharpNamespace_; } set { @@ -2465,8 +2750,13 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "javanano_use_deprecated_package" field. public const int JavananoUseDeprecatedPackageFieldNumber = 38; private bool javananoUseDeprecatedPackage_; + /// + /// Whether the nano proto compiler should generate in the deprecated non-nano + /// suffixed package. + /// public bool JavananoUseDeprecatedPackage { get { return javananoUseDeprecatedPackage_; } set { @@ -2474,10 +2764,14 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "uninterpreted_option" field. public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + /// + /// The parser stores options it doesn't recognize here. See above. + /// public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -2783,9 +3077,21 @@ namespace Google.Protobuf.Reflection { /// Container for nested types declared in the FileOptions message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// + /// Generated classes can be optimized for speed or code size. + /// internal enum OptimizeMode { + /// + /// Generate complete code for parsing, serialization, + /// SPEED = 1, + /// + /// etc. + /// CODE_SIZE = 2, + /// + /// Generate code using MessageLite and the lite runtime. + /// LITE_RUNTIME = 3, } @@ -2825,8 +3131,26 @@ namespace Google.Protobuf.Reflection { return new MessageOptions(this); } + /// Field number for the "message_set_wire_format" field. public const int MessageSetWireFormatFieldNumber = 1; private bool messageSetWireFormat_; + /// + /// Set true to use the old proto1 MessageSet wire format for extensions. + /// This is provided for backwards-compatibility with the MessageSet wire + /// format. You should not use this for any other reason: It's less + /// efficient, has fewer features, and is more complicated. + /// The message must be defined exactly as follows: + /// message Foo { + /// option message_set_wire_format = true; + /// extensions 4 to max; + /// } + /// Note that the message cannot have any defined fields; MessageSets only + /// have extensions. + /// All extensions of your type must be singular messages; e.g. they cannot + /// be int32s, enums, or repeated messages. + /// Because this is an option, the above two restrictions are not enforced by + /// the protocol compiler. + /// public bool MessageSetWireFormat { get { return messageSetWireFormat_; } set { @@ -2834,8 +3158,14 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "no_standard_descriptor_accessor" field. public const int NoStandardDescriptorAccessorFieldNumber = 2; private bool noStandardDescriptorAccessor_; + /// + /// Disables the generation of the standard "descriptor()" accessor, which can + /// conflict with a field of the same name. This is meant to make migration + /// from proto1 easier; new code should avoid fields named "descriptor". + /// public bool NoStandardDescriptorAccessor { get { return noStandardDescriptorAccessor_; } set { @@ -2843,8 +3173,15 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "deprecated" field. public const int DeprecatedFieldNumber = 3; private bool deprecated_; + /// + /// Is this message deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the message, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating messages. + /// public bool Deprecated { get { return deprecated_; } set { @@ -2852,8 +3189,29 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "map_entry" field. public const int MapEntryFieldNumber = 7; private bool mapEntry_; + /// + /// Whether the message is an automatically generated map entry type for the + /// maps field. + /// For maps fields: + /// map<KeyType, ValueType> map_field = 1; + /// The parsed descriptor looks like: + /// message MapFieldEntry { + /// option map_entry = true; + /// optional KeyType key = 1; + /// optional ValueType value = 2; + /// } + /// repeated MapFieldEntry map_field = 1; + /// Implementations may choose not to generate the map_entry=true message, but + /// use a native map in the target language to hold the keys and values. + /// The reflection APIs in such implementions still need to work as + /// if the field is a repeated message field. + /// NOTE: Do not set the option in .proto files. Always use the maps syntax + /// instead. The option should only be implicitly set by the proto compiler + /// parser. + /// public bool MapEntry { get { return mapEntry_; } set { @@ -2861,10 +3219,14 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "uninterpreted_option" field. public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + /// + /// The parser stores options it doesn't recognize here. See above. + /// public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3025,8 +3387,15 @@ namespace Google.Protobuf.Reflection { return new FieldOptions(this); } + /// Field number for the "ctype" field. public const int CtypeFieldNumber = 1; private global::Google.Protobuf.Reflection.FieldOptions.Types.CType ctype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING; + /// + /// The ctype option instructs the C++ code generator to use a different + /// representation of the field than it normally would. See the specific + /// options below. This option is not yet implemented in the open source + /// release -- sorry, we'll try to include it in a future version! + /// public global::Google.Protobuf.Reflection.FieldOptions.Types.CType Ctype { get { return ctype_; } set { @@ -3034,8 +3403,16 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "packed" field. public const int PackedFieldNumber = 2; private bool packed_; + /// + /// The packed option can be enabled for repeated primitive fields to enable + /// a more efficient representation on the wire. Rather than repeatedly + /// writing the tag and type for each element, the entire array is encoded as + /// a single length-delimited blob. In proto3, only explicit setting it to + /// false will avoid using packed encoding. + /// public bool Packed { get { return packed_; } set { @@ -3043,8 +3420,20 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "jstype" field. public const int JstypeFieldNumber = 6; private global::Google.Protobuf.Reflection.FieldOptions.Types.JSType jstype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL; + /// + /// The jstype option determines the JavaScript type used for values of the + /// field. The option is permitted only for 64 bit integral and fixed types + /// (int64, uint64, sint64, fixed64, sfixed64). By default these types are + /// represented as JavaScript strings. This avoids loss of precision that can + /// happen when a large value is converted to a floating point JavaScript + /// numbers. Specifying JS_NUMBER for the jstype causes the generated + /// JavaScript code to use the JavaScript "number" type instead of strings. + /// This option is an enum to permit additional types to be added, + /// e.g. goog.math.Integer. + /// public global::Google.Protobuf.Reflection.FieldOptions.Types.JSType Jstype { get { return jstype_; } set { @@ -3052,8 +3441,35 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "lazy" field. public const int LazyFieldNumber = 5; private bool lazy_; + /// + /// Should this field be parsed lazily? Lazy applies only to message-type + /// fields. It means that when the outer message is initially parsed, the + /// inner message's contents will not be parsed but instead stored in encoded + /// form. The inner message will actually be parsed when it is first accessed. + /// This is only a hint. Implementations are free to choose whether to use + /// eager or lazy parsing regardless of the value of this option. However, + /// setting this option true suggests that the protocol author believes that + /// using lazy parsing on this field is worth the additional bookkeeping + /// overhead typically needed to implement it. + /// This option does not affect the public interface of any generated code; + /// all method signatures remain the same. Furthermore, thread-safety of the + /// interface is not affected by this option; const methods remain safe to + /// call from multiple threads concurrently, while non-const methods continue + /// to require exclusive access. + /// Note that implementations may choose not to check required fields within + /// a lazy sub-message. That is, calling IsInitialized() on the outher message + /// may return true even if the inner message has missing required fields. + /// This is necessary because otherwise the inner message would have to be + /// parsed in order to perform the check, defeating the purpose of lazy + /// parsing. An implementation which chooses not to check required fields + /// must be consistent about it. That is, for any particular sub-message, the + /// implementation must either *always* check its required fields, or *never* + /// check its required fields, regardless of whether or not the message has + /// been parsed. + /// public bool Lazy { get { return lazy_; } set { @@ -3061,8 +3477,15 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "deprecated" field. public const int DeprecatedFieldNumber = 3; private bool deprecated_; + /// + /// Is this field deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for accessors, or it will be completely ignored; in the very least, this + /// is a formalization for deprecating fields. + /// public bool Deprecated { get { return deprecated_; } set { @@ -3070,8 +3493,12 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "weak" field. public const int WeakFieldNumber = 10; private bool weak_; + /// + /// For Google-internal migration only. Do not use. + /// public bool Weak { get { return weak_; } set { @@ -3079,10 +3506,14 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "uninterpreted_option" field. public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + /// + /// The parser stores options it doesn't recognize here. See above. + /// public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3245,14 +3676,26 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { internal enum CType { + /// + /// Default mode. + /// STRING = 0, CORD = 1, STRING_PIECE = 2, } internal enum JSType { + /// + /// Use the default type. + /// JS_NORMAL = 0, + /// + /// Use JavaScript strings. + /// JS_STRING = 1, + /// + /// Use JavaScript numbers. + /// JS_NUMBER = 2, } @@ -3290,8 +3733,13 @@ namespace Google.Protobuf.Reflection { return new EnumOptions(this); } + /// Field number for the "allow_alias" field. public const int AllowAliasFieldNumber = 2; private bool allowAlias_; + /// + /// Set this option to true to allow mapping different tag names to the same + /// value. + /// public bool AllowAlias { get { return allowAlias_; } set { @@ -3299,8 +3747,15 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "deprecated" field. public const int DeprecatedFieldNumber = 3; private bool deprecated_; + /// + /// Is this enum deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the enum, or it will be completely ignored; in the very least, this + /// is a formalization for deprecating enums. + /// public bool Deprecated { get { return deprecated_; } set { @@ -3308,10 +3763,14 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "uninterpreted_option" field. public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + /// + /// The parser stores options it doesn't recognize here. See above. + /// public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3435,8 +3894,15 @@ namespace Google.Protobuf.Reflection { return new EnumValueOptions(this); } + /// Field number for the "deprecated" field. public const int DeprecatedFieldNumber = 1; private bool deprecated_; + /// + /// Is this enum value deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the enum value, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating enum values. + /// public bool Deprecated { get { return deprecated_; } set { @@ -3444,10 +3910,14 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "uninterpreted_option" field. public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + /// + /// The parser stores options it doesn't recognize here. See above. + /// public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3555,8 +4025,15 @@ namespace Google.Protobuf.Reflection { return new ServiceOptions(this); } + /// Field number for the "deprecated" field. public const int DeprecatedFieldNumber = 33; private bool deprecated_; + /// + /// Is this service deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the service, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating services. + /// public bool Deprecated { get { return deprecated_; } set { @@ -3564,10 +4041,14 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "uninterpreted_option" field. public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + /// + /// The parser stores options it doesn't recognize here. See above. + /// public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3675,8 +4156,15 @@ namespace Google.Protobuf.Reflection { return new MethodOptions(this); } + /// Field number for the "deprecated" field. public const int DeprecatedFieldNumber = 33; private bool deprecated_; + /// + /// Is this method deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the method, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating methods. + /// public bool Deprecated { get { return deprecated_; } set { @@ -3684,10 +4172,14 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "uninterpreted_option" field. public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + /// + /// The parser stores options it doesn't recognize here. See above. + /// public pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3767,6 +4259,14 @@ namespace Google.Protobuf.Reflection { } + /// + /// A message representing a option the parser does not recognize. This only + /// appears in options protos created by the compiler::Parser class. + /// DescriptorPool resolves these when building Descriptor objects. Therefore, + /// options protos in descriptor objects (e.g. returned by Descriptor::options(), + /// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + /// in them. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class UninterpretedOption : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UninterpretedOption()); @@ -3800,6 +4300,7 @@ namespace Google.Protobuf.Reflection { return new UninterpretedOption(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 2; private static readonly pb::FieldCodec _repeated_name_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart.Parser); @@ -3808,8 +4309,13 @@ namespace Google.Protobuf.Reflection { get { return name_; } } + /// Field number for the "identifier_value" field. public const int IdentifierValueFieldNumber = 3; private string identifierValue_ = ""; + /// + /// The value of the uninterpreted option, in whatever type the tokenizer + /// identified it as during parsing. Exactly one of these should be set. + /// public string IdentifierValue { get { return identifierValue_; } set { @@ -3817,6 +4323,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "positive_int_value" field. public const int PositiveIntValueFieldNumber = 4; private ulong positiveIntValue_; public ulong PositiveIntValue { @@ -3826,6 +4333,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "negative_int_value" field. public const int NegativeIntValueFieldNumber = 5; private long negativeIntValue_; public long NegativeIntValue { @@ -3835,6 +4343,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "double_value" field. public const int DoubleValueFieldNumber = 6; private double doubleValue_; public double DoubleValue { @@ -3844,6 +4353,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "string_value" field. public const int StringValueFieldNumber = 7; private pb::ByteString stringValue_ = pb::ByteString.Empty; public pb::ByteString StringValue { @@ -3853,6 +4363,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "aggregate_value" field. public const int AggregateValueFieldNumber = 8; private string aggregateValue_ = ""; public string AggregateValue { @@ -4019,6 +4530,13 @@ namespace Google.Protobuf.Reflection { /// Container for nested types declared in the UninterpretedOption message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// + /// The name of the uninterpreted option. Each string represents a segment in + /// a dot-separated name. is_extension is true iff a segment represents an + /// extension (denoted with parentheses in options specs in .proto files). + /// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + /// "foo.(bar.baz).qux". + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class NamePart : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NamePart()); @@ -4047,6 +4565,7 @@ namespace Google.Protobuf.Reflection { return new NamePart(this); } + /// Field number for the "name_part" field. public const int NamePart_FieldNumber = 1; private string namePart_ = ""; public string NamePart_ { @@ -4056,6 +4575,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "is_extension" field. public const int IsExtensionFieldNumber = 2; private bool isExtension_; public bool IsExtension { @@ -4152,6 +4672,10 @@ namespace Google.Protobuf.Reflection { } + /// + /// Encapsulates information about the original source file from which a + /// FileDescriptorProto was generated. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class SourceCodeInfo : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceCodeInfo()); @@ -4179,10 +4703,54 @@ namespace Google.Protobuf.Reflection { return new SourceCodeInfo(this); } + /// Field number for the "location" field. public const int LocationFieldNumber = 1; private static readonly pb::FieldCodec _repeated_location_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location.Parser); private readonly pbc::RepeatedField location_ = new pbc::RepeatedField(); + /// + /// A Location identifies a piece of source code in a .proto file which + /// corresponds to a particular definition. This information is intended + /// to be useful to IDEs, code indexers, documentation generators, and similar + /// tools. + /// For example, say we have a file like: + /// message Foo { + /// optional string foo = 1; + /// } + /// Let's look at just the field definition: + /// optional string foo = 1; + /// ^ ^^ ^^ ^ ^^^ + /// a bc de f ghi + /// We have the following locations: + /// span path represents + /// [a,i) [ 4, 0, 2, 0 ] The whole field definition. + /// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + /// [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + /// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + /// [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + /// Notes: + /// - A location may refer to a repeated field itself (i.e. not to any + /// particular index within it). This is used whenever a set of elements are + /// logically enclosed in a single code segment. For example, an entire + /// extend block (possibly containing multiple extension definitions) will + /// have an outer location whose path refers to the "extensions" repeated + /// field without an index. + /// - Multiple locations may have the same path. This happens when a single + /// logical declaration is spread out across multiple places. The most + /// obvious example is the "extend" block again -- there may be multiple + /// extend blocks in the same scope, each of which will have the same path. + /// - A location's span is not always a subset of its parent's span. For + /// example, the "extendee" of an extension declaration appears at the + /// beginning of the "extend" block and is shared by all extensions within + /// the block. + /// - Just because a location's span is a subset of some other location's span + /// does not mean that it is a descendent. For example, a "group" defines + /// both a type and a field in a single declaration. Thus, the locations + /// corresponding to the type and field and their components will overlap. + /// - Code which tries to interpret locations should probably be designed to + /// ignore those that it doesn't understand, as more types of locations could + /// be recorded in the future. + /// public pbc::RepeatedField Location { get { return location_; } } @@ -4279,24 +4847,95 @@ namespace Google.Protobuf.Reflection { return new Location(this); } + /// Field number for the "path" field. public const int PathFieldNumber = 1; private static readonly pb::FieldCodec _repeated_path_codec = pb::FieldCodec.ForInt32(10); private readonly pbc::RepeatedField path_ = new pbc::RepeatedField(); + /// + /// Identifies which part of the FileDescriptorProto was defined at this + /// location. + /// Each element is a field number or an index. They form a path from + /// the root FileDescriptorProto to the place where the definition. For + /// example, this path: + /// [ 4, 3, 2, 7, 1 ] + /// refers to: + /// file.message_type(3) // 4, 3 + /// .field(7) // 2, 7 + /// .name() // 1 + /// This is because FileDescriptorProto.message_type has field number 4: + /// repeated DescriptorProto message_type = 4; + /// and DescriptorProto.field has field number 2: + /// repeated FieldDescriptorProto field = 2; + /// and FieldDescriptorProto.name has field number 1: + /// optional string name = 1; + /// Thus, the above path gives the location of a field name. If we removed + /// the last element: + /// [ 4, 3, 2, 7 ] + /// this path refers to the whole field declaration (from the beginning + /// of the label to the terminating semicolon). + /// public pbc::RepeatedField Path { get { return path_; } } + /// Field number for the "span" field. public const int SpanFieldNumber = 2; private static readonly pb::FieldCodec _repeated_span_codec = pb::FieldCodec.ForInt32(18); private readonly pbc::RepeatedField span_ = new pbc::RepeatedField(); + /// + /// Always has exactly three or four elements: start line, start column, + /// end line (optional, otherwise assumed same as start line), end column. + /// These are packed into a single field for efficiency. Note that line + /// and column numbers are zero-based -- typically you will want to add + /// 1 to each before displaying to a user. + /// public pbc::RepeatedField Span { get { return span_; } } + /// Field number for the "leading_comments" field. public const int LeadingCommentsFieldNumber = 3; private string leadingComments_ = ""; + /// + /// If this SourceCodeInfo represents a complete declaration, these are any + /// comments appearing before and after the declaration which appear to be + /// attached to the declaration. + /// A series of line comments appearing on consecutive lines, with no other + /// tokens appearing on those lines, will be treated as a single comment. + /// leading_detached_comments will keep paragraphs of comments that appear + /// before (but not connected to) the current element. Each paragraph, + /// separated by empty lines, will be one comment element in the repeated + /// field. + /// Only the comment content is provided; comment markers (e.g. //) are + /// stripped out. For block comments, leading whitespace and an asterisk + /// will be stripped from the beginning of each line other than the first. + /// Newlines are included in the output. + /// Examples: + /// optional int32 foo = 1; // Comment attached to foo. + /// // Comment attached to bar. + /// optional int32 bar = 2; + /// optional string baz = 3; + /// // Comment attached to baz. + /// // Another line attached to baz. + /// // Comment attached to qux. + /// // + /// // Another line attached to qux. + /// optional double qux = 4; + /// // Detached comment for corge. This is not leading or trailing comments + /// // to qux or corge because there are blank lines separating it from + /// // both. + /// // Detached comment for corge paragraph 2. + /// optional string corge = 5; + /// /* Block comment attached + /// * to corge. Leading asterisks + /// * will be removed. */ + /// /* Block comment attached to + /// * grault. */ + /// optional int32 grault = 6; + /// // ignored detached comments. + /// public string LeadingComments { get { return leadingComments_; } set { @@ -4304,6 +4943,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "trailing_comments" field. public const int TrailingCommentsFieldNumber = 4; private string trailingComments_ = ""; public string TrailingComments { @@ -4313,6 +4953,7 @@ namespace Google.Protobuf.Reflection { } } + /// Field number for the "leading_detached_comments" field. public const int LeadingDetachedCommentsFieldNumber = 6; private static readonly pb::FieldCodec _repeated_leadingDetachedComments_codec = pb::FieldCodec.ForString(50); diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs index 6bcdfdef..4a704018 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs @@ -40,6 +40,33 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// + /// `Any` contains an arbitrary serialized message along with a URL + /// that describes the type of the serialized message. + /// JSON + /// ==== + /// The JSON representation of an `Any` value uses the regular + /// representation of the deserialized, embedded message, with an + /// additional field `@type` which contains the type URL. Example: + /// package google.profile; + /// message Person { + /// string first_name = 1; + /// string last_name = 2; + /// } + /// { + /// "@type": "type.googleapis.com/google.profile.Person", + /// "firstName": <string>, + /// "lastName": <string> + /// } + /// If the embedded message type is well-known and has a custom JSON + /// representation, that representation will be embedded adding a field + /// `value` which holds the custom JSON in addition to the the `@type` + /// field. Example (for message [google.protobuf.Duration][google.protobuf.Duration]): + /// { + /// "@type": "type.googleapis.com/google.protobuf.Duration", + /// "value": "1.212s" + /// } + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Any : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Any()); @@ -68,8 +95,27 @@ namespace Google.Protobuf.WellKnownTypes { return new Any(this); } + /// Field number for the "type_url" field. public const int TypeUrlFieldNumber = 1; private string typeUrl_ = ""; + /// + /// A URL/resource name whose content describes the type of the + /// serialized message. + /// For URLs which use the schema `http`, `https`, or no schema, the + /// following restrictions and interpretations apply: + /// * If no schema is provided, `https` is assumed. + /// * The last segment of the URL's path must represent the fully + /// qualified name of the type (as in `path/google.protobuf.Duration`). + /// * An HTTP GET on the URL must yield a [google.protobuf.Type][google.protobuf.Type] + /// value in binary format, or produce an error. + /// * Applications are allowed to cache lookup results based on the + /// URL, or have them precompiled into a binary to avoid any + /// lookup. Therefore, binary compatibility needs to be preserved + /// on changes to types. (Use versioned type names to manage + /// breaking changes.) + /// Schemas other than `http`, `https` (or the empty schema) might be + /// used with implementation specific semantics. + /// public string TypeUrl { get { return typeUrl_; } set { @@ -77,8 +123,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "value" field. public const int ValueFieldNumber = 2; private pb::ByteString value_ = pb::ByteString.Empty; + /// + /// Must be valid serialized data of the above specified type. + /// public pb::ByteString Value { get { return value_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs index f2166ca5..2c64314d 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs @@ -54,6 +54,9 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// + /// Api is a light-weight descriptor for a protocol buffer service. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Api : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Api()); @@ -87,8 +90,13 @@ namespace Google.Protobuf.WellKnownTypes { return new Api(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + /// + /// The fully qualified name of this api, including package name + /// followed by the api's simple name. + /// public string Name { get { return name_; } set { @@ -96,24 +104,53 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "methods" field. public const int MethodsFieldNumber = 2; private static readonly pb::FieldCodec _repeated_methods_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Method.Parser); private readonly pbc::RepeatedField methods_ = new pbc::RepeatedField(); + /// + /// The methods of this api, in unspecified order. + /// public pbc::RepeatedField Methods { get { return methods_; } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 3; private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + /// + /// Any metadata attached to the API. + /// public pbc::RepeatedField Options { get { return options_; } } + /// Field number for the "version" field. public const int VersionFieldNumber = 4; private string version_ = ""; + /// + /// A version string for this api. If specified, must have the form + /// `major-version.minor-version`, as in `1.10`. If the minor version + /// is omitted, it defaults to zero. If the entire version field is + /// empty, the major version is derived from the package name, as + /// outlined below. If the field is not empty, the version in the + /// package name will be verified to be consistent with what is + /// provided here. + /// The versioning schema uses [semantic + /// versioning](http://semver.org) where the major version number + /// indicates a breaking change and the minor version an additive, + /// non-breaking change. Both version numbers are signals to users + /// what to expect from different versions, and should be carefully + /// chosen based on the product plan. + /// The major version is also reflected in the package name of the + /// API, which must end in `v<major-version>`, as in + /// `google.feature.v1`. For major versions 0 and 1, the suffix can + /// be omitted. Zero major versions must only be used for + /// experimental, none-GA apis. + /// public string Version { get { return version_; } set { @@ -121,8 +158,13 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "source_context" field. public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + /// + /// Source context for the protocol buffer service represented by this + /// message. + /// public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -130,16 +172,24 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "mixins" field. public const int MixinsFieldNumber = 6; private static readonly pb::FieldCodec _repeated_mixins_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Mixin.Parser); private readonly pbc::RepeatedField mixins_ = new pbc::RepeatedField(); + /// + /// Included APIs. See [Mixin][]. + /// public pbc::RepeatedField Mixins { get { return mixins_; } } + /// Field number for the "syntax" field. public const int SyntaxFieldNumber = 7; private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// + /// The source syntax of the service. + /// public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { get { return syntax_; } set { @@ -294,6 +344,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// + /// Method represents a method of an api. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Method : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Method()); @@ -327,8 +380,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Method(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + /// + /// The simple name of this method. + /// public string Name { get { return name_; } set { @@ -336,8 +393,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "request_type_url" field. public const int RequestTypeUrlFieldNumber = 2; private string requestTypeUrl_ = ""; + /// + /// A URL of the input message type. + /// public string RequestTypeUrl { get { return requestTypeUrl_; } set { @@ -345,8 +406,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "request_streaming" field. public const int RequestStreamingFieldNumber = 3; private bool requestStreaming_; + /// + /// If true, the request is streamed. + /// public bool RequestStreaming { get { return requestStreaming_; } set { @@ -354,8 +419,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "response_type_url" field. public const int ResponseTypeUrlFieldNumber = 4; private string responseTypeUrl_ = ""; + /// + /// The URL of the output message type. + /// public string ResponseTypeUrl { get { return responseTypeUrl_; } set { @@ -363,8 +432,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "response_streaming" field. public const int ResponseStreamingFieldNumber = 5; private bool responseStreaming_; + /// + /// If true, the response is streamed. + /// public bool ResponseStreaming { get { return responseStreaming_; } set { @@ -372,16 +445,24 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 6; private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + /// + /// Any metadata attached to the method. + /// public pbc::RepeatedField Options { get { return options_; } } + /// Field number for the "syntax" field. public const int SyntaxFieldNumber = 7; private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// + /// The source syntax of this method. + /// public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { get { return syntax_; } set { @@ -544,6 +625,70 @@ namespace Google.Protobuf.WellKnownTypes { } + /// + /// Declares an API to be included in this API. The including API must + /// redeclare all the methods from the included API, but documentation + /// and options are inherited as follows: + /// - If after comment and whitespace stripping, the documentation + /// string of the redeclared method is empty, it will be inherited + /// from the original method. + /// - Each annotation belonging to the service config (http, + /// visibility) which is not set in the redeclared method will be + /// inherited. + /// - If an http annotation is inherited, the path pattern will be + /// modified as follows. Any version prefix will be replaced by the + /// version of the including API plus the [root][] path if specified. + /// Example of a simple mixin: + /// package google.acl.v1; + /// service AccessControl { + /// // Get the underlying ACL object. + /// rpc GetAcl(GetAclRequest) returns (Acl) { + /// option (google.api.http).get = "/v1/{resource=**}:getAcl"; + /// } + /// } + /// package google.storage.v2; + /// service Storage { + /// // (-- see AccessControl.GetAcl --) + /// rpc GetAcl(GetAclRequest) returns (Acl); + /// // Get a data record. + /// rpc GetData(GetDataRequest) returns (Data) { + /// option (google.api.http).get = "/v2/{resource=**}"; + /// } + /// } + /// Example of a mixin configuration: + /// apis: + /// - name: google.storage.v2.Storage + /// mixins: + /// - name: google.acl.v1.AccessControl + /// The mixin construct implies that all methods in `AccessControl` are + /// also declared with same name and request/response types in + /// `Storage`. A documentation generator or annotation processor will + /// see the effective `Storage.GetAcl` method after inherting + /// documentation and annotations as follows: + /// service Storage { + /// // Get the underlying ACL object. + /// rpc GetAcl(GetAclRequest) returns (Acl) { + /// option (google.api.http).get = "/v2/{resource=**}:getAcl"; + /// } + /// ... + /// } + /// Note how the version in the path pattern changed from `v1` to `v2`. + /// If the `root` field in the mixin is specified, it should be a + /// relative path under which inherited HTTP paths are placed. Example: + /// apis: + /// - name: google.storage.v2.Storage + /// mixins: + /// - name: google.acl.v1.AccessControl + /// root: acls + /// This implies the following inherited HTTP annotation: + /// service Storage { + /// // Get the underlying ACL object. + /// rpc GetAcl(GetAclRequest) returns (Acl) { + /// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + /// } + /// ... + /// } + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Mixin : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mixin()); @@ -572,8 +717,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Mixin(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + /// + /// The fully qualified name of the API which is included. + /// public string Name { get { return name_; } set { @@ -581,8 +730,13 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "root" field. public const int RootFieldNumber = 2; private string root_ = ""; + /// + /// If non-empty specifies a path under which inherited HTTP paths + /// are rooted. + /// public string Root { get { return root_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs index e671eac8..39251e2e 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs @@ -41,6 +41,40 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// + /// A Duration represents a signed, fixed-length span of time represented + /// as a count of seconds and fractions of seconds at nanosecond + /// resolution. It is independent of any calendar and concepts like "day" + /// or "month". It is related to Timestamp in that the difference between + /// two Timestamp values is a Duration and it can be added or subtracted + /// from a Timestamp. Range is approximately +-10,000 years. + /// Example 1: Compute Duration from two Timestamps in pseudo code. + /// Timestamp start = ...; + /// Timestamp end = ...; + /// Duration duration = ...; + /// duration.seconds = end.seconds - start.seconds; + /// duration.nanos = end.nanos - start.nanos; + /// if (duration.seconds < 0 && duration.nanos > 0) { + /// duration.seconds += 1; + /// duration.nanos -= 1000000000; + /// } else if (durations.seconds > 0 && duration.nanos < 0) { + /// duration.seconds -= 1; + /// duration.nanos += 1000000000; + /// } + /// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + /// Timestamp start = ...; + /// Duration duration = ...; + /// Timestamp end = ...; + /// end.seconds = start.seconds + duration.seconds; + /// end.nanos = start.nanos + duration.nanos; + /// if (end.nanos < 0) { + /// end.seconds -= 1; + /// end.nanos += 1000000000; + /// } else if (end.nanos >= 1000000000) { + /// end.seconds += 1; + /// end.nanos -= 1000000000; + /// } + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Duration : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Duration()); @@ -69,8 +103,13 @@ namespace Google.Protobuf.WellKnownTypes { return new Duration(this); } + /// Field number for the "seconds" field. public const int SecondsFieldNumber = 1; private long seconds_; + /// + /// Signed seconds of the span of time. Must be from -315,576,000,000 + /// to +315,576,000,000 inclusive. + /// public long Seconds { get { return seconds_; } set { @@ -78,8 +117,17 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "nanos" field. public const int NanosFieldNumber = 2; private int nanos_; + /// + /// Signed fractions of a second at nanosecond resolution of the span + /// of time. Durations less than one second are represented with a 0 + /// `seconds` field and a positive or negative `nanos` field. For durations + /// of one second or more, a non-zero value for the `nanos` field must be + /// of the same sign as the `seconds` field. Must be from -999,999,999 + /// to +999,999,999 inclusive. + /// public int Nanos { get { return nanos_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs index 050f7476..18223a9e 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs @@ -40,6 +40,15 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// + /// A generic empty message that you can re-use to avoid defining duplicated + /// empty messages in your APIs. A typical example is to use it as the request + /// or the response type of an API method. For instance: + /// service Foo { + /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + /// } + /// The JSON representation for `Empty` is empty JSON object `{}`. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Empty : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs index 14acf394..33c814ef 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs @@ -40,6 +40,103 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// + /// `FieldMask` represents a set of symbolic field paths, for example: + /// paths: "f.a" + /// paths: "f.b.d" + /// Here `f` represents a field in some root message, `a` and `b` + /// fields in the message found in `f`, and `d` a field found in the + /// message in `f.b`. + /// Field masks are used to specify a subset of fields that should be + /// returned by a get operation or modified by an update operation. + /// Field masks also have a custom JSON encoding (see below). + /// # Field Masks in Projections + /// When used in the context of a projection, a response message or + /// sub-message is filtered by the API to only contain those fields as + /// specified in the mask. For example, if the mask in the previous + /// example is applied to a response message as follows: + /// f { + /// a : 22 + /// b { + /// d : 1 + /// x : 2 + /// } + /// y : 13 + /// } + /// z: 8 + /// The result will not contain specific values for fields x,y and z + /// (there value will be set to the default, and omitted in proto text + /// output): + /// f { + /// a : 22 + /// b { + /// d : 1 + /// } + /// } + /// A repeated field is not allowed except at the last position of a + /// field mask. + /// If a FieldMask object is not present in a get operation, the + /// operation applies to all fields (as if a FieldMask of all fields + /// had been specified). + /// Note that a field mask does not necessarily applies to the + /// top-level response message. In case of a REST get operation, the + /// field mask applies directly to the response, but in case of a REST + /// list operation, the mask instead applies to each individual message + /// in the returned resource list. In case of a REST custom method, + /// other definitions may be used. Where the mask applies will be + /// clearly documented together with its declaration in the API. In + /// any case, the effect on the returned resource/resources is required + /// behavior for APIs. + /// # Field Masks in Update Operations + /// A field mask in update operations specifies which fields of the + /// targeted resource are going to be updated. The API is required + /// to only change the values of the fields as specified in the mask + /// and leave the others untouched. If a resource is passed in to + /// describe the updated values, the API ignores the values of all + /// fields not covered by the mask. + /// In order to reset a field's value to the default, the field must + /// be in the mask and set to the default value in the provided resource. + /// Hence, in order to reset all fields of a resource, provide a default + /// instance of the resource and set all fields in the mask, or do + /// not provide a mask as described below. + /// If a field mask is not present on update, the operation applies to + /// all fields (as if a field mask of all fields has been specified). + /// Note that in the presence of schema evolution, this may mean that + /// fields the client does not know and has therefore not filled into + /// the request will be reset to their default. If this is unwanted + /// behavior, a specific service may require a client to always specify + /// a field mask, producing an error if not. + /// As with get operations, the location of the resource which + /// describes the updated values in the request message depends on the + /// operation kind. In any case, the effect of the field mask is + /// required to be honored by the API. + /// ## Considerations for HTTP REST + /// The HTTP kind of an update operation which uses a field mask must + /// be set to PATCH instead of PUT in order to satisfy HTTP semantics + /// (PUT must only be used for full updates). + /// # JSON Encoding of Field Masks + /// In JSON, a field mask is encoded as a single string where paths are + /// separated by a comma. Fields name in each path are converted + /// to/from lower-camel naming conventions. + /// As an example, consider the following message declarations: + /// message Profile { + /// User user = 1; + /// Photo photo = 2; + /// } + /// message User { + /// string display_name = 1; + /// string address = 2; + /// } + /// In proto a field mask for `Profile` may look as such: + /// mask { + /// paths: "user.display_name" + /// paths: "photo" + /// } + /// In JSON, the same mask is represented as below: + /// { + /// mask: "user.displayName,photo" + /// } + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class FieldMask : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldMask()); @@ -67,10 +164,14 @@ namespace Google.Protobuf.WellKnownTypes { return new FieldMask(this); } + /// Field number for the "paths" field. public const int PathsFieldNumber = 1; private static readonly pb::FieldCodec _repeated_paths_codec = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField paths_ = new pbc::RepeatedField(); + /// + /// The set of field mask paths. + /// public pbc::RepeatedField Paths { get { return paths_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs index e4d063b0..d87c54bd 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs @@ -41,6 +41,10 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// + /// `SourceContext` represents information about the source of a + /// protobuf element, like the file in which it is defined. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class SourceContext : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceContext()); @@ -68,8 +72,13 @@ namespace Google.Protobuf.WellKnownTypes { return new SourceContext(this); } + /// Field number for the "file_name" field. public const int FileNameFieldNumber = 1; private string fileName_ = ""; + /// + /// The path-qualified name of the .proto file that contained the associated + /// protobuf element. For example: `"google/protobuf/source.proto"`. + /// public string FileName { get { return fileName_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs index 257d52d8..a9961bea 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs @@ -52,13 +52,30 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Enums + /// + /// `NullValue` is a singleton enumeration to represent the null value for the + /// `Value` type union. + /// The JSON representation for `NullValue` is JSON `null`. + /// public enum NullValue { + /// + /// Null value. + /// NULL_VALUE = 0, } #endregion #region Messages + /// + /// `Struct` represents a structured data value, consisting of fields + /// which map to dynamically typed values. In some languages, `Struct` + /// might be supported by a native representation. For example, in + /// scripting languages like JS a struct is represented as an + /// object. The details of that representation are described together + /// with the proto support for the language. + /// The JSON representation for `Struct` is JSON object. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Struct : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Struct()); @@ -86,10 +103,14 @@ namespace Google.Protobuf.WellKnownTypes { return new Struct(this); } + /// Field number for the "fields" field. public const int FieldsFieldNumber = 1; private static readonly pbc::MapField.Codec _map_fields_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Value.Parser), 10); private readonly pbc::MapField fields_ = new pbc::MapField(); + /// + /// Map of dynamically typed values. + /// public pbc::MapField Fields { get { return fields_; } } @@ -153,6 +174,13 @@ namespace Google.Protobuf.WellKnownTypes { } + /// + /// `Value` represents a dynamically typed value which can be either + /// null, a number, a string, a boolean, a recursive struct value, or a + /// list of values. A producer of value is expected to set one of that + /// variants, absence of any variant indicates an error. + /// The JSON representation for `Value` is JSON value. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Value : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Value()); @@ -200,7 +228,11 @@ namespace Google.Protobuf.WellKnownTypes { return new Value(this); } + /// Field number for the "null_value" field. public const int NullValueFieldNumber = 1; + /// + /// Represents a null value. + /// public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { get { return kindCase_ == KindOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) kind_ : global::Google.Protobuf.WellKnownTypes.NullValue.NULL_VALUE; } set { @@ -209,7 +241,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "number_value" field. public const int NumberValueFieldNumber = 2; + /// + /// Represents a double value. + /// public double NumberValue { get { return kindCase_ == KindOneofCase.NumberValue ? (double) kind_ : 0D; } set { @@ -218,7 +254,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "string_value" field. public const int StringValueFieldNumber = 3; + /// + /// Represents a string value. + /// public string StringValue { get { return kindCase_ == KindOneofCase.StringValue ? (string) kind_ : ""; } set { @@ -227,7 +267,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "bool_value" field. public const int BoolValueFieldNumber = 4; + /// + /// Represents a boolean value. + /// public bool BoolValue { get { return kindCase_ == KindOneofCase.BoolValue ? (bool) kind_ : false; } set { @@ -236,7 +280,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "struct_value" field. public const int StructValueFieldNumber = 5; + /// + /// Represents a structured value. + /// public global::Google.Protobuf.WellKnownTypes.Struct StructValue { get { return kindCase_ == KindOneofCase.StructValue ? (global::Google.Protobuf.WellKnownTypes.Struct) kind_ : null; } set { @@ -245,7 +293,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "list_value" field. public const int ListValueFieldNumber = 6; + /// + /// Represents a repeated `Value`. + /// public global::Google.Protobuf.WellKnownTypes.ListValue ListValue { get { return kindCase_ == KindOneofCase.ListValue ? (global::Google.Protobuf.WellKnownTypes.ListValue) kind_ : null; } set { @@ -435,6 +487,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// + /// `ListValue` is a wrapper around a repeated field of values. + /// The JSON representation for `ListValue` is JSON array. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ListValue : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListValue()); @@ -462,10 +518,14 @@ namespace Google.Protobuf.WellKnownTypes { return new ListValue(this); } + /// Field number for the "values" field. public const int ValuesFieldNumber = 1; private static readonly pb::FieldCodec _repeated_values_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Value.Parser); private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); + /// + /// Repeated field of dynamically typed values. + /// public pbc::RepeatedField Values { get { return values_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs index 6b186b37..f372f8fd 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs @@ -41,6 +41,47 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// + /// A Timestamp represents a point in time independent of any time zone + /// or calendar, represented as seconds and fractions of seconds at + /// nanosecond resolution in UTC Epoch time. It is encoded using the + /// Proleptic Gregorian Calendar which extends the Gregorian calendar + /// backwards to year one. It is encoded assuming all minutes are 60 + /// seconds long, i.e. leap seconds are "smeared" so that no leap second + /// table is needed for interpretation. Range is from + /// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + /// By restricting to that range, we ensure that we can convert to + /// and from RFC 3339 date strings. + /// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + /// Example 1: Compute Timestamp from POSIX `time()`. + /// Timestamp timestamp; + /// timestamp.set_seconds(time(NULL)); + /// timestamp.set_nanos(0); + /// Example 2: Compute Timestamp from POSIX `gettimeofday()`. + /// struct timeval tv; + /// gettimeofday(&tv, NULL); + /// Timestamp timestamp; + /// timestamp.set_seconds(tv.tv_sec); + /// timestamp.set_nanos(tv.tv_usec * 1000); + /// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + /// FILETIME ft; + /// GetSystemTimeAsFileTime(&ft); + /// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + /// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + /// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + /// Timestamp timestamp; + /// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + /// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + /// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + /// long millis = System.currentTimeMillis(); + /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + /// .setNanos((int) ((millis % 1000) * 1000000)).build(); + /// Example 5: Compute Timestamp from current time in Python. + /// now = time.time() + /// seconds = int(now) + /// nanos = int((now - seconds) * 10**9) + /// timestamp = Timestamp(seconds=seconds, nanos=nanos) + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Timestamp : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Timestamp()); @@ -69,8 +110,14 @@ namespace Google.Protobuf.WellKnownTypes { return new Timestamp(this); } + /// Field number for the "seconds" field. public const int SecondsFieldNumber = 1; private long seconds_; + /// + /// Represents seconds of UTC time since Unix epoch + /// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to + /// 9999-12-31T23:59:59Z inclusive. + /// public long Seconds { get { return seconds_; } set { @@ -78,8 +125,15 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "nanos" field. public const int NanosFieldNumber = 2; private int nanos_; + /// + /// Non-negative fractions of a second at nanosecond resolution. Negative + /// second values with fractions must still have non-negative nanos values + /// that count forward in time. Must be from 0 to 999,999,999 + /// inclusive. + /// public int Nanos { get { return nanos_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs index 48039d66..3be90853 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs @@ -74,14 +74,26 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Enums + /// + /// Syntax specifies the syntax in which a service element was defined. + /// public enum Syntax { + /// + /// Syntax "proto2" + /// SYNTAX_PROTO2 = 0, + /// + /// Syntax "proto3" + /// SYNTAX_PROTO3 = 1, } #endregion #region Messages + /// + /// A light-weight descriptor for a proto message type. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Type : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Type()); @@ -114,8 +126,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Type(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + /// + /// The fully qualified message name. + /// public string Name { get { return name_; } set { @@ -123,32 +139,48 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "fields" field. public const int FieldsFieldNumber = 2; private static readonly pb::FieldCodec _repeated_fields_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser); private readonly pbc::RepeatedField fields_ = new pbc::RepeatedField(); + /// + /// The list of fields. + /// public pbc::RepeatedField Fields { get { return fields_; } } + /// Field number for the "oneofs" field. public const int OneofsFieldNumber = 3; private static readonly pb::FieldCodec _repeated_oneofs_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField oneofs_ = new pbc::RepeatedField(); + /// + /// The list of oneof definitions. + /// public pbc::RepeatedField Oneofs { get { return oneofs_; } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 4; private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + /// + /// The proto options. + /// public pbc::RepeatedField Options { get { return options_; } } + /// Field number for the "source_context" field. public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + /// + /// The source context. + /// public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -156,8 +188,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "syntax" field. public const int SyntaxFieldNumber = 6; private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// + /// The source syntax. + /// public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { get { return syntax_; } set { @@ -296,6 +332,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// + /// Field represents a single field of a message type. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Field : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Field()); @@ -331,8 +370,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Field(this); } + /// Field number for the "kind" field. public const int KindFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN; + /// + /// The field kind. + /// public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind { get { return kind_; } set { @@ -340,8 +383,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "cardinality" field. public const int CardinalityFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN; + /// + /// The field cardinality, i.e. optional/required/repeated. + /// public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality { get { return cardinality_; } set { @@ -349,8 +396,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "number" field. public const int NumberFieldNumber = 3; private int number_; + /// + /// The proto field number. + /// public int Number { get { return number_; } set { @@ -358,8 +409,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "name" field. public const int NameFieldNumber = 4; private string name_ = ""; + /// + /// The field name. + /// public string Name { get { return name_; } set { @@ -367,8 +422,13 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "type_url" field. public const int TypeUrlFieldNumber = 6; private string typeUrl_ = ""; + /// + /// The type URL (without the scheme) when the type is MESSAGE or ENUM, + /// such as `type.googleapis.com/google.protobuf.Empty`. + /// public string TypeUrl { get { return typeUrl_; } set { @@ -376,8 +436,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "oneof_index" field. public const int OneofIndexFieldNumber = 7; private int oneofIndex_; + /// + /// Index in Type.oneofs. Starts at 1. Zero means no oneof mapping. + /// public int OneofIndex { get { return oneofIndex_; } set { @@ -385,8 +449,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "packed" field. public const int PackedFieldNumber = 8; private bool packed_; + /// + /// Whether to use alternative packed wire representation. + /// public bool Packed { get { return packed_; } set { @@ -394,16 +462,24 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 9; private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + /// + /// The proto options. + /// public pbc::RepeatedField Options { get { return options_; } } + /// Field number for the "json_name" field. public const int JsonNameFieldNumber = 10; private string jsonName_ = ""; + /// + /// The JSON name for this field. + /// public string JsonName { get { return jsonName_; } set { @@ -600,32 +676,108 @@ namespace Google.Protobuf.WellKnownTypes { /// Container for nested types declared in the Field message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// + /// Kind represents a basic field type. + /// public enum Kind { + /// + /// Field type unknown. + /// TYPE_UNKNOWN = 0, + /// + /// Field type double. + /// TYPE_DOUBLE = 1, + /// + /// Field type float. + /// TYPE_FLOAT = 2, + /// + /// Field type int64. + /// TYPE_INT64 = 3, + /// + /// Field type uint64. + /// TYPE_UINT64 = 4, + /// + /// Field type int32. + /// TYPE_INT32 = 5, + /// + /// Field type fixed64. + /// TYPE_FIXED64 = 6, + /// + /// Field type fixed32. + /// TYPE_FIXED32 = 7, + /// + /// Field type bool. + /// TYPE_BOOL = 8, + /// + /// Field type string. + /// TYPE_STRING = 9, + /// + /// Field type group (deprecated proto2 type) + /// TYPE_GROUP = 10, + /// + /// Field type message. + /// TYPE_MESSAGE = 11, + /// + /// Field type bytes. + /// TYPE_BYTES = 12, + /// + /// Field type uint32. + /// TYPE_UINT32 = 13, + /// + /// Field type enum. + /// TYPE_ENUM = 14, + /// + /// Field type sfixed32. + /// TYPE_SFIXED32 = 15, + /// + /// Field type sfixed64. + /// TYPE_SFIXED64 = 16, + /// + /// Field type sint32. + /// TYPE_SINT32 = 17, + /// + /// Field type sint64. + /// TYPE_SINT64 = 18, } + /// + /// Cardinality represents whether a field is optional, required, or + /// repeated. + /// public enum Cardinality { + /// + /// The field cardinality is unknown. Typically an error condition. + /// CARDINALITY_UNKNOWN = 0, + /// + /// For optional fields. + /// CARDINALITY_OPTIONAL = 1, + /// + /// For required fields. Not used for proto3. + /// CARDINALITY_REQUIRED = 2, + /// + /// For repeated fields. + /// CARDINALITY_REPEATED = 3, } @@ -634,6 +786,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// + /// Enum type definition. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Enum : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Enum()); @@ -665,8 +820,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Enum(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + /// + /// Enum type name. + /// public string Name { get { return name_; } set { @@ -674,24 +833,36 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "enumvalue" field. public const int EnumvalueFieldNumber = 2; private static readonly pb::FieldCodec _repeated_enumvalue_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser); private readonly pbc::RepeatedField enumvalue_ = new pbc::RepeatedField(); + /// + /// Enum value definitions. + /// public pbc::RepeatedField Enumvalue { get { return enumvalue_; } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 3; private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + /// + /// Proto options for the enum type. + /// public pbc::RepeatedField Options { get { return options_; } } + /// Field number for the "source_context" field. public const int SourceContextFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + /// + /// The source context. + /// public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -699,8 +870,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "syntax" field. public const int SyntaxFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// + /// The source syntax. + /// public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { get { return syntax_; } set { @@ -830,6 +1005,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// + /// Enum value definition. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class EnumValue : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValue()); @@ -859,8 +1037,12 @@ namespace Google.Protobuf.WellKnownTypes { return new EnumValue(this); } + /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + /// + /// Enum value name. + /// public string Name { get { return name_; } set { @@ -868,8 +1050,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "number" field. public const int NumberFieldNumber = 2; private int number_; + /// + /// Enum value number. + /// public int Number { get { return number_; } set { @@ -877,10 +1063,14 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// Field number for the "options" field. public const int OptionsFieldNumber = 3; private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + /// + /// Proto options for the enum value. + /// public pbc::RepeatedField Options { get { return options_; } } @@ -976,6 +1166,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// + /// Proto option attached to messages/fields/enums etc. + /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Option : pb::IMessage