Metadata.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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\GPBType;
  14. use Google\Protobuf\Internal\GPBUtil;
  15. use Google\Protobuf\Internal\MapField;
  16. use Google\Protobuf\Internal\Message;
  17. /**
  18. * Generated from protobuf message <code>Metadata</code>.
  19. */
  20. class Metadata extends Message
  21. {
  22. /**
  23. * Generated from protobuf field <code>string type = 3;</code>.
  24. */
  25. protected $type = '';
  26. /**
  27. * Generated from protobuf field <code>string clientIp = 8;</code>.
  28. */
  29. protected $clientIp = '';
  30. /**
  31. * Generated from protobuf field <code>map<string, string> headers = 7;</code>.
  32. */
  33. private $headers;
  34. /**
  35. * Constructor.
  36. *
  37. * @param array $data {
  38. * Optional. Data for populating the Message object.
  39. *
  40. * @var string $type
  41. * @var string $clientIp
  42. * @var array|MapField $headers
  43. * }
  44. */
  45. public function __construct($data = null)
  46. {
  47. GPBMetadata\Nacos::initOnce();
  48. parent::__construct($data);
  49. }
  50. /**
  51. * Generated from protobuf field <code>string type = 3;</code>.
  52. * @return string
  53. */
  54. public function getType()
  55. {
  56. return $this->type;
  57. }
  58. /**
  59. * Generated from protobuf field <code>string type = 3;</code>.
  60. * @param string $var
  61. * @return $this
  62. */
  63. public function setType($var)
  64. {
  65. GPBUtil::checkString($var, true);
  66. $this->type = $var;
  67. return $this;
  68. }
  69. /**
  70. * Generated from protobuf field <code>string clientIp = 8;</code>.
  71. * @return string
  72. */
  73. public function getClientIp()
  74. {
  75. return $this->clientIp;
  76. }
  77. /**
  78. * Generated from protobuf field <code>string clientIp = 8;</code>.
  79. * @param string $var
  80. * @return $this
  81. */
  82. public function setClientIp($var)
  83. {
  84. GPBUtil::checkString($var, true);
  85. $this->clientIp = $var;
  86. return $this;
  87. }
  88. /**
  89. * Generated from protobuf field <code>map<string, string> headers = 7;</code>.
  90. * @return MapField
  91. */
  92. public function getHeaders()
  93. {
  94. return $this->headers;
  95. }
  96. /**
  97. * Generated from protobuf field <code>map<string, string> headers = 7;</code>.
  98. * @param array|MapField $var
  99. * @return $this
  100. */
  101. public function setHeaders($var)
  102. {
  103. $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::STRING);
  104. $this->headers = $arr;
  105. return $this;
  106. }
  107. }