Method.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: google/protobuf/api.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. * Method represents a method of an API interface.
  10. *
  11. * Generated from protobuf message <code>google.protobuf.Method</code>
  12. */
  13. class Method extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * The simple name of this method.
  17. *
  18. * Generated from protobuf field <code>string name = 1;</code>
  19. */
  20. private $name = '';
  21. /**
  22. * A URL of the input message type.
  23. *
  24. * Generated from protobuf field <code>string request_type_url = 2;</code>
  25. */
  26. private $request_type_url = '';
  27. /**
  28. * If true, the request is streamed.
  29. *
  30. * Generated from protobuf field <code>bool request_streaming = 3;</code>
  31. */
  32. private $request_streaming = false;
  33. /**
  34. * The URL of the output message type.
  35. *
  36. * Generated from protobuf field <code>string response_type_url = 4;</code>
  37. */
  38. private $response_type_url = '';
  39. /**
  40. * If true, the response is streamed.
  41. *
  42. * Generated from protobuf field <code>bool response_streaming = 5;</code>
  43. */
  44. private $response_streaming = false;
  45. /**
  46. * Any metadata attached to the method.
  47. *
  48. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
  49. */
  50. private $options;
  51. /**
  52. * The source syntax of this method.
  53. *
  54. * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
  55. */
  56. private $syntax = 0;
  57. /**
  58. * Constructor.
  59. *
  60. * @param array $data {
  61. * Optional. Data for populating the Message object.
  62. *
  63. * @type string $name
  64. * The simple name of this method.
  65. * @type string $request_type_url
  66. * A URL of the input message type.
  67. * @type bool $request_streaming
  68. * If true, the request is streamed.
  69. * @type string $response_type_url
  70. * The URL of the output message type.
  71. * @type bool $response_streaming
  72. * If true, the response is streamed.
  73. * @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
  74. * Any metadata attached to the method.
  75. * @type int $syntax
  76. * The source syntax of this method.
  77. * }
  78. */
  79. public function __construct($data = NULL) {
  80. \GPBMetadata\Google\Protobuf\Api::initOnce();
  81. parent::__construct($data);
  82. }
  83. /**
  84. * The simple name of this method.
  85. *
  86. * Generated from protobuf field <code>string name = 1;</code>
  87. * @return string
  88. */
  89. public function getName()
  90. {
  91. return $this->name;
  92. }
  93. /**
  94. * The simple name of this method.
  95. *
  96. * Generated from protobuf field <code>string name = 1;</code>
  97. * @param string $var
  98. * @return $this
  99. */
  100. public function setName($var)
  101. {
  102. GPBUtil::checkString($var, True);
  103. $this->name = $var;
  104. return $this;
  105. }
  106. /**
  107. * A URL of the input message type.
  108. *
  109. * Generated from protobuf field <code>string request_type_url = 2;</code>
  110. * @return string
  111. */
  112. public function getRequestTypeUrl()
  113. {
  114. return $this->request_type_url;
  115. }
  116. /**
  117. * A URL of the input message type.
  118. *
  119. * Generated from protobuf field <code>string request_type_url = 2;</code>
  120. * @param string $var
  121. * @return $this
  122. */
  123. public function setRequestTypeUrl($var)
  124. {
  125. GPBUtil::checkString($var, True);
  126. $this->request_type_url = $var;
  127. return $this;
  128. }
  129. /**
  130. * If true, the request is streamed.
  131. *
  132. * Generated from protobuf field <code>bool request_streaming = 3;</code>
  133. * @return bool
  134. */
  135. public function getRequestStreaming()
  136. {
  137. return $this->request_streaming;
  138. }
  139. /**
  140. * If true, the request is streamed.
  141. *
  142. * Generated from protobuf field <code>bool request_streaming = 3;</code>
  143. * @param bool $var
  144. * @return $this
  145. */
  146. public function setRequestStreaming($var)
  147. {
  148. GPBUtil::checkBool($var);
  149. $this->request_streaming = $var;
  150. return $this;
  151. }
  152. /**
  153. * The URL of the output message type.
  154. *
  155. * Generated from protobuf field <code>string response_type_url = 4;</code>
  156. * @return string
  157. */
  158. public function getResponseTypeUrl()
  159. {
  160. return $this->response_type_url;
  161. }
  162. /**
  163. * The URL of the output message type.
  164. *
  165. * Generated from protobuf field <code>string response_type_url = 4;</code>
  166. * @param string $var
  167. * @return $this
  168. */
  169. public function setResponseTypeUrl($var)
  170. {
  171. GPBUtil::checkString($var, True);
  172. $this->response_type_url = $var;
  173. return $this;
  174. }
  175. /**
  176. * If true, the response is streamed.
  177. *
  178. * Generated from protobuf field <code>bool response_streaming = 5;</code>
  179. * @return bool
  180. */
  181. public function getResponseStreaming()
  182. {
  183. return $this->response_streaming;
  184. }
  185. /**
  186. * If true, the response is streamed.
  187. *
  188. * Generated from protobuf field <code>bool response_streaming = 5;</code>
  189. * @param bool $var
  190. * @return $this
  191. */
  192. public function setResponseStreaming($var)
  193. {
  194. GPBUtil::checkBool($var);
  195. $this->response_streaming = $var;
  196. return $this;
  197. }
  198. /**
  199. * Any metadata attached to the method.
  200. *
  201. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
  202. * @return \Google\Protobuf\Internal\RepeatedField
  203. */
  204. public function getOptions()
  205. {
  206. return $this->options;
  207. }
  208. /**
  209. * Any metadata attached to the method.
  210. *
  211. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 6;</code>
  212. * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
  213. * @return $this
  214. */
  215. public function setOptions($var)
  216. {
  217. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
  218. $this->options = $arr;
  219. return $this;
  220. }
  221. /**
  222. * The source syntax of this method.
  223. *
  224. * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
  225. * @return int
  226. */
  227. public function getSyntax()
  228. {
  229. return $this->syntax;
  230. }
  231. /**
  232. * The source syntax of this method.
  233. *
  234. * Generated from protobuf field <code>.google.protobuf.Syntax syntax = 7;</code>
  235. * @param int $var
  236. * @return $this
  237. */
  238. public function setSyntax($var)
  239. {
  240. GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class);
  241. $this->syntax = $var;
  242. return $this;
  243. }
  244. }