Enum.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: google/protobuf/type.proto
  4. namespace Google\Protobuf;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Enum type definition.
  10. *
  11. * Generated from protobuf message <code>google.protobuf.Enum</code>
  12. */
  13. class Enum extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Enum type name.
  17. *
  18. * Generated from protobuf field <code>string name = 1;</code>
  19. */
  20. private $name = '';
  21. /**
  22. * Enum value definitions.
  23. *
  24. * Generated from protobuf field <code>repeated .google.protobuf.EnumValue enumvalue = 2;</code>
  25. */
  26. private $enumvalue;
  27. /**
  28. * Protocol buffer options.
  29. *
  30. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
  31. */
  32. private $options;
  33. /**
  34. * The source context.
  35. *
  36. * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 4;</code>
  37. */
  38. private $source_context = null;
  39. /**
  40. * The source syntax.
  41. *
  42. * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 5;</code>
  43. */
  44. private $syntax = 0;
  45. /**
  46. * Constructor.
  47. *
  48. * @param array $data {
  49. * Optional. Data for populating the Message object.
  50. *
  51. * @type string $name
  52. * Enum type name.
  53. * @type \Google\Protobuf\EnumValue[]|\Google\Protobuf\Internal\RepeatedField $enumvalue
  54. * Enum value definitions.
  55. * @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
  56. * Protocol buffer options.
  57. * @type \Google\Protobuf\SourceContext $source_context
  58. * The source context.
  59. * @type int $syntax
  60. * The source syntax.
  61. * }
  62. */
  63. public function __construct($data = NULL) {
  64. \GPBMetadata\Google\Protobuf\Type::initOnce();
  65. parent::__construct($data);
  66. }
  67. /**
  68. * Enum type name.
  69. *
  70. * Generated from protobuf field <code>string name = 1;</code>
  71. * @return string
  72. */
  73. public function getName()
  74. {
  75. return $this->name;
  76. }
  77. /**
  78. * Enum type name.
  79. *
  80. * Generated from protobuf field <code>string name = 1;</code>
  81. * @param string $var
  82. * @return $this
  83. */
  84. public function setName($var)
  85. {
  86. GPBUtil::checkString($var, True);
  87. $this->name = $var;
  88. return $this;
  89. }
  90. /**
  91. * Enum value definitions.
  92. *
  93. * Generated from protobuf field <code>repeated .google.protobuf.EnumValue enumvalue = 2;</code>
  94. * @return \Google\Protobuf\Internal\RepeatedField
  95. */
  96. public function getEnumvalue()
  97. {
  98. return $this->enumvalue;
  99. }
  100. /**
  101. * Enum value definitions.
  102. *
  103. * Generated from protobuf field <code>repeated .google.protobuf.EnumValue enumvalue = 2;</code>
  104. * @param \Google\Protobuf\EnumValue[]|\Google\Protobuf\Internal\RepeatedField $var
  105. * @return $this
  106. */
  107. public function setEnumvalue($var)
  108. {
  109. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\EnumValue::class);
  110. $this->enumvalue = $arr;
  111. return $this;
  112. }
  113. /**
  114. * Protocol buffer options.
  115. *
  116. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
  117. * @return \Google\Protobuf\Internal\RepeatedField
  118. */
  119. public function getOptions()
  120. {
  121. return $this->options;
  122. }
  123. /**
  124. * Protocol buffer options.
  125. *
  126. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
  127. * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
  128. * @return $this
  129. */
  130. public function setOptions($var)
  131. {
  132. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
  133. $this->options = $arr;
  134. return $this;
  135. }
  136. /**
  137. * The source context.
  138. *
  139. * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 4;</code>
  140. * @return \Google\Protobuf\SourceContext
  141. */
  142. public function getSourceContext()
  143. {
  144. return $this->source_context;
  145. }
  146. /**
  147. * The source context.
  148. *
  149. * Generated from protobuf field <code>.google.protobuf.SourceContext source_context = 4;</code>
  150. * @param \Google\Protobuf\SourceContext $var
  151. * @return $this
  152. */
  153. public function setSourceContext($var)
  154. {
  155. GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class);
  156. $this->source_context = $var;
  157. return $this;
  158. }
  159. /**
  160. * The source syntax.
  161. *
  162. * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 5;</code>
  163. * @return int
  164. */
  165. public function getSyntax()
  166. {
  167. return $this->syntax;
  168. }
  169. /**
  170. * The source syntax.
  171. *
  172. * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 5;</code>
  173. * @param int $var
  174. * @return $this
  175. */
  176. public function setSyntax($var)
  177. {
  178. GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
  179. $this->syntax = $var;
  180. return $this;
  181. }
  182. }