DeprecatedTrait.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <?php
  2. namespace AlibabaCloud\Client\Request\Traits;
  3. use AlibabaCloud\Client\Exception\ClientException;
  4. use RuntimeException;
  5. use AlibabaCloud\Client\Request\Request;
  6. /**
  7. * @package AlibabaCloud\Client\Request\Traits
  8. *
  9. * @mixin Request
  10. */
  11. trait DeprecatedTrait
  12. {
  13. /**
  14. * @param $content
  15. *
  16. * @return $this
  17. * @throws ClientException
  18. * @deprecated
  19. * @codeCoverageIgnore
  20. */
  21. public function setContent($content)
  22. {
  23. return $this->body($content);
  24. }
  25. /**
  26. * @param $method
  27. *
  28. * @return $this
  29. * @throws ClientException
  30. * @deprecated
  31. * @codeCoverageIgnore
  32. */
  33. public function setMethod($method)
  34. {
  35. return $this->method($method);
  36. }
  37. /**
  38. * @param $scheme
  39. *
  40. * @return $this
  41. * @throws ClientException
  42. * @deprecated
  43. * @codeCoverageIgnore
  44. */
  45. public function setProtocol($scheme)
  46. {
  47. return $this->scheme($scheme);
  48. }
  49. /**
  50. * @deprecated
  51. * @codeCoverageIgnore
  52. */
  53. public function getProtocolType()
  54. {
  55. return $this->uri->getScheme();
  56. }
  57. /**
  58. * @param $scheme
  59. *
  60. * @return $this
  61. * @throws ClientException
  62. * @deprecated
  63. * @codeCoverageIgnore
  64. */
  65. public function setProtocolType($scheme)
  66. {
  67. return $this->scheme($scheme);
  68. }
  69. /**
  70. * @param $actionName
  71. *
  72. * @return $this
  73. * @throws ClientException
  74. * @deprecated
  75. * @codeCoverageIgnore
  76. */
  77. public function setActionName($actionName)
  78. {
  79. return $this->action($actionName);
  80. }
  81. /**
  82. * @param $format
  83. *
  84. * @return $this
  85. * @throws ClientException
  86. * @deprecated
  87. * @codeCoverageIgnore
  88. */
  89. public function setAcceptFormat($format)
  90. {
  91. return $this->format($format);
  92. }
  93. /**
  94. * @deprecated
  95. * @codeCoverageIgnore
  96. */
  97. public function getProtocol()
  98. {
  99. return $this->uri->getScheme();
  100. }
  101. /**
  102. * @deprecated
  103. * @codeCoverageIgnore
  104. */
  105. public function getContent()
  106. {
  107. return isset($this->options['body'])
  108. ? $this->options['body']
  109. : null;
  110. }
  111. /**
  112. * @deprecated
  113. * @codeCoverageIgnore
  114. */
  115. public function getMethod()
  116. {
  117. return $this->method;
  118. }
  119. /**
  120. * @deprecated
  121. * @codeCoverageIgnore
  122. */
  123. public function getHeaders()
  124. {
  125. return isset($this->options['headers'])
  126. ? $this->options['headers']
  127. : [];
  128. }
  129. /**
  130. * @param $headerKey
  131. * @param $headerValue
  132. *
  133. * @return $this
  134. * @deprecated
  135. * @codeCoverageIgnore
  136. */
  137. public function addHeader($headerKey, $headerValue)
  138. {
  139. $this->options['headers'][$headerKey] = $headerValue;
  140. return $this;
  141. }
  142. /**
  143. * @deprecated
  144. * @codeCoverageIgnore
  145. */
  146. public function getQueryParameters()
  147. {
  148. return isset($this->options['query'])
  149. ? $this->options['query']
  150. : [];
  151. }
  152. /**
  153. * @param $name
  154. * @param $value
  155. *
  156. * @return $this
  157. * @deprecated
  158. * @codeCoverageIgnore
  159. */
  160. public function setQueryParameters($name, $value)
  161. {
  162. $this->options['query'][$name] = $value;
  163. return $this;
  164. }
  165. /**
  166. * @deprecated
  167. * @codeCoverageIgnore
  168. */
  169. public function getDomainParameter()
  170. {
  171. return isset($this->options['form_params'])
  172. ? $this->options['form_params']
  173. : [];
  174. }
  175. /**
  176. * @param $name
  177. * @param $value
  178. *
  179. * @return $this
  180. * @deprecated
  181. * @codeCoverageIgnore
  182. */
  183. public function putDomainParameters($name, $value)
  184. {
  185. $this->options['form_params'][$name] = $value;
  186. return $this;
  187. }
  188. /**
  189. * @deprecated
  190. * @codeCoverageIgnore
  191. */
  192. public function getActionName()
  193. {
  194. return $this->action;
  195. }
  196. /**
  197. * @deprecated
  198. * @codeCoverageIgnore
  199. */
  200. public function getAcceptFormat()
  201. {
  202. return $this->format;
  203. }
  204. /**
  205. * @deprecated
  206. * @codeCoverageIgnore
  207. */
  208. public function getLocationEndpointType()
  209. {
  210. return $this->endpointType;
  211. }
  212. /**
  213. * @deprecated
  214. * @codeCoverageIgnore
  215. */
  216. public function getLocationServiceCode()
  217. {
  218. return $this->serviceCode;
  219. }
  220. }