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