AcsRequest.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. abstract class AcsRequest
  21. {
  22. protected $version;
  23. protected $product;
  24. protected $actionName;
  25. protected $regionId;
  26. protected $acceptFormat;
  27. protected $method;
  28. protected $protocolType = "http";
  29. protected $content;
  30. protected $queryParameters = array();
  31. protected $headers = array();
  32. function __construct($product, $version, $actionName)
  33. {
  34. $this->headers["x-sdk-client"] = "php/2.0.0";
  35. $this->product = $product;
  36. $this->version = $version;
  37. $this->actionName = $actionName;
  38. }
  39. public abstract function composeUrl($iSigner, $credential, $domain);
  40. public function getVersion()
  41. {
  42. return $this->version;
  43. }
  44. public function setVersion($version)
  45. {
  46. $this->version = $version;
  47. }
  48. public function getProduct()
  49. {
  50. return $this->product;
  51. }
  52. public function setProduct($product)
  53. {
  54. $this->product = $product;
  55. }
  56. public function getActionName()
  57. {
  58. return $this->actionName;
  59. }
  60. public function setActionName($actionName)
  61. {
  62. $this->actionName = $actionName;
  63. }
  64. public function getAcceptFormat()
  65. {
  66. return $this->acceptFormat;
  67. }
  68. public function setAcceptFormat($acceptFormat)
  69. {
  70. $this->acceptFormat = $acceptFormat;
  71. }
  72. public function getQueryParameters()
  73. {
  74. return $this->queryParameters;
  75. }
  76. public function getHeaders()
  77. {
  78. return $this->headers;
  79. }
  80. public function getMethod()
  81. {
  82. return $this->method;
  83. }
  84. public function setMethod($method)
  85. {
  86. $this->method = $method;
  87. }
  88. public function getProtocol()
  89. {
  90. return $this->protocolType;
  91. }
  92. public function setProtocol($protocol)
  93. {
  94. $this->protocolType = $protocol;
  95. }
  96. public function getRegionId()
  97. {
  98. return $this->regionId;
  99. }
  100. public function setRegionId($region)
  101. {
  102. $this->regionId = $region;
  103. }
  104. public function getContent()
  105. {
  106. return $this->content;
  107. }
  108. public function setContent($content)
  109. {
  110. $this->content = $content;
  111. }
  112. public function addHeader($headerKey, $headerValue)
  113. {
  114. $this->headers[$headerKey] = $headerValue;
  115. }
  116. }