AcsRequest.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. namespace Mrgoon\AliyunSmsSdk;
  21. abstract class AcsRequest
  22. {
  23. protected $version;
  24. protected $product;
  25. protected $actionName;
  26. protected $regionId;
  27. protected $acceptFormat;
  28. protected $method;
  29. protected $protocolType = "http";
  30. protected $content;
  31. protected $queryParameters = array();
  32. protected $headers = array();
  33. function __construct($product, $version, $actionName)
  34. {
  35. $this->headers["x-sdk-client"] = "php/2.0.0";
  36. $this->product = $product;
  37. $this->version = $version;
  38. $this->actionName = $actionName;
  39. }
  40. public abstract function composeUrl($iSigner, $credential, $domain);
  41. public function getVersion()
  42. {
  43. return $this->version;
  44. }
  45. public function setVersion($version)
  46. {
  47. $this->version = $version;
  48. }
  49. public function getProduct()
  50. {
  51. return $this->product;
  52. }
  53. public function setProduct($product)
  54. {
  55. $this->product = $product;
  56. }
  57. public function getActionName()
  58. {
  59. return $this->actionName;
  60. }
  61. public function setActionName($actionName)
  62. {
  63. $this->actionName = $actionName;
  64. }
  65. public function getAcceptFormat()
  66. {
  67. return $this->acceptFormat;
  68. }
  69. public function setAcceptFormat($acceptFormat)
  70. {
  71. $this->acceptFormat = $acceptFormat;
  72. }
  73. public function getQueryParameters()
  74. {
  75. return $this->queryParameters;
  76. }
  77. public function getHeaders()
  78. {
  79. return $this->headers;
  80. }
  81. public function getMethod()
  82. {
  83. return $this->method;
  84. }
  85. public function setMethod($method)
  86. {
  87. $this->method = $method;
  88. }
  89. public function getProtocol()
  90. {
  91. return $this->protocolType;
  92. }
  93. public function setProtocol($protocol)
  94. {
  95. $this->protocolType = $protocol;
  96. }
  97. public function getRegionId()
  98. {
  99. return $this->regionId;
  100. }
  101. public function setRegionId($region)
  102. {
  103. $this->regionId = $region;
  104. }
  105. public function getContent()
  106. {
  107. return $this->content;
  108. }
  109. public function setContent($content)
  110. {
  111. $this->content = $content;
  112. }
  113. public function addHeader($headerKey, $headerValue)
  114. {
  115. $this->headers[$headerKey] = $headerValue;
  116. }
  117. }