77 private $headers = [];
91 private $operationMetadata = [];
98 private $successRegex;
105 private $returnRegex;
111 private $removeBackend;
142 $successRegex =
null,
146 $this->operation = $operation;
147 $this->dataType = $dataType;
148 $this->apiMethod = $apiMethod;
149 $this->apiUri = trim($apiUri,
'/');
151 $this->headers = $headers;
152 $this->params = $params;
153 $this->operationMetadata = $metaData;
154 $this->successRegex = $successRegex;
155 $this->returnRegex = $returnRegex;
156 $this->removeBackend = $removeBackend;
157 $this->apiUrl =
null;
159 if (!empty($contentType)) {
160 $this->contentType = $contentType;
162 $this->contentType =
'application/x-www-form-urlencoded';
166 $this->headers[] = self::HTTP_CONTENT_TYPE_HEADER .
': ' . $this->contentType;
176 return $this->dataType;
186 return $this->operation;
196 return $this->apiMethod;
206 if (!$this->apiUrl) {
207 $this->apiUrl = $this->apiUri;
209 if (array_key_exists(
'query', $this->params)) {
214 return $this->apiUrl;
234 return $this->headers;
244 return $this->removeBackend;
254 return $this->contentType;
264 return $this->operationMetadata;
274 return $this->successRegex;
284 return $this->returnRegex;
294 foreach ($this->params[
'query'] as $paramName => $paramValue) {
295 if (strpos($this->apiUrl,
'?') ===
false) {
296 $this->apiUrl = $this->apiUrl .
"?";
298 $this->apiUrl = $this->apiUrl .
"&";
300 $this->apiUrl = $this->apiUrl . $paramName .
"=" . $paramValue;
const HTTP_CONTENT_TYPE_HEADER
__construct( $name, $operation, $dataType, $apiMethod, $apiUri, $auth, $headers, $params, $metaData, $contentType, $removeBackend, $successRegex=null, $returnRegex=null)