Skip to content

Commit

Permalink
fix response from deleteScreenRecordingSegment
Browse files Browse the repository at this point in the history
  • Loading branch information
perrytew committed Mar 15, 2021
1 parent f6b6152 commit 13e97ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 51 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ Not every change is committed to every SDK.

| Version | Date | Comments |
| --: | :-: | --- |
| 3.1.15 | 03/15/2021 | fix response from deleteScreenRecordingSegment that should have been void |
| 3.1.14 | 03/15/2021 | sort screen recordings by favorite flag |
| 3.1.13 | 03/02/2021 | new webhook order_payment_failed |
| 3.1.12 | 02/25/2021 | added screen recording visitor_first_seen property |
Expand Down
7 changes: 3 additions & 4 deletions docs/Api/StorefrontApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **deleteScreenRecordingSegment**
> \ultracart\v2\models\ScreenRecordingSegmentResponse deleteScreenRecordingSegment($storefront_oid, $screen_recording_segment_oid)
> deleteScreenRecordingSegment($storefront_oid, $screen_recording_segment_oid)
Delete screen recording segment

Expand All @@ -1074,8 +1074,7 @@ $storefront_oid = 56; // int |
$screen_recording_segment_oid = 56; // int |

try {
$result = $apiInstance->deleteScreenRecordingSegment($storefront_oid, $screen_recording_segment_oid);
print_r($result);
$apiInstance->deleteScreenRecordingSegment($storefront_oid, $screen_recording_segment_oid);
} catch (Exception $e) {
echo 'Exception when calling StorefrontApi->deleteScreenRecordingSegment: ', $e->getMessage(), PHP_EOL;
}
Expand All @@ -1091,7 +1090,7 @@ Name | Type | Description | Notes

### Return type

[**\ultracart\v2\models\ScreenRecordingSegmentResponse**](../Model/ScreenRecordingSegmentResponse.md)
void (empty response body)

### Authorization

Expand Down
57 changes: 10 additions & 47 deletions lib/api/StorefrontApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -6809,12 +6809,11 @@ protected function deleteLibraryItemPublishedVersionsRequest($library_item_oid)
*
* @throws \ultracart\v2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \ultracart\v2\models\ScreenRecordingSegmentResponse
* @return void
*/
public function deleteScreenRecordingSegment($storefront_oid, $screen_recording_segment_oid)
{
list($response) = $this->deleteScreenRecordingSegmentWithHttpInfo($storefront_oid, $screen_recording_segment_oid);
return $response;
$this->deleteScreenRecordingSegmentWithHttpInfo($storefront_oid, $screen_recording_segment_oid);
}


Expand All @@ -6828,11 +6827,11 @@ public function deleteScreenRecordingSegment($storefront_oid, $screen_recording_
*
* @throws \ultracart\v2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \ultracart\v2\models\ScreenRecordingSegmentResponse, HTTP status code, HTTP response headers (array of strings)
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteScreenRecordingSegmentWithHttpInfo($storefront_oid, $screen_recording_segment_oid)
{
return $this->deleteScreenRecordingSegmentWithHttpInfoRetry(true , $storefront_oid, $screen_recording_segment_oid);
$this->deleteScreenRecordingSegmentWithHttpInfoRetry(true , $storefront_oid, $screen_recording_segment_oid);
}


Expand All @@ -6847,11 +6846,11 @@ public function deleteScreenRecordingSegmentWithHttpInfo($storefront_oid, $scree
*
* @throws \ultracart\v2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \ultracart\v2\models\ScreenRecordingSegmentResponse, HTTP status code, HTTP response headers (array of strings)
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteScreenRecordingSegmentWithHttpInfoRetry($retry , $storefront_oid, $screen_recording_segment_oid)
{
$returnType = '\ultracart\v2\models\ScreenRecordingSegmentResponse';
$returnType = '';
$request = $this->deleteScreenRecordingSegmentRequest($storefront_oid, $screen_recording_segment_oid);

try {
Expand All @@ -6871,7 +6870,7 @@ public function deleteScreenRecordingSegmentWithHttpInfoRetry($retry , $storefr

if ($statusCode == 429 && $retry && $retryAfter > 0 && $retryAfter <= $this->config->getMaxRetrySeconds()) {
sleep($retryAfter);
return $this->deleteScreenRecordingSegmentWithHttpInfoRetry(false , $storefront_oid, $screen_recording_segment_oid);
$this->deleteScreenRecordingSegmentWithHttpInfoRetry(false , $storefront_oid, $screen_recording_segment_oid);
}
}

Expand All @@ -6883,32 +6882,10 @@ public function deleteScreenRecordingSegmentWithHttpInfoRetry($retry , $storefr
);
}

$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}

return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
return [null, $response->getStatusCode(), $response->getHeaders()];

} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\ultracart\v2\models\ScreenRecordingSegmentResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
Expand Down Expand Up @@ -6988,28 +6965,14 @@ function ($response) {
*/
public function deleteScreenRecordingSegmentAsyncWithHttpInfo($storefront_oid, $screen_recording_segment_oid)
{
$returnType = '\ultracart\v2\models\ScreenRecordingSegmentResponse';
$returnType = '';
$request = $this->deleteScreenRecordingSegmentRequest($storefront_oid, $screen_recording_segment_oid);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}

return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
return [null, $response->getStatusCode(), $response->getHeaders()];
},
function ($exception) {
$response = $exception->getResponse();
Expand Down

0 comments on commit 13e97ef

Please sign in to comment.