Payload.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. # source: nacos.proto
  12. namespace Hyperf\Nacos\Protobuf;
  13. use Google\Protobuf\Internal\GPBUtil;
  14. use Google\Protobuf\Internal\Message;
  15. /**
  16. * Generated from protobuf message <code>Payload</code>.
  17. */
  18. class Payload extends Message
  19. {
  20. /**
  21. * Generated from protobuf field <code>.Metadata metadata = 2;</code>.
  22. */
  23. protected $metadata;
  24. /**
  25. * Generated from protobuf field <code>.google.protobuf.Any body = 3;</code>.
  26. */
  27. protected $body;
  28. /**
  29. * Constructor.
  30. *
  31. * @param array $data {
  32. * Optional. Data for populating the Message object.
  33. *
  34. * @var Metadata $metadata
  35. * @var Any $body
  36. * }
  37. */
  38. public function __construct($data = null)
  39. {
  40. GPBMetadata\Nacos::initOnce();
  41. parent::__construct($data);
  42. }
  43. /**
  44. * Generated from protobuf field <code>.Metadata metadata = 2;</code>.
  45. * @return null|Metadata
  46. */
  47. public function getMetadata()
  48. {
  49. return $this->metadata;
  50. }
  51. public function hasMetadata()
  52. {
  53. return isset($this->metadata);
  54. }
  55. public function clearMetadata()
  56. {
  57. unset($this->metadata);
  58. }
  59. /**
  60. * Generated from protobuf field <code>.Metadata metadata = 2;</code>.
  61. * @param Metadata $var
  62. * @return $this
  63. */
  64. public function setMetadata($var)
  65. {
  66. GPBUtil::checkMessage($var, Metadata::class);
  67. $this->metadata = $var;
  68. return $this;
  69. }
  70. /**
  71. * Generated from protobuf field <code>.google.protobuf.Any body = 3;</code>.
  72. * @return null|Any
  73. */
  74. public function getBody()
  75. {
  76. return $this->body;
  77. }
  78. public function hasBody()
  79. {
  80. return isset($this->body);
  81. }
  82. public function clearBody()
  83. {
  84. unset($this->body);
  85. }
  86. /**
  87. * Generated from protobuf field <code>.google.protobuf.Any body = 3;</code>.
  88. * @param Any $var
  89. * @return $this
  90. */
  91. public function setBody($var)
  92. {
  93. GPBUtil::checkMessage($var, Any::class);
  94. $this->body = $var;
  95. return $this;
  96. }
  97. }