1 // Generated by the protocol buffer compiler. DO NOT EDIT! 2 // source: google/protobuf/struct.proto 3 #pragma warning disable 1591, 0612, 3021 4 #region Designer generated code 5 6 using pb = global::Google.Protobuf; 7 using pbc = global::Google.Protobuf.Collections; 8 using pbr = global::Google.Protobuf.Reflection; 9 using scg = global::System.Collections.Generic; 10 namespace Google.Protobuf.WellKnownTypes { 11 12 /// <summary>Holder for reflection information generated from google/protobuf/struct.proto</summary> 13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 14 public static partial class StructReflection { 15 16 #region Descriptor 17 /// <summary>File descriptor for google/protobuf/struct.proto</summary> 18 public static pbr::FileDescriptor Descriptor { 19 get { return descriptor; } 20 } 21 private static pbr::FileDescriptor descriptor; 22 StructReflection()23 static StructReflection() { 24 byte[] descriptorData = global::System.Convert.FromBase64String( 25 string.Concat( 26 "Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9i", 27 "dWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9i", 28 "dWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgB", 29 "IAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToC", 30 "OAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJv", 31 "dG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoM", 32 "c3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8K", 33 "DHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RI", 34 "ABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RW", 35 "YWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIW", 36 "Lmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9W", 37 "QUxVRRAAQoEBChNjb20uZ29vZ2xlLnByb3RvYnVmQgtTdHJ1Y3RQcm90b1AB", 38 "WjFnaXRodWIuY29tL2dvbGFuZy9wcm90b2J1Zi9wdHlwZXMvc3RydWN0O3N0", 39 "cnVjdHBioAEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5", 40 "cGVzYgZwcm90bzM=")); 41 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, 42 new pbr::FileDescriptor[] { }, 43 new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.NullValue), }, new pbr::GeneratedClrTypeInfo[] { 44 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Struct), global::Google.Protobuf.WellKnownTypes.Struct.Parser, new[]{ "Fields" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), 45 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Value), global::Google.Protobuf.WellKnownTypes.Value.Parser, new[]{ "NullValue", "NumberValue", "StringValue", "BoolValue", "StructValue", "ListValue" }, new[]{ "Kind" }, null, null), 46 new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.ListValue), global::Google.Protobuf.WellKnownTypes.ListValue.Parser, new[]{ "Values" }, null, null, null) 47 })); 48 } 49 #endregion 50 51 } 52 #region Enums 53 /// <summary> 54 /// `NullValue` is a singleton enumeration to represent the null value for the 55 /// `Value` type union. 56 /// 57 /// The JSON representation for `NullValue` is JSON `null`. 58 /// </summary> 59 public enum NullValue { 60 /// <summary> 61 /// Null value. 62 /// </summary> 63 [pbr::OriginalName("NULL_VALUE")] NullValue = 0, 64 } 65 66 #endregion 67 68 #region Messages 69 /// <summary> 70 /// `Struct` represents a structured data value, consisting of fields 71 /// which map to dynamically typed values. In some languages, `Struct` 72 /// might be supported by a native representation. For example, in 73 /// scripting languages like JS a struct is represented as an 74 /// object. The details of that representation are described together 75 /// with the proto support for the language. 76 /// 77 /// The JSON representation for `Struct` is JSON object. 78 /// </summary> 79 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 80 public sealed partial class Struct : pb::IMessage<Struct> { 81 private static readonly pb::MessageParser<Struct> _parser = new pb::MessageParser<Struct>(() => new Struct()); 82 public static pb::MessageParser<Struct> Parser { get { return _parser; } } 83 84 public static pbr::MessageDescriptor Descriptor { 85 get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[0]; } 86 } 87 88 pbr::MessageDescriptor pb::IMessage.Descriptor { 89 get { return Descriptor; } 90 } 91 Struct()92 public Struct() { 93 OnConstruction(); 94 } 95 OnConstruction()96 partial void OnConstruction(); 97 Struct(Struct other)98 public Struct(Struct other) : this() { 99 fields_ = other.fields_.Clone(); 100 } 101 Clone()102 public Struct Clone() { 103 return new Struct(this); 104 } 105 106 /// <summary>Field number for the "fields" field.</summary> 107 public const int FieldsFieldNumber = 1; 108 private static readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>.Codec _map_fields_codec 109 = new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Value.Parser), 10); 110 private readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value> fields_ = new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>(); 111 /// <summary> 112 /// Unordered map of dynamically typed values. 113 /// </summary> 114 public pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value> Fields { 115 get { return fields_; } 116 } 117 Equals(object other)118 public override bool Equals(object other) { 119 return Equals(other as Struct); 120 } 121 Equals(Struct other)122 public bool Equals(Struct other) { 123 if (ReferenceEquals(other, null)) { 124 return false; 125 } 126 if (ReferenceEquals(other, this)) { 127 return true; 128 } 129 if (!Fields.Equals(other.Fields)) return false; 130 return true; 131 } 132 GetHashCode()133 public override int GetHashCode() { 134 int hash = 1; 135 hash ^= Fields.GetHashCode(); 136 return hash; 137 } 138 ToString()139 public override string ToString() { 140 return pb::JsonFormatter.ToDiagnosticString(this); 141 } 142 WriteTo(pb::CodedOutputStream output)143 public void WriteTo(pb::CodedOutputStream output) { 144 fields_.WriteTo(output, _map_fields_codec); 145 } 146 CalculateSize()147 public int CalculateSize() { 148 int size = 0; 149 size += fields_.CalculateSize(_map_fields_codec); 150 return size; 151 } 152 MergeFrom(Struct other)153 public void MergeFrom(Struct other) { 154 if (other == null) { 155 return; 156 } 157 fields_.Add(other.fields_); 158 } 159 MergeFrom(pb::CodedInputStream input)160 public void MergeFrom(pb::CodedInputStream input) { 161 uint tag; 162 while ((tag = input.ReadTag()) != 0) { 163 switch(tag) { 164 default: 165 input.SkipLastField(); 166 break; 167 case 10: { 168 fields_.AddEntriesFrom(input, _map_fields_codec); 169 break; 170 } 171 } 172 } 173 } 174 175 } 176 177 /// <summary> 178 /// `Value` represents a dynamically typed value which can be either 179 /// null, a number, a string, a boolean, a recursive struct value, or a 180 /// list of values. A producer of value is expected to set one of that 181 /// variants, absence of any variant indicates an error. 182 /// 183 /// The JSON representation for `Value` is JSON value. 184 /// </summary> 185 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 186 public sealed partial class Value : pb::IMessage<Value> { 187 private static readonly pb::MessageParser<Value> _parser = new pb::MessageParser<Value>(() => new Value()); 188 public static pb::MessageParser<Value> Parser { get { return _parser; } } 189 190 public static pbr::MessageDescriptor Descriptor { 191 get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[1]; } 192 } 193 194 pbr::MessageDescriptor pb::IMessage.Descriptor { 195 get { return Descriptor; } 196 } 197 Value()198 public Value() { 199 OnConstruction(); 200 } 201 OnConstruction()202 partial void OnConstruction(); 203 Value(Value other)204 public Value(Value other) : this() { 205 switch (other.KindCase) { 206 case KindOneofCase.NullValue: 207 NullValue = other.NullValue; 208 break; 209 case KindOneofCase.NumberValue: 210 NumberValue = other.NumberValue; 211 break; 212 case KindOneofCase.StringValue: 213 StringValue = other.StringValue; 214 break; 215 case KindOneofCase.BoolValue: 216 BoolValue = other.BoolValue; 217 break; 218 case KindOneofCase.StructValue: 219 StructValue = other.StructValue.Clone(); 220 break; 221 case KindOneofCase.ListValue: 222 ListValue = other.ListValue.Clone(); 223 break; 224 } 225 226 } 227 Clone()228 public Value Clone() { 229 return new Value(this); 230 } 231 232 /// <summary>Field number for the "null_value" field.</summary> 233 public const int NullValueFieldNumber = 1; 234 /// <summary> 235 /// Represents a null value. 236 /// </summary> 237 public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { 238 get { return kindCase_ == KindOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) kind_ : 0; } 239 set { 240 kind_ = value; 241 kindCase_ = KindOneofCase.NullValue; 242 } 243 } 244 245 /// <summary>Field number for the "number_value" field.</summary> 246 public const int NumberValueFieldNumber = 2; 247 /// <summary> 248 /// Represents a double value. 249 /// </summary> 250 public double NumberValue { 251 get { return kindCase_ == KindOneofCase.NumberValue ? (double) kind_ : 0D; } 252 set { 253 kind_ = value; 254 kindCase_ = KindOneofCase.NumberValue; 255 } 256 } 257 258 /// <summary>Field number for the "string_value" field.</summary> 259 public const int StringValueFieldNumber = 3; 260 /// <summary> 261 /// Represents a string value. 262 /// </summary> 263 public string StringValue { 264 get { return kindCase_ == KindOneofCase.StringValue ? (string) kind_ : ""; } 265 set { 266 kind_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); 267 kindCase_ = KindOneofCase.StringValue; 268 } 269 } 270 271 /// <summary>Field number for the "bool_value" field.</summary> 272 public const int BoolValueFieldNumber = 4; 273 /// <summary> 274 /// Represents a boolean value. 275 /// </summary> 276 public bool BoolValue { 277 get { return kindCase_ == KindOneofCase.BoolValue ? (bool) kind_ : false; } 278 set { 279 kind_ = value; 280 kindCase_ = KindOneofCase.BoolValue; 281 } 282 } 283 284 /// <summary>Field number for the "struct_value" field.</summary> 285 public const int StructValueFieldNumber = 5; 286 /// <summary> 287 /// Represents a structured value. 288 /// </summary> 289 public global::Google.Protobuf.WellKnownTypes.Struct StructValue { 290 get { return kindCase_ == KindOneofCase.StructValue ? (global::Google.Protobuf.WellKnownTypes.Struct) kind_ : null; } 291 set { 292 kind_ = value; 293 kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.StructValue; 294 } 295 } 296 297 /// <summary>Field number for the "list_value" field.</summary> 298 public const int ListValueFieldNumber = 6; 299 /// <summary> 300 /// Represents a repeated `Value`. 301 /// </summary> 302 public global::Google.Protobuf.WellKnownTypes.ListValue ListValue { 303 get { return kindCase_ == KindOneofCase.ListValue ? (global::Google.Protobuf.WellKnownTypes.ListValue) kind_ : null; } 304 set { 305 kind_ = value; 306 kindCase_ = value == null ? KindOneofCase.None : KindOneofCase.ListValue; 307 } 308 } 309 310 private object kind_; 311 /// <summary>Enum of possible cases for the "kind" oneof.</summary> 312 public enum KindOneofCase { 313 None = 0, 314 NullValue = 1, 315 NumberValue = 2, 316 StringValue = 3, 317 BoolValue = 4, 318 StructValue = 5, 319 ListValue = 6, 320 } 321 private KindOneofCase kindCase_ = KindOneofCase.None; 322 public KindOneofCase KindCase { 323 get { return kindCase_; } 324 } 325 ClearKind()326 public void ClearKind() { 327 kindCase_ = KindOneofCase.None; 328 kind_ = null; 329 } 330 Equals(object other)331 public override bool Equals(object other) { 332 return Equals(other as Value); 333 } 334 Equals(Value other)335 public bool Equals(Value other) { 336 if (ReferenceEquals(other, null)) { 337 return false; 338 } 339 if (ReferenceEquals(other, this)) { 340 return true; 341 } 342 if (NullValue != other.NullValue) return false; 343 if (NumberValue != other.NumberValue) return false; 344 if (StringValue != other.StringValue) return false; 345 if (BoolValue != other.BoolValue) return false; 346 if (!object.Equals(StructValue, other.StructValue)) return false; 347 if (!object.Equals(ListValue, other.ListValue)) return false; 348 if (KindCase != other.KindCase) return false; 349 return true; 350 } 351 GetHashCode()352 public override int GetHashCode() { 353 int hash = 1; 354 if (kindCase_ == KindOneofCase.NullValue) hash ^= NullValue.GetHashCode(); 355 if (kindCase_ == KindOneofCase.NumberValue) hash ^= NumberValue.GetHashCode(); 356 if (kindCase_ == KindOneofCase.StringValue) hash ^= StringValue.GetHashCode(); 357 if (kindCase_ == KindOneofCase.BoolValue) hash ^= BoolValue.GetHashCode(); 358 if (kindCase_ == KindOneofCase.StructValue) hash ^= StructValue.GetHashCode(); 359 if (kindCase_ == KindOneofCase.ListValue) hash ^= ListValue.GetHashCode(); 360 hash ^= (int) kindCase_; 361 return hash; 362 } 363 ToString()364 public override string ToString() { 365 return pb::JsonFormatter.ToDiagnosticString(this); 366 } 367 WriteTo(pb::CodedOutputStream output)368 public void WriteTo(pb::CodedOutputStream output) { 369 if (kindCase_ == KindOneofCase.NullValue) { 370 output.WriteRawTag(8); 371 output.WriteEnum((int) NullValue); 372 } 373 if (kindCase_ == KindOneofCase.NumberValue) { 374 output.WriteRawTag(17); 375 output.WriteDouble(NumberValue); 376 } 377 if (kindCase_ == KindOneofCase.StringValue) { 378 output.WriteRawTag(26); 379 output.WriteString(StringValue); 380 } 381 if (kindCase_ == KindOneofCase.BoolValue) { 382 output.WriteRawTag(32); 383 output.WriteBool(BoolValue); 384 } 385 if (kindCase_ == KindOneofCase.StructValue) { 386 output.WriteRawTag(42); 387 output.WriteMessage(StructValue); 388 } 389 if (kindCase_ == KindOneofCase.ListValue) { 390 output.WriteRawTag(50); 391 output.WriteMessage(ListValue); 392 } 393 } 394 CalculateSize()395 public int CalculateSize() { 396 int size = 0; 397 if (kindCase_ == KindOneofCase.NullValue) { 398 size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) NullValue); 399 } 400 if (kindCase_ == KindOneofCase.NumberValue) { 401 size += 1 + 8; 402 } 403 if (kindCase_ == KindOneofCase.StringValue) { 404 size += 1 + pb::CodedOutputStream.ComputeStringSize(StringValue); 405 } 406 if (kindCase_ == KindOneofCase.BoolValue) { 407 size += 1 + 1; 408 } 409 if (kindCase_ == KindOneofCase.StructValue) { 410 size += 1 + pb::CodedOutputStream.ComputeMessageSize(StructValue); 411 } 412 if (kindCase_ == KindOneofCase.ListValue) { 413 size += 1 + pb::CodedOutputStream.ComputeMessageSize(ListValue); 414 } 415 return size; 416 } 417 MergeFrom(Value other)418 public void MergeFrom(Value other) { 419 if (other == null) { 420 return; 421 } 422 switch (other.KindCase) { 423 case KindOneofCase.NullValue: 424 NullValue = other.NullValue; 425 break; 426 case KindOneofCase.NumberValue: 427 NumberValue = other.NumberValue; 428 break; 429 case KindOneofCase.StringValue: 430 StringValue = other.StringValue; 431 break; 432 case KindOneofCase.BoolValue: 433 BoolValue = other.BoolValue; 434 break; 435 case KindOneofCase.StructValue: 436 StructValue = other.StructValue; 437 break; 438 case KindOneofCase.ListValue: 439 ListValue = other.ListValue; 440 break; 441 } 442 443 } 444 MergeFrom(pb::CodedInputStream input)445 public void MergeFrom(pb::CodedInputStream input) { 446 uint tag; 447 while ((tag = input.ReadTag()) != 0) { 448 switch(tag) { 449 default: 450 input.SkipLastField(); 451 break; 452 case 8: { 453 kind_ = input.ReadEnum(); 454 kindCase_ = KindOneofCase.NullValue; 455 break; 456 } 457 case 17: { 458 NumberValue = input.ReadDouble(); 459 break; 460 } 461 case 26: { 462 StringValue = input.ReadString(); 463 break; 464 } 465 case 32: { 466 BoolValue = input.ReadBool(); 467 break; 468 } 469 case 42: { 470 global::Google.Protobuf.WellKnownTypes.Struct subBuilder = new global::Google.Protobuf.WellKnownTypes.Struct(); 471 if (kindCase_ == KindOneofCase.StructValue) { 472 subBuilder.MergeFrom(StructValue); 473 } 474 input.ReadMessage(subBuilder); 475 StructValue = subBuilder; 476 break; 477 } 478 case 50: { 479 global::Google.Protobuf.WellKnownTypes.ListValue subBuilder = new global::Google.Protobuf.WellKnownTypes.ListValue(); 480 if (kindCase_ == KindOneofCase.ListValue) { 481 subBuilder.MergeFrom(ListValue); 482 } 483 input.ReadMessage(subBuilder); 484 ListValue = subBuilder; 485 break; 486 } 487 } 488 } 489 } 490 491 } 492 493 /// <summary> 494 /// `ListValue` is a wrapper around a repeated field of values. 495 /// 496 /// The JSON representation for `ListValue` is JSON array. 497 /// </summary> 498 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 499 public sealed partial class ListValue : pb::IMessage<ListValue> { 500 private static readonly pb::MessageParser<ListValue> _parser = new pb::MessageParser<ListValue>(() => new ListValue()); 501 public static pb::MessageParser<ListValue> Parser { get { return _parser; } } 502 503 public static pbr::MessageDescriptor Descriptor { 504 get { return global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor.MessageTypes[2]; } 505 } 506 507 pbr::MessageDescriptor pb::IMessage.Descriptor { 508 get { return Descriptor; } 509 } 510 ListValue()511 public ListValue() { 512 OnConstruction(); 513 } 514 OnConstruction()515 partial void OnConstruction(); 516 ListValue(ListValue other)517 public ListValue(ListValue other) : this() { 518 values_ = other.values_.Clone(); 519 } 520 Clone()521 public ListValue Clone() { 522 return new ListValue(this); 523 } 524 525 /// <summary>Field number for the "values" field.</summary> 526 public const int ValuesFieldNumber = 1; 527 private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Value> _repeated_values_codec 528 = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Value.Parser); 529 private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value> values_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value>(); 530 /// <summary> 531 /// Repeated field of dynamically typed values. 532 /// </summary> 533 public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value> Values { 534 get { return values_; } 535 } 536 Equals(object other)537 public override bool Equals(object other) { 538 return Equals(other as ListValue); 539 } 540 Equals(ListValue other)541 public bool Equals(ListValue other) { 542 if (ReferenceEquals(other, null)) { 543 return false; 544 } 545 if (ReferenceEquals(other, this)) { 546 return true; 547 } 548 if(!values_.Equals(other.values_)) return false; 549 return true; 550 } 551 GetHashCode()552 public override int GetHashCode() { 553 int hash = 1; 554 hash ^= values_.GetHashCode(); 555 return hash; 556 } 557 ToString()558 public override string ToString() { 559 return pb::JsonFormatter.ToDiagnosticString(this); 560 } 561 WriteTo(pb::CodedOutputStream output)562 public void WriteTo(pb::CodedOutputStream output) { 563 values_.WriteTo(output, _repeated_values_codec); 564 } 565 CalculateSize()566 public int CalculateSize() { 567 int size = 0; 568 size += values_.CalculateSize(_repeated_values_codec); 569 return size; 570 } 571 MergeFrom(ListValue other)572 public void MergeFrom(ListValue other) { 573 if (other == null) { 574 return; 575 } 576 values_.Add(other.values_); 577 } 578 MergeFrom(pb::CodedInputStream input)579 public void MergeFrom(pb::CodedInputStream input) { 580 uint tag; 581 while ((tag = input.ReadTag()) != 0) { 582 switch(tag) { 583 default: 584 input.SkipLastField(); 585 break; 586 case 10: { 587 values_.AddEntriesFrom(input, _repeated_values_codec); 588 break; 589 } 590 } 591 } 592 } 593 594 } 595 596 #endregion 597 598 } 599 600 #endregion Designer generated code 601