forked from loafle/openapi-generator-original
update php sample
This commit is contained in:
@@ -90,7 +90,6 @@ class PetApi
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addPet
|
||||
*
|
||||
@@ -156,7 +155,6 @@ class PetApi
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -164,9 +162,8 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -174,7 +171,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* addPetUsingByteArray
|
||||
*
|
||||
@@ -205,7 +201,7 @@ class PetApi
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet?testing_byte_array=true";
|
||||
$resourcePath = "/pet?testing_byte_array=true";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
@@ -240,7 +236,6 @@ class PetApi
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -248,9 +243,8 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -258,7 +252,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* deletePet
|
||||
*
|
||||
@@ -308,12 +301,10 @@ class PetApi
|
||||
|
||||
|
||||
// header params
|
||||
|
||||
if ($api_key !== null) {
|
||||
$headerParams['api_key'] = $this->apiClient->getSerializer()->toHeaderValue($api_key);
|
||||
}
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
@@ -338,7 +329,6 @@ class PetApi
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -346,9 +336,8 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -356,7 +345,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* findPetsByStatus
|
||||
*
|
||||
@@ -399,11 +387,9 @@ class PetApi
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||
|
||||
// query params
|
||||
|
||||
if (is_array($status)) {
|
||||
$status = $this->apiClient->getSerializer()->serializeCollection($status, 'multi', true);
|
||||
}
|
||||
|
||||
if ($status !== null) {
|
||||
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
|
||||
}
|
||||
@@ -426,7 +412,6 @@ class PetApi
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -434,14 +419,12 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\Pet[]'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders());
|
||||
@@ -452,7 +435,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* findPetsByTags
|
||||
*
|
||||
@@ -495,11 +477,9 @@ class PetApi
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||
|
||||
// query params
|
||||
|
||||
if (is_array($tags)) {
|
||||
$tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'multi', true);
|
||||
}
|
||||
|
||||
if ($tags !== null) {
|
||||
$queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags);
|
||||
}
|
||||
@@ -522,7 +502,6 @@ class PetApi
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -530,14 +509,12 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\Pet[]'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders());
|
||||
@@ -548,7 +525,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPetById
|
||||
*
|
||||
@@ -597,7 +573,6 @@ class PetApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
@@ -624,12 +599,11 @@ class PetApi
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -637,14 +611,12 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\Pet'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders());
|
||||
@@ -655,7 +627,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPetByIdInObject
|
||||
*
|
||||
@@ -690,7 +661,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}?response=inline_arbitrary_object";
|
||||
$resourcePath = "/pet/{petId}?response=inline_arbitrary_object";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
@@ -704,7 +675,6 @@ class PetApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
@@ -731,12 +701,11 @@ class PetApi
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -744,14 +713,12 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\InlineResponse200'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\InlineResponse200', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\InlineResponse200', $e->getResponseHeaders());
|
||||
@@ -762,7 +729,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* petPetIdtestingByteArraytrueGet
|
||||
*
|
||||
@@ -797,7 +763,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/pet/{petId}?testing_byte_array=true";
|
||||
$resourcePath = "/pet/{petId}?testing_byte_array=true";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
@@ -811,7 +777,6 @@ class PetApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
@@ -838,12 +803,11 @@ class PetApi
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -851,14 +815,12 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, 'string'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders());
|
||||
@@ -869,7 +831,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* updatePet
|
||||
*
|
||||
@@ -935,7 +896,6 @@ class PetApi
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -943,9 +903,8 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -953,7 +912,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* updatePetWithForm
|
||||
*
|
||||
@@ -1006,7 +964,6 @@ class PetApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
@@ -1019,16 +976,10 @@ class PetApi
|
||||
|
||||
// form params
|
||||
if ($name !== null) {
|
||||
|
||||
|
||||
$formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name);
|
||||
|
||||
}// form params
|
||||
if ($status !== null) {
|
||||
|
||||
|
||||
$formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1043,7 +994,6 @@ class PetApi
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -1051,9 +1001,8 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -1061,7 +1010,6 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* uploadFile
|
||||
*
|
||||
@@ -1114,7 +1062,6 @@ class PetApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($pet_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "petId" . "}",
|
||||
@@ -1127,13 +1074,9 @@ class PetApi
|
||||
|
||||
// form params
|
||||
if ($additional_metadata !== null) {
|
||||
|
||||
|
||||
$formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata);
|
||||
|
||||
}// form params
|
||||
if ($file !== null) {
|
||||
|
||||
// PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
|
||||
// See: https://wiki.php.net/rfc/curl-file-upload
|
||||
if (function_exists('curl_file_create')) {
|
||||
@@ -1141,8 +1084,6 @@ class PetApi
|
||||
} else {
|
||||
$formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1157,7 +1098,6 @@ class PetApi
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -1165,9 +1105,8 @@ class PetApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -1175,5 +1114,4 @@ class PetApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -90,7 +90,6 @@ class StoreApi
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* deleteOrder
|
||||
*
|
||||
@@ -139,7 +138,6 @@ class StoreApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($order_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "orderId" . "}",
|
||||
@@ -159,17 +157,15 @@ class StoreApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'DELETE',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -177,7 +173,6 @@ class StoreApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* findOrdersByStatus
|
||||
*
|
||||
@@ -220,7 +215,6 @@ class StoreApi
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||
|
||||
// query params
|
||||
|
||||
if ($status !== null) {
|
||||
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
|
||||
}
|
||||
@@ -245,14 +239,13 @@ class StoreApi
|
||||
$headerParams['x-test_api_client_id'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_secret');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_secret'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -260,14 +253,12 @@ class StoreApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\Order[]'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order[]', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order[]', $e->getResponseHeaders());
|
||||
@@ -278,7 +269,6 @@ class StoreApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getInventory
|
||||
*
|
||||
@@ -340,7 +330,6 @@ class StoreApi
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -348,14 +337,12 @@ class StoreApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, 'map[string,int]'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, 'map[string,int]', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders());
|
||||
@@ -366,7 +353,6 @@ class StoreApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getInventoryInObject
|
||||
*
|
||||
@@ -395,7 +381,7 @@ class StoreApi
|
||||
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/store/inventory?response=arbitrary_object";
|
||||
$resourcePath = "/store/inventory?response=arbitrary_object";
|
||||
$httpBody = '';
|
||||
$queryParams = array();
|
||||
$headerParams = array();
|
||||
@@ -428,7 +414,6 @@ class StoreApi
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -436,14 +421,12 @@ class StoreApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, 'object'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders());
|
||||
@@ -454,7 +437,6 @@ class StoreApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getOrderById
|
||||
*
|
||||
@@ -503,7 +485,6 @@ class StoreApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($order_id !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "orderId" . "}",
|
||||
@@ -530,14 +511,13 @@ class StoreApi
|
||||
$headerParams['test_api_key_header'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$queryParams['test_api_key_query'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -545,14 +525,12 @@ class StoreApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\Order'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders());
|
||||
@@ -563,7 +541,6 @@ class StoreApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* placeOrder
|
||||
*
|
||||
@@ -631,14 +608,13 @@ class StoreApi
|
||||
$headerParams['x-test_api_client_id'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_secret');
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['x-test_api_client_secret'] = $apiKey;
|
||||
}
|
||||
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -646,14 +622,12 @@ class StoreApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\Order'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders());
|
||||
@@ -664,5 +638,4 @@ class StoreApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -90,7 +90,6 @@ class UserApi
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* createUser
|
||||
*
|
||||
@@ -151,17 +150,15 @@ class UserApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -169,7 +166,6 @@ class UserApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* createUsersWithArrayInput
|
||||
*
|
||||
@@ -230,17 +226,15 @@ class UserApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -248,7 +242,6 @@ class UserApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* createUsersWithListInput
|
||||
*
|
||||
@@ -309,17 +302,15 @@ class UserApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'POST',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -327,7 +318,6 @@ class UserApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* deleteUser
|
||||
*
|
||||
@@ -376,7 +366,6 @@ class UserApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($username !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "username" . "}",
|
||||
@@ -401,7 +390,6 @@ class UserApi
|
||||
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
@@ -409,9 +397,8 @@ class UserApi
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -419,13 +406,12 @@ class UserApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getUserByName
|
||||
*
|
||||
* Get user by user name
|
||||
*
|
||||
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return \Swagger\Client\Model\User
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
@@ -441,7 +427,7 @@ class UserApi
|
||||
*
|
||||
* Get user by user name
|
||||
*
|
||||
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @param string $username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return Array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings)
|
||||
* @throws \Swagger\Client\ApiException on non-2xx response
|
||||
*/
|
||||
@@ -468,7 +454,6 @@ class UserApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($username !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "username" . "}",
|
||||
@@ -488,22 +473,19 @@ class UserApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, '\Swagger\Client\Model\User'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\User', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders());
|
||||
@@ -514,7 +496,6 @@ class UserApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* loginUser
|
||||
*
|
||||
@@ -559,11 +540,9 @@ class UserApi
|
||||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
|
||||
|
||||
// query params
|
||||
|
||||
if ($username !== null) {
|
||||
$queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username);
|
||||
}// query params
|
||||
|
||||
if ($password !== null) {
|
||||
$queryParams['password'] = $this->apiClient->getSerializer()->toQueryValue($password);
|
||||
}
|
||||
@@ -581,22 +560,19 @@ class UserApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams, 'string'
|
||||
);
|
||||
|
||||
if (!$response) {
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
}
|
||||
|
||||
return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders());
|
||||
@@ -607,7 +583,6 @@ class UserApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* logoutUser
|
||||
*
|
||||
@@ -662,17 +637,15 @@ class UserApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'GET',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -680,7 +653,6 @@ class UserApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* updateUser
|
||||
*
|
||||
@@ -731,7 +703,6 @@ class UserApi
|
||||
|
||||
|
||||
// path params
|
||||
|
||||
if ($username !== null) {
|
||||
$resourcePath = str_replace(
|
||||
"{" . "username" . "}",
|
||||
@@ -755,17 +726,15 @@ class UserApi
|
||||
} elseif (count($formParams) > 0) {
|
||||
$httpBody = $formParams; // for HTTP post (form)
|
||||
}
|
||||
|
||||
// make the API Call
|
||||
// make the API Call
|
||||
try {
|
||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||
$resourcePath, 'PUT',
|
||||
$queryParams, $httpBody,
|
||||
$headerParams
|
||||
);
|
||||
|
||||
|
||||
return array(null, $statusCode, $httpHeader);
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
}
|
||||
@@ -773,5 +742,4 @@ class UserApi
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user