From 6b2d97dd47736050117870dce3607cac936d254d Mon Sep 17 00:00:00 2001 From: Jesse Evers Date: Wed, 15 Dec 2021 22:18:40 -0500 Subject: [PATCH] Avoid moving stream pointer when reading response/error body to debug --- lib/Api/AplusContentApi.php | 120 ++++++----- lib/Api/AuthorizationApi.php | 12 +- lib/Api/CatalogApi.php | 24 ++- lib/Api/CatalogItemsV0Api.php | 36 ++-- lib/Api/FbaInboundApi.php | 204 ++++++++++-------- lib/Api/FbaInboundEligibilityApi.php | 12 +- lib/Api/FbaInventoryApi.php | 12 +- lib/Api/FbaOutboundApi.php | 144 +++++++------ lib/Api/FeedsApi.php | 72 ++++--- lib/Api/FeesApi.php | 24 ++- lib/Api/FinancesApi.php | 48 +++-- lib/Api/ListingsApi.php | 48 +++-- lib/Api/ListingsRestrictionsApi.php | 12 +- lib/Api/MerchantFulfillmentApi.php | 96 +++++---- lib/Api/MessagingApi.php | 144 +++++++------ lib/Api/NotificationsApi.php | 96 +++++---- lib/Api/OrdersApi.php | 72 ++++--- lib/Api/ProductPricingApi.php | 48 +++-- lib/Api/ProductTypeDefinitionsApi.php | 24 ++- lib/Api/ReportsApi.php | 108 ++++++---- lib/Api/SalesApi.php | 12 +- lib/Api/SellersApi.php | 12 +- lib/Api/ServiceApi.php | 72 ++++--- lib/Api/ShipmentInvoicingApi.php | 36 ++-- lib/Api/ShippingApi.php | 108 ++++++---- lib/Api/SmallAndLightApi.php | 60 +++--- lib/Api/SolicitationsApi.php | 24 ++- lib/Api/TokensApi.php | 12 +- lib/Api/UploadsApi.php | 12 +- .../VendorDirectFulfillmentInventoryApi.php | 12 +- lib/Api/VendorDirectFulfillmentOrdersApi.php | 36 ++-- .../VendorDirectFulfillmentPaymentsApi.php | 12 +- .../VendorDirectFulfillmentShippingApi.php | 108 ++++++---- ...VendorDirectFulfillmentTransactionsApi.php | 12 +- lib/Api/VendorInvoicesApi.php | 12 +- lib/Api/VendorOrdersApi.php | 48 +++-- lib/Api/VendorShippingApi.php | 12 +- lib/Api/VendorTransactionStatusApi.php | 12 +- 38 files changed, 1148 insertions(+), 820 deletions(-) diff --git a/lib/Api/AplusContentApi.php b/lib/Api/AplusContentApi.php index 494d21cb7..f7d827fa3 100644 --- a/lib/Api/AplusContentApi.php +++ b/lib/Api/AplusContentApi.php @@ -151,15 +151,16 @@ public function createContentDocumentWithHttpInfo($marketplace_id, $post_content try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -386,6 +387,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -396,7 +398,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -550,15 +552,16 @@ public function getContentDocumentWithHttpInfo($content_reference_key, $marketpl try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -803,6 +806,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -813,7 +817,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -997,15 +1001,16 @@ public function listContentDocumentAsinRelationsWithHttpInfo($content_reference_ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1254,6 +1259,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1264,7 +1270,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1459,15 +1465,16 @@ public function postContentDocumentApprovalSubmissionWithHttpInfo($content_refer try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1710,6 +1717,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1720,7 +1728,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1881,15 +1889,16 @@ public function postContentDocumentAsinRelationsWithHttpInfo($content_reference_ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2134,6 +2143,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2144,7 +2154,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2316,15 +2326,16 @@ public function postContentDocumentSuspendSubmissionWithHttpInfo($content_refere try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2567,6 +2578,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2577,7 +2589,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2736,15 +2748,16 @@ public function searchContentDocumentsWithHttpInfo($marketplace_id, $page_token try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2987,6 +3000,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2997,7 +3011,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3151,15 +3165,16 @@ public function searchContentPublishRecordsWithHttpInfo($marketplace_id, $asin, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3388,6 +3403,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3398,7 +3414,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3571,15 +3587,16 @@ public function updateContentDocumentWithHttpInfo($content_reference_key, $marke try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3824,6 +3841,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3834,7 +3852,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -4008,15 +4026,16 @@ public function validateContentDocumentAsinRelationsWithHttpInfo($marketplace_id try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -4245,6 +4264,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -4255,7 +4275,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/AuthorizationApi.php b/lib/Api/AuthorizationApi.php index 58b28aa5f..07943c236 100644 --- a/lib/Api/AuthorizationApi.php +++ b/lib/Api/AuthorizationApi.php @@ -158,15 +158,16 @@ public function getAuthorizationCodeWithHttpInfo($selling_partner_id, $developer try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -412,6 +413,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -422,7 +424,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/CatalogApi.php b/lib/Api/CatalogApi.php index 6c8dff8f5..8377a257e 100644 --- a/lib/Api/CatalogApi.php +++ b/lib/Api/CatalogApi.php @@ -155,15 +155,16 @@ public function getCatalogItemWithHttpInfo($asin, $marketplace_ids, $included_da try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -410,6 +411,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -420,7 +422,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -603,15 +605,16 @@ public function searchCatalogItemsWithHttpInfo($keywords, $marketplace_ids, $inc try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -868,6 +871,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -878,7 +882,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/CatalogItemsV0Api.php b/lib/Api/CatalogItemsV0Api.php index 61c9c2a2e..74221f090 100644 --- a/lib/Api/CatalogItemsV0Api.php +++ b/lib/Api/CatalogItemsV0Api.php @@ -151,15 +151,16 @@ public function getCatalogItemWithHttpInfo($marketplace_id, $asin) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -386,6 +387,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -396,7 +398,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -549,15 +551,16 @@ public function listCatalogCategoriesWithHttpInfo($marketplace_id, $asin = null, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -786,6 +789,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -796,7 +800,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -961,15 +965,16 @@ public function listCatalogItemsWithHttpInfo($marketplace_id, $query = null, $qu try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1208,6 +1213,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1218,7 +1224,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/FbaInboundApi.php b/lib/Api/FbaInboundApi.php index 2d4e3b1d4..22a1a10dc 100644 --- a/lib/Api/FbaInboundApi.php +++ b/lib/Api/FbaInboundApi.php @@ -153,15 +153,16 @@ public function confirmPreorderWithHttpInfo($shipment_id, $need_by_date, $market try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -390,6 +391,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -400,7 +402,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -564,15 +566,16 @@ public function confirmTransportWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -797,6 +800,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -807,7 +811,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -943,15 +947,16 @@ public function createInboundShipmentWithHttpInfo($shipment_id, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1178,6 +1183,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1188,7 +1194,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1335,15 +1341,16 @@ public function createInboundShipmentPlanWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1568,6 +1575,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1578,7 +1586,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1709,15 +1717,16 @@ public function estimateTransportWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1942,6 +1951,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1952,7 +1962,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2086,15 +2096,16 @@ public function getBillOfLadingWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2319,6 +2330,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2329,7 +2341,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2467,15 +2479,16 @@ public function getInboundGuidanceWithHttpInfo($marketplace_id, $seller_sku_list try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2704,6 +2717,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2714,7 +2728,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2887,15 +2901,16 @@ public function getLabelsWithHttpInfo($shipment_id, $page_type, $label_type, $nu try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3134,6 +3149,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3144,7 +3160,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3359,15 +3375,16 @@ public function getPreorderInfoWithHttpInfo($shipment_id, $marketplace_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3594,6 +3611,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3604,7 +3622,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3757,15 +3775,16 @@ public function getPrepInstructionsWithHttpInfo($ship_to_country_code, $seller_s try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3994,6 +4013,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -4004,7 +4024,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -4171,15 +4191,16 @@ public function getShipmentItemsWithHttpInfo($query_type, $marketplace_id, $last try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -4412,6 +4433,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -4422,7 +4444,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -4599,15 +4621,16 @@ public function getShipmentItemsByShipmentIdWithHttpInfo($shipment_id, $marketpl try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -4834,6 +4857,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -4844,7 +4868,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -5005,15 +5029,16 @@ public function getShipmentsWithHttpInfo($query_type, $marketplace_id, $shipment try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -5250,6 +5275,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -5260,7 +5286,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -5453,15 +5479,16 @@ public function getTransportDetailsWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -5686,6 +5713,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -5696,7 +5724,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -5832,15 +5860,16 @@ public function putTransportDetailsWithHttpInfo($shipment_id, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -6067,6 +6096,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -6077,7 +6107,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -6226,15 +6256,16 @@ public function updateInboundShipmentWithHttpInfo($shipment_id, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -6461,6 +6492,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -6471,7 +6503,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -6618,15 +6650,16 @@ public function voidTransportWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -6851,6 +6884,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -6861,7 +6895,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/FbaInboundEligibilityApi.php b/lib/Api/FbaInboundEligibilityApi.php index 4eeb2ed0b..f6809ff0e 100644 --- a/lib/Api/FbaInboundEligibilityApi.php +++ b/lib/Api/FbaInboundEligibilityApi.php @@ -153,15 +153,16 @@ public function getItemEligibilityPreviewWithHttpInfo($asin, $program, $marketpl try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -390,6 +391,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -400,7 +402,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/FbaInventoryApi.php b/lib/Api/FbaInventoryApi.php index 426b215ad..8d1e06ff9 100644 --- a/lib/Api/FbaInventoryApi.php +++ b/lib/Api/FbaInventoryApi.php @@ -161,15 +161,16 @@ public function getInventorySummariesWithHttpInfo($granularity_type, $granularit try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -390,6 +391,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -400,7 +402,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/FbaOutboundApi.php b/lib/Api/FbaOutboundApi.php index 9ec5e095b..d8b31c815 100644 --- a/lib/Api/FbaOutboundApi.php +++ b/lib/Api/FbaOutboundApi.php @@ -149,15 +149,16 @@ public function cancelFulfillmentOrderWithHttpInfo($seller_fulfillment_order_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -382,6 +383,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -392,7 +394,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -530,15 +532,16 @@ public function createFulfillmentOrderWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -763,6 +766,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -773,7 +777,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -906,15 +910,16 @@ public function createFulfillmentReturnWithHttpInfo($seller_fulfillment_order_id try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1141,6 +1146,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1151,7 +1157,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1302,15 +1308,16 @@ public function getFeatureInventoryWithHttpInfo($marketplace_id, $feature_name, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1539,6 +1546,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1549,7 +1557,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1711,15 +1719,16 @@ public function getFeatureSKUWithHttpInfo($marketplace_id, $feature_name, $selle try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1948,6 +1957,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1958,7 +1968,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2123,15 +2133,16 @@ public function getFeaturesWithHttpInfo($marketplace_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2356,6 +2367,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2366,7 +2378,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2499,15 +2511,16 @@ public function getFulfillmentOrderWithHttpInfo($seller_fulfillment_order_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2732,6 +2745,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2742,7 +2756,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2880,15 +2894,16 @@ public function getFulfillmentPreviewWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3113,6 +3128,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3123,7 +3139,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3254,15 +3270,16 @@ public function getPackageTrackingDetailsWithHttpInfo($package_number) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3487,6 +3504,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3497,7 +3515,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3632,15 +3650,16 @@ public function listAllFulfillmentOrdersWithHttpInfo($query_start_date = null, $ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3867,6 +3886,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3877,7 +3897,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -4019,15 +4039,16 @@ public function listReturnReasonCodesWithHttpInfo($seller_sku, $language, $marke try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -4258,6 +4279,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -4268,7 +4290,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -4436,15 +4458,16 @@ public function updateFulfillmentOrderWithHttpInfo($seller_fulfillment_order_id, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -4671,6 +4694,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -4681,7 +4705,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/FeedsApi.php b/lib/Api/FeedsApi.php index 57f4b09b9..bbba662f1 100644 --- a/lib/Api/FeedsApi.php +++ b/lib/Api/FeedsApi.php @@ -148,15 +148,16 @@ public function cancelFeedWithHttpInfo($feed_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -298,6 +299,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -308,7 +310,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -442,15 +444,16 @@ public function createFeedWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -691,6 +694,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -701,7 +705,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -832,15 +836,16 @@ public function createFeedDocumentWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1081,6 +1086,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1091,7 +1097,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1222,15 +1228,16 @@ public function getFeedWithHttpInfo($feed_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1471,6 +1478,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1481,7 +1489,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1615,15 +1623,16 @@ public function getFeedDocumentWithHttpInfo($feed_document_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1864,6 +1873,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1874,7 +1884,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2020,15 +2030,16 @@ public function getFeedsWithHttpInfo($feed_types = null, $marketplace_ids = null try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2281,6 +2292,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2291,7 +2303,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/FeesApi.php b/lib/Api/FeesApi.php index 582a3aa03..0c629cfca 100644 --- a/lib/Api/FeesApi.php +++ b/lib/Api/FeesApi.php @@ -151,15 +151,16 @@ public function getMyFeesEstimateForASINWithHttpInfo($asin, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -386,6 +387,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -396,7 +398,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -545,15 +547,16 @@ public function getMyFeesEstimateForSKUWithHttpInfo($seller_sku, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -780,6 +783,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -790,7 +794,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/FinancesApi.php b/lib/Api/FinancesApi.php index 5a9854acc..908185017 100644 --- a/lib/Api/FinancesApi.php +++ b/lib/Api/FinancesApi.php @@ -155,15 +155,16 @@ public function listFinancialEventGroupsWithHttpInfo($max_results_per_page = 100 try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -378,6 +379,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -388,7 +390,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -555,15 +557,16 @@ public function listFinancialEventsWithHttpInfo($max_results_per_page = 100, $po try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -778,6 +781,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -788,7 +792,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -953,15 +957,16 @@ public function listFinancialEventsByGroupIdWithHttpInfo($event_group_id, $max_r try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1174,6 +1179,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1184,7 +1190,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1347,15 +1353,16 @@ public function listFinancialEventsByOrderIdWithHttpInfo($order_id, $max_results try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1568,6 +1575,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1578,7 +1586,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/ListingsApi.php b/lib/Api/ListingsApi.php index a620c3140..5a6d9d6e3 100644 --- a/lib/Api/ListingsApi.php +++ b/lib/Api/ListingsApi.php @@ -155,15 +155,16 @@ public function deleteListingsItemWithHttpInfo($seller_id, $sku, $marketplace_id try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -394,6 +395,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -404,7 +406,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -586,15 +588,16 @@ public function getListingsItemWithHttpInfo($seller_id, $sku, $marketplace_ids, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -843,6 +846,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -853,7 +857,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1044,15 +1048,16 @@ public function patchListingsItemWithHttpInfo($seller_id, $sku, $marketplace_ids try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1285,6 +1290,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1295,7 +1301,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1490,15 +1496,16 @@ public function putListingsItemWithHttpInfo($seller_id, $sku, $marketplace_ids, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1731,6 +1738,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1741,7 +1749,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/ListingsRestrictionsApi.php b/lib/Api/ListingsRestrictionsApi.php index 1be94fb92..a6e60cff9 100644 --- a/lib/Api/ListingsRestrictionsApi.php +++ b/lib/Api/ListingsRestrictionsApi.php @@ -157,15 +157,16 @@ public function getListingsRestrictionsWithHttpInfo($asin, $seller_id, $marketpl try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -414,6 +415,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -424,7 +426,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/MerchantFulfillmentApi.php b/lib/Api/MerchantFulfillmentApi.php index b5ba8dcfc..007ed8b00 100644 --- a/lib/Api/MerchantFulfillmentApi.php +++ b/lib/Api/MerchantFulfillmentApi.php @@ -152,15 +152,16 @@ public function cancelShipmentWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -388,6 +389,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -398,7 +400,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -539,15 +541,16 @@ public function cancelShipmentOldWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -775,6 +778,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -785,7 +789,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -926,15 +930,16 @@ public function createShipmentWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1162,6 +1167,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1172,7 +1178,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1303,15 +1309,16 @@ public function getAdditionalSellerInputsWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1536,6 +1543,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1546,7 +1554,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1677,15 +1685,16 @@ public function getAdditionalSellerInputsOldWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1910,6 +1919,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1920,7 +1930,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2051,15 +2061,16 @@ public function getEligibleShipmentServicesWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2284,6 +2295,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2294,7 +2306,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2425,15 +2437,16 @@ public function getEligibleShipmentServicesOldWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2658,6 +2671,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2668,7 +2682,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2802,15 +2816,16 @@ public function getShipmentWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3038,6 +3053,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3048,7 +3064,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/MessagingApi.php b/lib/Api/MessagingApi.php index 6b23919ed..8664a9493 100644 --- a/lib/Api/MessagingApi.php +++ b/lib/Api/MessagingApi.php @@ -153,15 +153,16 @@ public function confirmCustomizationDetailsWithHttpInfo($amazon_order_id, $marke try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -406,6 +407,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -416,7 +418,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -586,15 +588,16 @@ public function createAmazonMotorsWithHttpInfo($amazon_order_id, $marketplace_id try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -839,6 +842,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -849,7 +853,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1019,15 +1023,16 @@ public function createConfirmDeliveryDetailsWithHttpInfo($amazon_order_id, $mark try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1272,6 +1277,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1282,7 +1288,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1452,15 +1458,16 @@ public function createConfirmOrderDetailsWithHttpInfo($amazon_order_id, $marketp try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1705,6 +1712,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1715,7 +1723,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1885,15 +1893,16 @@ public function createConfirmServiceDetailsWithHttpInfo($amazon_order_id, $marke try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2138,6 +2147,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2148,7 +2158,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2318,15 +2328,16 @@ public function createDigitalAccessKeyWithHttpInfo($amazon_order_id, $marketplac try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2571,6 +2582,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2581,7 +2593,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2751,15 +2763,16 @@ public function createLegalDisclosureWithHttpInfo($amazon_order_id, $marketplace try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3004,6 +3017,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3014,7 +3028,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3182,15 +3196,16 @@ public function createNegativeFeedbackRemovalWithHttpInfo($amazon_order_id, $mar try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3433,6 +3448,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3443,7 +3459,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3600,15 +3616,16 @@ public function createUnexpectedProblemWithHttpInfo($amazon_order_id, $marketpla try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3853,6 +3870,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3863,7 +3881,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -4033,15 +4051,16 @@ public function createWarrantyWithHttpInfo($amazon_order_id, $marketplace_ids, $ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -4286,6 +4305,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -4296,7 +4316,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -4464,15 +4484,16 @@ public function getAttributesWithHttpInfo($amazon_order_id, $marketplace_ids) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -4715,6 +4736,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -4725,7 +4747,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -4880,15 +4902,16 @@ public function getMessagingActionsForOrderWithHttpInfo($amazon_order_id, $marke try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -5131,6 +5154,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -5141,7 +5165,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/NotificationsApi.php b/lib/Api/NotificationsApi.php index 1731c5716..03cdff051 100644 --- a/lib/Api/NotificationsApi.php +++ b/lib/Api/NotificationsApi.php @@ -150,15 +150,16 @@ public function createDestinationWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -416,6 +417,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -426,7 +428,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -560,15 +562,16 @@ public function createSubscriptionWithHttpInfo($notification_type, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -827,6 +830,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -837,7 +841,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -985,15 +989,16 @@ public function deleteDestinationWithHttpInfo($destination_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1251,6 +1256,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1261,7 +1267,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1399,15 +1405,16 @@ public function deleteSubscriptionByIdWithHttpInfo($subscription_id, $notificati try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1667,6 +1674,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1677,7 +1685,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1829,15 +1837,16 @@ public function getDestinationWithHttpInfo($destination_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2095,6 +2104,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2105,7 +2115,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2239,15 +2249,16 @@ public function getDestinationsWithHttpInfo() try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2503,6 +2514,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2513,7 +2525,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2632,15 +2644,16 @@ public function getSubscriptionWithHttpInfo($notification_type) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2881,6 +2894,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2891,7 +2905,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3028,15 +3042,16 @@ public function getSubscriptionByIdWithHttpInfo($subscription_id, $notification_ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3296,6 +3311,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3306,7 +3322,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/OrdersApi.php b/lib/Api/OrdersApi.php index 28ff23dd4..1f4a30fb6 100644 --- a/lib/Api/OrdersApi.php +++ b/lib/Api/OrdersApi.php @@ -154,15 +154,16 @@ public function getOrderWithHttpInfo($order_id, $data_elements = null) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -376,6 +377,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -386,7 +388,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -532,15 +534,16 @@ public function getOrderAddressWithHttpInfo($order_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -752,6 +755,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -762,7 +766,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -899,15 +903,16 @@ public function getOrderBuyerInfoWithHttpInfo($order_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1119,6 +1124,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1129,7 +1135,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1270,15 +1276,16 @@ public function getOrderItemsWithHttpInfo($order_id, $next_token = null, $data_e try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1494,6 +1501,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1504,7 +1512,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1661,15 +1669,16 @@ public function getOrderItemsBuyerInfoWithHttpInfo($order_id, $next_token = null try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1883,6 +1892,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1893,7 +1903,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2073,15 +2083,16 @@ public function getOrdersWithHttpInfo($marketplace_ids, $created_after = null, $ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2327,6 +2338,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2337,7 +2349,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/ProductPricingApi.php b/lib/Api/ProductPricingApi.php index b535c1d34..ae0aef151 100644 --- a/lib/Api/ProductPricingApi.php +++ b/lib/Api/ProductPricingApi.php @@ -157,15 +157,16 @@ public function getCompetitivePricingWithHttpInfo($marketplace_id, $item_type, $ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -597,15 +599,16 @@ public function getItemOffersWithHttpInfo($marketplace_id, $item_condition, $asi try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -836,6 +839,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -846,7 +850,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1025,15 +1029,16 @@ public function getListingOffersWithHttpInfo($marketplace_id, $item_condition, $ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1264,6 +1269,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1274,7 +1280,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1457,15 +1463,16 @@ public function getPricingWithHttpInfo($marketplace_id, $item_type, $asins = nul try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1700,6 +1707,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1710,7 +1718,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/ProductTypeDefinitionsApi.php b/lib/Api/ProductTypeDefinitionsApi.php index 4621f1460..650be6e5d 100644 --- a/lib/Api/ProductTypeDefinitionsApi.php +++ b/lib/Api/ProductTypeDefinitionsApi.php @@ -161,15 +161,16 @@ public function getDefinitionsProductTypeWithHttpInfo($product_type, $marketplac try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -422,6 +423,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -432,7 +434,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -628,15 +630,16 @@ public function searchDefinitionsProductTypesWithHttpInfo($marketplace_ids, $key try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -879,6 +882,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -889,7 +893,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/ReportsApi.php b/lib/Api/ReportsApi.php index 4da018d8a..b132fcb97 100644 --- a/lib/Api/ReportsApi.php +++ b/lib/Api/ReportsApi.php @@ -148,15 +148,16 @@ public function cancelReportWithHttpInfo($report_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -298,6 +299,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -308,7 +310,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -441,15 +443,16 @@ public function cancelReportScheduleWithHttpInfo($report_schedule_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -591,6 +594,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -601,7 +605,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -735,15 +739,16 @@ public function createReportWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -984,6 +989,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -994,7 +1000,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1125,15 +1131,16 @@ public function createReportScheduleWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1374,6 +1381,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1384,7 +1392,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1515,15 +1523,16 @@ public function getReportWithHttpInfo($report_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1764,6 +1773,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1774,7 +1784,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1913,15 +1923,16 @@ public function getReportDocumentWithHttpInfo($report_document_id, $report_type try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2167,6 +2178,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2177,7 +2189,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2320,15 +2332,16 @@ public function getReportScheduleWithHttpInfo($report_schedule_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2569,6 +2582,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2579,7 +2593,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2713,15 +2727,16 @@ public function getReportSchedulesWithHttpInfo($report_types) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2962,6 +2977,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2972,7 +2988,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3124,15 +3140,16 @@ public function getReportsWithHttpInfo($report_types = null, $processing_statuse try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3385,6 +3402,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3395,7 +3413,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/SalesApi.php b/lib/Api/SalesApi.php index cec29c41d..1e8250c82 100644 --- a/lib/Api/SalesApi.php +++ b/lib/Api/SalesApi.php @@ -165,15 +165,16 @@ public function getOrderMetricsWithHttpInfo($marketplace_ids, $interval, $granul try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -430,6 +431,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -440,7 +442,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/SellersApi.php b/lib/Api/SellersApi.php index b5d533bc4..375319496 100644 --- a/lib/Api/SellersApi.php +++ b/lib/Api/SellersApi.php @@ -147,15 +147,16 @@ public function getMarketplaceParticipationsWithHttpInfo() try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -394,6 +395,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -404,7 +406,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/ServiceApi.php b/lib/Api/ServiceApi.php index d2ea126f3..a87f508f7 100644 --- a/lib/Api/ServiceApi.php +++ b/lib/Api/ServiceApi.php @@ -151,15 +151,16 @@ public function addAppointmentForServiceJobByServiceJobIdWithHttpInfo($service_j try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -418,6 +419,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -428,7 +430,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -584,15 +586,16 @@ public function cancelServiceJobByServiceJobIdWithHttpInfo($service_job_id, $can try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -851,6 +854,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -861,7 +865,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1027,15 +1031,16 @@ public function completeServiceJobByServiceJobIdWithHttpInfo($service_job_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1292,6 +1297,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1302,7 +1308,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1443,15 +1449,16 @@ public function getServiceJobByServiceJobIdWithHttpInfo($service_job_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1708,6 +1715,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1718,7 +1726,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1883,15 +1891,16 @@ public function getServiceJobsWithHttpInfo($marketplace_ids, $service_order_ids try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2156,6 +2165,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2166,7 +2176,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2429,15 +2439,16 @@ public function rescheduleAppointmentForServiceJobByServiceJobIdWithHttpInfo($se try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2698,6 +2709,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2708,7 +2720,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/ShipmentInvoicingApi.php b/lib/Api/ShipmentInvoicingApi.php index c2cb14836..f2423d7da 100644 --- a/lib/Api/ShipmentInvoicingApi.php +++ b/lib/Api/ShipmentInvoicingApi.php @@ -149,15 +149,16 @@ public function getInvoiceStatusWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -545,15 +547,16 @@ public function getShipmentDetailsWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -797,6 +800,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -807,7 +811,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -943,15 +947,16 @@ public function submitInvoiceWithHttpInfo($shipment_id, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1194,6 +1199,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1204,7 +1210,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/ShippingApi.php b/lib/Api/ShippingApi.php index 52b5d275c..0c2a106ef 100644 --- a/lib/Api/ShippingApi.php +++ b/lib/Api/ShippingApi.php @@ -149,15 +149,16 @@ public function cancelShipmentWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -382,6 +383,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -392,7 +394,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -526,15 +528,16 @@ public function createShipmentWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -759,6 +762,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -769,7 +773,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -898,15 +902,16 @@ public function getAccountWithHttpInfo() try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1129,6 +1134,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1139,7 +1145,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1257,15 +1263,16 @@ public function getRatesWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1490,6 +1497,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1500,7 +1508,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1634,15 +1642,16 @@ public function getShipmentWithHttpInfo($shipment_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1870,6 +1879,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1880,7 +1890,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2014,15 +2024,16 @@ public function getTrackingInformationWithHttpInfo($tracking_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2247,6 +2258,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2257,7 +2269,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2393,15 +2405,16 @@ public function purchaseLabelsWithHttpInfo($shipment_id, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2628,6 +2641,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2638,7 +2652,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2785,15 +2799,16 @@ public function purchaseShipmentWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3018,6 +3033,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3028,7 +3044,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3163,15 +3179,16 @@ public function retrieveShippingLabelWithHttpInfo($shipment_id, $tracking_id, $b try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3400,6 +3417,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3410,7 +3428,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/SmallAndLightApi.php b/lib/Api/SmallAndLightApi.php index 3d3b94ffa..cb915c735 100644 --- a/lib/Api/SmallAndLightApi.php +++ b/lib/Api/SmallAndLightApi.php @@ -150,15 +150,16 @@ public function deleteSmallAndLightEnrollmentBySellerSKUWithHttpInfo($seller_sku try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -302,6 +303,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -312,7 +314,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -467,15 +469,16 @@ public function getSmallAndLightEligibilityBySellerSKUWithHttpInfo($seller_sku, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -718,6 +721,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -728,7 +732,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -883,15 +887,16 @@ public function getSmallAndLightEnrollmentBySellerSKUWithHttpInfo($seller_sku, $ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1134,6 +1139,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1144,7 +1150,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1297,15 +1303,16 @@ public function getSmallAndLightFeePreviewWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1530,6 +1537,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1540,7 +1548,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1673,15 +1681,16 @@ public function putSmallAndLightEnrollmentBySellerSKUWithHttpInfo($seller_sku, $ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1924,6 +1933,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1934,7 +1944,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/SolicitationsApi.php b/lib/Api/SolicitationsApi.php index e5d6d232a..38411f992 100644 --- a/lib/Api/SolicitationsApi.php +++ b/lib/Api/SolicitationsApi.php @@ -151,15 +151,16 @@ public function createProductReviewAndSellerFeedbackSolicitationWithHttpInfo($am try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -402,6 +403,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -412,7 +414,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -567,15 +569,16 @@ public function getSolicitationActionsForOrderWithHttpInfo($amazon_order_id, $ma try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -818,6 +821,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -828,7 +832,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/TokensApi.php b/lib/Api/TokensApi.php index da2d4a5b7..46acd4ba9 100644 --- a/lib/Api/TokensApi.php +++ b/lib/Api/TokensApi.php @@ -149,15 +149,16 @@ public function createRestrictedDataTokenWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/UploadsApi.php b/lib/Api/UploadsApi.php index 0d960d5eb..c6761b67d 100644 --- a/lib/Api/UploadsApi.php +++ b/lib/Api/UploadsApi.php @@ -155,15 +155,16 @@ public function createUploadDestinationForResourceWithHttpInfo($marketplace_ids, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -410,6 +411,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -420,7 +422,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorDirectFulfillmentInventoryApi.php b/lib/Api/VendorDirectFulfillmentInventoryApi.php index 21f8f1b5e..cb9f83250 100644 --- a/lib/Api/VendorDirectFulfillmentInventoryApi.php +++ b/lib/Api/VendorDirectFulfillmentInventoryApi.php @@ -151,15 +151,16 @@ public function submitInventoryUpdateWithHttpInfo($warehouse_id, $body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -402,6 +403,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -412,7 +414,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorDirectFulfillmentOrdersApi.php b/lib/Api/VendorDirectFulfillmentOrdersApi.php index fd3cde043..ea4982342 100644 --- a/lib/Api/VendorDirectFulfillmentOrdersApi.php +++ b/lib/Api/VendorDirectFulfillmentOrdersApi.php @@ -152,15 +152,16 @@ public function getOrderWithHttpInfo($purchase_order_number) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -404,6 +405,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -414,7 +416,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -565,15 +567,16 @@ public function getOrdersWithHttpInfo($created_after, $created_before, $ship_fro try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -815,6 +818,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -825,7 +829,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1034,15 +1038,16 @@ public function submitAcknowledgementWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1283,6 +1288,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1293,7 +1299,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorDirectFulfillmentPaymentsApi.php b/lib/Api/VendorDirectFulfillmentPaymentsApi.php index c10c32c8a..2119e01ea 100644 --- a/lib/Api/VendorDirectFulfillmentPaymentsApi.php +++ b/lib/Api/VendorDirectFulfillmentPaymentsApi.php @@ -149,15 +149,16 @@ public function submitInvoiceWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorDirectFulfillmentShippingApi.php b/lib/Api/VendorDirectFulfillmentShippingApi.php index c225e9df4..867acb0fb 100644 --- a/lib/Api/VendorDirectFulfillmentShippingApi.php +++ b/lib/Api/VendorDirectFulfillmentShippingApi.php @@ -149,15 +149,16 @@ public function getCustomerInvoiceWithHttpInfo($purchase_order_number) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -559,15 +561,16 @@ public function getCustomerInvoicesWithHttpInfo($created_after, $created_before, try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -805,6 +808,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -815,7 +819,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1006,15 +1010,16 @@ public function getPackingSlipWithHttpInfo($purchase_order_number) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1255,6 +1260,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1265,7 +1271,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1416,15 +1422,16 @@ public function getPackingSlipsWithHttpInfo($created_after, $created_before, $sh try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1678,6 +1685,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1688,7 +1696,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1879,15 +1887,16 @@ public function getShippingLabelWithHttpInfo($purchase_order_number) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2128,6 +2137,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2138,7 +2148,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2289,15 +2299,16 @@ public function getShippingLabelsWithHttpInfo($created_after, $created_before, $ try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2535,6 +2546,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2545,7 +2557,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -2736,15 +2748,16 @@ public function submitShipmentConfirmationsWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -2985,6 +2998,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -2995,7 +3009,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3126,15 +3140,16 @@ public function submitShipmentStatusUpdatesWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3375,6 +3390,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3385,7 +3401,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -3516,15 +3532,16 @@ public function submitShippingLabelRequestWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -3765,6 +3782,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -3775,7 +3793,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorDirectFulfillmentTransactionsApi.php b/lib/Api/VendorDirectFulfillmentTransactionsApi.php index 8fd5a4acd..2735fecc9 100644 --- a/lib/Api/VendorDirectFulfillmentTransactionsApi.php +++ b/lib/Api/VendorDirectFulfillmentTransactionsApi.php @@ -149,15 +149,16 @@ public function getTransactionStatusWithHttpInfo($transaction_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorInvoicesApi.php b/lib/Api/VendorInvoicesApi.php index d3d0204fd..01b17b413 100644 --- a/lib/Api/VendorInvoicesApi.php +++ b/lib/Api/VendorInvoicesApi.php @@ -149,15 +149,16 @@ public function submitInvoicesWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorOrdersApi.php b/lib/Api/VendorOrdersApi.php index c2750745f..c8f4f0822 100644 --- a/lib/Api/VendorOrdersApi.php +++ b/lib/Api/VendorOrdersApi.php @@ -149,15 +149,16 @@ public function getPurchaseOrderWithHttpInfo($purchase_order_number) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -564,15 +566,16 @@ public function getPurchaseOrdersWithHttpInfo($limit = null, $created_after = nu try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -819,6 +822,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -829,7 +833,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1084,15 +1088,16 @@ public function getPurchaseOrdersStatusWithHttpInfo($limit = null, $sort_order = try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1339,6 +1344,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1349,7 +1355,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); @@ -1582,15 +1588,16 @@ public function submitAcknowledgementWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -1831,6 +1838,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -1841,7 +1849,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorShippingApi.php b/lib/Api/VendorShippingApi.php index 3b257767a..e0a1a8ab4 100644 --- a/lib/Api/VendorShippingApi.php +++ b/lib/Api/VendorShippingApi.php @@ -149,15 +149,16 @@ public function submitShipmentConfirmationsWithHttpInfo($body) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } ); diff --git a/lib/Api/VendorTransactionStatusApi.php b/lib/Api/VendorTransactionStatusApi.php index e8d0e45fb..f0f810a4d 100644 --- a/lib/Api/VendorTransactionStatusApi.php +++ b/lib/Api/VendorTransactionStatusApi.php @@ -149,15 +149,16 @@ public function getTransactionWithHttpInfo($transaction_id) try { $response = $this->client->send($signedRequest, $options); $this->writeDebug($response); - $this->writeDebug($response->getBody()->getContents()); + $this->writeDebug((string) $response->getBody()); } catch (RequestException $e) { + $body = (string) $e->getResponse()->getBody(); $this->writeDebug($e->getResponse()); - $this->writeDebug($e->getResponse()->getBody()->getContents()); + $this->writeDebug($body); throw new ApiException( - "[{$e->getCode()}] {$e->getResponse()->getBody()->getContents()}", + "[{$e->getCode()}] {$body}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? $body : null ); } @@ -398,6 +399,7 @@ function ($response) use ($returnType) { }, function ($exception) { $response = $exception->getResponse(); + $body = (string) $response->getBody(); $this->writeDebug($response); $statusCode = $response->getStatusCode(); throw new ApiException( @@ -408,7 +410,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody()->getContents() + $body ); } );