From 0f6a8babca0f8d104f2528b8a721f2942476ff29 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Mon, 11 Sep 2023 14:04:40 +0000 Subject: [PATCH] feat(all) remove raw statistics --- README.md | 13 - docs/Api/LiveStreamsApi.md | 2 +- docs/Api/RawStatisticsApi.md | 116 ------- docs/Model/LiveStream.md | 1 - docs/Model/LiveStreamCreationPayload.md | 1 - docs/Model/LiveStreamUpdatePayload.md | 1 - ...atisticsListLiveStreamAnalyticsResponse.md | 10 - ...atisticsListPlayerSessionEventsResponse.md | 10 - .../RawStatisticsListSessionsResponse.md | 10 - src/Api/LiveStreamsApi.php | 4 +- src/Api/RawStatisticsApi.php | 323 ------------------ src/Client.php | 12 - src/Model/LiveStream.php | 31 -- src/Model/LiveStreamCreationPayload.php | 31 -- src/Model/LiveStreamUpdatePayload.php | 31 -- ...tisticsListLiveStreamAnalyticsResponse.php | 186 ---------- ...tisticsListPlayerSessionEventsResponse.php | 186 ---------- .../RawStatisticsListSessionsResponse.php | 186 ---------- tests/Api/LiveStreamsApiTest.php | 4 - tests/Api/RawStatisticsApiTest.php | 27 -- 20 files changed, 3 insertions(+), 1182 deletions(-) delete mode 100644 docs/Api/RawStatisticsApi.md delete mode 100644 docs/Model/RawStatisticsListLiveStreamAnalyticsResponse.md delete mode 100644 docs/Model/RawStatisticsListPlayerSessionEventsResponse.md delete mode 100644 docs/Model/RawStatisticsListSessionsResponse.md delete mode 100644 src/Api/RawStatisticsApi.php delete mode 100644 src/Model/RawStatisticsListLiveStreamAnalyticsResponse.php delete mode 100644 src/Model/RawStatisticsListPlayerSessionEventsResponse.php delete mode 100644 src/Model/RawStatisticsListSessionsResponse.php delete mode 100644 tests/Api/RawStatisticsApiTest.php diff --git a/README.md b/README.md index 3570238..595a48e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ - [ChaptersApi](#chaptersapi) - [LiveStreamsApi](#livestreamsapi) - [PlayerThemesApi](#playerthemesapi) - - [RawStatisticsApi](#rawstatisticsapi) - [UploadTokensApi](#uploadtokensapi) - [VideosApi](#videosapi) - [WatermarksApi](#watermarksapi) @@ -171,15 +170,6 @@ Method | Description | HTTP request [**deleteLogo()**](docs/Api/PlayerThemesApi.md#deleteLogo) | Delete logo | **DELETE** `/players/{playerId}/logo` -### RawStatisticsApi - -Method | Description | HTTP request -------------- | ------------- | ------------- -[**listLiveStreamSessions()**](docs/Api/RawStatisticsApi.md#listLiveStreamSessions) | List live stream player sessions | **GET** `/analytics/live-streams/{liveStreamId}` -[**listSessionEvents()**](docs/Api/RawStatisticsApi.md#listSessionEvents) | List player session events | **GET** `/analytics/sessions/{sessionId}/events` -[**listVideoSessions()**](docs/Api/RawStatisticsApi.md#listVideoSessions) | List video player sessions | **GET** `/analytics/videos/{videoId}` - - ### UploadTokensApi Method | Description | HTTP request @@ -265,9 +255,6 @@ Method | Description | HTTP request - [PlayerThemeUpdatePayload](docs/Model/PlayerThemeUpdatePayload.md) - [PlayerThemesListResponse](docs/Model/PlayerThemesListResponse.md) - [Quality](docs/Model/Quality.md) - - [RawStatisticsListLiveStreamAnalyticsResponse](docs/Model/RawStatisticsListLiveStreamAnalyticsResponse.md) - - [RawStatisticsListPlayerSessionEventsResponse](docs/Model/RawStatisticsListPlayerSessionEventsResponse.md) - - [RawStatisticsListSessionsResponse](docs/Model/RawStatisticsListSessionsResponse.md) - [RefreshTokenPayload](docs/Model/RefreshTokenPayload.md) - [RestreamsRequestObject](docs/Model/RestreamsRequestObject.md) - [RestreamsResponseObject](docs/Model/RestreamsResponseObject.md) diff --git a/docs/Api/LiveStreamsApi.md b/docs/Api/LiveStreamsApi.md index 6c186e6..2ec3fe2 100644 --- a/docs/Api/LiveStreamsApi.md +++ b/docs/Api/LiveStreamsApi.md @@ -75,7 +75,7 @@ Updates the livestream object. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - `liveStreamId` | **string**| The unique ID for the live stream that you want to update information for such as player details, or whether you want the recording on or off. | + `liveStreamId` | **string**| The unique ID for the live stream that you want to update information for such as player details. | `liveStreamUpdatePayload` | [**\ApiVideo\Client\Model\LiveStreamUpdatePayload**](../Model/LiveStreamUpdatePayload.md)| | diff --git a/docs/Api/RawStatisticsApi.md b/docs/Api/RawStatisticsApi.md deleted file mode 100644 index 2f954e8..0000000 --- a/docs/Api/RawStatisticsApi.md +++ /dev/null @@ -1,116 +0,0 @@ -# ApiVideo\Client\Api\RawStatisticsApi - -All URIs are relative to https://ws.api.video. - -Method | Description | HTTP request -------------- | ------------- | ------------- -[**listLiveStreamSessions()**](RawStatisticsApi.md#listLiveStreamSessions) | List live stream player sessions | **GET** `/analytics/live-streams/{liveStreamId}` -[**listSessionEvents()**](RawStatisticsApi.md#listSessionEvents) | List player session events | **GET** `/analytics/sessions/{sessionId}/events` -[**listVideoSessions()**](RawStatisticsApi.md#listVideoSessions) | List video player sessions | **GET** `/analytics/videos/{videoId}` - - -## **`listLiveStreamSessions()` - List live stream player sessions** - - - -### Arguments - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - `liveStreamId` | **string**| The unique identifier for the live stream you want to retrieve analytics for. | -`queryParams` | array | (see below) | - - -Note: `queryParams` argument is an associative array with the keys listed below. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - `period` | **string**| Period must have one of the following formats: - For a day : \"2018-01-01\", - For a week: \"2018-W01\", - For a month: \"2018-01\" - For a year: \"2018\" For a range period: - Date range: \"2018-01-01/2018-01-15\" | - `currentPage` | **int**| Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] - `pageSize` | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] - - - - - - -### Return type - -[**\ApiVideo\Client\Model\RawStatisticsListLiveStreamAnalyticsResponse**](../Model/RawStatisticsListLiveStreamAnalyticsResponse.md) - - - - - -## **`listSessionEvents()` - List player session events** - - - -Useful to track and measure video's engagement. - -### Arguments - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - `sessionId` | **string**| A unique identifier you can use to reference and track a session with. | -`queryParams` | array | (see below) | - - -Note: `queryParams` argument is an associative array with the keys listed below. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - `currentPage` | **int**| Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] - `pageSize` | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] - - - - - - -### Return type - -[**\ApiVideo\Client\Model\RawStatisticsListPlayerSessionEventsResponse**](../Model/RawStatisticsListPlayerSessionEventsResponse.md) - - - - - -## **`listVideoSessions()` - List video player sessions** - - - -Retrieve all available user sessions for a specific video. Tutorials that use the [analytics endpoint](https://api.video/blog/endpoints/analytics). - -### Arguments - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - `videoId` | **string**| The unique identifier for the video you want to retrieve session information for. | -`queryParams` | array | (see below) | - - -Note: `queryParams` argument is an associative array with the keys listed below. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - `period` | **string**| Period must have one of the following formats: - For a day : 2018-01-01, - For a week: 2018-W01, - For a month: 2018-01 - For a year: 2018 For a range period: - Date range: 2018-01-01/2018-01-15 | - `metadata` | [**array**](../Model/string.md)| Metadata and [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata) filter. Send an array of key value pairs you want to filter sessios with. | [optional] - `currentPage` | **int**| Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] - `pageSize` | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] - - - - - - -### Return type - -[**\ApiVideo\Client\Model\RawStatisticsListSessionsResponse**](../Model/RawStatisticsListSessionsResponse.md) - - - - diff --git a/docs/Model/LiveStream.md b/docs/Model/LiveStream.md index 31ba950..f6a399c 100644 --- a/docs/Model/LiveStream.md +++ b/docs/Model/LiveStream.md @@ -7,7 +7,6 @@ Name | Type | Description | Notes **liveStreamId** | **string** | The unique identifier for the live stream. Live stream IDs begin with \"li.\" | **name** | **string** | The name of your live stream. | [optional] **streamKey** | **string** | The unique, private stream key that you use to begin streaming. | [optional] -**record** | **bool** | Whether you are recording or not. | [optional] **public** | **bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/docs/private-videos). | [optional] **assets** | [**\ApiVideo\Client\Model\LiveStreamAssets**](LiveStreamAssets.md) | | [optional] **playerId** | **string** | The unique identifier for the player. | [optional] diff --git a/docs/Model/LiveStreamCreationPayload.md b/docs/Model/LiveStreamCreationPayload.md index d437953..2f08c26 100644 --- a/docs/Model/LiveStreamCreationPayload.md +++ b/docs/Model/LiveStreamCreationPayload.md @@ -5,7 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Add a name for your live stream here. | -**record** | **bool** | Whether you are recording or not. True for record, false for not record. | [optional] [default to false] **public** | **bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/docs/private-videos). | [optional] **playerId** | **string** | The unique identifier for the player. | [optional] **restreams** | [**\ApiVideo\Client\Model\RestreamsRequestObject[]**](RestreamsRequestObject.md) | Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. | [optional] diff --git a/docs/Model/LiveStreamUpdatePayload.md b/docs/Model/LiveStreamUpdatePayload.md index 3c99c5f..45555c6 100644 --- a/docs/Model/LiveStreamUpdatePayload.md +++ b/docs/Model/LiveStreamUpdatePayload.md @@ -6,7 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | The name you want to use for your live stream. | [optional] **public** | **bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/docs/private-videos). | [optional] -**record** | **bool** | Use this to indicate whether you want the recording on or off. On is true, off is false. | [optional] **playerId** | **string** | The unique ID for the player associated with a live stream that you want to update. | [optional] **restreams** | [**\ApiVideo\Client\Model\RestreamsRequestObject[]**](RestreamsRequestObject.md) | Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed. | [optional] diff --git a/docs/Model/RawStatisticsListLiveStreamAnalyticsResponse.md b/docs/Model/RawStatisticsListLiveStreamAnalyticsResponse.md deleted file mode 100644 index bfdd6cb..0000000 --- a/docs/Model/RawStatisticsListLiveStreamAnalyticsResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # RawStatisticsListLiveStreamAnalyticsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**\ApiVideo\Client\Model\LiveStreamSession[]**](LiveStreamSession.md) | | -**pagination** | [**\ApiVideo\Client\Model\Pagination**](Pagination.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RawStatisticsListPlayerSessionEventsResponse.md b/docs/Model/RawStatisticsListPlayerSessionEventsResponse.md deleted file mode 100644 index dbfc62c..0000000 --- a/docs/Model/RawStatisticsListPlayerSessionEventsResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # RawStatisticsListPlayerSessionEventsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**\ApiVideo\Client\Model\PlayerSessionEvent[]**](PlayerSessionEvent.md) | | -**pagination** | [**\ApiVideo\Client\Model\Pagination**](Pagination.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RawStatisticsListSessionsResponse.md b/docs/Model/RawStatisticsListSessionsResponse.md deleted file mode 100644 index ffd05b1..0000000 --- a/docs/Model/RawStatisticsListSessionsResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # RawStatisticsListSessionsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**\ApiVideo\Client\Model\VideoSession[]**](VideoSession.md) | | -**pagination** | [**\ApiVideo\Client\Model\Pagination**](Pagination.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/LiveStreamsApi.php b/src/Api/LiveStreamsApi.php index 7c42142..d01ae81 100644 --- a/src/Api/LiveStreamsApi.php +++ b/src/Api/LiveStreamsApi.php @@ -168,7 +168,7 @@ private function buildGetRequest(string $liveStreamId): Request /** * Update a live stream * - * @param string $liveStreamId The unique ID for the live stream that you want to update information for such as player details, or whether you want the recording on or off. (required) + * @param string $liveStreamId The unique ID for the live stream that you want to update information for such as player details. (required) * @param \ApiVideo\Client\Model\LiveStreamUpdatePayload $liveStreamUpdatePayload liveStreamUpdatePayload (required) * * @throws \ApiVideo\Client\ApiException on non-2xx response @@ -187,7 +187,7 @@ public function update(string $liveStreamId, \ApiVideo\Client\Model\LiveStreamUp /** * Create request for operation 'update' * - * @param string $liveStreamId The unique ID for the live stream that you want to update information for such as player details, or whether you want the recording on or off. (required) + * @param string $liveStreamId The unique ID for the live stream that you want to update information for such as player details. (required) * @param \ApiVideo\Client\Model\LiveStreamUpdatePayload $liveStreamUpdatePayload (required) * * @throws \InvalidArgumentException diff --git a/src/Api/RawStatisticsApi.php b/src/Api/RawStatisticsApi.php deleted file mode 100644 index 14ee6b8..0000000 --- a/src/Api/RawStatisticsApi.php +++ /dev/null @@ -1,323 +0,0 @@ -client = $client; - } - - /** - * List live stream player sessions - * - * @param string $liveStreamId The unique identifier for the live stream you want to retrieve analytics for. (required) - * @param string $period Period must have one of the following formats: - For a day : \"2018-01-01\", - For a week: \"2018-W01\", - For a month: \"2018-01\" - For a year: \"2018\" For a range period: - Date range: \"2018-01-01/2018-01-15\" (required) - * @param array $queryParams - * - * @throws \ApiVideo\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\RawStatisticsListLiveStreamAnalyticsResponse|\ApiVideo\Client\Model\NotFound - */ - public function listLiveStreamSessions(string $liveStreamId, string $period, array $queryParams = []): \ApiVideo\Client\Model\RawStatisticsListLiveStreamAnalyticsResponse - { - $request = $this->buildListLiveStreamSessionsRequest($liveStreamId, $period, $queryParams); - - $model = new \ApiVideo\Client\Model\RawStatisticsListLiveStreamAnalyticsResponse($this->client->request($request)); - - return $model; - } - - /** - * Create request for operation 'listLiveStreamSessions' - * - * @param string $liveStreamId The unique identifier for the live stream you want to retrieve analytics for. (required) - * @param array $queryParams - * - * @throws \InvalidArgumentException - * @return Request - */ - private function buildListLiveStreamSessionsRequest(string $liveStreamId, string $period, array $queryParams = []): Request - { - // unbox the parameters from the associative array - $currentPage = array_key_exists('currentPage', $queryParams) ? $queryParams['currentPage'] : 1; - $pageSize = array_key_exists('pageSize', $queryParams) ? $queryParams['pageSize'] : 25; - - // verify the required parameter 'liveStreamId' is set - if ($liveStreamId === null || (is_array($liveStreamId) && count($liveStreamId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $liveStreamId when calling ' - ); - } - // verify the required parameter 'period' is set - if ($period === null || (is_array($period) && count($period) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $period when calling ' - ); - } - - $resourcePath = '/analytics/live-streams/{liveStreamId}'; - $formParams = []; - $queryParams = []; - $headers = []; - $httpBody = ''; - $multipart = false; - - // period query params - if ($period !== null) { - $queryParams['period'] = $period; - } - - // currentPage query params - if ($currentPage !== null) { - $queryParams['currentPage'] = $currentPage; - } - - // pageSize query params - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - - // path params - if ($liveStreamId !== null) { - $resourcePath = str_replace( - '{' . 'liveStreamId' . '}', - ObjectSerializer::toPathValue($liveStreamId), - $resourcePath - ); - } - - - - $query = \http_build_query($queryParams); - - return new Request( - 'GET', - $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - - /** - * List player session events - * - * @param string $sessionId A unique identifier you can use to reference and track a session with. (required) - * @param array $queryParams - * - * @throws \ApiVideo\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\RawStatisticsListPlayerSessionEventsResponse|\ApiVideo\Client\Model\NotFound - */ - public function listSessionEvents(string $sessionId, array $queryParams = []): \ApiVideo\Client\Model\RawStatisticsListPlayerSessionEventsResponse - { - $request = $this->buildListSessionEventsRequest($sessionId, $queryParams); - - $model = new \ApiVideo\Client\Model\RawStatisticsListPlayerSessionEventsResponse($this->client->request($request)); - - return $model; - } - - /** - * Create request for operation 'listSessionEvents' - * - * @param string $sessionId A unique identifier you can use to reference and track a session with. (required) - * @param array $queryParams - * - * @throws \InvalidArgumentException - * @return Request - */ - private function buildListSessionEventsRequest(string $sessionId, array $queryParams = []): Request - { - // unbox the parameters from the associative array - $currentPage = array_key_exists('currentPage', $queryParams) ? $queryParams['currentPage'] : 1; - $pageSize = array_key_exists('pageSize', $queryParams) ? $queryParams['pageSize'] : 25; - - // verify the required parameter 'sessionId' is set - if ($sessionId === null || (is_array($sessionId) && count($sessionId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $sessionId when calling ' - ); - } - - $resourcePath = '/analytics/sessions/{sessionId}/events'; - $formParams = []; - $queryParams = []; - $headers = []; - $httpBody = ''; - $multipart = false; - - // currentPage query params - if ($currentPage !== null) { - $queryParams['currentPage'] = $currentPage; - } - - // pageSize query params - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - - // path params - if ($sessionId !== null) { - $resourcePath = str_replace( - '{' . 'sessionId' . '}', - ObjectSerializer::toPathValue($sessionId), - $resourcePath - ); - } - - - - $query = \http_build_query($queryParams); - - return new Request( - 'GET', - $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - - /** - * List video player sessions - * - * @param string $videoId The unique identifier for the video you want to retrieve session information for. (required) - * @param string $period Period must have one of the following formats: - For a day : 2018-01-01, - For a week: 2018-W01, - For a month: 2018-01 - For a year: 2018 For a range period: - Date range: 2018-01-01/2018-01-15 (required) - * @param array $queryParams - * - * @throws \ApiVideo\Client\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\RawStatisticsListSessionsResponse|\ApiVideo\Client\Model\NotFound - */ - public function listVideoSessions(string $videoId, string $period, array $queryParams = []): \ApiVideo\Client\Model\RawStatisticsListSessionsResponse - { - $request = $this->buildListVideoSessionsRequest($videoId, $period, $queryParams); - - $model = new \ApiVideo\Client\Model\RawStatisticsListSessionsResponse($this->client->request($request)); - - return $model; - } - - /** - * Create request for operation 'listVideoSessions' - * - * @param string $videoId The unique identifier for the video you want to retrieve session information for. (required) - * @param array $queryParams - * - * @throws \InvalidArgumentException - * @return Request - */ - private function buildListVideoSessionsRequest(string $videoId, string $period, array $queryParams = []): Request - { - // unbox the parameters from the associative array - $metadata = array_key_exists('metadata', $queryParams) ? $queryParams['metadata'] : null; - $currentPage = array_key_exists('currentPage', $queryParams) ? $queryParams['currentPage'] : 1; - $pageSize = array_key_exists('pageSize', $queryParams) ? $queryParams['pageSize'] : 25; - - // verify the required parameter 'videoId' is set - if ($videoId === null || (is_array($videoId) && count($videoId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $videoId when calling ' - ); - } - // verify the required parameter 'period' is set - if ($period === null || (is_array($period) && count($period) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $period when calling ' - ); - } - - $resourcePath = '/analytics/videos/{videoId}'; - $formParams = []; - $queryParams = []; - $headers = []; - $httpBody = ''; - $multipart = false; - - // period query params - if ($period !== null) { - $queryParams['period'] = $period; - } - - // metadata query params - if ($metadata !== null) { - if(is_array($metadata)) { - $queryParams["metadata"] = array(); - foreach($metadata as $key => $value) { - $queryParams['metadata'][$key] = $value; - } - } - else { - throw new \InvalidArgumentException('invalid value for "$metadata" when calling RawStatisticsApi.ListVideoSessions, must be an array.'); - } - } - - // currentPage query params - if ($currentPage !== null) { - $queryParams['currentPage'] = $currentPage; - } - - // pageSize query params - if ($pageSize !== null) { - $queryParams['pageSize'] = $pageSize; - } - - // path params - if ($videoId !== null) { - $resourcePath = str_replace( - '{' . 'videoId' . '}', - ObjectSerializer::toPathValue($videoId), - $resourcePath - ); - } - - - - $query = \http_build_query($queryParams); - - return new Request( - 'GET', - $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - -} diff --git a/src/Client.php b/src/Client.php index ee5b304..ed9196c 100644 --- a/src/Client.php +++ b/src/Client.php @@ -132,18 +132,6 @@ public function playerThemes(): \ApiVideo\Client\Api\PlayerThemesApi return $this->services['playerThemes']; } - /** - * @return \ApiVideo\Client\Api\RawStatisticsApi - */ - public function rawStatistics(): \ApiVideo\Client\Api\RawStatisticsApi - { - if (!array_key_exists('rawStatistics', $this->services)) { - $this->services['rawStatistics'] = new \ApiVideo\Client\Api\RawStatisticsApi($this->baseClient); - } - - return $this->services['rawStatistics']; - } - /** * @return \ApiVideo\Client\Api\UploadTokensApi */ diff --git a/src/Model/LiveStream.php b/src/Model/LiveStream.php index b3d0565..30b58ac 100644 --- a/src/Model/LiveStream.php +++ b/src/Model/LiveStream.php @@ -34,7 +34,6 @@ public static function getDefinition(): ModelDefinition 'liveStreamId' => 'string', 'name' => 'string', 'streamKey' => 'string', - 'record' => 'bool', 'public' => 'bool', 'assets' => '\ApiVideo\Client\Model\LiveStreamAssets', 'playerId' => 'string', @@ -47,7 +46,6 @@ public static function getDefinition(): ModelDefinition 'liveStreamId' => null, 'name' => null, 'streamKey' => null, - 'record' => null, 'public' => null, 'assets' => null, 'playerId' => null, @@ -60,7 +58,6 @@ public static function getDefinition(): ModelDefinition 'liveStreamId' => 'liveStreamId', 'name' => 'name', 'streamKey' => 'streamKey', - 'record' => 'record', 'public' => 'public', 'assets' => 'assets', 'playerId' => 'playerId', @@ -73,7 +70,6 @@ public static function getDefinition(): ModelDefinition 'liveStreamId' => 'setLiveStreamId', 'name' => 'setName', 'streamKey' => 'setStreamKey', - 'record' => 'setRecord', 'public' => 'setPublic', 'assets' => 'setAssets', 'playerId' => 'setPlayerId', @@ -86,7 +82,6 @@ public static function getDefinition(): ModelDefinition 'liveStreamId' => 'getLiveStreamId', 'name' => 'getName', 'streamKey' => 'getStreamKey', - 'record' => 'getRecord', 'public' => 'getPublic', 'assets' => 'getAssets', 'playerId' => 'getPlayerId', @@ -99,7 +94,6 @@ public static function getDefinition(): ModelDefinition 'liveStreamId' => null, 'name' => null, 'streamKey' => null, - 'record' => null, 'public' => null, 'assets' => null, 'playerId' => null, @@ -131,7 +125,6 @@ public function __construct(array $data = null) $this->container['liveStreamId'] = $data['liveStreamId'] ?? null; $this->container['name'] = $data['name'] ?? null; $this->container['streamKey'] = $data['streamKey'] ?? null; - $this->container['record'] = $data['record'] ?? null; $this->container['public'] = $data['public'] ?? null; $this->container['assets'] = isset($data['assets']) ? new LiveStreamAssets($data['assets']) : null; $this->container['playerId'] = $data['playerId'] ?? null; @@ -243,30 +236,6 @@ public function setStreamKey($streamKey) return $this; } - /** - * Gets record - * - * @return bool|null - */ - public function getRecord() - { - return $this->container['record']; - } - - /** - * Sets record - * - * @param bool|null $record Whether you are recording or not. - * - * @return self - */ - public function setRecord($record) - { - $this->container['record'] = $record; - - return $this; - } - /** * Gets public * diff --git a/src/Model/LiveStreamCreationPayload.php b/src/Model/LiveStreamCreationPayload.php index c72687b..db6e916 100644 --- a/src/Model/LiveStreamCreationPayload.php +++ b/src/Model/LiveStreamCreationPayload.php @@ -32,42 +32,36 @@ public static function getDefinition(): ModelDefinition 'live-stream-creation-payload', [ 'name' => 'string', - 'record' => 'bool', 'public' => 'bool', 'playerId' => 'string', 'restreams' => '\ApiVideo\Client\Model\RestreamsRequestObject[]' ], [ 'name' => null, - 'record' => null, 'public' => null, 'playerId' => null, 'restreams' => null ], [ 'name' => 'name', - 'record' => 'record', 'public' => 'public', 'playerId' => 'playerId', 'restreams' => 'restreams' ], [ 'name' => 'setName', - 'record' => 'setRecord', 'public' => 'setPublic', 'playerId' => 'setPlayerId', 'restreams' => 'setRestreams' ], [ 'name' => 'getName', - 'record' => 'getRecord', 'public' => 'getPublic', 'playerId' => 'getPlayerId', 'restreams' => 'getRestreams' ], [ 'name' => null, - 'record' => null, 'public' => null, 'playerId' => null, 'restreams' => null @@ -93,7 +87,6 @@ public static function getDefinition(): ModelDefinition public function __construct(array $data = null) { $this->container['name'] = $data['name'] ?? null; - $this->container['record'] = $data['record'] ?? false; $this->container['public'] = $data['public'] ?? null; $this->container['playerId'] = $data['playerId'] ?? null; $this->container['restreams'] = isset($data['restreams']) ? array_map(function(array $value): RestreamsRequestObject { return new RestreamsRequestObject($value); }, $data['restreams']) : null; @@ -154,30 +147,6 @@ public function setName($name) return $this; } - /** - * Gets record - * - * @return bool|null - */ - public function getRecord() - { - return $this->container['record']; - } - - /** - * Sets record - * - * @param bool|null $record Whether you are recording or not. True for record, false for not record. - * - * @return self - */ - public function setRecord($record) - { - $this->container['record'] = $record; - - return $this; - } - /** * Gets public * diff --git a/src/Model/LiveStreamUpdatePayload.php b/src/Model/LiveStreamUpdatePayload.php index 58ca2b5..3d9cf9a 100644 --- a/src/Model/LiveStreamUpdatePayload.php +++ b/src/Model/LiveStreamUpdatePayload.php @@ -33,42 +33,36 @@ public static function getDefinition(): ModelDefinition [ 'name' => 'string', 'public' => 'bool', - 'record' => 'bool', 'playerId' => 'string', 'restreams' => '\ApiVideo\Client\Model\RestreamsRequestObject[]' ], [ 'name' => null, 'public' => null, - 'record' => null, 'playerId' => null, 'restreams' => null ], [ 'name' => 'name', 'public' => 'public', - 'record' => 'record', 'playerId' => 'playerId', 'restreams' => 'restreams' ], [ 'name' => 'setName', 'public' => 'setPublic', - 'record' => 'setRecord', 'playerId' => 'setPlayerId', 'restreams' => 'setRestreams' ], [ 'name' => 'getName', 'public' => 'getPublic', - 'record' => 'getRecord', 'playerId' => 'getPlayerId', 'restreams' => 'getRestreams' ], [ 'name' => null, 'public' => null, - 'record' => null, 'playerId' => null, 'restreams' => null ], @@ -94,7 +88,6 @@ public function __construct(array $data = null) { $this->container['name'] = $data['name'] ?? null; $this->container['public'] = $data['public'] ?? null; - $this->container['record'] = $data['record'] ?? null; $this->container['playerId'] = $data['playerId'] ?? null; $this->container['restreams'] = isset($data['restreams']) ? array_map(function(array $value): RestreamsRequestObject { return new RestreamsRequestObject($value); }, $data['restreams']) : null; } @@ -175,30 +168,6 @@ public function setPublic($public) return $this; } - /** - * Gets record - * - * @return bool|null - */ - public function getRecord() - { - return $this->container['record']; - } - - /** - * Sets record - * - * @param bool|null $record Use this to indicate whether you want the recording on or off. On is true, off is false. - * - * @return self - */ - public function setRecord($record) - { - $this->container['record'] = $record; - - return $this; - } - /** * Gets playerId * diff --git a/src/Model/RawStatisticsListLiveStreamAnalyticsResponse.php b/src/Model/RawStatisticsListLiveStreamAnalyticsResponse.php deleted file mode 100644 index dd8767d..0000000 --- a/src/Model/RawStatisticsListLiveStreamAnalyticsResponse.php +++ /dev/null @@ -1,186 +0,0 @@ - '\ApiVideo\Client\Model\LiveStreamSession[]', - 'pagination' => '\ApiVideo\Client\Model\Pagination' - ], - [ - 'data' => null, - 'pagination' => null - ], - [ - 'data' => 'data', - 'pagination' => 'pagination' - ], - [ - 'data' => 'setData', - 'pagination' => 'setPagination' - ], - [ - 'data' => 'getData', - 'pagination' => 'getPagination' - ], - [ - 'data' => null, - 'pagination' => null - ], - null - ); - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['data'] = isset($data['data']) ? array_map(function(array $value): LiveStreamSession { return new LiveStreamSession($value); }, $data['data']) : null; - $this->container['pagination'] = isset($data['pagination']) ? new Pagination($data['pagination']) : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['data'] === null) { - $invalidProperties[] = "'data' can't be null"; - } - if ($this->container['pagination'] === null) { - $invalidProperties[] = "'pagination' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets data - * - * @return \ApiVideo\Client\Model\LiveStreamSession[] - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param \ApiVideo\Client\Model\LiveStreamSession[] $data data - * - * @return self - */ - public function setData($data) - { - $this->container['data'] = $data; - - return $this; - } - - /** - * Gets pagination - * - * @return \ApiVideo\Client\Model\Pagination - */ - public function getPagination() - { - return $this->container['pagination']; - } - - /** - * Sets pagination - * - * @param \ApiVideo\Client\Model\Pagination $pagination pagination - * - * @return self - */ - public function setPagination($pagination) - { - $this->container['pagination'] = $pagination; - - return $this; - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } -} - - diff --git a/src/Model/RawStatisticsListPlayerSessionEventsResponse.php b/src/Model/RawStatisticsListPlayerSessionEventsResponse.php deleted file mode 100644 index 9cabe10..0000000 --- a/src/Model/RawStatisticsListPlayerSessionEventsResponse.php +++ /dev/null @@ -1,186 +0,0 @@ - '\ApiVideo\Client\Model\PlayerSessionEvent[]', - 'pagination' => '\ApiVideo\Client\Model\Pagination' - ], - [ - 'data' => null, - 'pagination' => null - ], - [ - 'data' => 'data', - 'pagination' => 'pagination' - ], - [ - 'data' => 'setData', - 'pagination' => 'setPagination' - ], - [ - 'data' => 'getData', - 'pagination' => 'getPagination' - ], - [ - 'data' => null, - 'pagination' => null - ], - null - ); - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['data'] = isset($data['data']) ? array_map(function(array $value): PlayerSessionEvent { return new PlayerSessionEvent($value); }, $data['data']) : null; - $this->container['pagination'] = isset($data['pagination']) ? new Pagination($data['pagination']) : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['data'] === null) { - $invalidProperties[] = "'data' can't be null"; - } - if ($this->container['pagination'] === null) { - $invalidProperties[] = "'pagination' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets data - * - * @return \ApiVideo\Client\Model\PlayerSessionEvent[] - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param \ApiVideo\Client\Model\PlayerSessionEvent[] $data data - * - * @return self - */ - public function setData($data) - { - $this->container['data'] = $data; - - return $this; - } - - /** - * Gets pagination - * - * @return \ApiVideo\Client\Model\Pagination - */ - public function getPagination() - { - return $this->container['pagination']; - } - - /** - * Sets pagination - * - * @param \ApiVideo\Client\Model\Pagination $pagination pagination - * - * @return self - */ - public function setPagination($pagination) - { - $this->container['pagination'] = $pagination; - - return $this; - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } -} - - diff --git a/src/Model/RawStatisticsListSessionsResponse.php b/src/Model/RawStatisticsListSessionsResponse.php deleted file mode 100644 index aaf2134..0000000 --- a/src/Model/RawStatisticsListSessionsResponse.php +++ /dev/null @@ -1,186 +0,0 @@ - '\ApiVideo\Client\Model\VideoSession[]', - 'pagination' => '\ApiVideo\Client\Model\Pagination' - ], - [ - 'data' => null, - 'pagination' => null - ], - [ - 'data' => 'data', - 'pagination' => 'pagination' - ], - [ - 'data' => 'setData', - 'pagination' => 'setPagination' - ], - [ - 'data' => 'getData', - 'pagination' => 'getPagination' - ], - [ - 'data' => null, - 'pagination' => null - ], - null - ); - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['data'] = isset($data['data']) ? array_map(function(array $value): VideoSession { return new VideoSession($value); }, $data['data']) : null; - $this->container['pagination'] = isset($data['pagination']) ? new Pagination($data['pagination']) : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['data'] === null) { - $invalidProperties[] = "'data' can't be null"; - } - if ($this->container['pagination'] === null) { - $invalidProperties[] = "'pagination' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets data - * - * @return \ApiVideo\Client\Model\VideoSession[] - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param \ApiVideo\Client\Model\VideoSession[] $data data - * - * @return self - */ - public function setData($data) - { - $this->container['data'] = $data; - - return $this; - } - - /** - * Gets pagination - * - * @return \ApiVideo\Client\Model\Pagination - */ - public function getPagination() - { - return $this->container['pagination']; - } - - /** - * Sets pagination - * - * @param \ApiVideo\Client\Model\Pagination $pagination pagination - * - * @return self - */ - public function setPagination($pagination) - { - $this->container['pagination'] = $pagination; - - return $this; - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } -} - - diff --git a/tests/Api/LiveStreamsApiTest.php b/tests/Api/LiveStreamsApiTest.php index 2e52a01..12d88e6 100644 --- a/tests/Api/LiveStreamsApiTest.php +++ b/tests/Api/LiveStreamsApiTest.php @@ -63,27 +63,23 @@ public function testUpdate() $payload ->setName('Test live stream') ->setPublic(false) - ->setRecord(true) ; $liveStream = $this->client->liveStreams()->create($payload); $this->assertEquals('Test live stream', $liveStream->getName()); $this->assertEquals(false, $liveStream->getPublic()); - $this->assertEquals(true, $liveStream->getRecord()); $payload = new LiveStreamUpdatePayload(); $payload ->setName('New name') ->setPublic(true) - ->setRecord(false) ; $liveStream = $this->client->liveStreams()->update($liveStream->getLiveStreamId(), $payload); $this->assertEquals('New name', $liveStream->getName()); $this->assertEquals(true, $liveStream->getPublic()); - $this->assertEquals(false, $liveStream->getRecord()); } public function testCreate() diff --git a/tests/Api/RawStatisticsApiTest.php b/tests/Api/RawStatisticsApiTest.php deleted file mode 100644 index 2e13658..0000000 --- a/tests/Api/RawStatisticsApiTest.php +++ /dev/null @@ -1,27 +0,0 @@ -client))->createLiveStream(); - - $response = $this->client->rawStatistics()->listLiveStreamSessions($liveStream->getLiveStreamId(), '2022-01'); - - $this->assertCount(0, $response->getData()); - } - - public function testListVideoSessions() - { - $video = (new Helper($this->client))->createVideo(); - - $response = $this->client->rawStatistics()->listVideoSessions($video->getVideoId(), '2022-01'); - - $this->assertCount(0, $response->getData()); - } -}