AcsRequest.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 $queryParameters = array();
  30. protected $headers = array();
  31. function __construct($product, $version, $actionName)
  32. {
  33. $this->headers["x-sdk-client"] = "php/2.0.0";
  34. $this->product = $product;
  35. $this->version = $version;
  36. $this->actionName = $actionName;
  37. }
  38. public abstract function composeUrl($iSigner, $credential, $domain);
  39. public function getVersion()
  40. {
  41. return $this->version;
  42. }
  43. public function setVersion($version)
  44. {
  45. $this->version = $version;
  46. }
  47. public function getProduct()
  48. {
  49. return $this->product;
  50. }
  51. public function setProduct($product)
  52. {
  53. $this->product = $product;
  54. }
  55. public function getActionName()
  56. {
  57. return $this->actionName;
  58. }
  59. public function setActionName($actionName)
  60. {
  61. $this->actionName = $actionName;
  62. }
  63. public function getAcceptFormat()
  64. {
  65. return $this->acceptFormat;
  66. }
  67. public function setAcceptFormat($acceptFormat)
  68. {
  69. $this->acceptFormat = $acceptFormat;
  70. }
  71. public function getQueryParameters()
  72. {
  73. return $this->queryParameters;
  74. }
  75. public function getHeaders()
  76. {
  77. return $this->headers;
  78. }
  79. public function getMethod()
  80. {
  81. return $this->method;
  82. }
  83. public function setMethod($method)
  84. {
  85. $this->method = $method;
  86. }
  87. public function getProtocol()
  88. {
  89. return $this->protocolType;
  90. }
  91. public function setProtocol($protocol)
  92. {
  93. $this->protocolType = $protocol;
  94. }
  95. public function getRegionId()
  96. {
  97. return $this->regionId;
  98. }
  99. public function setRegionId($region)
  100. {
  101. $this->regionId = $region;
  102. }
  103. }