mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 15:10:49 +00:00
Issue-7869: Update to Guzzle 7, removed all deprecated Guzzle\Psr7 function calls by their static counterparts and updated FakeHttpClient interface to Guzzle7 client (#10585)
Co-authored-by: Benjamin <Benjamin.Heiss@tngtech.com>
This commit is contained in:
parent
fc7c6d8edb
commit
69452360ab
@ -21,6 +21,7 @@ namespace {{apiPackage}};
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use GuzzleHttp\Psr7\MultipartStream;
|
use GuzzleHttp\Psr7\MultipartStream;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
@ -197,6 +198,13 @@ use {{invokerPackage}}\ObjectSerializer;
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -552,7 +560,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
|||||||
$formParams['{{baseName}}'] = [];
|
$formParams['{{baseName}}'] = [];
|
||||||
$paramFiles = is_array(${{paramName}}) ? ${{paramName}} : [${{paramName}}];
|
$paramFiles = is_array(${{paramName}}) ? ${{paramName}} : [${{paramName}}];
|
||||||
foreach ($paramFiles as $paramFile) {
|
foreach ($paramFiles as $paramFile) {
|
||||||
$formParams['{{baseName}}'][] = \GuzzleHttp\Psr7\try_fopen(
|
$formParams['{{baseName}}'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||||
ObjectSerializer::toFormValue($paramFile),
|
ObjectSerializer::toFormValue($paramFile),
|
||||||
'rb'
|
'rb'
|
||||||
);
|
);
|
||||||
@ -607,7 +615,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,7 +668,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
|||||||
$operationHost = $operationHosts[$this->hostIndex];
|
$operationHost = $operationHosts[$this->hostIndex];
|
||||||
|
|
||||||
{{/servers.0}}
|
{{/servers.0}}
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'{{httpMethod}}',
|
'{{httpMethod}}',
|
||||||
{{^servers.0}}$this->config->getHost(){{/servers.0}}{{#servers.0}}$operationHost{{/servers.0}} . $resourcePath . ($query ? "?{$query}" : ''),
|
{{^servers.0}}$this->config->getHost(){{/servers.0}}{{#servers.0}}$operationHost{{/servers.0}} . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
|
@ -28,7 +28,8 @@
|
|||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"guzzlehttp/guzzle": "^6.2"
|
"guzzlehttp/guzzle": "^7.3",
|
||||||
|
"guzzlehttp/psr7": "^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^8.0 || ^9.0",
|
"phpunit/phpunit": "^8.0 || ^9.0",
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"guzzlehttp/guzzle": "^6.2"
|
"guzzlehttp/guzzle": "^7.3",
|
||||||
|
"guzzlehttp/psr7": "^2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^8.0 || ^9.0",
|
"phpunit/phpunit": "^8.0 || ^9.0",
|
||||||
|
@ -30,6 +30,7 @@ namespace OpenAPI\Client\Api;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use GuzzleHttp\Psr7\MultipartStream;
|
use GuzzleHttp\Psr7\MultipartStream;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
@ -157,6 +158,13 @@ class AnotherFakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -351,7 +359,7 @@ class AnotherFakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,7 +375,7 @@ class AnotherFakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PATCH',
|
'PATCH',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
|
@ -30,6 +30,7 @@ namespace OpenAPI\Client\Api;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use GuzzleHttp\Psr7\MultipartStream;
|
use GuzzleHttp\Psr7\MultipartStream;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
@ -151,6 +152,13 @@ class DefaultApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -326,7 +334,7 @@ class DefaultApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,7 +350,7 @@ class DefaultApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
|
@ -30,6 +30,7 @@ namespace OpenAPI\Client\Api;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use GuzzleHttp\Psr7\MultipartStream;
|
use GuzzleHttp\Psr7\MultipartStream;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
@ -155,6 +156,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -334,7 +342,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +358,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -405,6 +413,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -576,7 +591,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,7 +607,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -640,6 +655,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -824,7 +846,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -840,7 +862,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -888,6 +910,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1072,7 +1101,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1088,7 +1117,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1136,6 +1165,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1320,7 +1356,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1336,7 +1372,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1384,6 +1420,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1568,7 +1611,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1584,7 +1627,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1632,6 +1675,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1822,7 +1872,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1838,7 +1888,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1885,6 +1935,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -2031,7 +2088,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2047,7 +2104,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PUT',
|
'PUT',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -2094,6 +2151,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -2240,7 +2304,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2256,7 +2320,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PUT',
|
'PUT',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -2305,6 +2369,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -2471,7 +2542,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2487,7 +2558,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PUT',
|
'PUT',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -2539,6 +2610,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -2733,7 +2811,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2749,7 +2827,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PATCH',
|
'PATCH',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -2826,6 +2904,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -3083,7 +3168,7 @@ class FakeApi
|
|||||||
$formParams['binary'] = [];
|
$formParams['binary'] = [];
|
||||||
$paramFiles = is_array($binary) ? $binary : [$binary];
|
$paramFiles = is_array($binary) ? $binary : [$binary];
|
||||||
foreach ($paramFiles as $paramFile) {
|
foreach ($paramFiles as $paramFile) {
|
||||||
$formParams['binary'][] = \GuzzleHttp\Psr7\try_fopen(
|
$formParams['binary'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||||
ObjectSerializer::toFormValue($paramFile),
|
ObjectSerializer::toFormValue($paramFile),
|
||||||
'rb'
|
'rb'
|
||||||
);
|
);
|
||||||
@ -3138,7 +3223,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3158,7 +3243,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -3223,6 +3308,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -3445,7 +3537,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3461,7 +3553,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -3526,6 +3618,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -3763,7 +3862,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3783,7 +3882,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -3834,6 +3933,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -3984,7 +4090,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4000,7 +4106,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -4053,6 +4159,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -4214,7 +4327,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4230,7 +4343,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -4289,6 +4402,13 @@ class FakeApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -4538,7 +4658,7 @@ class FakeApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4554,7 +4674,7 @@ class FakeApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PUT',
|
'PUT',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
|
@ -30,6 +30,7 @@ namespace OpenAPI\Client\Api;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use GuzzleHttp\Psr7\MultipartStream;
|
use GuzzleHttp\Psr7\MultipartStream;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
@ -157,6 +158,13 @@ class FakeClassnameTags123Api
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -351,7 +359,7 @@ class FakeClassnameTags123Api
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,7 +380,7 @@ class FakeClassnameTags123Api
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PATCH',
|
'PATCH',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
|
@ -30,6 +30,7 @@ namespace OpenAPI\Client\Api;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use GuzzleHttp\Psr7\MultipartStream;
|
use GuzzleHttp\Psr7\MultipartStream;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
@ -164,6 +165,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -326,7 +334,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +360,7 @@ class PetApi
|
|||||||
}
|
}
|
||||||
$operationHost = $operationHosts[$this->hostIndex];
|
$operationHost = $operationHosts[$this->hostIndex];
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -405,6 +413,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -564,7 +579,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,7 +599,7 @@ class PetApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -636,6 +651,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -831,7 +853,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -851,7 +873,7 @@ class PetApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -905,6 +927,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1104,7 +1133,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1124,7 +1153,7 @@ class PetApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1176,6 +1205,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1372,7 +1408,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1393,7 +1429,7 @@ class PetApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1452,6 +1488,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1614,7 +1657,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1640,7 +1683,7 @@ class PetApi
|
|||||||
}
|
}
|
||||||
$operationHost = $operationHosts[$this->hostIndex];
|
$operationHost = $operationHosts[$this->hostIndex];
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PUT',
|
'PUT',
|
||||||
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1695,6 +1738,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1861,7 +1911,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1881,7 +1931,7 @@ class PetApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1937,6 +1987,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -2116,7 +2173,7 @@ class PetApi
|
|||||||
$formParams['file'] = [];
|
$formParams['file'] = [];
|
||||||
$paramFiles = is_array($file) ? $file : [$file];
|
$paramFiles = is_array($file) ? $file : [$file];
|
||||||
foreach ($paramFiles as $paramFile) {
|
foreach ($paramFiles as $paramFile) {
|
||||||
$formParams['file'][] = \GuzzleHttp\Psr7\try_fopen(
|
$formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||||
ObjectSerializer::toFormValue($paramFile),
|
ObjectSerializer::toFormValue($paramFile),
|
||||||
'rb'
|
'rb'
|
||||||
);
|
);
|
||||||
@ -2155,7 +2212,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2175,7 +2232,7 @@ class PetApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -2231,6 +2288,13 @@ class PetApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -2416,7 +2480,7 @@ class PetApi
|
|||||||
$formParams['requiredFile'] = [];
|
$formParams['requiredFile'] = [];
|
||||||
$paramFiles = is_array($required_file) ? $required_file : [$required_file];
|
$paramFiles = is_array($required_file) ? $required_file : [$required_file];
|
||||||
foreach ($paramFiles as $paramFile) {
|
foreach ($paramFiles as $paramFile) {
|
||||||
$formParams['requiredFile'][] = \GuzzleHttp\Psr7\try_fopen(
|
$formParams['requiredFile'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||||
ObjectSerializer::toFormValue($paramFile),
|
ObjectSerializer::toFormValue($paramFile),
|
||||||
'rb'
|
'rb'
|
||||||
);
|
);
|
||||||
@ -2455,7 +2519,7 @@ class PetApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2475,7 +2539,7 @@ class PetApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
|
@ -30,6 +30,7 @@ namespace OpenAPI\Client\Api;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use GuzzleHttp\Psr7\MultipartStream;
|
use GuzzleHttp\Psr7\MultipartStream;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
@ -156,6 +157,13 @@ class StoreApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -308,7 +316,7 @@ class StoreApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +332,7 @@ class StoreApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -374,6 +382,13 @@ class StoreApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -553,7 +568,7 @@ class StoreApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -574,7 +589,7 @@ class StoreApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -626,6 +641,13 @@ class StoreApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -829,7 +851,7 @@ class StoreApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -845,7 +867,7 @@ class StoreApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -897,6 +919,13 @@ class StoreApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1091,7 +1120,7 @@ class StoreApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1107,7 +1136,7 @@ class StoreApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
|
@ -30,6 +30,7 @@ namespace OpenAPI\Client\Api;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
|
use GuzzleHttp\Exception\ConnectException;
|
||||||
use GuzzleHttp\Psr7\MultipartStream;
|
use GuzzleHttp\Psr7\MultipartStream;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
@ -156,6 +157,13 @@ class UserApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -306,7 +314,7 @@ class UserApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +330,7 @@ class UserApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -373,6 +381,13 @@ class UserApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -523,7 +538,7 @@ class UserApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,7 +554,7 @@ class UserApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -590,6 +605,13 @@ class UserApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -740,7 +762,7 @@ class UserApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -756,7 +778,7 @@ class UserApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -807,6 +829,13 @@ class UserApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -959,7 +988,7 @@ class UserApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -975,7 +1004,7 @@ class UserApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1027,6 +1056,13 @@ class UserApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1223,7 +1259,7 @@ class UserApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1239,7 +1275,7 @@ class UserApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1293,6 +1329,13 @@ class UserApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1512,7 +1555,7 @@ class UserApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1528,7 +1571,7 @@ class UserApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1577,6 +1620,13 @@ class UserApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1712,7 +1762,7 @@ class UserApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1728,7 +1778,7 @@ class UserApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
@ -1781,6 +1831,13 @@ class UserApi
|
|||||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||||
);
|
);
|
||||||
|
} catch (ConnectException $e) {
|
||||||
|
throw new ApiException(
|
||||||
|
"[{$e->getCode()}] {$e->getMessage()}",
|
||||||
|
(int) $e->getCode(),
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusCode = $response->getStatusCode();
|
$statusCode = $response->getStatusCode();
|
||||||
@ -1948,7 +2005,7 @@ class UserApi
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// for HTTP post (form)
|
// for HTTP post (form)
|
||||||
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
|
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1964,7 +2021,7 @@ class UserApi
|
|||||||
$headers
|
$headers
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = \GuzzleHttp\Psr7\build_query($queryParams);
|
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
|
||||||
return new Request(
|
return new Request(
|
||||||
'PUT',
|
'PUT',
|
||||||
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
|
||||||
|
@ -4,6 +4,7 @@ namespace OpenAPI\Client;
|
|||||||
|
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\GuzzleException;
|
use GuzzleHttp\Exception\GuzzleException;
|
||||||
|
use GuzzleHttp\Promise\PromiseInterface;
|
||||||
use GuzzleHttp\Psr7\Response;
|
use GuzzleHttp\Psr7\Response;
|
||||||
use Psr\Http\Message\RequestInterface;
|
use Psr\Http\Message\RequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
@ -41,23 +42,23 @@ class FakeHttpClient implements ClientInterface
|
|||||||
* @return ResponseInterface
|
* @return ResponseInterface
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
*/
|
*/
|
||||||
public function send(RequestInterface $request, array $options = [])
|
public function send(RequestInterface $request, array $options = []): ResponseInterface
|
||||||
{
|
{
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
return $this->response ?: new Response(200);
|
return $this->response ?: new Response(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendAsync(RequestInterface $request, array $options = [])
|
public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface
|
||||||
{
|
{
|
||||||
throw new \RuntimeException('not implemented');
|
throw new \RuntimeException('not implemented');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function request($method, $uri, array $options = [])
|
public function request($method, $uri, array $options = []): ResponseInterface
|
||||||
{
|
{
|
||||||
throw new \RuntimeException('not implemented');
|
throw new \RuntimeException('not implemented');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function requestAsync($method, $uri, array $options = [])
|
public function requestAsync($method, $uri, array $options = []): PromiseInterface
|
||||||
{
|
{
|
||||||
throw new \RuntimeException('not implemented');
|
throw new \RuntimeException('not implemented');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user