aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/Google.Protobuf/WellKnownTypes/Type.cs')
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Type.cs423
1 files changed, 291 insertions, 132 deletions
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
index 8faa1d1c..3e2fe541 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
@@ -1,5 +1,7 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: google/protobuf/type.proto
+// <auto-generated>
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/protobuf/type.proto
+// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
@@ -10,7 +12,6 @@ using scg = global::System.Collections.Generic;
namespace Google.Protobuf.WellKnownTypes {
/// <summary>Holder for reflection information generated from google/protobuf/type.proto</summary>
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class TypeReflection {
#region Descriptor
@@ -55,9 +56,10 @@ namespace Google.Protobuf.WellKnownTypes {
"ASgFEigKB29wdGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9u",
"IjsKBk9wdGlvbhIMCgRuYW1lGAEgASgJEiMKBXZhbHVlGAIgASgLMhQuZ29v",
"Z2xlLnByb3RvYnVmLkFueSouCgZTeW50YXgSEQoNU1lOVEFYX1BST1RPMhAA",
- "EhEKDVNZTlRBWF9QUk9UTzMQAUJMChNjb20uZ29vZ2xlLnByb3RvYnVmQglU",
- "eXBlUHJvdG9QAaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25v",
- "d25UeXBlc2IGcHJvdG8z"));
+ "EhEKDVNZTlRBWF9QUk9UTzMQAUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQglU",
+ "eXBlUHJvdG9QAVovZ29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vcHJvdG9i",
+ "dWYvcHR5cGU7cHR5cGX4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2Vs",
+ "bEtub3duVHlwZXNiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.SourceContextReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, new pbr::GeneratedClrTypeInfo[] {
@@ -73,53 +75,60 @@ namespace Google.Protobuf.WellKnownTypes {
}
#region Enums
/// <summary>
- /// The syntax in which a protocol buffer element is defined.
+ /// The syntax in which a protocol buffer element is defined.
/// </summary>
public enum Syntax {
/// <summary>
- /// Syntax `proto2`.
+ /// Syntax `proto2`.
/// </summary>
- SYNTAX_PROTO2 = 0,
+ [pbr::OriginalName("SYNTAX_PROTO2")] Proto2 = 0,
/// <summary>
- /// Syntax `proto3`.
+ /// Syntax `proto3`.
/// </summary>
- SYNTAX_PROTO3 = 1,
+ [pbr::OriginalName("SYNTAX_PROTO3")] Proto3 = 1,
}
#endregion
#region Messages
/// <summary>
- /// A protocol buffer message type.
+ /// A protocol buffer 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());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Type> Parser { get { return _parser; } }
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[0]; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Type() {
OnConstruction();
}
partial void OnConstruction();
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Type(Type other) : this() {
name_ = other.name_;
fields_ = other.fields_.Clone();
oneofs_ = other.oneofs_.Clone();
options_ = other.options_.Clone();
- SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
+ sourceContext_ = other.sourceContext_ != null ? other.sourceContext_.Clone() : null;
syntax_ = other.syntax_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Type Clone() {
return new Type(this);
}
@@ -128,8 +137,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
- /// The fully qualified message name.
+ /// The fully qualified message name.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
@@ -143,8 +153,9 @@ namespace Google.Protobuf.WellKnownTypes {
= 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.
+ /// The list of fields.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> Fields {
get { return fields_; }
}
@@ -155,8 +166,9 @@ namespace Google.Protobuf.WellKnownTypes {
= pb::FieldCodec.ForString(26);
private readonly pbc::RepeatedField<string> oneofs_ = new pbc::RepeatedField<string>();
/// <summary>
- /// The list of types appearing in `oneof` definitions in this type.
+ /// The list of types appearing in `oneof` definitions in this type.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Oneofs {
get { return oneofs_; }
}
@@ -167,8 +179,9 @@ namespace Google.Protobuf.WellKnownTypes {
= 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 protocol buffer options.
+ /// The protocol buffer options.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
@@ -177,8 +190,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int SourceContextFieldNumber = 5;
private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
/// <summary>
- /// The source context.
+ /// The source context.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
get { return sourceContext_; }
set {
@@ -188,10 +202,11 @@ 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;
+ private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = 0;
/// <summary>
- /// The source syntax.
+ /// The source syntax.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
get { return syntax_; }
set {
@@ -199,10 +214,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Type);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Type other) {
if (ReferenceEquals(other, null)) {
return false;
@@ -216,9 +233,10 @@ namespace Google.Protobuf.WellKnownTypes {
if(!options_.Equals(other.options_)) return false;
if (!object.Equals(SourceContext, other.SourceContext)) return false;
if (Syntax != other.Syntax) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
@@ -226,14 +244,19 @@ 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();
+ if (Syntax != 0) hash ^= Syntax.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
@@ -246,12 +269,16 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteRawTag(42);
output.WriteMessage(SourceContext);
}
- if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
+ if (Syntax != 0) {
output.WriteRawTag(48);
output.WriteEnum((int) Syntax);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
@@ -263,12 +290,16 @@ namespace Google.Protobuf.WellKnownTypes {
if (sourceContext_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
}
- if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
+ if (Syntax != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Type other) {
if (other == null) {
return;
@@ -285,17 +316,19 @@ namespace Google.Protobuf.WellKnownTypes {
}
SourceContext.MergeFrom(other.SourceContext);
}
- if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
+ if (other.Syntax != 0) {
Syntax = other.Syntax;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();
@@ -331,27 +364,32 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
- /// A single field of a message type.
+ /// 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());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Field> Parser { get { return _parser; } }
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[1]; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Field() {
OnConstruction();
}
partial void OnConstruction();
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Field(Field other) : this() {
kind_ = other.kind_;
cardinality_ = other.cardinality_;
@@ -363,18 +401,21 @@ namespace Google.Protobuf.WellKnownTypes {
options_ = other.options_.Clone();
jsonName_ = other.jsonName_;
defaultValue_ = other.defaultValue_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
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;
+ private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = 0;
/// <summary>
- /// The field type.
+ /// The field type.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind {
get { return kind_; }
set {
@@ -384,10 +425,11 @@ 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;
+ private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = 0;
/// <summary>
- /// The field cardinality.
+ /// The field cardinality.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality {
get { return cardinality_; }
set {
@@ -399,8 +441,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int NumberFieldNumber = 3;
private int number_;
/// <summary>
- /// The field number.
+ /// The field number.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Number {
get { return number_; }
set {
@@ -412,8 +455,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int NameFieldNumber = 4;
private string name_ = "";
/// <summary>
- /// The field name.
+ /// The field name.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
@@ -425,9 +469,10 @@ namespace Google.Protobuf.WellKnownTypes {
public const int TypeUrlFieldNumber = 6;
private string typeUrl_ = "";
/// <summary>
- /// The field type URL, without the scheme, for message or enumeration
- /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
+ /// The field type URL, without the scheme, for message or enumeration
+ /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string TypeUrl {
get { return typeUrl_; }
set {
@@ -439,9 +484,10 @@ namespace Google.Protobuf.WellKnownTypes {
public const int OneofIndexFieldNumber = 7;
private int oneofIndex_;
/// <summary>
- /// The index of the field type in `Type.oneofs`, for message or enumeration
- /// types. The first type has index 1; zero means the type is not in the list.
+ /// The index of the field type in `Type.oneofs`, for message or enumeration
+ /// types. The first type has index 1; zero means the type is not in the list.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int OneofIndex {
get { return oneofIndex_; }
set {
@@ -453,8 +499,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int PackedFieldNumber = 8;
private bool packed_;
/// <summary>
- /// Whether to use alternative packed wire representation.
+ /// Whether to use alternative packed wire representation.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Packed {
get { return packed_; }
set {
@@ -468,8 +515,9 @@ namespace Google.Protobuf.WellKnownTypes {
= 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 protocol buffer options.
+ /// The protocol buffer options.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
@@ -478,8 +526,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int JsonNameFieldNumber = 10;
private string jsonName_ = "";
/// <summary>
- /// The field JSON name.
+ /// The field JSON name.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string JsonName {
get { return jsonName_; }
set {
@@ -491,8 +540,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int DefaultValueFieldNumber = 11;
private string defaultValue_ = "";
/// <summary>
- /// The string value of the default value of this field. Proto2 syntax only.
+ /// The string value of the default value of this field. Proto2 syntax only.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DefaultValue {
get { return defaultValue_; }
set {
@@ -500,10 +550,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Field);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Field other) {
if (ReferenceEquals(other, null)) {
return false;
@@ -521,13 +573,14 @@ namespace Google.Protobuf.WellKnownTypes {
if(!options_.Equals(other.options_)) return false;
if (JsonName != other.JsonName) return false;
if (DefaultValue != other.DefaultValue) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
- if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) hash ^= Kind.GetHashCode();
- if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) hash ^= Cardinality.GetHashCode();
+ if (Kind != 0) hash ^= Kind.GetHashCode();
+ if (Cardinality != 0) hash ^= Cardinality.GetHashCode();
if (Number != 0) hash ^= Number.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (TypeUrl.Length != 0) hash ^= TypeUrl.GetHashCode();
@@ -536,19 +589,24 @@ namespace Google.Protobuf.WellKnownTypes {
hash ^= options_.GetHashCode();
if (JsonName.Length != 0) hash ^= JsonName.GetHashCode();
if (DefaultValue.Length != 0) hash ^= DefaultValue.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
- if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
+ if (Kind != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) Kind);
}
- if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
+ if (Cardinality != 0) {
output.WriteRawTag(16);
output.WriteEnum((int) Cardinality);
}
@@ -581,14 +639,18 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteRawTag(90);
output.WriteString(DefaultValue);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
- if (Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
+ if (Kind != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Kind);
}
- if (Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
+ if (Cardinality != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Cardinality);
}
if (Number != 0) {
@@ -613,17 +675,21 @@ namespace Google.Protobuf.WellKnownTypes {
if (DefaultValue.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DefaultValue);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Field other) {
if (other == null) {
return;
}
- if (other.Kind != global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN) {
+ if (other.Kind != 0) {
Kind = other.Kind;
}
- if (other.Cardinality != global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN) {
+ if (other.Cardinality != 0) {
Cardinality = other.Cardinality;
}
if (other.Number != 0) {
@@ -648,14 +714,16 @@ namespace Google.Protobuf.WellKnownTypes {
if (other.DefaultValue.Length != 0) {
DefaultValue = other.DefaultValue;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
kind_ = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum();
@@ -703,110 +771,110 @@ namespace Google.Protobuf.WellKnownTypes {
#region Nested types
/// <summary>Container for nested types declared in the Field message type.</summary>
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
- /// Basic field types.
+ /// Basic field types.
/// </summary>
public enum Kind {
/// <summary>
- /// Field type unknown.
+ /// Field type unknown.
/// </summary>
- TYPE_UNKNOWN = 0,
+ [pbr::OriginalName("TYPE_UNKNOWN")] TypeUnknown = 0,
/// <summary>
- /// Field type double.
+ /// Field type double.
/// </summary>
- TYPE_DOUBLE = 1,
+ [pbr::OriginalName("TYPE_DOUBLE")] TypeDouble = 1,
/// <summary>
- /// Field type float.
+ /// Field type float.
/// </summary>
- TYPE_FLOAT = 2,
+ [pbr::OriginalName("TYPE_FLOAT")] TypeFloat = 2,
/// <summary>
- /// Field type int64.
+ /// Field type int64.
/// </summary>
- TYPE_INT64 = 3,
+ [pbr::OriginalName("TYPE_INT64")] TypeInt64 = 3,
/// <summary>
- /// Field type uint64.
+ /// Field type uint64.
/// </summary>
- TYPE_UINT64 = 4,
+ [pbr::OriginalName("TYPE_UINT64")] TypeUint64 = 4,
/// <summary>
- /// Field type int32.
+ /// Field type int32.
/// </summary>
- TYPE_INT32 = 5,
+ [pbr::OriginalName("TYPE_INT32")] TypeInt32 = 5,
/// <summary>
- /// Field type fixed64.
+ /// Field type fixed64.
/// </summary>
- TYPE_FIXED64 = 6,
+ [pbr::OriginalName("TYPE_FIXED64")] TypeFixed64 = 6,
/// <summary>
- /// Field type fixed32.
+ /// Field type fixed32.
/// </summary>
- TYPE_FIXED32 = 7,
+ [pbr::OriginalName("TYPE_FIXED32")] TypeFixed32 = 7,
/// <summary>
- /// Field type bool.
+ /// Field type bool.
/// </summary>
- TYPE_BOOL = 8,
+ [pbr::OriginalName("TYPE_BOOL")] TypeBool = 8,
/// <summary>
- /// Field type string.
+ /// Field type string.
/// </summary>
- TYPE_STRING = 9,
+ [pbr::OriginalName("TYPE_STRING")] TypeString = 9,
/// <summary>
- /// Field type group. Proto2 syntax only, and deprecated.
+ /// Field type group. Proto2 syntax only, and deprecated.
/// </summary>
- TYPE_GROUP = 10,
+ [pbr::OriginalName("TYPE_GROUP")] TypeGroup = 10,
/// <summary>
- /// Field type message.
+ /// Field type message.
/// </summary>
- TYPE_MESSAGE = 11,
+ [pbr::OriginalName("TYPE_MESSAGE")] TypeMessage = 11,
/// <summary>
- /// Field type bytes.
+ /// Field type bytes.
/// </summary>
- TYPE_BYTES = 12,
+ [pbr::OriginalName("TYPE_BYTES")] TypeBytes = 12,
/// <summary>
- /// Field type uint32.
+ /// Field type uint32.
/// </summary>
- TYPE_UINT32 = 13,
+ [pbr::OriginalName("TYPE_UINT32")] TypeUint32 = 13,
/// <summary>
- /// Field type enum.
+ /// Field type enum.
/// </summary>
- TYPE_ENUM = 14,
+ [pbr::OriginalName("TYPE_ENUM")] TypeEnum = 14,
/// <summary>
- /// Field type sfixed32.
+ /// Field type sfixed32.
/// </summary>
- TYPE_SFIXED32 = 15,
+ [pbr::OriginalName("TYPE_SFIXED32")] TypeSfixed32 = 15,
/// <summary>
- /// Field type sfixed64.
+ /// Field type sfixed64.
/// </summary>
- TYPE_SFIXED64 = 16,
+ [pbr::OriginalName("TYPE_SFIXED64")] TypeSfixed64 = 16,
/// <summary>
- /// Field type sint32.
+ /// Field type sint32.
/// </summary>
- TYPE_SINT32 = 17,
+ [pbr::OriginalName("TYPE_SINT32")] TypeSint32 = 17,
/// <summary>
- /// Field type sint64.
+ /// Field type sint64.
/// </summary>
- TYPE_SINT64 = 18,
+ [pbr::OriginalName("TYPE_SINT64")] TypeSint64 = 18,
}
/// <summary>
- /// Whether a field is optional, required, or repeated.
+ /// Whether a field is optional, required, or repeated.
/// </summary>
public enum Cardinality {
/// <summary>
- /// For fields with unknown cardinality.
+ /// For fields with unknown cardinality.
/// </summary>
- CARDINALITY_UNKNOWN = 0,
+ [pbr::OriginalName("CARDINALITY_UNKNOWN")] Unknown = 0,
/// <summary>
- /// For optional fields.
+ /// For optional fields.
/// </summary>
- CARDINALITY_OPTIONAL = 1,
+ [pbr::OriginalName("CARDINALITY_OPTIONAL")] Optional = 1,
/// <summary>
- /// For required fields. Proto2 syntax only.
+ /// For required fields. Proto2 syntax only.
/// </summary>
- CARDINALITY_REQUIRED = 2,
+ [pbr::OriginalName("CARDINALITY_REQUIRED")] Required = 2,
/// <summary>
- /// For repeated fields.
+ /// For repeated fields.
/// </summary>
- CARDINALITY_REPEATED = 3,
+ [pbr::OriginalName("CARDINALITY_REPEATED")] Repeated = 3,
}
}
@@ -815,35 +883,42 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
- /// Enum type definition.
+ /// 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());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Enum> Parser { get { return _parser; } }
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[2]; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Enum() {
OnConstruction();
}
partial void OnConstruction();
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Enum(Enum other) : this() {
name_ = other.name_;
enumvalue_ = other.enumvalue_.Clone();
options_ = other.options_.Clone();
- SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null;
+ sourceContext_ = other.sourceContext_ != null ? other.sourceContext_.Clone() : null;
syntax_ = other.syntax_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Enum Clone() {
return new Enum(this);
}
@@ -852,8 +927,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
- /// Enum type name.
+ /// Enum type name.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
@@ -867,8 +943,9 @@ namespace Google.Protobuf.WellKnownTypes {
= 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.
+ /// Enum value definitions.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> Enumvalue {
get { return enumvalue_; }
}
@@ -879,8 +956,9 @@ namespace Google.Protobuf.WellKnownTypes {
= 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>
- /// Protocol buffer options.
+ /// Protocol buffer options.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
@@ -889,8 +967,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int SourceContextFieldNumber = 4;
private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_;
/// <summary>
- /// The source context.
+ /// The source context.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext {
get { return sourceContext_; }
set {
@@ -900,10 +979,11 @@ 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;
+ private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = 0;
/// <summary>
- /// The source syntax.
+ /// The source syntax.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Syntax Syntax {
get { return syntax_; }
set {
@@ -911,10 +991,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Enum);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Enum other) {
if (ReferenceEquals(other, null)) {
return false;
@@ -927,23 +1009,29 @@ namespace Google.Protobuf.WellKnownTypes {
if(!options_.Equals(other.options_)) return false;
if (!object.Equals(SourceContext, other.SourceContext)) return false;
if (Syntax != other.Syntax) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
hash ^= enumvalue_.GetHashCode();
hash ^= options_.GetHashCode();
if (sourceContext_ != null) hash ^= SourceContext.GetHashCode();
- if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode();
+ if (Syntax != 0) hash ^= Syntax.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
@@ -955,12 +1043,16 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteRawTag(34);
output.WriteMessage(SourceContext);
}
- if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
+ if (Syntax != 0) {
output.WriteRawTag(40);
output.WriteEnum((int) Syntax);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
@@ -971,12 +1063,16 @@ namespace Google.Protobuf.WellKnownTypes {
if (sourceContext_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext);
}
- if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
+ if (Syntax != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Enum other) {
if (other == null) {
return;
@@ -992,17 +1088,19 @@ namespace Google.Protobuf.WellKnownTypes {
}
SourceContext.MergeFrom(other.SourceContext);
}
- if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) {
+ if (other.Syntax != 0) {
Syntax = other.Syntax;
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();
@@ -1034,33 +1132,40 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
- /// Enum value definition.
+ /// 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());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<EnumValue> Parser { get { return _parser; } }
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[3]; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public EnumValue() {
OnConstruction();
}
partial void OnConstruction();
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public EnumValue(EnumValue other) : this() {
name_ = other.name_;
number_ = other.number_;
options_ = other.options_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public EnumValue Clone() {
return new EnumValue(this);
}
@@ -1069,8 +1174,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
- /// Enum value name.
+ /// Enum value name.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
@@ -1082,8 +1188,9 @@ namespace Google.Protobuf.WellKnownTypes {
public const int NumberFieldNumber = 2;
private int number_;
/// <summary>
- /// Enum value number.
+ /// Enum value number.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Number {
get { return number_; }
set {
@@ -1097,16 +1204,19 @@ namespace Google.Protobuf.WellKnownTypes {
= 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>
- /// Protocol buffer options.
+ /// Protocol buffer options.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options {
get { return options_; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as EnumValue);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(EnumValue other) {
if (ReferenceEquals(other, null)) {
return false;
@@ -1117,21 +1227,27 @@ namespace Google.Protobuf.WellKnownTypes {
if (Name != other.Name) return false;
if (Number != other.Number) return false;
if(!options_.Equals(other.options_)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Number != 0) hash ^= Number.GetHashCode();
hash ^= options_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
@@ -1142,8 +1258,12 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteInt32(Number);
}
options_.WriteTo(output, _repeated_options_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
@@ -1153,9 +1273,13 @@ namespace Google.Protobuf.WellKnownTypes {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Number);
}
size += options_.CalculateSize(_repeated_options_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(EnumValue other) {
if (other == null) {
return;
@@ -1167,14 +1291,16 @@ namespace Google.Protobuf.WellKnownTypes {
Number = other.Number;
}
options_.Add(other.options_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();
@@ -1195,33 +1321,40 @@ namespace Google.Protobuf.WellKnownTypes {
}
/// <summary>
- /// A protocol buffer option, which can be attached to a message, field,
- /// enumeration, etc.
+ /// A protocol buffer option, which can be attached to a message, field,
+ /// enumeration, 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());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Option> Parser { get { return _parser; } }
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Protobuf.WellKnownTypes.TypeReflection.Descriptor.MessageTypes[4]; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Option() {
OnConstruction();
}
partial void OnConstruction();
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Option(Option other) : this() {
name_ = other.name_;
- Value = other.value_ != null ? other.Value.Clone() : null;
+ value_ = other.value_ != null ? other.value_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Option Clone() {
return new Option(this);
}
@@ -1230,8 +1363,12 @@ namespace Google.Protobuf.WellKnownTypes {
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
- /// The option's name. For example, `"java_package"`.
+ /// The option's name. For protobuf built-in options (options defined in
+ /// descriptor.proto), this is the short name. For example, `"map_entry"`.
+ /// For custom options, it should be the fully-qualified name. For example,
+ /// `"google.api.http"`.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
@@ -1243,8 +1380,12 @@ namespace Google.Protobuf.WellKnownTypes {
public const int ValueFieldNumber = 2;
private global::Google.Protobuf.WellKnownTypes.Any value_;
/// <summary>
- /// The option's value. For example, `"com.google.protobuf"`.
+ /// The option's value packed in an Any message. If the value is a primitive,
+ /// the corresponding wrapper type defined in google/protobuf/wrappers.proto
+ /// should be used. If the value is an enum, it should be stored as an int32
+ /// value using the google.protobuf.Int32Value type.
/// </summary>
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Any Value {
get { return value_; }
set {
@@ -1252,10 +1393,12 @@ namespace Google.Protobuf.WellKnownTypes {
}
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Option);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Option other) {
if (ReferenceEquals(other, null)) {
return false;
@@ -1265,20 +1408,26 @@ namespace Google.Protobuf.WellKnownTypes {
}
if (Name != other.Name) return false;
if (!object.Equals(Value, other.Value)) return false;
- return true;
+ return Equals(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (value_ != null) hash ^= Value.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
return hash;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
@@ -1288,8 +1437,12 @@ namespace Google.Protobuf.WellKnownTypes {
output.WriteRawTag(18);
output.WriteMessage(Value);
}
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
@@ -1298,9 +1451,13 @@ namespace Google.Protobuf.WellKnownTypes {
if (value_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value);
}
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
return size;
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Option other) {
if (other == null) {
return;
@@ -1314,14 +1471,16 @@ namespace Google.Protobuf.WellKnownTypes {
}
Value.MergeFrom(other.Value);
}
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
- input.SkipLastField();
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();