diff --git a/.gitignore b/.gitignore index e69de29..7579f74 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor +composer.lock diff --git a/composer.json b/composer.json index 7be6538..23a81c7 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^6.2 || ^7.0", - "guzzlehttp/psr7": "^1.8.2" + "guzzlehttp/psr7": "^1.8.2 || ^2.0" }, "require-dev": { "phpunit/phpunit": "^4.8", diff --git a/src/com/amazon/paapi5/v1/api/DefaultApi.php b/src/com/amazon/paapi5/v1/api/DefaultApi.php index f51d229..342a39b 100644 --- a/src/com/amazon/paapi5/v1/api/DefaultApi.php +++ b/src/com/amazon/paapi5/v1/api/DefaultApi.php @@ -207,7 +207,7 @@ public function getBrowseNodesWithHttpInfo($getBrowseNodesRequest) /** * Operation getBrowseNodesAsync * - * + * * * @param \Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\GetBrowseNodesRequest $getBrowseNodesRequest GetBrowseNodesRequest (required) * @@ -227,7 +227,7 @@ function ($response) { /** * Operation getBrowseNodesAsyncWithHttpInfo * - * + * * * @param \Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\GetBrowseNodesRequest $getBrowseNodesRequest GetBrowseNodesRequest (required) * @@ -341,7 +341,7 @@ protected function getBrowseNodesRequest($getBrowseNodesRequest) $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = \GuzzleHttp\Utils::jsonEncode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -356,11 +356,11 @@ protected function getBrowseNodesRequest($getBrowseNodesRequest) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -378,7 +378,7 @@ protected function getBrowseNodesRequest($getBrowseNodesRequest) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -519,7 +519,7 @@ public function getItemsWithHttpInfo($getItemsRequest) /** * Operation getItemsAsync * - * + * * * @param \Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\GetItemsRequest $getItemsRequest GetItemsRequest (required) * @@ -539,7 +539,7 @@ function ($response) { /** * Operation getItemsAsyncWithHttpInfo * - * + * * * @param \Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\GetItemsRequest $getItemsRequest GetItemsRequest (required) * @@ -653,7 +653,7 @@ protected function getItemsRequest($getItemsRequest) $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = \GuzzleHttp\Utils::jsonEncode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -668,11 +668,11 @@ protected function getItemsRequest($getItemsRequest) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -690,7 +690,7 @@ protected function getItemsRequest($getItemsRequest) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -831,7 +831,7 @@ public function getVariationsWithHttpInfo($getVariationsRequest) /** * Operation getVariationsAsync * - * + * * * @param \Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\GetVariationsRequest $getVariationsRequest GetVariationsRequest (required) * @@ -851,7 +851,7 @@ function ($response) { /** * Operation getVariationsAsyncWithHttpInfo * - * + * * * @param \Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\GetVariationsRequest $getVariationsRequest GetVariationsRequest (required) * @@ -965,7 +965,7 @@ protected function getVariationsRequest($getVariationsRequest) $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = \GuzzleHttp\Utils::jsonEncode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -980,11 +980,11 @@ protected function getVariationsRequest($getVariationsRequest) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1002,7 +1002,7 @@ protected function getVariationsRequest($getVariationsRequest) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1143,7 +1143,7 @@ public function searchItemsWithHttpInfo($searchItemsRequest) /** * Operation searchItemsAsync * - * + * * * @param \Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\SearchItemsRequest $searchItemsRequest SearchItemsRequest (required) * @@ -1163,7 +1163,7 @@ function ($response) { /** * Operation searchItemsAsyncWithHttpInfo * - * + * * * @param \Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\SearchItemsRequest $searchItemsRequest SearchItemsRequest (required) * @@ -1277,7 +1277,7 @@ protected function searchItemsRequest($searchItemsRequest) $httpBody = $_tempBody; // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = \GuzzleHttp\Utils::jsonEncode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1292,11 +1292,11 @@ protected function searchItemsRequest($searchItemsRequest) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1314,7 +1314,7 @@ protected function searchItemsRequest($searchItemsRequest) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),