forked from loafle/openapi-generator-original
[PHP] - Add range HTTP code support (#20992)
* [PHP] - Add range HTTP code support * Adding response body to 200 * Fix diff; update php-nextgen sample * Working on unit tests * Removes dangling files * Finalize tests * Remove dangling files * Add tests for no response body exception
This commit is contained in:
@@ -36,6 +36,8 @@ use GuzzleHttp\Psr7\MultipartStream;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
@@ -184,36 +186,15 @@ class AuthApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -228,34 +209,11 @@ class AuthApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -265,8 +223,9 @@ class AuthApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -486,36 +445,15 @@ class AuthApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -530,34 +468,11 @@ class AuthApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -567,8 +482,9 @@ class AuthApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -748,4 +664,47 @@ class AuthApi
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
private function handleResponseWithDataType(
|
||||
string $dataType,
|
||||
RequestInterface $request,
|
||||
ResponseInterface $response,
|
||||
): array {
|
||||
if (in_array($dataType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($dataType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $dataType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
private function responseWithinRangeCode(
|
||||
string $rangeCode,
|
||||
int $statusCode,
|
||||
): bool {
|
||||
$left = (int) ($rangeCode[0].'00');
|
||||
$right = (int) ($rangeCode[0].'99');
|
||||
|
||||
return $statusCode >= $left && $statusCode <= $right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ use GuzzleHttp\Psr7\MultipartStream;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
@@ -208,36 +210,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('\SplFileObject' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, '\SplFileObject', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'\SplFileObject',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -252,34 +233,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = '\SplFileObject';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'\SplFileObject',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -289,8 +247,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -510,36 +469,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -554,34 +492,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -591,8 +506,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -826,36 +742,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -870,34 +765,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -907,8 +779,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1155,36 +1028,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -1199,34 +1051,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -1236,8 +1065,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1478,36 +1308,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('\OpenAPI\Client\Model\Pet', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('\OpenAPI\Client\Model\Pet' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'\OpenAPI\Client\Model\Pet',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -1522,34 +1331,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Pet';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'\OpenAPI\Client\Model\Pet',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -1559,8 +1345,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1794,36 +1581,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -1838,34 +1604,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -1875,8 +1618,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2110,36 +1854,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('\OpenAPI\Client\Model\Pet', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('\OpenAPI\Client\Model\Pet' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'\OpenAPI\Client\Model\Pet',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -2154,34 +1877,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Pet';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'\OpenAPI\Client\Model\Pet',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -2191,8 +1891,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2426,36 +2127,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -2470,34 +2150,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -2507,8 +2164,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2742,36 +2400,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('\OpenAPI\Client\Model\StringEnumRef', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('\OpenAPI\Client\Model\StringEnumRef' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\StringEnumRef', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'\OpenAPI\Client\Model\StringEnumRef',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -2786,34 +2423,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\StringEnumRef';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'\OpenAPI\Client\Model\StringEnumRef',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -2823,8 +2437,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -3058,36 +2673,15 @@ class BodyApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -3102,34 +2696,11 @@ class BodyApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -3139,8 +2710,9 @@ class BodyApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -3330,4 +2902,47 @@ class BodyApi
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
private function handleResponseWithDataType(
|
||||
string $dataType,
|
||||
RequestInterface $request,
|
||||
ResponseInterface $response,
|
||||
): array {
|
||||
if (in_array($dataType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($dataType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $dataType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
private function responseWithinRangeCode(
|
||||
string $rangeCode,
|
||||
int $statusCode,
|
||||
): bool {
|
||||
$left = (int) ($rangeCode[0].'00');
|
||||
$right = (int) ($rangeCode[0].'99');
|
||||
|
||||
return $statusCode >= $left && $statusCode <= $right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ use GuzzleHttp\Psr7\MultipartStream;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
@@ -199,36 +201,15 @@ class FormApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -243,34 +224,11 @@ class FormApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -280,8 +238,9 @@ class FormApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -534,36 +493,15 @@ class FormApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -578,34 +516,11 @@ class FormApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -615,8 +530,9 @@ class FormApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -873,36 +789,15 @@ class FormApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -917,34 +812,11 @@ class FormApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -954,8 +826,9 @@ class FormApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1197,4 +1070,47 @@ class FormApi
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
private function handleResponseWithDataType(
|
||||
string $dataType,
|
||||
RequestInterface $request,
|
||||
ResponseInterface $response,
|
||||
): array {
|
||||
if (in_array($dataType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($dataType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $dataType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
private function responseWithinRangeCode(
|
||||
string $rangeCode,
|
||||
int $statusCode,
|
||||
): bool {
|
||||
$left = (int) ($rangeCode[0].'00');
|
||||
$right = (int) ($rangeCode[0].'99');
|
||||
|
||||
return $statusCode >= $left && $statusCode <= $right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ use GuzzleHttp\Psr7\MultipartStream;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
@@ -201,36 +203,15 @@ class HeaderApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -245,34 +226,11 @@ class HeaderApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -282,8 +240,9 @@ class HeaderApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -514,4 +473,47 @@ class HeaderApi
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
private function handleResponseWithDataType(
|
||||
string $dataType,
|
||||
RequestInterface $request,
|
||||
ResponseInterface $response,
|
||||
): array {
|
||||
if (in_array($dataType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($dataType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $dataType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
private function responseWithinRangeCode(
|
||||
string $rangeCode,
|
||||
int $statusCode,
|
||||
): bool {
|
||||
$left = (int) ($rangeCode[0].'00');
|
||||
$right = (int) ($rangeCode[0].'99');
|
||||
|
||||
return $statusCode >= $left && $statusCode <= $right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ use GuzzleHttp\Psr7\MultipartStream;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
@@ -197,36 +199,15 @@ class PathApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -241,34 +222,11 @@ class PathApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -278,8 +236,9 @@ class PathApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -539,4 +498,47 @@ class PathApi
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
private function handleResponseWithDataType(
|
||||
string $dataType,
|
||||
RequestInterface $request,
|
||||
ResponseInterface $response,
|
||||
): array {
|
||||
if (in_array($dataType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($dataType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $dataType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
private function responseWithinRangeCode(
|
||||
string $rangeCode,
|
||||
int $statusCode,
|
||||
): bool {
|
||||
$left = (int) ($rangeCode[0].'00');
|
||||
$right = (int) ($rangeCode[0].'99');
|
||||
|
||||
return $statusCode >= $left && $statusCode <= $right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ use GuzzleHttp\Psr7\MultipartStream;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
@@ -216,36 +218,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -260,34 +241,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -297,8 +255,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -558,36 +517,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -602,34 +540,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -639,8 +554,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -916,36 +832,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -960,34 +855,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -997,8 +869,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1266,36 +1139,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -1310,34 +1162,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -1347,8 +1176,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1584,36 +1414,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -1628,34 +1437,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -1665,8 +1451,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -1902,36 +1689,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -1946,34 +1712,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -1983,8 +1726,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2220,36 +1964,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -2264,34 +1987,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -2301,8 +2001,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2538,36 +2239,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -2582,34 +2262,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -2619,8 +2276,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -2856,36 +2514,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -2900,34 +2537,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -2937,8 +2551,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -3174,36 +2789,15 @@ class QueryApi
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
@@ -3218,34 +2812,11 @@ class QueryApi
|
||||
);
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
return $this->handleResponseWithDataType(
|
||||
'string',
|
||||
$request,
|
||||
$response,
|
||||
);
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
@@ -3255,8 +2826,9 @@ class QueryApi
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
@@ -3448,4 +3020,47 @@ class QueryApi
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
private function handleResponseWithDataType(
|
||||
string $dataType,
|
||||
RequestInterface $request,
|
||||
ResponseInterface $response,
|
||||
): array {
|
||||
if (in_array($dataType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($dataType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $dataType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
private function responseWithinRangeCode(
|
||||
string $rangeCode,
|
||||
int $statusCode,
|
||||
): bool {
|
||||
$left = (int) ($rangeCode[0].'00');
|
||||
$right = (int) ($rangeCode[0].'99');
|
||||
|
||||
return $statusCode >= $left && $statusCode <= $right;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user