AcsRequest.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. namespace Aliyun\Core;
  3. abstract class AcsRequest
  4. {
  5. protected $version;
  6. protected $product;
  7. protected $actionName;
  8. protected $regionId;
  9. protected $acceptFormat;
  10. protected $method;
  11. protected $protocolType = "http";
  12. protected $content;
  13. protected $queryParameters = array();
  14. protected $headers = array();
  15. function __construct($product, $version, $actionName)
  16. {
  17. $this->headers["x-sdk-client"] = "php/2.0.0";
  18. $this->product = $product;
  19. $this->version = $version;
  20. $this->actionName = $actionName;
  21. }
  22. public abstract function composeUrl($iSigner, $credential, $domain);
  23. public function getVersion()
  24. {
  25. return $this->version;
  26. }
  27. public function setVersion($version)
  28. {
  29. $this->version = $version;
  30. }
  31. public function getProduct()
  32. {
  33. return $this->product;
  34. }
  35. public function setProduct($product)
  36. {
  37. $this->product = $product;
  38. }
  39. public function getActionName()
  40. {
  41. return $this->actionName;
  42. }
  43. public function setActionName($actionName)
  44. {
  45. $this->actionName = $actionName;
  46. }
  47. public function getAcceptFormat()
  48. {
  49. return $this->acceptFormat;
  50. }
  51. public function setAcceptFormat($acceptFormat)
  52. {
  53. $this->acceptFormat = $acceptFormat;
  54. }
  55. public function getQueryParameters()
  56. {
  57. return $this->queryParameters;
  58. }
  59. public function getHeaders()
  60. {
  61. return $this->headers;
  62. }
  63. public function getMethod()
  64. {
  65. return $this->method;
  66. }
  67. public function setMethod($method)
  68. {
  69. $this->method = $method;
  70. }
  71. public function getProtocol()
  72. {
  73. return $this->protocolType;
  74. }
  75. public function setProtocol($protocol)
  76. {
  77. $this->protocolType = $protocol;
  78. }
  79. public function getRegionId()
  80. {
  81. return $this->regionId;
  82. }
  83. public function setRegionId($region)
  84. {
  85. $this->regionId = $region;
  86. }
  87. public function getContent()
  88. {
  89. return $this->content;
  90. }
  91. public function setContent($content)
  92. {
  93. $this->content = $content;
  94. }
  95. public function addHeader($headerKey, $headerValue)
  96. {
  97. $this->headers[$headerKey] = $headerValue;
  98. }
  99. }