Regenerated PHP petstore sample.

This commit is contained in:
Arne Jørgensen
2015-12-27 15:29:08 +01:00
parent 6a45111e10
commit 84c35bd0cb
2 changed files with 81 additions and 1 deletions

View File

@@ -738,6 +738,86 @@ class PetApi
}
}
/**
* downloadFile
*
* downloads an image
*
* @return \Swagger\Client\Model\File
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function downloadFile()
{
list($response, $statusCode, $httpHeader) = $this->downloadFileWithHttpInfo ();
return $response;
}
/**
* downloadFileWithHttpInfo
*
* downloads an image
*
* @return Array of \Swagger\Client\Model\File, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response
*/
public function downloadFileWithHttpInfo()
{
// parse inputs
$resourcePath = "/pet/{petId}/downloadImage";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "GET";
$httpBody = '';
$queryParams = array();
$headerParams = array();
$formParams = array();
$_header_accept = ApiClient::selectHeaderAccept(array('application/octet-stream'));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form)
}
// make the API Call
try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, $method,
$queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\File'
);
if (!$response) {
return array(null, $statusCode, $httpHeader);
}
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\File', $httpHeader), $statusCode, $httpHeader);
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\File', $e->getResponseHeaders());
$e->setResponseObject($data);
break;
}
throw $e;
}
}
/**
* uploadFile
*

View File

@@ -193,7 +193,7 @@ class ObjectSerializer
$deserialized = $values;
} elseif ($class === '\DateTime') {
$deserialized = new \DateTime($data);
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
settype($data, $class);
$deserialized = $data;
} elseif ($class === '\SplFileObject') {