diff options
Diffstat (limited to 'csharp/src/Google.Protobuf/WellKnownTypes/Type.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/WellKnownTypes/Type.cs | 364 |
1 files changed, 329 insertions, 35 deletions
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs index ff2ecc57..3be90853 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/type.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Type { #region Descriptor + /// <summary>File descriptor for google/protobuf/type.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,43 +25,46 @@ namespace Google.Protobuf.WellKnownTypes { static Type() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVm", - "Ghlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvGiRnb29nbGUvcHJvdG9idWYv", - "c291cmNlX2NvbnRleHQucHJvdG8irgEKBFR5cGUSDAoEbmFtZRgBIAEoCRIm", - "CgZmaWVsZHMYAiADKAsyFi5nb29nbGUucHJvdG9idWYuRmllbGQSDgoGb25l", - "b2ZzGAMgAygJEigKB29wdGlvbnMYBCADKAsyFy5nb29nbGUucHJvdG9idWYu", - "T3B0aW9uEjYKDnNvdXJjZV9jb250ZXh0GAUgASgLMh4uZ29vZ2xlLnByb3Rv", - "YnVmLlNvdXJjZUNvbnRleHQimwUKBUZpZWxkEikKBGtpbmQYASABKA4yGy5n", - "b29nbGUucHJvdG9idWYuRmllbGQuS2luZBI3CgtjYXJkaW5hbGl0eRgCIAEo", - "DjIiLmdvb2dsZS5wcm90b2J1Zi5GaWVsZC5DYXJka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IMCgRuYW1lGAEgASgJEg4KBm51bWJlchgCIAEoBRIo", - "CgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbiI7CgZP", - "cHRpb24SDAoEbmFtZRgBIAEoCRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5w", - "cm90b2J1Zi5BbnlCSQoTY29tLmdvb2dsZS5wcm90b2J1ZkIJVHlwZVByb3Rv", - "UAGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", - "b3RvMw==")); + "Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVm", + "Ghlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvGiRnb29nbGUvcHJvdG9idWYv", + "c291cmNlX2NvbnRleHQucHJvdG8i1wEKBFR5cGUSDAoEbmFtZRgBIAEoCRIm", + "CgZmaWVsZHMYAiADKAsyFi5nb29nbGUucHJvdG9idWYuRmllbGQSDgoGb25l", + "b2ZzGAMgAygJEigKB29wdGlvbnMYBCADKAsyFy5nb29nbGUucHJvdG9idWYu", + "T3B0aW9uEjYKDnNvdXJjZV9jb250ZXh0GAUgASgLMh4uZ29vZ2xlLnByb3Rv", + "YnVmLlNvdXJjZUNvbnRleHQSJwoGc3ludGF4GAYgASgOMhcuZ29vZ2xlLnBy", + "b3RvYnVmLlN5bnRheCK+BQoFRmllbGQSKQoEa2luZBgBIAEoDjIbLmdvb2ds", + "ZS5wcm90b2J1Zi5GaWVsZC5LaW5kEjcKC2NhcmRpbmFsaXR5GAIgASgOMiIu", + "Z29vZ2xlLnByb3RvYnVmLkZpZWxkLkNhcmRpbmFsaXR5Eg4KBm51bWJlchgD", + "IAEoBRIMCgRuYW1lGAQgASgJEhAKCHR5cGVfdXJsGAYgASgJEhMKC29uZW9m", + "X2luZGV4GAcgASgFEg4KBnBhY2tlZBgIIAEoCBIoCgdvcHRpb25zGAkgAygL", + "MhcuZ29v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LnByb3RvYnVmLk9wdGlvbiI7CgZPcHRpb24SDAoEbmFtZRgBIAEo", + "CRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnkqLgoGU3lu", + "dGF4EhEKDVNZTlRBWF9QUk9UTzIQABIRCg1TWU5UQVhfUFJPVE8zEAFCTAoT", + "Y29tLmdvb2dsZS5wcm90b2J1ZkIJVHlwZVByb3RvUAGgAQGiAgNHUEKqAh5H", + "b29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, }, - new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null), - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), new[]{ "Name", "Enumvalue", "Options", "SourceContext" }, null, null, null), + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext", "Syntax" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options", "JsonName" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), new[]{ "Name", "Enumvalue", "Options", "SourceContext", "Syntax" }, null, null, null), new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), new[]{ "Name", "Number", "Options" }, null, null, null), new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Option), new[]{ "Name", "Value" }, null, null, null) })); @@ -68,7 +73,27 @@ namespace Google.Protobuf.WellKnownTypes { } } + #region Enums + /// <summary> + /// Syntax specifies the syntax in which a service element was defined. + /// </summary> + public enum Syntax { + /// <summary> + /// Syntax "proto2" + /// </summary> + SYNTAX_PROTO2 = 0, + /// <summary> + /// Syntax "proto3" + /// </summary> + SYNTAX_PROTO3 = 1, + } + + #endregion + #region Messages + /// <summary> + /// A light-weight descriptor for a proto message type. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Type : pb::IMessage<Type> { private static readonly pb::MessageParser<Type> _parser = new pb::MessageParser<Type>(() => new Type()); @@ -94,14 +119,19 @@ namespace Google.Protobuf.WellKnownTypes { oneofs_ = other.oneofs_.Clone(); options_ = other.options_.Clone(); SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; + syntax_ = other.syntax_; } public Type Clone() { return new Type(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// The fully qualified message name. + /// </summary> public string Name { get { return name_; } set { @@ -109,32 +139,48 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "fields" field.</summary> public const int FieldsFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Field> _repeated_fields_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> fields_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field>(); + /// <summary> + /// The list of fields. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> Fields { get { return fields_; } } + /// <summary>Field number for the "oneofs" field.</summary> public const int OneofsFieldNumber = 3; private static readonly pb::FieldCodec<string> _repeated_oneofs_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField<string> oneofs_ = new pbc::RepeatedField<string>(); + /// <summary> + /// The list of oneof definitions. + /// </summary> public pbc::RepeatedField<string> Oneofs { get { return oneofs_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 4; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// The proto options. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } + /// <summary>Field number for the "source_context" field.</summary> public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + /// <summary> + /// The source context. + /// </summary> public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -142,6 +188,19 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "syntax" field.</summary> + public const int SyntaxFieldNumber = 6; + private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// <summary> + /// The source syntax. + /// </summary> + public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { + get { return syntax_; } + set { + syntax_ = value; + } + } + public override bool Equals(object other) { return Equals(other as Type); } @@ -158,6 +217,7 @@ namespace Google.Protobuf.WellKnownTypes { if(!oneofs_.Equals(other.oneofs_)) return false; if(!options_.Equals(other.options_)) return false; if (!object.Equals(SourceContext, other.SourceContext)) return false; + if (Syntax != other.Syntax) return false; return true; } @@ -168,6 +228,7 @@ namespace Google.Protobuf.WellKnownTypes { hash ^= oneofs_.GetHashCode(); hash ^= options_.GetHashCode(); if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode(); return hash; } @@ -187,6 +248,10 @@ namespace Google.Protobuf.WellKnownTypes { output.WriteRawTag(42); output.WriteMessage(SourceContext); } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + output.WriteRawTag(48); + output.WriteEnum((int) Syntax); + } } public int CalculateSize() { @@ -200,6 +265,9 @@ namespace Google.Protobuf.WellKnownTypes { if (sourceContext_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); + } return size; } @@ -219,6 +287,9 @@ namespace Google.Protobuf.WellKnownTypes { } SourceContext.MergeFrom(other.SourceContext); } + if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + Syntax = other.Syntax; + } } public void MergeFrom(pb::CodedInputStream input) { @@ -251,12 +322,19 @@ namespace Google.Protobuf.WellKnownTypes { input.ReadMessage(sourceContext_); break; } + case 48: { + syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } } } } } + /// <summary> + /// Field represents a single field of a message type. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Field : pb::IMessage<Field> { private static readonly pb::MessageParser<Field> _parser = new pb::MessageParser<Field>(() => new Field()); @@ -285,14 +363,19 @@ namespace Google.Protobuf.WellKnownTypes { oneofIndex_ = other.oneofIndex_; packed_ = other.packed_; options_ = other.options_.Clone(); + jsonName_ = other.jsonName_; } public Field Clone() { return new Field(this); } + /// <summary>Field number for the "kind" field.</summary> public const int KindFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN; + /// <summary> + /// The field kind. + /// </summary> public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind { get { return kind_; } set { @@ -300,8 +383,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "cardinality" field.</summary> public const int CardinalityFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN; + /// <summary> + /// The field cardinality, i.e. optional/required/repeated. + /// </summary> public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality { get { return cardinality_; } set { @@ -309,8 +396,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "number" field.</summary> public const int NumberFieldNumber = 3; private int number_; + /// <summary> + /// The proto field number. + /// </summary> public int Number { get { return number_; } set { @@ -318,8 +409,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 4; private string name_ = ""; + /// <summary> + /// The field name. + /// </summary> public string Name { get { return name_; } set { @@ -327,8 +422,13 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "type_url" field.</summary> public const int TypeUrlFieldNumber = 6; private string typeUrl_ = ""; + /// <summary> + /// The type URL (without the scheme) when the type is MESSAGE or ENUM, + /// such as `type.googleapis.com/google.protobuf.Empty`. + /// </summary> public string TypeUrl { get { return typeUrl_; } set { @@ -336,8 +436,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "oneof_index" field.</summary> public const int OneofIndexFieldNumber = 7; private int oneofIndex_; + /// <summary> + /// Index in Type.oneofs. Starts at 1. Zero means no oneof mapping. + /// </summary> public int OneofIndex { get { return oneofIndex_; } set { @@ -345,8 +449,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "packed" field.</summary> public const int PackedFieldNumber = 8; private bool packed_; + /// <summary> + /// Whether to use alternative packed wire representation. + /// </summary> public bool Packed { get { return packed_; } set { @@ -354,14 +462,31 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 9; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// The proto options. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } + /// <summary>Field number for the "json_name" field.</summary> + public const int JsonNameFieldNumber = 10; + private string jsonName_ = ""; + /// <summary> + /// The JSON name for this field. + /// </summary> + public string JsonName { + get { return jsonName_; } + set { + jsonName_ = pb::Preconditions.CheckNotNull(value, "value"); + } + } + public override bool Equals(object other) { return Equals(other as Field); } @@ -381,6 +506,7 @@ namespace Google.Protobuf.WellKnownTypes { if (OneofIndex != other.OneofIndex) return false; if (Packed != other.Packed) return false; if(!options_.Equals(other.options_)) return false; + if (JsonName != other.JsonName) return false; return true; } @@ -394,6 +520,7 @@ namespace Google.Protobuf.WellKnownTypes { if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode(); if (Packed != false) hash ^= Packed.GetHashCode(); hash ^= options_.GetHashCode(); + if (JsonName.Length != 0) hash ^= JsonName.GetHashCode(); return hash; } @@ -431,6 +558,10 @@ namespace Google.Protobuf.WellKnownTypes { output.WriteBool(Packed); } options_.WriteTo(output, _repeated_options_codec); + if (JsonName.Length != 0) { + output.WriteRawTag(82); + output.WriteString(JsonName); + } } public int CalculateSize() { @@ -457,6 +588,9 @@ namespace Google.Protobuf.WellKnownTypes { size += 1 + 1; } size += options_.CalculateSize(_repeated_options_codec); + if (JsonName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName); + } return size; } @@ -486,6 +620,9 @@ namespace Google.Protobuf.WellKnownTypes { Packed = other.Packed; } options_.Add(other.options_); + if (other.JsonName.Length != 0) { + JsonName = other.JsonName; + } } public void MergeFrom(pb::CodedInputStream input) { @@ -527,38 +664,120 @@ namespace Google.Protobuf.WellKnownTypes { options_.AddEntriesFrom(input, _repeated_options_codec); break; } + case 82: { + JsonName = input.ReadString(); + break; + } } } } #region Nested types + /// <summary>Container for nested types declared in the Field message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// <summary> + /// Kind represents a basic field type. + /// </summary> public enum Kind { + /// <summary> + /// Field type unknown. + /// </summary> TYPE_UNKNOWN = 0, + /// <summary> + /// Field type double. + /// </summary> TYPE_DOUBLE = 1, + /// <summary> + /// Field type float. + /// </summary> TYPE_FLOAT = 2, + /// <summary> + /// Field type int64. + /// </summary> TYPE_INT64 = 3, + /// <summary> + /// Field type uint64. + /// </summary> TYPE_UINT64 = 4, + /// <summary> + /// Field type int32. + /// </summary> TYPE_INT32 = 5, + /// <summary> + /// Field type fixed64. + /// </summary> TYPE_FIXED64 = 6, + /// <summary> + /// Field type fixed32. + /// </summary> TYPE_FIXED32 = 7, + /// <summary> + /// Field type bool. + /// </summary> TYPE_BOOL = 8, + /// <summary> + /// Field type string. + /// </summary> TYPE_STRING = 9, + /// <summary> + /// Field type group (deprecated proto2 type) + /// </summary> + TYPE_GROUP = 10, + /// <summary> + /// Field type message. + /// </summary> TYPE_MESSAGE = 11, + /// <summary> + /// Field type bytes. + /// </summary> TYPE_BYTES = 12, + /// <summary> + /// Field type uint32. + /// </summary> TYPE_UINT32 = 13, + /// <summary> + /// Field type enum. + /// </summary> TYPE_ENUM = 14, + /// <summary> + /// Field type sfixed32. + /// </summary> TYPE_SFIXED32 = 15, + /// <summary> + /// Field type sfixed64. + /// </summary> TYPE_SFIXED64 = 16, + /// <summary> + /// Field type sint32. + /// </summary> TYPE_SINT32 = 17, + /// <summary> + /// Field type sint64. + /// </summary> TYPE_SINT64 = 18, } + /// <summary> + /// Cardinality represents whether a field is optional, required, or + /// repeated. + /// </summary> public enum Cardinality { + /// <summary> + /// The field cardinality is unknown. Typically an error condition. + /// </summary> CARDINALITY_UNKNOWN = 0, + /// <summary> + /// For optional fields. + /// </summary> CARDINALITY_OPTIONAL = 1, + /// <summary> + /// For required fields. Not used for proto3. + /// </summary> CARDINALITY_REQUIRED = 2, + /// <summary> + /// For repeated fields. + /// </summary> CARDINALITY_REPEATED = 3, } @@ -567,6 +786,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Enum type definition. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Enum : pb::IMessage<Enum> { private static readonly pb::MessageParser<Enum> _parser = new pb::MessageParser<Enum>(() => new Enum()); @@ -591,14 +813,19 @@ namespace Google.Protobuf.WellKnownTypes { enumvalue_ = other.enumvalue_.Clone(); options_ = other.options_.Clone(); SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; + syntax_ = other.syntax_; } public Enum Clone() { return new Enum(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// Enum type name. + /// </summary> public string Name { get { return name_; } set { @@ -606,24 +833,36 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "enumvalue" field.</summary> public const int EnumvalueFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.EnumValue> _repeated_enumvalue_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> enumvalue_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue>(); + /// <summary> + /// Enum value definitions. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> Enumvalue { get { return enumvalue_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 3; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// Proto options for the enum type. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } + /// <summary>Field number for the "source_context" field.</summary> public const int SourceContextFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + /// <summary> + /// The source context. + /// </summary> public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -631,6 +870,19 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "syntax" field.</summary> + public const int SyntaxFieldNumber = 5; + private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// <summary> + /// The source syntax. + /// </summary> + public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { + get { return syntax_; } + set { + syntax_ = value; + } + } + public override bool Equals(object other) { return Equals(other as Enum); } @@ -646,6 +898,7 @@ namespace Google.Protobuf.WellKnownTypes { if(!enumvalue_.Equals(other.enumvalue_)) return false; if(!options_.Equals(other.options_)) return false; if (!object.Equals(SourceContext, other.SourceContext)) return false; + if (Syntax != other.Syntax) return false; return true; } @@ -655,6 +908,7 @@ namespace Google.Protobuf.WellKnownTypes { hash ^= enumvalue_.GetHashCode(); hash ^= options_.GetHashCode(); if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode(); return hash; } @@ -673,6 +927,10 @@ namespace Google.Protobuf.WellKnownTypes { output.WriteRawTag(34); output.WriteMessage(SourceContext); } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + output.WriteRawTag(40); + output.WriteEnum((int) Syntax); + } } public int CalculateSize() { @@ -685,6 +943,9 @@ namespace Google.Protobuf.WellKnownTypes { if (sourceContext_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); + } return size; } @@ -703,6 +964,9 @@ namespace Google.Protobuf.WellKnownTypes { } SourceContext.MergeFrom(other.SourceContext); } + if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + Syntax = other.Syntax; + } } public void MergeFrom(pb::CodedInputStream input) { @@ -731,12 +995,19 @@ namespace Google.Protobuf.WellKnownTypes { input.ReadMessage(sourceContext_); break; } + case 40: { + syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } } } } } + /// <summary> + /// Enum value definition. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class EnumValue : pb::IMessage<EnumValue> { private static readonly pb::MessageParser<EnumValue> _parser = new pb::MessageParser<EnumValue>(() => new EnumValue()); @@ -766,8 +1037,12 @@ namespace Google.Protobuf.WellKnownTypes { return new EnumValue(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// Enum value name. + /// </summary> public string Name { get { return name_; } set { @@ -775,8 +1050,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "number" field.</summary> public const int NumberFieldNumber = 2; private int number_; + /// <summary> + /// Enum value number. + /// </summary> public int Number { get { return number_; } set { @@ -784,10 +1063,14 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 3; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// Proto options for the enum value. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } @@ -883,6 +1166,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Proto option attached to messages/fields/enums etc. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Option : pb::IMessage<Option> { private static readonly pb::MessageParser<Option> _parser = new pb::MessageParser<Option>(() => new Option()); @@ -911,8 +1197,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Option(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// Proto option name. + /// </summary> public string Name { get { return name_; } set { @@ -920,8 +1210,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Any value_; + /// <summary> + /// Proto option value. + /// </summary> public global::Google.Protobuf.WellKnownTypes.Any Value { get { return value_; } set { |