From b143fbe4d1e2193ada7ba6c3ec6be04ed56acb54 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Fri, 26 Jul 2024 12:50:20 +0000 Subject: [PATCH] Add new analytics endpoints & livestream complete() --- CHANGELOG.md | 4 + README.md | 32 +- docs/Api/AnalyticsApi.md | 80 +++- docs/Api/LiveStreamsApi.md | 32 ++ ... => AnalyticsAggregatedMetricsResponse.md} | 6 +- ...alyticsAggregatedMetricsResponseContext.md | 11 + ...gregatedMetricsResponseContextTimeframe.md | 10 + .../AnalyticsMetricsBreakdownResponse.md | 11 + ...nalyticsMetricsBreakdownResponseContext.md | 11 + .../AnalyticsMetricsBreakdownResponseData.md | 10 + .../Model/AnalyticsMetricsOverTimeResponse.md | 11 + ...AnalyticsMetricsOverTimeResponseContext.md | 11 + .../AnalyticsMetricsOverTimeResponseData.md | 10 + docs/Model/FilterBy.md | 16 + docs/Model/FilterBy1.md | 16 + docs/Model/FilterBy2.md | 16 + docs/Model/LiveStream.md | 4 +- docs/Model/LiveStreamCreationPayload.md | 4 +- docs/Model/LiveStreamSession.md | 14 - docs/Model/LiveStreamSessionClient.md | 11 - docs/Model/LiveStreamSessionDevice.md | 11 - docs/Model/LiveStreamSessionReferrer.md | 12 - docs/Model/LiveStreamSessionSession.md | 11 - docs/Model/LiveStreamUpdatePayload.md | 4 +- docs/Model/RestreamsRequestObject.md | 2 +- docs/Model/RestreamsResponseObject.md | 2 +- ...nLocation.md => UnrecognizedRequestUrl.md} | 7 +- docs/Model/VideoCreationPayload.md | 2 +- docs/Model/VideoSession.md | 14 - docs/Model/VideoSessionClient.md | 11 - docs/Model/VideoSessionDevice.md | 11 - docs/Model/VideoSessionOs.md | 11 - docs/Model/VideoSessionReferrer.md | 12 - docs/Model/VideoSessionSession.md | 12 - src/Api/AnalyticsApi.php | 281 +++++++++--- src/Api/LiveStreamsApi.php | 62 +++ src/BaseClient.php | 4 +- .../AnalyticsAggregatedMetricsResponse.php | 186 ++++++++ ...lyticsAggregatedMetricsResponseContext.php | 293 ++++++++++++ ...egatedMetricsResponseContextTimeframe.php} | 68 +-- .../AnalyticsMetricsBreakdownResponse.php | 220 +++++++++ ...alyticsMetricsBreakdownResponseContext.php | 295 ++++++++++++ ...AnalyticsMetricsBreakdownResponseData.php} | 96 ++-- .../AnalyticsMetricsOverTimeResponse.php | 220 +++++++++ ...nalyticsMetricsOverTimeResponseContext.php | 285 ++++++++++++ ... AnalyticsMetricsOverTimeResponseData.php} | 65 ++- src/Model/FilterBy.php | 434 ++++++++++++++++++ src/Model/FilterBy1.php | 434 ++++++++++++++++++ src/Model/FilterBy2.php | 434 ++++++++++++++++++ src/Model/LiveStream.php | 4 +- src/Model/LiveStreamCreationPayload.php | 4 +- src/Model/LiveStreamSession.php | 304 ------------ src/Model/LiveStreamSessionClient.php | 212 --------- src/Model/LiveStreamSessionDevice.php | 212 --------- src/Model/LiveStreamSessionReferrer.php | 242 ---------- src/Model/LiveStreamSessionSession.php | 211 --------- src/Model/LiveStreamUpdatePayload.php | 4 +- src/Model/RestreamsRequestObject.php | 2 +- src/Model/RestreamsResponseObject.php | 2 +- ...nDevice.php => UnrecognizedRequestUrl.php} | 67 ++- src/Model/VideoCreationPayload.php | 2 +- src/Model/VideoSession.php | 304 ------------ src/Model/VideoSessionOs.php | 212 --------- src/Model/VideoSessionReferrer.php | 242 ---------- src/Model/VideoSessionSession.php | 242 ---------- 65 files changed, 3487 insertions(+), 2598 deletions(-) rename docs/Model/{VideoSessionLocation.md => AnalyticsAggregatedMetricsResponse.md} (54%) create mode 100644 docs/Model/AnalyticsAggregatedMetricsResponseContext.md create mode 100644 docs/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.md create mode 100644 docs/Model/AnalyticsMetricsBreakdownResponse.md create mode 100644 docs/Model/AnalyticsMetricsBreakdownResponseContext.md create mode 100644 docs/Model/AnalyticsMetricsBreakdownResponseData.md create mode 100644 docs/Model/AnalyticsMetricsOverTimeResponse.md create mode 100644 docs/Model/AnalyticsMetricsOverTimeResponseContext.md create mode 100644 docs/Model/AnalyticsMetricsOverTimeResponseData.md create mode 100644 docs/Model/FilterBy.md create mode 100644 docs/Model/FilterBy1.md create mode 100644 docs/Model/FilterBy2.md delete mode 100644 docs/Model/LiveStreamSession.md delete mode 100644 docs/Model/LiveStreamSessionClient.md delete mode 100644 docs/Model/LiveStreamSessionDevice.md delete mode 100644 docs/Model/LiveStreamSessionReferrer.md delete mode 100644 docs/Model/LiveStreamSessionSession.md rename docs/Model/{LiveStreamSessionLocation.md => UnrecognizedRequestUrl.md} (50%) delete mode 100644 docs/Model/VideoSession.md delete mode 100644 docs/Model/VideoSessionClient.md delete mode 100644 docs/Model/VideoSessionDevice.md delete mode 100644 docs/Model/VideoSessionOs.md delete mode 100644 docs/Model/VideoSessionReferrer.md delete mode 100644 docs/Model/VideoSessionSession.md create mode 100644 src/Model/AnalyticsAggregatedMetricsResponse.php create mode 100644 src/Model/AnalyticsAggregatedMetricsResponseContext.php rename src/Model/{VideoSessionLocation.php => AnalyticsAggregatedMetricsResponseContextTimeframe.php} (63%) create mode 100644 src/Model/AnalyticsMetricsBreakdownResponse.php create mode 100644 src/Model/AnalyticsMetricsBreakdownResponseContext.php rename src/Model/{VideoSessionClient.php => AnalyticsMetricsBreakdownResponseData.php} (57%) create mode 100644 src/Model/AnalyticsMetricsOverTimeResponse.php create mode 100644 src/Model/AnalyticsMetricsOverTimeResponseContext.php rename src/Model/{LiveStreamSessionLocation.php => AnalyticsMetricsOverTimeResponseData.php} (61%) create mode 100644 src/Model/FilterBy.php create mode 100644 src/Model/FilterBy1.php create mode 100644 src/Model/FilterBy2.php delete mode 100644 src/Model/LiveStreamSession.php delete mode 100644 src/Model/LiveStreamSessionClient.php delete mode 100644 src/Model/LiveStreamSessionDevice.php delete mode 100644 src/Model/LiveStreamSessionReferrer.php delete mode 100644 src/Model/LiveStreamSessionSession.php rename src/Model/{VideoSessionDevice.php => UnrecognizedRequestUrl.php} (69%) delete mode 100644 src/Model/VideoSession.php delete mode 100644 src/Model/VideoSessionOs.php delete mode 100644 src/Model/VideoSessionReferrer.php delete mode 100644 src/Model/VideoSessionSession.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 87ea0eb..d14a5ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All changes to this project will be documented in this file. +## [1.4.0] - 2024-07-29 +- Add new analytics methods +- Add livestream complete() method + ## [1.3.2] - 2024-02-19 - Update VideoStatusIngest enum diff --git a/README.md b/README.md index eb1e566..802660a 100644 --- a/README.md +++ b/README.md @@ -132,8 +132,9 @@ $client->videos()->upload( Method | Description | HTTP request ------------- | ------------- | ------------- -[**getLiveStreamsPlays()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/AnalyticsApi.md#getLiveStreamsPlays) | Get play events for live stream | **GET** `/analytics/live-streams/plays` -[**getVideosPlays()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/AnalyticsApi.md#getVideosPlays) | Get play events for video | **GET** `/analytics/videos/plays` +[**getAggregatedMetrics()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/AnalyticsApi.md#getAggregatedMetrics) | Retrieve aggregated metrics | **GET** `/data/metrics/{metric}/{aggregation}` +[**getMetricsBreakdown()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/AnalyticsApi.md#getMetricsBreakdown) | Retrieve metrics in a breakdown of dimensions | **GET** `/data/buckets/{metric}/{breakdown}` +[**getMetricsOverTime()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/AnalyticsApi.md#getMetricsOverTime) | Retrieve metrics over time | **GET** `/data/timeseries/{metric}` #### CaptionsApi @@ -168,6 +169,7 @@ Method | Description | HTTP request [**list()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#list) | List all live streams | **GET** `/live-streams` [**uploadThumbnail()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#uploadThumbnail) | Upload a thumbnail | **POST** `/live-streams/{liveStreamId}/thumbnail` [**deleteThumbnail()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#deleteThumbnail) | Delete a thumbnail | **DELETE** `/live-streams/{liveStreamId}/thumbnail` +[**complete()**](https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#complete) | Complete a live stream | **PUT** `/live-streams/{liveStreamId}/complete` #### PlayerThemesApi @@ -233,7 +235,16 @@ Method | Description | HTTP request - [AccessToken](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AccessToken.md) - [AdditionalBadRequestErrors](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AdditionalBadRequestErrors.md) + - [AnalyticsAggregatedMetricsResponse](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsAggregatedMetricsResponse.md) + - [AnalyticsAggregatedMetricsResponseContext](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsAggregatedMetricsResponseContext.md) + - [AnalyticsAggregatedMetricsResponseContextTimeframe](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.md) - [AnalyticsData](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsData.md) + - [AnalyticsMetricsBreakdownResponse](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsMetricsBreakdownResponse.md) + - [AnalyticsMetricsBreakdownResponseContext](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsMetricsBreakdownResponseContext.md) + - [AnalyticsMetricsBreakdownResponseData](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsMetricsBreakdownResponseData.md) + - [AnalyticsMetricsOverTimeResponse](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsMetricsOverTimeResponse.md) + - [AnalyticsMetricsOverTimeResponseContext](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsMetricsOverTimeResponseContext.md) + - [AnalyticsMetricsOverTimeResponseData](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsMetricsOverTimeResponseData.md) - [AnalyticsPlays400Error](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsPlays400Error.md) - [AnalyticsPlaysResponse](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AnalyticsPlaysResponse.md) - [AuthenticatePayload](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/AuthenticatePayload.md) @@ -244,17 +255,14 @@ Method | Description | HTTP request - [CaptionsUpdatePayload](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/CaptionsUpdatePayload.md) - [Chapter](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/Chapter.md) - [ChaptersListResponse](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/ChaptersListResponse.md) + - [FilterBy](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/FilterBy.md) + - [FilterBy1](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/FilterBy1.md) + - [FilterBy2](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/FilterBy2.md) - [Link](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/Link.md) - [LiveStream](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStream.md) - [LiveStreamAssets](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamAssets.md) - [LiveStreamCreationPayload](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamCreationPayload.md) - [LiveStreamListResponse](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamListResponse.md) - - [LiveStreamSession](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamSession.md) - - [LiveStreamSessionClient](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamSessionClient.md) - - [LiveStreamSessionDevice](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamSessionDevice.md) - - [LiveStreamSessionLocation](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamSessionLocation.md) - - [LiveStreamSessionReferrer](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamSessionReferrer.md) - - [LiveStreamSessionSession](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamSessionSession.md) - [LiveStreamUpdatePayload](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/LiveStreamUpdatePayload.md) - [Metadata](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/Metadata.md) - [Model403ErrorSchema](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/Model403ErrorSchema.md) @@ -274,18 +282,12 @@ Method | Description | HTTP request - [TokenCreationPayload](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/TokenCreationPayload.md) - [TokenListResponse](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/TokenListResponse.md) - [TooManyRequests](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/TooManyRequests.md) + - [UnrecognizedRequestUrl](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/UnrecognizedRequestUrl.md) - [UploadToken](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/UploadToken.md) - [Video](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/Video.md) - [VideoAssets](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoAssets.md) - [VideoClip](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoClip.md) - [VideoCreationPayload](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoCreationPayload.md) - - [VideoSession](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSession.md) - - [VideoSessionClient](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSessionClient.md) - - [VideoSessionDevice](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSessionDevice.md) - - [VideoSessionLocation](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSessionLocation.md) - - [VideoSessionOs](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSessionOs.md) - - [VideoSessionReferrer](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSessionReferrer.md) - - [VideoSessionSession](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSessionSession.md) - [VideoSource](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSource.md) - [VideoSourceLiveStream](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSourceLiveStream.md) - [VideoSourceLiveStreamLink](https://github.com/apivideo/api.video-php-client/blob/main/docs/Model/VideoSourceLiveStreamLink.md) diff --git a/docs/Api/AnalyticsApi.md b/docs/Api/AnalyticsApi.md index 7866608..118088b 100644 --- a/docs/Api/AnalyticsApi.md +++ b/docs/Api/AnalyticsApi.md @@ -4,30 +4,73 @@ All URIs are relative to https://ws.api.video. Method | Description | HTTP request ------------- | ------------- | ------------- -[**getLiveStreamsPlays()**](AnalyticsApi.md#getLiveStreamsPlays) | Get play events for live stream | **GET** /analytics/live-streams/plays -[**getVideosPlays()**](AnalyticsApi.md#getVideosPlays) | Get play events for video | **GET** /analytics/videos/plays +[**getAggregatedMetrics()**](AnalyticsApi.md#getAggregatedMetrics) | Retrieve aggregated metrics | **GET** /data/metrics/{metric}/{aggregation} +[**getMetricsBreakdown()**](AnalyticsApi.md#getMetricsBreakdown) | Retrieve metrics in a breakdown of dimensions | **GET** /data/buckets/{metric}/{breakdown} +[**getMetricsOverTime()**](AnalyticsApi.md#getMetricsOverTime) | Retrieve metrics over time | **GET** /data/timeseries/{metric} -## **`getLiveStreamsPlays()` - Get play events for live stream** +## **`getAggregatedMetrics()` - Retrieve aggregated metrics** -Retrieve filtered analytics about the number of plays for your live streams in a project. +Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. ### Arguments +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + `metric` | **string**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. | +`queryParams` | array | (see below) | + `aggregation` | **string**| Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. | +`queryParams` | array | (see below) | + + +Note: `queryParams` argument is an associative array with the keys listed below. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + `from` | **\DateTime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. | [optional] + `to` | **\DateTime**| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] + `filterBy` | [**FilterBy2**](../Model/.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + + + + + + +### Return type + +[**\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponse**](../Model/AnalyticsAggregatedMetricsResponse.md) + + +## **`getMetricsBreakdown()` - Retrieve metrics in a breakdown of dimensions** + + + +Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. + +### Arguments + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + `metric` | **string**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. | +`queryParams` | array | (see below) | + `breakdown` | **string**| Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | +`queryParams` | array | (see below) | + + Note: `queryParams` argument is an associative array with the keys listed below. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - `from` | **\DateTime**| Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. | - `dimension` | **string**| Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. | - `to` | **\DateTime**| Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. | [optional] - `filter` | **string**| Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. | [optional] + `from` | **\DateTime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | [optional] + `to` | **\DateTime**| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] + `filterBy` | [**FilterBy2**](../Model/.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [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] @@ -38,32 +81,35 @@ Name | Type | Description | Notes ### Return type -[**\ApiVideo\Client\Model\AnalyticsPlaysResponse**](../Model/AnalyticsPlaysResponse.md) +[**\ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponse**](../Model/AnalyticsMetricsBreakdownResponse.md) -## **`getVideosPlays()` - Get play events for video** +## **`getMetricsOverTime()` - Retrieve metrics over time** -Retrieve filtered analytics about the number of plays for your videos in a project. +Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred ### Arguments - +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + `metric` | **string**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. | +`queryParams` | array | (see below) | Note: `queryParams` argument is an associative array with the keys listed below. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - `from` | **\DateTime**| Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. | - `dimension` | **string**| Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. | - `to` | **\DateTime**| Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. | [optional] - `filter` | **string**| Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. | [optional] + `from` | **\DateTime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | [optional] + `to` | **\DateTime**| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] + `interval` | **string**| Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. | [optional] + `filterBy` | [**FilterBy2**](../Model/.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [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] @@ -74,7 +120,7 @@ Name | Type | Description | Notes ### Return type -[**\ApiVideo\Client\Model\AnalyticsPlaysResponse**](../Model/AnalyticsPlaysResponse.md) +[**\ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponse**](../Model/AnalyticsMetricsOverTimeResponse.md) diff --git a/docs/Api/LiveStreamsApi.md b/docs/Api/LiveStreamsApi.md index e9603a9..3efa15c 100644 --- a/docs/Api/LiveStreamsApi.md +++ b/docs/Api/LiveStreamsApi.md @@ -11,6 +11,7 @@ Method | Description | HTTP request [**list()**](LiveStreamsApi.md#list) | List all live streams | **GET** /live-streams [**uploadThumbnail()**](LiveStreamsApi.md#uploadThumbnail) | Upload a thumbnail | **POST** /live-streams/{liveStreamId}/thumbnail [**deleteThumbnail()**](LiveStreamsApi.md#deleteThumbnail) | Delete a thumbnail | **DELETE** /live-streams/{liveStreamId}/thumbnail +[**complete()**](LiveStreamsApi.md#complete) | Complete a live stream | **PUT** /live-streams/{liveStreamId}/complete ## **`create()` - Create live stream** @@ -200,3 +201,34 @@ Name | Type | Description | Notes + +## **`complete()` - Complete a live stream** + + + +Request the completion of a live stream that is currently running. This operation is asynchronous and the live stream will stop after a few seconds. + + + +The API adds the `EXT-X-ENDLIST` tag to the live stream's HLS manifest. This stops the live stream on the player and also stops the recording of the live stream. The API keeps the incoming connection from the streamer open for at most 1 minute, which can be used to terminate the stream. + + + +### Arguments + + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + `liveStreamId` | **string**| The unique ID for the live stream you want to complete. | + + + + +### Return type + +void (empty response body) + + + + diff --git a/docs/Model/VideoSessionLocation.md b/docs/Model/AnalyticsAggregatedMetricsResponse.md similarity index 54% rename from docs/Model/VideoSessionLocation.md rename to docs/Model/AnalyticsAggregatedMetricsResponse.md index 2805535..9674396 100644 --- a/docs/Model/VideoSessionLocation.md +++ b/docs/Model/AnalyticsAggregatedMetricsResponse.md @@ -1,10 +1,10 @@ -# # VideoSessionLocation +# # AnalyticsAggregatedMetricsResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**country** | **string** | The country of the viewer. | [optional] -**city** | **string** | The city of the viewer. | [optional] +**context** | [**\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContext**](AnalyticsAggregatedMetricsResponseContext.md) | | +**data** | **float** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalyticsAggregatedMetricsResponseContext.md b/docs/Model/AnalyticsAggregatedMetricsResponseContext.md new file mode 100644 index 0000000..0db5e2e --- /dev/null +++ b/docs/Model/AnalyticsAggregatedMetricsResponseContext.md @@ -0,0 +1,11 @@ +# # AnalyticsAggregatedMetricsResponseContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **string** | Returns the metric you selected. | [optional] +**aggregation** | **string** | Returns the aggregation you selected. | [optional] +**timeframe** | [**\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.md b/docs/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.md new file mode 100644 index 0000000..8b65775 --- /dev/null +++ b/docs/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.md @@ -0,0 +1,10 @@ +# # AnalyticsAggregatedMetricsResponseContextTimeframe + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from** | [**\DateTime**](\DateTime.md) | Returns the starting date-time of the period you want analytics for in ATOM date-time format. | [optional] +**to** | [**\DateTime**](\DateTime.md) | Returns the starting date-time of the period you want analytics for in ATOM date-time format. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalyticsMetricsBreakdownResponse.md b/docs/Model/AnalyticsMetricsBreakdownResponse.md new file mode 100644 index 0000000..ecd483d --- /dev/null +++ b/docs/Model/AnalyticsMetricsBreakdownResponse.md @@ -0,0 +1,11 @@ +# # AnalyticsMetricsBreakdownResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | [**\ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponseContext**](AnalyticsMetricsBreakdownResponseContext.md) | | +**data** | [**\ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponseData[]**](AnalyticsMetricsBreakdownResponseData.md) | Returns an array of dimensions and their respective metrics. | +**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/AnalyticsMetricsBreakdownResponseContext.md b/docs/Model/AnalyticsMetricsBreakdownResponseContext.md new file mode 100644 index 0000000..6e15192 --- /dev/null +++ b/docs/Model/AnalyticsMetricsBreakdownResponseContext.md @@ -0,0 +1,11 @@ +# # AnalyticsMetricsBreakdownResponseContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **string** | Returns the metric you selected. | [optional] +**breakdown** | **string** | Returns the dimension you selected. | [optional] +**timeframe** | [**\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalyticsMetricsBreakdownResponseData.md b/docs/Model/AnalyticsMetricsBreakdownResponseData.md new file mode 100644 index 0000000..f28eb6d --- /dev/null +++ b/docs/Model/AnalyticsMetricsBreakdownResponseData.md @@ -0,0 +1,10 @@ +# # AnalyticsMetricsBreakdownResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dimensionValue** | **string** | Returns a specific value for the dimension you selected, based on the data. For example if you select `continent` as a dimension, then `dimensionValue` returns values like `EU` or \"AZ\". | [optional] +**metricValue** | **float** | Returns the data for a specific dimension value. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalyticsMetricsOverTimeResponse.md b/docs/Model/AnalyticsMetricsOverTimeResponse.md new file mode 100644 index 0000000..d57e8b4 --- /dev/null +++ b/docs/Model/AnalyticsMetricsOverTimeResponse.md @@ -0,0 +1,11 @@ +# # AnalyticsMetricsOverTimeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | [**\ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponseContext**](AnalyticsMetricsOverTimeResponseContext.md) | | +**data** | [**\ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponseData[]**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps . | +**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/AnalyticsMetricsOverTimeResponseContext.md b/docs/Model/AnalyticsMetricsOverTimeResponseContext.md new file mode 100644 index 0000000..946fd40 --- /dev/null +++ b/docs/Model/AnalyticsMetricsOverTimeResponseContext.md @@ -0,0 +1,11 @@ +# # AnalyticsMetricsOverTimeResponseContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **string** | Returns the metric you selected. | [optional] +**interval** | **string** | Returns the interval you selected. | [optional] +**timeframe** | [**\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AnalyticsMetricsOverTimeResponseData.md b/docs/Model/AnalyticsMetricsOverTimeResponseData.md new file mode 100644 index 0000000..4814d65 --- /dev/null +++ b/docs/Model/AnalyticsMetricsOverTimeResponseData.md @@ -0,0 +1,10 @@ +# # AnalyticsMetricsOverTimeResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emittedAt** | **string** | Returns the timestamp of the event that belongs to a specific metric in ATOM date-time format. For example, if you set `play` with an `hour` interval in your request, then `emittedAt` returns the hourly timestamps of every play event within the timeframe you defined. | [optional] +**metricValue** | **float** | Returns the data for a specific metric value. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FilterBy.md b/docs/Model/FilterBy.md new file mode 100644 index 0000000..ced254c --- /dev/null +++ b/docs/Model/FilterBy.md @@ -0,0 +1,16 @@ +# # FilterBy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mediaId** | **string[]** | Returns analytics based on the unique identifiers of a video or a live stream. | [optional] +**mediaType** | **string** | | [optional] +**continent** | **string[]** | Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. | [optional] +**country** | **string[]** | Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. | [optional] +**deviceType** | **string[]** | Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. | [optional] +**operatingSystem** | **string[]** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] +**browser** | **string[]** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] +**tag** | **string** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FilterBy1.md b/docs/Model/FilterBy1.md new file mode 100644 index 0000000..2bd34f5 --- /dev/null +++ b/docs/Model/FilterBy1.md @@ -0,0 +1,16 @@ +# # FilterBy1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mediaId** | **string[]** | Returns analytics based on the unique identifiers of a video or a live stream. | [optional] +**mediaType** | **string** | | [optional] +**continent** | **string[]** | Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. | [optional] +**country** | **string[]** | Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. | [optional] +**deviceType** | **string[]** | Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. | [optional] +**operatingSystem** | **string[]** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] +**browser** | **string[]** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] +**tag** | **string** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FilterBy2.md b/docs/Model/FilterBy2.md new file mode 100644 index 0000000..96bf935 --- /dev/null +++ b/docs/Model/FilterBy2.md @@ -0,0 +1,16 @@ +# # FilterBy2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mediaId** | **string[]** | Returns analytics based on the unique identifiers of a video or a live stream. | [optional] +**mediaType** | **string** | | [optional] +**continent** | **string[]** | Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. | [optional] +**country** | **string[]** | Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. | [optional] +**deviceType** | **string[]** | Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. | [optional] +**operatingSystem** | **string[]** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] +**browser** | **string[]** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] +**tag** | **string** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveStream.md b/docs/Model/LiveStream.md index ad22790..a109be3 100644 --- a/docs/Model/LiveStream.md +++ b/docs/Model/LiveStream.md @@ -7,11 +7,11 @@ 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] -**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/delivery-analytics/video-privacy-access-management). | [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/delivery/video-privacy-access-management). | [optional] **assets** | [**\ApiVideo\Client\Model\LiveStreamAssets**](LiveStreamAssets.md) | | [optional] **playerId** | **string** | The unique identifier for the player. | [optional] **broadcasting** | **bool** | Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not. | [optional] -**restreams** | [**\ApiVideo\Client\Model\RestreamsResponseObject[]**](RestreamsResponseObject.md) | Returns the list of RTMP restream destinations. | +**restreams** | [**\ApiVideo\Client\Model\RestreamsResponseObject[]**](RestreamsResponseObject.md) | Returns the list of restream destinations. | **createdAt** | [**\DateTime**](\DateTime.md) | When the player was created, presented in ISO-8601 format. | [optional] **updatedAt** | [**\DateTime**](\DateTime.md) | When the player was last updated, presented in ISO-8601 format. | [optional] diff --git a/docs/Model/LiveStreamCreationPayload.md b/docs/Model/LiveStreamCreationPayload.md index a5822f7..b626246 100644 --- a/docs/Model/LiveStreamCreationPayload.md +++ b/docs/Model/LiveStreamCreationPayload.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Add a name for your live stream here. | -**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/delivery-analytics/video-privacy-access-management). | [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/delivery/video-privacy-access-management). | [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] +**restreams** | [**\ApiVideo\Client\Model\RestreamsRequestObject[]**](RestreamsRequestObject.md) | Use this parameter to add, edit, or remove `RTMPS` or `RTMP` services where you want to restream a live stream. The list can only contain up to 5 destinations. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveStreamSession.md b/docs/Model/LiveStreamSession.md deleted file mode 100644 index 1f30f06..0000000 --- a/docs/Model/LiveStreamSession.md +++ /dev/null @@ -1,14 +0,0 @@ -# # LiveStreamSession - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**session** | [**\ApiVideo\Client\Model\LiveStreamSessionSession**](LiveStreamSessionSession.md) | | [optional] -**location** | [**\ApiVideo\Client\Model\LiveStreamSessionLocation**](LiveStreamSessionLocation.md) | | [optional] -**referrer** | [**\ApiVideo\Client\Model\LiveStreamSessionReferrer**](LiveStreamSessionReferrer.md) | | [optional] -**device** | [**\ApiVideo\Client\Model\LiveStreamSessionDevice**](LiveStreamSessionDevice.md) | | [optional] -**os** | [**\ApiVideo\Client\Model\VideoSessionOs**](VideoSessionOs.md) | | [optional] -**client** | [**\ApiVideo\Client\Model\LiveStreamSessionClient**](LiveStreamSessionClient.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveStreamSessionClient.md b/docs/Model/LiveStreamSessionClient.md deleted file mode 100644 index c3bf180..0000000 --- a/docs/Model/LiveStreamSessionClient.md +++ /dev/null @@ -1,11 +0,0 @@ -# # LiveStreamSessionClient - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | The name of the browser used to view the live stream session. | [optional] -**version** | **string** | The version of the browser used to view the live stream session. | [optional] -**type** | **string** | The type of client used to view the live stream session. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveStreamSessionDevice.md b/docs/Model/LiveStreamSessionDevice.md deleted file mode 100644 index a2acd62..0000000 --- a/docs/Model/LiveStreamSessionDevice.md +++ /dev/null @@ -1,11 +0,0 @@ -# # LiveStreamSessionDevice - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **string** | What the type is like desktop, laptop, mobile. | [optional] -**vendor** | **string** | If known, what the brand of the device is, like Apple, Dell, etc. | [optional] -**model** | **string** | The specific model of the device, if known. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveStreamSessionReferrer.md b/docs/Model/LiveStreamSessionReferrer.md deleted file mode 100644 index 36b90d7..0000000 --- a/docs/Model/LiveStreamSessionReferrer.md +++ /dev/null @@ -1,12 +0,0 @@ -# # LiveStreamSessionReferrer - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **string** | The website the viewer of the live stream was referred to in order to view the live stream. | [optional] -**medium** | **string** | The type of search that brought the viewer to the live stream. Organic would be they found it on their own, paid would be they found it via an advertisement. | [optional] -**source** | **string** | Where the viewer came from to see the live stream (usually where they searched from). | [optional] -**searchTerm** | **string** | What term they searched for that led them to the live stream. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveStreamSessionSession.md b/docs/Model/LiveStreamSessionSession.md deleted file mode 100644 index bd9e1d8..0000000 --- a/docs/Model/LiveStreamSessionSession.md +++ /dev/null @@ -1,11 +0,0 @@ -# # LiveStreamSessionSession - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sessionId** | **string** | A unique identifier for your session. You can use this to track what happens during a specific session. | [optional] -**loadedAt** | [**\DateTime**](\DateTime.md) | When the session started, with the date and time presented in ISO-8601 format. | [optional] -**endedAt** | [**\DateTime**](\DateTime.md) | When the session ended, with the date and time presented in ISO-8601 format. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveStreamUpdatePayload.md b/docs/Model/LiveStreamUpdatePayload.md index 23c9579..81a26c6 100644 --- a/docs/Model/LiveStreamUpdatePayload.md +++ b/docs/Model/LiveStreamUpdatePayload.md @@ -5,8 +5,8 @@ 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/delivery-analytics/video-privacy-access-management). | [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/delivery/video-privacy-access-management). | [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] +**restreams** | [**\ApiVideo\Client\Model\RestreamsRequestObject[]**](RestreamsRequestObject.md) | Use this parameter to add, edit, or remove `RTMPS` or `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] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RestreamsRequestObject.md b/docs/Model/RestreamsRequestObject.md index d32fd53..f2b477b 100644 --- a/docs/Model/RestreamsRequestObject.md +++ b/docs/Model/RestreamsRequestObject.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Use this parameter to define a name for the restream destination. | -**serverUrl** | **string** | Use this parameter to set the RTMP URL of the restream destination. | +**serverUrl** | **string** | Use this parameter to set the `RTMPS` or `RTMP` server URL of the restream destination. | **streamKey** | **string** | Use this parameter to provide the unique key of the live stream that you want to restream. | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RestreamsResponseObject.md b/docs/Model/RestreamsResponseObject.md index 9f9573f..8de43b2 100644 --- a/docs/Model/RestreamsResponseObject.md +++ b/docs/Model/RestreamsResponseObject.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Returns the name of a restream destination. | [optional] -**serverUrl** | **string** | Returns the RTMP URL of a restream destination. | [optional] +**serverUrl** | **string** | Returns the server URL of a restream destination. | [optional] **streamKey** | **string** | Returns the unique key of the live stream that is set up for restreaming. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LiveStreamSessionLocation.md b/docs/Model/UnrecognizedRequestUrl.md similarity index 50% rename from docs/Model/LiveStreamSessionLocation.md rename to docs/Model/UnrecognizedRequestUrl.md index b8ae38b..710f4c9 100644 --- a/docs/Model/LiveStreamSessionLocation.md +++ b/docs/Model/UnrecognizedRequestUrl.md @@ -1,10 +1,11 @@ -# # LiveStreamSessionLocation +# # UnrecognizedRequestUrl ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**country** | **string** | The country of the viewer of the live stream. | [optional] -**city** | **string** | The city of the viewer of the live stream. | [optional] +**type** | **string** | A link to the error documentation. | [optional] +**title** | **string** | A description of the error that occurred. | [optional] +**status** | **int** | The HTTP status code. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VideoCreationPayload.md b/docs/Model/VideoCreationPayload.md index 7182f81..cab606f 100644 --- a/docs/Model/VideoCreationPayload.md +++ b/docs/Model/VideoCreationPayload.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **title** | **string** | The title of your new video. | **description** | **string** | A brief description of your video. | [optional] **source** | **string** | You can either add a video already on the web, by entering the URL of the video, or you can also enter the `videoId` of one of the videos you already have on your api.video acccount, and this will generate a copy of your video. Creating a copy of a video can be especially useful if you want to keep your original video and trim or apply a watermark onto the copy you would create. | [optional] -**public** | **bool** | Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/delivery-analytics/video-privacy-access-management) | [optional] [default to true] +**public** | **bool** | Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/delivery/video-privacy-access-management) | [optional] [default to true] **panoramic** | **bool** | Indicates if your video is a 360/immersive video. | [optional] [default to false] **mp4Support** | **bool** | Enables mp4 version in addition to streamed version. | [optional] [default to true] **playerId** | **string** | The unique identification number for your video player. | [optional] diff --git a/docs/Model/VideoSession.md b/docs/Model/VideoSession.md deleted file mode 100644 index 494eb21..0000000 --- a/docs/Model/VideoSession.md +++ /dev/null @@ -1,14 +0,0 @@ -# # VideoSession - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**session** | [**\ApiVideo\Client\Model\VideoSessionSession**](VideoSessionSession.md) | | [optional] -**location** | [**\ApiVideo\Client\Model\VideoSessionLocation**](VideoSessionLocation.md) | | [optional] -**referrer** | [**\ApiVideo\Client\Model\VideoSessionReferrer**](VideoSessionReferrer.md) | | [optional] -**device** | [**\ApiVideo\Client\Model\VideoSessionDevice**](VideoSessionDevice.md) | | [optional] -**os** | [**\ApiVideo\Client\Model\VideoSessionOs**](VideoSessionOs.md) | | [optional] -**client** | [**\ApiVideo\Client\Model\VideoSessionClient**](VideoSessionClient.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VideoSessionClient.md b/docs/Model/VideoSessionClient.md deleted file mode 100644 index ba59895..0000000 --- a/docs/Model/VideoSessionClient.md +++ /dev/null @@ -1,11 +0,0 @@ -# # VideoSessionClient - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | The name of the browser used to view the video session. | [optional] -**version** | **string** | The version of the browser used to view the video session. | [optional] -**type** | **string** | The type of client used to view the video session. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VideoSessionDevice.md b/docs/Model/VideoSessionDevice.md deleted file mode 100644 index 192eca9..0000000 --- a/docs/Model/VideoSessionDevice.md +++ /dev/null @@ -1,11 +0,0 @@ -# # VideoSessionDevice - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **string** | What the type is like desktop, laptop, mobile. | [optional] -**vendor** | **string** | If known, what the brand of the device is, like Apple, Dell, etc. | [optional] -**model** | **string** | The specific model of the device, if known. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VideoSessionOs.md b/docs/Model/VideoSessionOs.md deleted file mode 100644 index 8e153da..0000000 --- a/docs/Model/VideoSessionOs.md +++ /dev/null @@ -1,11 +0,0 @@ -# # VideoSessionOs - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | The name of the operating system. | [optional] -**shortname** | **string** | The nickname for the operating system, often representing the version. | [optional] -**version** | **string** | The version of the operating system. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VideoSessionReferrer.md b/docs/Model/VideoSessionReferrer.md deleted file mode 100644 index e567183..0000000 --- a/docs/Model/VideoSessionReferrer.md +++ /dev/null @@ -1,12 +0,0 @@ -# # VideoSessionReferrer - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **string** | The link the viewer used to reach the video session. | [optional] -**medium** | **string** | How they arrived at the site, for example organic or paid. Organic meaning they found it themselves and paid meaning they followed a link from an advertisement. | [optional] -**source** | **string** | The source the referrer came from to the video session. For example if they searched through google to find the stream. | [optional] -**searchTerm** | **string** | The search term they typed to arrive at the video session. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VideoSessionSession.md b/docs/Model/VideoSessionSession.md deleted file mode 100644 index f0e5bb9..0000000 --- a/docs/Model/VideoSessionSession.md +++ /dev/null @@ -1,12 +0,0 @@ -# # VideoSessionSession - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sessionId** | **string** | The unique identifier for the session that you can use to track what happens during it. | [optional] -**loadedAt** | [**\DateTime**](\DateTime.md) | When the video session started, presented in ISO-8601 format. | [optional] -**endedAt** | [**\DateTime**](\DateTime.md) | When the video session ended, presented in ISO-8601 format. | [optional] -**metadata** | [**\ApiVideo\Client\Model\Metadata[]**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. You can also just use the pairs as another way to tag and categorize your videos. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/AnalyticsApi.php b/src/Api/AnalyticsApi.php index 9c0229f..1b64942 100644 --- a/src/Api/AnalyticsApi.php +++ b/src/Api/AnalyticsApi.php @@ -43,55 +43,56 @@ public function __construct(BaseClient $client) } /** - * Get play events for live stream + * Retrieve aggregated metrics * - * @param \DateTime $from Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (required) - * @param string $dimension Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. (required) + * @param string $metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. (required) + * @param string $aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. (required) * @param array $queryParams * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\AnalyticsPlaysResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\Model403ErrorSchema|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests + * @return \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\UnrecognizedRequestUrl|\ApiVideo\Client\Model\TooManyRequests */ - public function getLiveStreamsPlays(\DateTime $from, string $dimension, array $queryParams = []): \ApiVideo\Client\Model\AnalyticsPlaysResponse + public function getAggregatedMetrics(string $metric, string $aggregation, array $queryParams = []): \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponse { - $request = $this->buildGetLiveStreamsPlaysRequest($from, $dimension, $queryParams); + $request = $this->buildGetAggregatedMetricsRequest($metric, $aggregation, $queryParams); - $model = new \ApiVideo\Client\Model\AnalyticsPlaysResponse($this->client->request($request)); + $model = new \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponse($this->client->request($request)); return $model; } /** - * Create request for operation 'getLiveStreamsPlays' + * Create request for operation 'getAggregatedMetrics' * + * @param string $metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. (required) + * @param string $aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. (required) * @param array $queryParams * * @throws \InvalidArgumentException * @return Request */ - private function buildGetLiveStreamsPlaysRequest(\DateTime $from, string $dimension, array $queryParams = []): Request + private function buildGetAggregatedMetricsRequest(string $metric, string $aggregation, array $queryParams = []): Request { // unbox the parameters from the associative array + $from = array_key_exists('from', $queryParams) ? $queryParams['from'] : null; $to = array_key_exists('to', $queryParams) ? $queryParams['to'] : null; - $filter = array_key_exists('filter', $queryParams) ? $queryParams['filter'] : null; - $currentPage = array_key_exists('currentPage', $queryParams) ? $queryParams['currentPage'] : 1; - $pageSize = array_key_exists('pageSize', $queryParams) ? $queryParams['pageSize'] : 25; + $filterBy = array_key_exists('filterBy', $queryParams) ? $queryParams['filterBy'] : null; - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { + // verify the required parameter 'metric' is set + if ($metric === null || (is_array($metric) && count($metric) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling ' + 'Missing the required parameter $metric when calling ' ); } - // verify the required parameter 'dimension' is set - if ($dimension === null || (is_array($dimension) && count($dimension) === 0)) { + // verify the required parameter 'aggregation' is set + if ($aggregation === null || (is_array($aggregation) && count($aggregation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $dimension when calling ' + 'Missing the required parameter $aggregation when calling ' ); } - $resourcePath = '/analytics/live-streams/plays'; + $resourcePath = '/data/metrics/{metric}/{aggregation}'; $formParams = []; $queryParams = []; $headers = []; @@ -99,29 +100,150 @@ private function buildGetLiveStreamsPlaysRequest(\DateTime $from, string $dimens $multipart = false; // from query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, 'form', true); + } if ($from !== null) { - $queryParams['from'] = ObjectSerializer::sanitizeForSerialization($from, 'date'); + $queryParams['from'] = $from; } // to query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, 'form', true); + } if ($to !== null) { - $queryParams['to'] = ObjectSerializer::sanitizeForSerialization($to, 'date'); + $queryParams['to'] = $to; } - // dimension query params - if (is_array($dimension)) { - $dimension = ObjectSerializer::serializeCollection($dimension, 'form', true); + // filterBy query params + if ($filterBy !== null) { + if(is_array($filterBy)) { + $queryParams["filterBy"] = array(); + foreach($filterBy as $key => $value) { + $queryParams['filterBy'][$key] = $value; + } + } + else { + throw new \InvalidArgumentException('invalid value for "$filterBy" when calling AnalyticsApi.GetAggregatedMetrics, must be an array.'); + } } - if ($dimension !== null) { - $queryParams['dimension'] = $dimension; + + // path params + if ($metric !== null) { + $resourcePath = str_replace( + '{' . 'metric' . '}', + ObjectSerializer::toPathValue($metric), + $resourcePath + ); } + // path params + if ($aggregation !== null) { + $resourcePath = str_replace( + '{' . 'aggregation' . '}', + ObjectSerializer::toPathValue($aggregation), + $resourcePath + ); + } + + + + $query = \http_build_query($queryParams); + + return new Request( + 'GET', + $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + - // filter query params - if (is_array($filter)) { - $filter = ObjectSerializer::serializeCollection($filter, 'form', true); + /** + * Retrieve metrics in a breakdown of dimensions + * + * @param string $metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. (required) + * @param string $breakdown Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. (required) + * @param array $queryParams + * + * @throws \ApiVideo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\UnrecognizedRequestUrl|\ApiVideo\Client\Model\TooManyRequests + */ + public function getMetricsBreakdown(string $metric, string $breakdown, array $queryParams = []): \ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponse + { + $request = $this->buildGetMetricsBreakdownRequest($metric, $breakdown, $queryParams); + + $model = new \ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponse($this->client->request($request)); + + return $model; + } + + /** + * Create request for operation 'getMetricsBreakdown' + * + * @param string $metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. (required) + * @param string $breakdown Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. (required) + * @param array $queryParams + * + * @throws \InvalidArgumentException + * @return Request + */ + private function buildGetMetricsBreakdownRequest(string $metric, string $breakdown, array $queryParams = []): Request + { + // unbox the parameters from the associative array + $from = array_key_exists('from', $queryParams) ? $queryParams['from'] : null; + $to = array_key_exists('to', $queryParams) ? $queryParams['to'] : null; + $filterBy = array_key_exists('filterBy', $queryParams) ? $queryParams['filterBy'] : null; + $currentPage = array_key_exists('currentPage', $queryParams) ? $queryParams['currentPage'] : 1; + $pageSize = array_key_exists('pageSize', $queryParams) ? $queryParams['pageSize'] : 25; + + // verify the required parameter 'metric' is set + if ($metric === null || (is_array($metric) && count($metric) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $metric when calling ' + ); + } + // verify the required parameter 'breakdown' is set + if ($breakdown === null || (is_array($breakdown) && count($breakdown) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $breakdown when calling ' + ); + } + + $resourcePath = '/data/buckets/{metric}/{breakdown}'; + $formParams = []; + $queryParams = []; + $headers = []; + $httpBody = ''; + $multipart = false; + + // from query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, 'form', true); } - if ($filter !== null) { - $queryParams['filter'] = $filter; + if ($from !== null) { + $queryParams['from'] = $from; + } + + // to query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, 'form', true); + } + if ($to !== null) { + $queryParams['to'] = $to; + } + + // filterBy query params + if ($filterBy !== null) { + if(is_array($filterBy)) { + $queryParams["filterBy"] = array(); + foreach($filterBy as $key => $value) { + $queryParams['filterBy'][$key] = $value; + } + } + else { + throw new \InvalidArgumentException('invalid value for "$filterBy" when calling AnalyticsApi.GetMetricsBreakdown, must be an array.'); + } } // currentPage query params @@ -134,6 +256,22 @@ private function buildGetLiveStreamsPlaysRequest(\DateTime $from, string $dimens $queryParams['pageSize'] = $pageSize; } + // path params + if ($metric !== null) { + $resourcePath = str_replace( + '{' . 'metric' . '}', + ObjectSerializer::toPathValue($metric), + $resourcePath + ); + } + // path params + if ($breakdown !== null) { + $resourcePath = str_replace( + '{' . 'breakdown' . '}', + ObjectSerializer::toPathValue($breakdown), + $resourcePath + ); + } @@ -149,55 +287,51 @@ private function buildGetLiveStreamsPlaysRequest(\DateTime $from, string $dimens /** - * Get play events for video + * Retrieve metrics over time * - * @param \DateTime $from Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (required) - * @param string $dimension Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. (required) + * @param string $metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. (required) * @param array $queryParams * * @throws \ApiVideo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \ApiVideo\Client\Model\AnalyticsPlaysResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\Model403ErrorSchema|\ApiVideo\Client\Model\NotFound|\ApiVideo\Client\Model\TooManyRequests + * @return \ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponse|\ApiVideo\Client\Model\AnalyticsPlays400Error|\ApiVideo\Client\Model\UnrecognizedRequestUrl|\ApiVideo\Client\Model\TooManyRequests */ - public function getVideosPlays(\DateTime $from, string $dimension, array $queryParams = []): \ApiVideo\Client\Model\AnalyticsPlaysResponse + public function getMetricsOverTime(string $metric, array $queryParams = []): \ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponse { - $request = $this->buildGetVideosPlaysRequest($from, $dimension, $queryParams); + $request = $this->buildGetMetricsOverTimeRequest($metric, $queryParams); - $model = new \ApiVideo\Client\Model\AnalyticsPlaysResponse($this->client->request($request)); + $model = new \ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponse($this->client->request($request)); return $model; } /** - * Create request for operation 'getVideosPlays' + * Create request for operation 'getMetricsOverTime' * + * @param string $metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. (required) * @param array $queryParams * * @throws \InvalidArgumentException * @return Request */ - private function buildGetVideosPlaysRequest(\DateTime $from, string $dimension, array $queryParams = []): Request + private function buildGetMetricsOverTimeRequest(string $metric, array $queryParams = []): Request { // unbox the parameters from the associative array + $from = array_key_exists('from', $queryParams) ? $queryParams['from'] : null; $to = array_key_exists('to', $queryParams) ? $queryParams['to'] : null; - $filter = array_key_exists('filter', $queryParams) ? $queryParams['filter'] : null; + $interval = array_key_exists('interval', $queryParams) ? $queryParams['interval'] : null; + $filterBy = array_key_exists('filterBy', $queryParams) ? $queryParams['filterBy'] : null; $currentPage = array_key_exists('currentPage', $queryParams) ? $queryParams['currentPage'] : 1; $pageSize = array_key_exists('pageSize', $queryParams) ? $queryParams['pageSize'] : 25; - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling ' - ); - } - // verify the required parameter 'dimension' is set - if ($dimension === null || (is_array($dimension) && count($dimension) === 0)) { + // verify the required parameter 'metric' is set + if ($metric === null || (is_array($metric) && count($metric) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $dimension when calling ' + 'Missing the required parameter $metric when calling ' ); } - $resourcePath = '/analytics/videos/plays'; + $resourcePath = '/data/timeseries/{metric}'; $formParams = []; $queryParams = []; $headers = []; @@ -205,29 +339,40 @@ private function buildGetVideosPlaysRequest(\DateTime $from, string $dimension, $multipart = false; // from query params + if (is_array($from)) { + $from = ObjectSerializer::serializeCollection($from, 'form', true); + } if ($from !== null) { - $queryParams['from'] = ObjectSerializer::sanitizeForSerialization($from, 'date'); + $queryParams['from'] = $from; } // to query params + if (is_array($to)) { + $to = ObjectSerializer::serializeCollection($to, 'form', true); + } if ($to !== null) { - $queryParams['to'] = ObjectSerializer::sanitizeForSerialization($to, 'date'); + $queryParams['to'] = $to; } - // dimension query params - if (is_array($dimension)) { - $dimension = ObjectSerializer::serializeCollection($dimension, 'form', true); + // interval query params + if (is_array($interval)) { + $interval = ObjectSerializer::serializeCollection($interval, 'form', true); } - if ($dimension !== null) { - $queryParams['dimension'] = $dimension; + if ($interval !== null) { + $queryParams['interval'] = $interval; } - // filter query params - if (is_array($filter)) { - $filter = ObjectSerializer::serializeCollection($filter, 'form', true); - } - if ($filter !== null) { - $queryParams['filter'] = $filter; + // filterBy query params + if ($filterBy !== null) { + if(is_array($filterBy)) { + $queryParams["filterBy"] = array(); + foreach($filterBy as $key => $value) { + $queryParams['filterBy'][$key] = $value; + } + } + else { + throw new \InvalidArgumentException('invalid value for "$filterBy" when calling AnalyticsApi.GetMetricsOverTime, must be an array.'); + } } // currentPage query params @@ -240,6 +385,14 @@ private function buildGetVideosPlaysRequest(\DateTime $from, string $dimension, $queryParams['pageSize'] = $pageSize; } + // path params + if ($metric !== null) { + $resourcePath = str_replace( + '{' . 'metric' . '}', + ObjectSerializer::toPathValue($metric), + $resourcePath + ); + } diff --git a/src/Api/LiveStreamsApi.php b/src/Api/LiveStreamsApi.php index fe36863..b7d883d 100644 --- a/src/Api/LiveStreamsApi.php +++ b/src/Api/LiveStreamsApi.php @@ -545,4 +545,66 @@ private function buildDeleteThumbnailRequest(string $liveStreamId): Request } + /** + * Complete a live stream + * + * @param string $liveStreamId The unique ID for the live stream you want to complete. (required) + * + * @throws \ApiVideo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function complete(string $liveStreamId): void + { + $request = $this->buildCompleteRequest($liveStreamId); + + $this->client->request($request); + } + + /** + * Create request for operation 'complete' + * + * @param string $liveStreamId The unique ID for the live stream you want to complete. (required) + * + * @throws \InvalidArgumentException + * @return Request + */ + private function buildCompleteRequest(string $liveStreamId): Request + { + // 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 ' + ); + } + + $resourcePath = '/live-streams/{liveStreamId}/complete'; + $formParams = []; + $queryParams = []; + $headers = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($liveStreamId !== null) { + $resourcePath = str_replace( + '{' . 'liveStreamId' . '}', + ObjectSerializer::toPathValue($liveStreamId), + $resourcePath + ); + } + + + + $query = \http_build_query($queryParams); + + return new Request( + 'PUT', + $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + } diff --git a/src/BaseClient.php b/src/BaseClient.php index 56e4777..0acdd67 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -78,7 +78,7 @@ public function __construct(string $baseUri, ?string $apiKey, ClientInterface $h $this->originSdkHeaderValue = ""; if ($apiKey) { - $this->authenticator = new Authenticator($this, $apiKey, 'php:1.3.2'); + $this->authenticator = new Authenticator($this, $apiKey, 'php:1.4.0'); } } @@ -111,7 +111,7 @@ public function request(Request $commandRequest, bool $skipAuthRequest = false): if($this->originSdkHeaderValue) { $request = $request->withHeader('AV-Origin-Sdk', $this->originSdkHeaderValue); } - $request = $request->withHeader('AV-Origin-Client', 'php:1.3.2'); + $request = $request->withHeader('AV-Origin-Client', 'php:1.4.0'); return $this->sendRequest($request, $skipAuthRequest); } diff --git a/src/Model/AnalyticsAggregatedMetricsResponse.php b/src/Model/AnalyticsAggregatedMetricsResponse.php new file mode 100644 index 0000000..a64326f --- /dev/null +++ b/src/Model/AnalyticsAggregatedMetricsResponse.php @@ -0,0 +1,186 @@ + '\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContext', + 'data' => 'float' + ], + [ + 'context' => null, + 'data' => 'float' + ], + [ + 'context' => 'context', + 'data' => 'data' + ], + [ + 'context' => 'setContext', + 'data' => 'setData' + ], + [ + 'context' => 'getContext', + 'data' => 'getData' + ], + [ + 'context' => null, + 'data' => 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['context'] = isset($data['context']) ? new AnalyticsAggregatedMetricsResponseContext($data['context']) : null; + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['context'] === null) { + $invalidProperties[] = "'context' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' 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 context + * + * @return \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContext + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContext $context context + * + * @return self + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets data + * + * @return float + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param float $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + 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/AnalyticsAggregatedMetricsResponseContext.php b/src/Model/AnalyticsAggregatedMetricsResponseContext.php new file mode 100644 index 0000000..bf1ca3d --- /dev/null +++ b/src/Model/AnalyticsAggregatedMetricsResponseContext.php @@ -0,0 +1,293 @@ + 'string', + 'aggregation' => 'string', + 'timeframe' => '\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe' + ], + [ + 'metric' => null, + 'aggregation' => null, + 'timeframe' => null + ], + [ + 'metric' => 'metric', + 'aggregation' => 'aggregation', + 'timeframe' => 'timeframe' + ], + [ + 'metric' => 'setMetric', + 'aggregation' => 'setAggregation', + 'timeframe' => 'setTimeframe' + ], + [ + 'metric' => 'getMetric', + 'aggregation' => 'getAggregation', + 'timeframe' => 'getTimeframe' + ], + [ + 'metric' => null, + 'aggregation' => null, + 'timeframe' => null + ], + null + ); + } + + const METRIC_PLAY = 'play'; + const METRIC_START = 'start'; + const METRIC_END = 'end'; + const METRIC_IMPRESSION = 'impression'; + const METRIC_IMPRESSION_TIME = 'impression-time'; + const METRIC_WATCH_TIME = 'watch-time'; + const AGGREGATION_COUNT = 'count'; + const AGGREGATION_RATE = 'rate'; + const AGGREGATION_TOTAL = 'total'; + const AGGREGATION_AVERAGE = 'average'; + const AGGREGATION_SUM = 'sum'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMetricAllowableValues() + { + return [ + self::METRIC_PLAY, + self::METRIC_START, + self::METRIC_END, + self::METRIC_IMPRESSION, + self::METRIC_IMPRESSION_TIME, + self::METRIC_WATCH_TIME, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAggregationAllowableValues() + { + return [ + self::AGGREGATION_COUNT, + self::AGGREGATION_RATE, + self::AGGREGATION_TOTAL, + self::AGGREGATION_AVERAGE, + self::AGGREGATION_SUM, + ]; + } + + /** + * 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['metric'] = $data['metric'] ?? null; + $this->container['aggregation'] = $data['aggregation'] ?? null; + $this->container['timeframe'] = isset($data['timeframe']) ? new AnalyticsAggregatedMetricsResponseContextTimeframe($data['timeframe']) : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMetricAllowableValues(); + if (!is_null($this->container['metric']) && !in_array($this->container['metric'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'metric', must be one of '%s'", + $this->container['metric'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getAggregationAllowableValues(); + if (!is_null($this->container['aggregation']) && !in_array($this->container['aggregation'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'aggregation', must be one of '%s'", + $this->container['aggregation'], + implode("', '", $allowedValues) + ); + } + + 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 metric + * + * @return string|null + */ + public function getMetric() + { + return $this->container['metric']; + } + + /** + * Sets metric + * + * @param string|null $metric Returns the metric you selected. + * + * @return self + */ + public function setMetric($metric) + { + $allowedValues = $this->getMetricAllowableValues(); + if (!is_null($metric) && !in_array($metric, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'metric', must be one of '%s'", + $metric, + implode("', '", $allowedValues) + ) + ); + } + $this->container['metric'] = $metric; + + return $this; + } + + /** + * Gets aggregation + * + * @return string|null + */ + public function getAggregation() + { + return $this->container['aggregation']; + } + + /** + * Sets aggregation + * + * @param string|null $aggregation Returns the aggregation you selected. + * + * @return self + */ + public function setAggregation($aggregation) + { + $allowedValues = $this->getAggregationAllowableValues(); + if (!is_null($aggregation) && !in_array($aggregation, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'aggregation', must be one of '%s'", + $aggregation, + implode("', '", $allowedValues) + ) + ); + } + $this->container['aggregation'] = $aggregation; + + return $this; + } + + /** + * Gets timeframe + * + * @return \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe|null + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe|null $timeframe timeframe + * + * @return self + */ + public function setTimeframe($timeframe) + { + $this->container['timeframe'] = $timeframe; + + 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/VideoSessionLocation.php b/src/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.php similarity index 63% rename from src/Model/VideoSessionLocation.php rename to src/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.php index 486dcb2..3f3bc4b 100644 --- a/src/Model/VideoSessionLocation.php +++ b/src/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.php @@ -17,43 +17,43 @@ use ApiVideo\Client\ObjectSerializer; /** - * VideoSessionLocation Class Doc Comment + * AnalyticsAggregatedMetricsResponseContextTimeframe Class Doc Comment * * @category Class - * @description The location of the viewer. + * @description Returns the starting and ending date-times of the period you want analytics for. * @package ApiVideo\Client * @template TKey int|null * @template TValue mixed|null */ -class VideoSessionLocation implements ModelInterface, \JsonSerializable +class AnalyticsAggregatedMetricsResponseContextTimeframe implements ModelInterface, \JsonSerializable { public static function getDefinition(): ModelDefinition { return new ModelDefinition( - 'video-session-location', + 'analytics_aggregated_metrics_response_context_timeframe', [ - 'country' => 'string', - 'city' => 'string' + 'from' => '\DateTime', + 'to' => '\DateTime' ], [ - 'country' => null, - 'city' => null + 'from' => 'date-time', + 'to' => 'date-time' ], [ - 'country' => 'country', - 'city' => 'city' + 'from' => 'from', + 'to' => 'to' ], [ - 'country' => 'setCountry', - 'city' => 'setCity' + 'from' => 'setFrom', + 'to' => 'setTo' ], [ - 'country' => 'getCountry', - 'city' => 'getCity' + 'from' => 'getFrom', + 'to' => 'getTo' ], [ - 'country' => null, - 'city' => null + 'from' => null, + 'to' => null ], null ); @@ -75,8 +75,8 @@ public static function getDefinition(): ModelDefinition */ public function __construct(array $data = null) { - $this->container['country'] = $data['country'] ?? null; - $this->container['city'] = $data['city'] ?? null; + $this->container['from'] = isset($data['from']) ? new \DateTime($data['from']) : null; + $this->container['to'] = isset($data['to']) ? new \DateTime($data['to']) : null; } /** @@ -104,49 +104,49 @@ public function valid() /** - * Gets country + * Gets from * - * @return string|null + * @return \DateTime|null */ - public function getCountry() + public function getFrom() { - return $this->container['country']; + return $this->container['from']; } /** - * Sets country + * Sets from * - * @param string|null $country The country of the viewer. + * @param \DateTime|null $from Returns the starting date-time of the period you want analytics for in ATOM date-time format. * * @return self */ - public function setCountry($country) + public function setFrom($from) { - $this->container['country'] = $country; + $this->container['from'] = $from; return $this; } /** - * Gets city + * Gets to * - * @return string|null + * @return \DateTime|null */ - public function getCity() + public function getTo() { - return $this->container['city']; + return $this->container['to']; } /** - * Sets city + * Sets to * - * @param string|null $city The city of the viewer. + * @param \DateTime|null $to Returns the starting date-time of the period you want analytics for in ATOM date-time format. * * @return self */ - public function setCity($city) + public function setTo($to) { - $this->container['city'] = $city; + $this->container['to'] = $to; return $this; } diff --git a/src/Model/AnalyticsMetricsBreakdownResponse.php b/src/Model/AnalyticsMetricsBreakdownResponse.php new file mode 100644 index 0000000..bac8751 --- /dev/null +++ b/src/Model/AnalyticsMetricsBreakdownResponse.php @@ -0,0 +1,220 @@ + '\ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponseContext', + 'data' => '\ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponseData[]', + 'pagination' => '\ApiVideo\Client\Model\Pagination' + ], + [ + 'context' => null, + 'data' => null, + 'pagination' => null + ], + [ + 'context' => 'context', + 'data' => 'data', + 'pagination' => 'pagination' + ], + [ + 'context' => 'setContext', + 'data' => 'setData', + 'pagination' => 'setPagination' + ], + [ + 'context' => 'getContext', + 'data' => 'getData', + 'pagination' => 'getPagination' + ], + [ + 'context' => null, + '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['context'] = isset($data['context']) ? new AnalyticsMetricsBreakdownResponseContext($data['context']) : null; + $this->container['data'] = isset($data['data']) ? array_map(function(array $value): AnalyticsMetricsBreakdownResponseData { return new AnalyticsMetricsBreakdownResponseData($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['context'] === null) { + $invalidProperties[] = "'context' can't be null"; + } + 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 context + * + * @return \ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponseContext + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param \ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponseContext $context context + * + * @return self + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets data + * + * @return \ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponseData[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \ApiVideo\Client\Model\AnalyticsMetricsBreakdownResponseData[] $data Returns an array of dimensions and their respective metrics. + * + * @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/AnalyticsMetricsBreakdownResponseContext.php b/src/Model/AnalyticsMetricsBreakdownResponseContext.php new file mode 100644 index 0000000..09f86cd --- /dev/null +++ b/src/Model/AnalyticsMetricsBreakdownResponseContext.php @@ -0,0 +1,295 @@ + 'string', + 'breakdown' => 'string', + 'timeframe' => '\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe' + ], + [ + 'metric' => null, + 'breakdown' => null, + 'timeframe' => null + ], + [ + 'metric' => 'metric', + 'breakdown' => 'breakdown', + 'timeframe' => 'timeframe' + ], + [ + 'metric' => 'setMetric', + 'breakdown' => 'setBreakdown', + 'timeframe' => 'setTimeframe' + ], + [ + 'metric' => 'getMetric', + 'breakdown' => 'getBreakdown', + 'timeframe' => 'getTimeframe' + ], + [ + 'metric' => null, + 'breakdown' => null, + 'timeframe' => null + ], + null + ); + } + + const METRIC_PLAY = 'play'; + const METRIC_PLAY_RATE = 'play-rate'; + const METRIC_START = 'start'; + const METRIC_END = 'end'; + const METRIC_IMPRESSION = 'impression'; + const BREAKDOWN_MEDIA_ID = 'media-id'; + const BREAKDOWN_MEDIA_TYPE = 'media-type'; + const BREAKDOWN_CONTINENT = 'continent'; + const BREAKDOWN_COUNTRY = 'country'; + const BREAKDOWN_DEVICE_TYPE = 'device-type'; + const BREAKDOWN_OPERATING_SYSTEM = 'operating-system'; + const BREAKDOWN_BROWSER = 'browser'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMetricAllowableValues() + { + return [ + self::METRIC_PLAY, + self::METRIC_PLAY_RATE, + self::METRIC_START, + self::METRIC_END, + self::METRIC_IMPRESSION, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBreakdownAllowableValues() + { + return [ + self::BREAKDOWN_MEDIA_ID, + self::BREAKDOWN_MEDIA_TYPE, + self::BREAKDOWN_CONTINENT, + self::BREAKDOWN_COUNTRY, + self::BREAKDOWN_DEVICE_TYPE, + self::BREAKDOWN_OPERATING_SYSTEM, + self::BREAKDOWN_BROWSER, + ]; + } + + /** + * 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['metric'] = $data['metric'] ?? null; + $this->container['breakdown'] = $data['breakdown'] ?? null; + $this->container['timeframe'] = isset($data['timeframe']) ? new AnalyticsAggregatedMetricsResponseContextTimeframe($data['timeframe']) : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMetricAllowableValues(); + if (!is_null($this->container['metric']) && !in_array($this->container['metric'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'metric', must be one of '%s'", + $this->container['metric'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getBreakdownAllowableValues(); + if (!is_null($this->container['breakdown']) && !in_array($this->container['breakdown'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'breakdown', must be one of '%s'", + $this->container['breakdown'], + implode("', '", $allowedValues) + ); + } + + 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 metric + * + * @return string|null + */ + public function getMetric() + { + return $this->container['metric']; + } + + /** + * Sets metric + * + * @param string|null $metric Returns the metric you selected. + * + * @return self + */ + public function setMetric($metric) + { + $allowedValues = $this->getMetricAllowableValues(); + if (!is_null($metric) && !in_array($metric, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'metric', must be one of '%s'", + $metric, + implode("', '", $allowedValues) + ) + ); + } + $this->container['metric'] = $metric; + + return $this; + } + + /** + * Gets breakdown + * + * @return string|null + */ + public function getBreakdown() + { + return $this->container['breakdown']; + } + + /** + * Sets breakdown + * + * @param string|null $breakdown Returns the dimension you selected. + * + * @return self + */ + public function setBreakdown($breakdown) + { + $allowedValues = $this->getBreakdownAllowableValues(); + if (!is_null($breakdown) && !in_array($breakdown, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'breakdown', must be one of '%s'", + $breakdown, + implode("', '", $allowedValues) + ) + ); + } + $this->container['breakdown'] = $breakdown; + + return $this; + } + + /** + * Gets timeframe + * + * @return \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe|null + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe|null $timeframe timeframe + * + * @return self + */ + public function setTimeframe($timeframe) + { + $this->container['timeframe'] = $timeframe; + + 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/VideoSessionClient.php b/src/Model/AnalyticsMetricsBreakdownResponseData.php similarity index 57% rename from src/Model/VideoSessionClient.php rename to src/Model/AnalyticsMetricsBreakdownResponseData.php index 01d616c..9d1874f 100644 --- a/src/Model/VideoSessionClient.php +++ b/src/Model/AnalyticsMetricsBreakdownResponseData.php @@ -17,49 +17,42 @@ use ApiVideo\Client\ObjectSerializer; /** - * VideoSessionClient Class Doc Comment + * AnalyticsMetricsBreakdownResponseData Class Doc Comment * * @category Class - * @description What kind of browser the viewer is using for the video session. * @package ApiVideo\Client * @template TKey int|null * @template TValue mixed|null */ -class VideoSessionClient implements ModelInterface, \JsonSerializable +class AnalyticsMetricsBreakdownResponseData implements ModelInterface, \JsonSerializable { public static function getDefinition(): ModelDefinition { return new ModelDefinition( - 'video-session-client', + 'analytics_metrics_breakdown_response_data', [ - 'name' => 'string', - 'version' => 'string', - 'type' => 'string' + 'dimensionValue' => 'string', + 'metricValue' => 'float' ], [ - 'name' => null, - 'version' => null, - 'type' => null + 'dimensionValue' => null, + 'metricValue' => 'float' ], [ - 'name' => 'name', - 'version' => 'version', - 'type' => 'type' + 'dimensionValue' => 'dimensionValue', + 'metricValue' => 'metricValue' ], [ - 'name' => 'setName', - 'version' => 'setVersion', - 'type' => 'setType' + 'dimensionValue' => 'setDimensionValue', + 'metricValue' => 'setMetricValue' ], [ - 'name' => 'getName', - 'version' => 'getVersion', - 'type' => 'getType' + 'dimensionValue' => 'getDimensionValue', + 'metricValue' => 'getMetricValue' ], [ - 'name' => null, - 'version' => null, - 'type' => null + 'dimensionValue' => null, + 'metricValue' => null ], null ); @@ -81,9 +74,8 @@ public static function getDefinition(): ModelDefinition */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['version'] = $data['version'] ?? null; - $this->container['type'] = $data['type'] ?? null; + $this->container['dimensionValue'] = $data['dimensionValue'] ?? null; + $this->container['metricValue'] = $data['metricValue'] ?? null; } /** @@ -111,73 +103,49 @@ public function valid() /** - * Gets name + * Gets dimensionValue * * @return string|null */ - public function getName() + public function getDimensionValue() { - return $this->container['name']; + return $this->container['dimensionValue']; } /** - * Sets name + * Sets dimensionValue * - * @param string|null $name The name of the browser used to view the video session. + * @param string|null $dimensionValue Returns a specific value for the dimension you selected, based on the data. For example if you select `continent` as a dimension, then `dimensionValue` returns values like `EU` or \"AZ\". * * @return self */ - public function setName($name) + public function setDimensionValue($dimensionValue) { - $this->container['name'] = $name; + $this->container['dimensionValue'] = $dimensionValue; return $this; } /** - * Gets version + * Gets metricValue * - * @return string|null - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param string|null $version The version of the browser used to view the video session. - * - * @return self - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - return $this; - } - - /** - * Gets type - * - * @return string|null + * @return float|null */ - public function getType() + public function getMetricValue() { - return $this->container['type']; + return $this->container['metricValue']; } /** - * Sets type + * Sets metricValue * - * @param string|null $type The type of client used to view the video session. + * @param float|null $metricValue Returns the data for a specific dimension value. * * @return self */ - public function setType($type) + public function setMetricValue($metricValue) { - $this->container['type'] = $type; + $this->container['metricValue'] = $metricValue; return $this; } diff --git a/src/Model/AnalyticsMetricsOverTimeResponse.php b/src/Model/AnalyticsMetricsOverTimeResponse.php new file mode 100644 index 0000000..72ab4fc --- /dev/null +++ b/src/Model/AnalyticsMetricsOverTimeResponse.php @@ -0,0 +1,220 @@ + '\ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponseContext', + 'data' => '\ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponseData[]', + 'pagination' => '\ApiVideo\Client\Model\Pagination' + ], + [ + 'context' => null, + 'data' => null, + 'pagination' => null + ], + [ + 'context' => 'context', + 'data' => 'data', + 'pagination' => 'pagination' + ], + [ + 'context' => 'setContext', + 'data' => 'setData', + 'pagination' => 'setPagination' + ], + [ + 'context' => 'getContext', + 'data' => 'getData', + 'pagination' => 'getPagination' + ], + [ + 'context' => null, + '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['context'] = isset($data['context']) ? new AnalyticsMetricsOverTimeResponseContext($data['context']) : null; + $this->container['data'] = isset($data['data']) ? array_map(function(array $value): AnalyticsMetricsOverTimeResponseData { return new AnalyticsMetricsOverTimeResponseData($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['context'] === null) { + $invalidProperties[] = "'context' can't be null"; + } + 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 context + * + * @return \ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponseContext + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param \ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponseContext $context context + * + * @return self + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets data + * + * @return \ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponseData[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \ApiVideo\Client\Model\AnalyticsMetricsOverTimeResponseData[] $data Returns an array of metrics and the timestamps . + * + * @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/AnalyticsMetricsOverTimeResponseContext.php b/src/Model/AnalyticsMetricsOverTimeResponseContext.php new file mode 100644 index 0000000..efc843e --- /dev/null +++ b/src/Model/AnalyticsMetricsOverTimeResponseContext.php @@ -0,0 +1,285 @@ + 'string', + 'interval' => 'string', + 'timeframe' => '\ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe' + ], + [ + 'metric' => null, + 'interval' => null, + 'timeframe' => null + ], + [ + 'metric' => 'metric', + 'interval' => 'interval', + 'timeframe' => 'timeframe' + ], + [ + 'metric' => 'setMetric', + 'interval' => 'setInterval', + 'timeframe' => 'setTimeframe' + ], + [ + 'metric' => 'getMetric', + 'interval' => 'getInterval', + 'timeframe' => 'getTimeframe' + ], + [ + 'metric' => null, + 'interval' => null, + 'timeframe' => null + ], + null + ); + } + + const METRIC_PLAY = 'play'; + const METRIC_PLAY_RATE = 'play-rate'; + const METRIC_START = 'start'; + const METRIC_END = 'end'; + const METRIC_IMPRESSION = 'impression'; + const INTERVAL_HOUR = 'hour'; + const INTERVAL_DAY = 'day'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMetricAllowableValues() + { + return [ + self::METRIC_PLAY, + self::METRIC_PLAY_RATE, + self::METRIC_START, + self::METRIC_END, + self::METRIC_IMPRESSION, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getIntervalAllowableValues() + { + return [ + self::INTERVAL_HOUR, + self::INTERVAL_DAY, + ]; + } + + /** + * 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['metric'] = $data['metric'] ?? null; + $this->container['interval'] = $data['interval'] ?? null; + $this->container['timeframe'] = isset($data['timeframe']) ? new AnalyticsAggregatedMetricsResponseContextTimeframe($data['timeframe']) : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMetricAllowableValues(); + if (!is_null($this->container['metric']) && !in_array($this->container['metric'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'metric', must be one of '%s'", + $this->container['metric'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getIntervalAllowableValues(); + if (!is_null($this->container['interval']) && !in_array($this->container['interval'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'interval', must be one of '%s'", + $this->container['interval'], + implode("', '", $allowedValues) + ); + } + + 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 metric + * + * @return string|null + */ + public function getMetric() + { + return $this->container['metric']; + } + + /** + * Sets metric + * + * @param string|null $metric Returns the metric you selected. + * + * @return self + */ + public function setMetric($metric) + { + $allowedValues = $this->getMetricAllowableValues(); + if (!is_null($metric) && !in_array($metric, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'metric', must be one of '%s'", + $metric, + implode("', '", $allowedValues) + ) + ); + } + $this->container['metric'] = $metric; + + return $this; + } + + /** + * Gets interval + * + * @return string|null + */ + public function getInterval() + { + return $this->container['interval']; + } + + /** + * Sets interval + * + * @param string|null $interval Returns the interval you selected. + * + * @return self + */ + public function setInterval($interval) + { + $allowedValues = $this->getIntervalAllowableValues(); + if (!is_null($interval) && !in_array($interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'interval', must be one of '%s'", + $interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['interval'] = $interval; + + return $this; + } + + /** + * Gets timeframe + * + * @return \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe|null + */ + public function getTimeframe() + { + return $this->container['timeframe']; + } + + /** + * Sets timeframe + * + * @param \ApiVideo\Client\Model\AnalyticsAggregatedMetricsResponseContextTimeframe|null $timeframe timeframe + * + * @return self + */ + public function setTimeframe($timeframe) + { + $this->container['timeframe'] = $timeframe; + + 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/LiveStreamSessionLocation.php b/src/Model/AnalyticsMetricsOverTimeResponseData.php similarity index 61% rename from src/Model/LiveStreamSessionLocation.php rename to src/Model/AnalyticsMetricsOverTimeResponseData.php index bd44ca5..dc2c9f5 100644 --- a/src/Model/LiveStreamSessionLocation.php +++ b/src/Model/AnalyticsMetricsOverTimeResponseData.php @@ -17,43 +17,42 @@ use ApiVideo\Client\ObjectSerializer; /** - * LiveStreamSessionLocation Class Doc Comment + * AnalyticsMetricsOverTimeResponseData Class Doc Comment * * @category Class - * @description The location of the viewer of the live stream. * @package ApiVideo\Client * @template TKey int|null * @template TValue mixed|null */ -class LiveStreamSessionLocation implements ModelInterface, \JsonSerializable +class AnalyticsMetricsOverTimeResponseData implements ModelInterface, \JsonSerializable { public static function getDefinition(): ModelDefinition { return new ModelDefinition( - 'live-stream-session-location', + 'analytics_metrics_over_time_response_data', [ - 'country' => 'string', - 'city' => 'string' + 'emittedAt' => 'string', + 'metricValue' => 'float' ], [ - 'country' => null, - 'city' => null + 'emittedAt' => null, + 'metricValue' => 'float' ], [ - 'country' => 'country', - 'city' => 'city' + 'emittedAt' => 'emittedAt', + 'metricValue' => 'metricValue' ], [ - 'country' => 'setCountry', - 'city' => 'setCity' + 'emittedAt' => 'setEmittedAt', + 'metricValue' => 'setMetricValue' ], [ - 'country' => 'getCountry', - 'city' => 'getCity' + 'emittedAt' => 'getEmittedAt', + 'metricValue' => 'getMetricValue' ], [ - 'country' => null, - 'city' => null + 'emittedAt' => null, + 'metricValue' => null ], null ); @@ -75,8 +74,8 @@ public static function getDefinition(): ModelDefinition */ public function __construct(array $data = null) { - $this->container['country'] = $data['country'] ?? null; - $this->container['city'] = $data['city'] ?? null; + $this->container['emittedAt'] = $data['emittedAt'] ?? null; + $this->container['metricValue'] = $data['metricValue'] ?? null; } /** @@ -104,49 +103,49 @@ public function valid() /** - * Gets country + * Gets emittedAt * * @return string|null */ - public function getCountry() + public function getEmittedAt() { - return $this->container['country']; + return $this->container['emittedAt']; } /** - * Sets country + * Sets emittedAt * - * @param string|null $country The country of the viewer of the live stream. + * @param string|null $emittedAt Returns the timestamp of the event that belongs to a specific metric in ATOM date-time format. For example, if you set `play` with an `hour` interval in your request, then `emittedAt` returns the hourly timestamps of every play event within the timeframe you defined. * * @return self */ - public function setCountry($country) + public function setEmittedAt($emittedAt) { - $this->container['country'] = $country; + $this->container['emittedAt'] = $emittedAt; return $this; } /** - * Gets city + * Gets metricValue * - * @return string|null + * @return float|null */ - public function getCity() + public function getMetricValue() { - return $this->container['city']; + return $this->container['metricValue']; } /** - * Sets city + * Sets metricValue * - * @param string|null $city The city of the viewer of the live stream. + * @param float|null $metricValue Returns the data for a specific metric value. * * @return self */ - public function setCity($city) + public function setMetricValue($metricValue) { - $this->container['city'] = $city; + $this->container['metricValue'] = $metricValue; return $this; } diff --git a/src/Model/FilterBy.php b/src/Model/FilterBy.php new file mode 100644 index 0000000..f405c81 --- /dev/null +++ b/src/Model/FilterBy.php @@ -0,0 +1,434 @@ + 'string[]', + 'mediaType' => 'string', + 'continent' => 'string[]', + 'country' => 'string[]', + 'deviceType' => 'string[]', + 'operatingSystem' => 'string[]', + 'browser' => 'string[]', + 'tag' => 'string' + ], + [ + 'mediaId' => null, + 'mediaType' => null, + 'continent' => null, + 'country' => null, + 'deviceType' => null, + 'operatingSystem' => null, + 'browser' => null, + 'tag' => null + ], + [ + 'mediaId' => 'mediaId', + 'mediaType' => 'mediaType', + 'continent' => 'continent', + 'country' => 'country', + 'deviceType' => 'deviceType', + 'operatingSystem' => 'operatingSystem', + 'browser' => 'browser', + 'tag' => 'tag' + ], + [ + 'mediaId' => 'setMediaId', + 'mediaType' => 'setMediaType', + 'continent' => 'setContinent', + 'country' => 'setCountry', + 'deviceType' => 'setDeviceType', + 'operatingSystem' => 'setOperatingSystem', + 'browser' => 'setBrowser', + 'tag' => 'setTag' + ], + [ + 'mediaId' => 'getMediaId', + 'mediaType' => 'getMediaType', + 'continent' => 'getContinent', + 'country' => 'getCountry', + 'deviceType' => 'getDeviceType', + 'operatingSystem' => 'getOperatingSystem', + 'browser' => 'getBrowser', + 'tag' => 'getTag' + ], + [ + 'mediaId' => null, + 'mediaType' => null, + 'continent' => null, + 'country' => null, + 'deviceType' => null, + 'operatingSystem' => null, + 'browser' => null, + 'tag' => null + ], + null + ); + } + + const MEDIA_TYPE_VIDEO = 'video'; + const MEDIA_TYPE_LIVE_STREAM = 'live-stream'; + const CONTINENT__AS = 'AS'; + const CONTINENT_AF = 'AF'; + const CONTINENT_NA = 'NA'; + const CONTINENT_SA = 'SA'; + const CONTINENT_AN = 'AN'; + const CONTINENT_EU = 'EU'; + const CONTINENT_AZ = 'AZ'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMediaTypeAllowableValues() + { + return [ + self::MEDIA_TYPE_VIDEO, + self::MEDIA_TYPE_LIVE_STREAM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContinentAllowableValues() + { + return [ + self::CONTINENT__AS, + self::CONTINENT_AF, + self::CONTINENT_NA, + self::CONTINENT_SA, + self::CONTINENT_AN, + self::CONTINENT_EU, + self::CONTINENT_AZ, + ]; + } + + /** + * 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['mediaId'] = $data['mediaId'] ?? null; + $this->container['mediaType'] = $data['mediaType'] ?? null; + $this->container['continent'] = $data['continent'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['deviceType'] = $data['deviceType'] ?? null; + $this->container['operatingSystem'] = $data['operatingSystem'] ?? null; + $this->container['browser'] = $data['browser'] ?? null; + $this->container['tag'] = $data['tag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMediaTypeAllowableValues(); + if (!is_null($this->container['mediaType']) && !in_array($this->container['mediaType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'mediaType', must be one of '%s'", + $this->container['mediaType'], + implode("', '", $allowedValues) + ); + } + + 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 mediaId + * + * @return string[]|null + */ + public function getMediaId() + { + return $this->container['mediaId']; + } + + /** + * Sets mediaId + * + * @param string[]|null $mediaId Returns analytics based on the unique identifiers of a video or a live stream. + * + * @return self + */ + public function setMediaId($mediaId) + { + $this->container['mediaId'] = $mediaId; + + return $this; + } + + /** + * Gets mediaType + * + * @return string|null + */ + public function getMediaType() + { + return $this->container['mediaType']; + } + + /** + * Sets mediaType + * + * @param string|null $mediaType mediaType + * + * @return self + */ + public function setMediaType($mediaType) + { + $allowedValues = $this->getMediaTypeAllowableValues(); + if (!is_null($mediaType) && !in_array($mediaType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'mediaType', must be one of '%s'", + $mediaType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['mediaType'] = $mediaType; + + return $this; + } + + /** + * Gets continent + * + * @return string[]|null + */ + public function getContinent() + { + return $this->container['continent']; + } + + /** + * Sets continent + * + * @param string[]|null $continent Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. + * + * @return self + */ + public function setContinent($continent) + { + $allowedValues = $this->getContinentAllowableValues(); + if (!is_null($continent) && array_diff($continent, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'continent', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['continent'] = $continent; + + return $this; + } + + /** + * Gets country + * + * @return string[]|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string[]|null $country Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets deviceType + * + * @return string[]|null + */ + public function getDeviceType() + { + return $this->container['deviceType']; + } + + /** + * Sets deviceType + * + * @param string[]|null $deviceType Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. + * + * @return self + */ + public function setDeviceType($deviceType) + { + $this->container['deviceType'] = $deviceType; + + return $this; + } + + /** + * Gets operatingSystem + * + * @return string[]|null + */ + public function getOperatingSystem() + { + return $this->container['operatingSystem']; + } + + /** + * Sets operatingSystem + * + * @param string[]|null $operatingSystem Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. + * + * @return self + */ + public function setOperatingSystem($operatingSystem) + { + $this->container['operatingSystem'] = $operatingSystem; + + return $this; + } + + /** + * Gets browser + * + * @return string[]|null + */ + public function getBrowser() + { + return $this->container['browser']; + } + + /** + * Sets browser + * + * @param string[]|null $browser Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. + * + * @return self + */ + public function setBrowser($browser) + { + $this->container['browser'] = $browser; + + return $this; + } + + /** + * Gets tag + * + * @return string|null + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string|null $tag Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * + * @return self + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + 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/FilterBy1.php b/src/Model/FilterBy1.php new file mode 100644 index 0000000..fb0508c --- /dev/null +++ b/src/Model/FilterBy1.php @@ -0,0 +1,434 @@ + 'string[]', + 'mediaType' => 'string', + 'continent' => 'string[]', + 'country' => 'string[]', + 'deviceType' => 'string[]', + 'operatingSystem' => 'string[]', + 'browser' => 'string[]', + 'tag' => 'string' + ], + [ + 'mediaId' => null, + 'mediaType' => null, + 'continent' => null, + 'country' => null, + 'deviceType' => null, + 'operatingSystem' => null, + 'browser' => null, + 'tag' => null + ], + [ + 'mediaId' => 'mediaId', + 'mediaType' => 'mediaType', + 'continent' => 'continent', + 'country' => 'country', + 'deviceType' => 'deviceType', + 'operatingSystem' => 'operatingSystem', + 'browser' => 'browser', + 'tag' => 'tag' + ], + [ + 'mediaId' => 'setMediaId', + 'mediaType' => 'setMediaType', + 'continent' => 'setContinent', + 'country' => 'setCountry', + 'deviceType' => 'setDeviceType', + 'operatingSystem' => 'setOperatingSystem', + 'browser' => 'setBrowser', + 'tag' => 'setTag' + ], + [ + 'mediaId' => 'getMediaId', + 'mediaType' => 'getMediaType', + 'continent' => 'getContinent', + 'country' => 'getCountry', + 'deviceType' => 'getDeviceType', + 'operatingSystem' => 'getOperatingSystem', + 'browser' => 'getBrowser', + 'tag' => 'getTag' + ], + [ + 'mediaId' => null, + 'mediaType' => null, + 'continent' => null, + 'country' => null, + 'deviceType' => null, + 'operatingSystem' => null, + 'browser' => null, + 'tag' => null + ], + null + ); + } + + const MEDIA_TYPE_VIDEO = 'video'; + const MEDIA_TYPE_LIVE_STREAM = 'live-stream'; + const CONTINENT__AS = 'AS'; + const CONTINENT_AF = 'AF'; + const CONTINENT_NA = 'NA'; + const CONTINENT_SA = 'SA'; + const CONTINENT_AN = 'AN'; + const CONTINENT_EU = 'EU'; + const CONTINENT_AZ = 'AZ'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMediaTypeAllowableValues() + { + return [ + self::MEDIA_TYPE_VIDEO, + self::MEDIA_TYPE_LIVE_STREAM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContinentAllowableValues() + { + return [ + self::CONTINENT__AS, + self::CONTINENT_AF, + self::CONTINENT_NA, + self::CONTINENT_SA, + self::CONTINENT_AN, + self::CONTINENT_EU, + self::CONTINENT_AZ, + ]; + } + + /** + * 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['mediaId'] = $data['mediaId'] ?? null; + $this->container['mediaType'] = $data['mediaType'] ?? null; + $this->container['continent'] = $data['continent'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['deviceType'] = $data['deviceType'] ?? null; + $this->container['operatingSystem'] = $data['operatingSystem'] ?? null; + $this->container['browser'] = $data['browser'] ?? null; + $this->container['tag'] = $data['tag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMediaTypeAllowableValues(); + if (!is_null($this->container['mediaType']) && !in_array($this->container['mediaType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'mediaType', must be one of '%s'", + $this->container['mediaType'], + implode("', '", $allowedValues) + ); + } + + 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 mediaId + * + * @return string[]|null + */ + public function getMediaId() + { + return $this->container['mediaId']; + } + + /** + * Sets mediaId + * + * @param string[]|null $mediaId Returns analytics based on the unique identifiers of a video or a live stream. + * + * @return self + */ + public function setMediaId($mediaId) + { + $this->container['mediaId'] = $mediaId; + + return $this; + } + + /** + * Gets mediaType + * + * @return string|null + */ + public function getMediaType() + { + return $this->container['mediaType']; + } + + /** + * Sets mediaType + * + * @param string|null $mediaType mediaType + * + * @return self + */ + public function setMediaType($mediaType) + { + $allowedValues = $this->getMediaTypeAllowableValues(); + if (!is_null($mediaType) && !in_array($mediaType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'mediaType', must be one of '%s'", + $mediaType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['mediaType'] = $mediaType; + + return $this; + } + + /** + * Gets continent + * + * @return string[]|null + */ + public function getContinent() + { + return $this->container['continent']; + } + + /** + * Sets continent + * + * @param string[]|null $continent Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. + * + * @return self + */ + public function setContinent($continent) + { + $allowedValues = $this->getContinentAllowableValues(); + if (!is_null($continent) && array_diff($continent, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'continent', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['continent'] = $continent; + + return $this; + } + + /** + * Gets country + * + * @return string[]|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string[]|null $country Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets deviceType + * + * @return string[]|null + */ + public function getDeviceType() + { + return $this->container['deviceType']; + } + + /** + * Sets deviceType + * + * @param string[]|null $deviceType Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. + * + * @return self + */ + public function setDeviceType($deviceType) + { + $this->container['deviceType'] = $deviceType; + + return $this; + } + + /** + * Gets operatingSystem + * + * @return string[]|null + */ + public function getOperatingSystem() + { + return $this->container['operatingSystem']; + } + + /** + * Sets operatingSystem + * + * @param string[]|null $operatingSystem Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. + * + * @return self + */ + public function setOperatingSystem($operatingSystem) + { + $this->container['operatingSystem'] = $operatingSystem; + + return $this; + } + + /** + * Gets browser + * + * @return string[]|null + */ + public function getBrowser() + { + return $this->container['browser']; + } + + /** + * Sets browser + * + * @param string[]|null $browser Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. + * + * @return self + */ + public function setBrowser($browser) + { + $this->container['browser'] = $browser; + + return $this; + } + + /** + * Gets tag + * + * @return string|null + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string|null $tag Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * + * @return self + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + 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/FilterBy2.php b/src/Model/FilterBy2.php new file mode 100644 index 0000000..9c857ef --- /dev/null +++ b/src/Model/FilterBy2.php @@ -0,0 +1,434 @@ + 'string[]', + 'mediaType' => 'string', + 'continent' => 'string[]', + 'country' => 'string[]', + 'deviceType' => 'string[]', + 'operatingSystem' => 'string[]', + 'browser' => 'string[]', + 'tag' => 'string' + ], + [ + 'mediaId' => null, + 'mediaType' => null, + 'continent' => null, + 'country' => null, + 'deviceType' => null, + 'operatingSystem' => null, + 'browser' => null, + 'tag' => null + ], + [ + 'mediaId' => 'mediaId', + 'mediaType' => 'mediaType', + 'continent' => 'continent', + 'country' => 'country', + 'deviceType' => 'deviceType', + 'operatingSystem' => 'operatingSystem', + 'browser' => 'browser', + 'tag' => 'tag' + ], + [ + 'mediaId' => 'setMediaId', + 'mediaType' => 'setMediaType', + 'continent' => 'setContinent', + 'country' => 'setCountry', + 'deviceType' => 'setDeviceType', + 'operatingSystem' => 'setOperatingSystem', + 'browser' => 'setBrowser', + 'tag' => 'setTag' + ], + [ + 'mediaId' => 'getMediaId', + 'mediaType' => 'getMediaType', + 'continent' => 'getContinent', + 'country' => 'getCountry', + 'deviceType' => 'getDeviceType', + 'operatingSystem' => 'getOperatingSystem', + 'browser' => 'getBrowser', + 'tag' => 'getTag' + ], + [ + 'mediaId' => null, + 'mediaType' => null, + 'continent' => null, + 'country' => null, + 'deviceType' => null, + 'operatingSystem' => null, + 'browser' => null, + 'tag' => null + ], + null + ); + } + + const MEDIA_TYPE_VIDEO = 'video'; + const MEDIA_TYPE_LIVE_STREAM = 'live-stream'; + const CONTINENT__AS = 'AS'; + const CONTINENT_AF = 'AF'; + const CONTINENT_NA = 'NA'; + const CONTINENT_SA = 'SA'; + const CONTINENT_AN = 'AN'; + const CONTINENT_EU = 'EU'; + const CONTINENT_AZ = 'AZ'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMediaTypeAllowableValues() + { + return [ + self::MEDIA_TYPE_VIDEO, + self::MEDIA_TYPE_LIVE_STREAM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getContinentAllowableValues() + { + return [ + self::CONTINENT__AS, + self::CONTINENT_AF, + self::CONTINENT_NA, + self::CONTINENT_SA, + self::CONTINENT_AN, + self::CONTINENT_EU, + self::CONTINENT_AZ, + ]; + } + + /** + * 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['mediaId'] = $data['mediaId'] ?? null; + $this->container['mediaType'] = $data['mediaType'] ?? null; + $this->container['continent'] = $data['continent'] ?? null; + $this->container['country'] = $data['country'] ?? null; + $this->container['deviceType'] = $data['deviceType'] ?? null; + $this->container['operatingSystem'] = $data['operatingSystem'] ?? null; + $this->container['browser'] = $data['browser'] ?? null; + $this->container['tag'] = $data['tag'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMediaTypeAllowableValues(); + if (!is_null($this->container['mediaType']) && !in_array($this->container['mediaType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'mediaType', must be one of '%s'", + $this->container['mediaType'], + implode("', '", $allowedValues) + ); + } + + 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 mediaId + * + * @return string[]|null + */ + public function getMediaId() + { + return $this->container['mediaId']; + } + + /** + * Sets mediaId + * + * @param string[]|null $mediaId Returns analytics based on the unique identifiers of a video or a live stream. + * + * @return self + */ + public function setMediaId($mediaId) + { + $this->container['mediaId'] = $mediaId; + + return $this; + } + + /** + * Gets mediaType + * + * @return string|null + */ + public function getMediaType() + { + return $this->container['mediaType']; + } + + /** + * Sets mediaType + * + * @param string|null $mediaType mediaType + * + * @return self + */ + public function setMediaType($mediaType) + { + $allowedValues = $this->getMediaTypeAllowableValues(); + if (!is_null($mediaType) && !in_array($mediaType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'mediaType', must be one of '%s'", + $mediaType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['mediaType'] = $mediaType; + + return $this; + } + + /** + * Gets continent + * + * @return string[]|null + */ + public function getContinent() + { + return $this->container['continent']; + } + + /** + * Sets continent + * + * @param string[]|null $continent Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. + * + * @return self + */ + public function setContinent($continent) + { + $allowedValues = $this->getContinentAllowableValues(); + if (!is_null($continent) && array_diff($continent, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'continent', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['continent'] = $continent; + + return $this; + } + + /** + * Gets country + * + * @return string[]|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string[]|null $country Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets deviceType + * + * @return string[]|null + */ + public function getDeviceType() + { + return $this->container['deviceType']; + } + + /** + * Sets deviceType + * + * @param string[]|null $deviceType Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. + * + * @return self + */ + public function setDeviceType($deviceType) + { + $this->container['deviceType'] = $deviceType; + + return $this; + } + + /** + * Gets operatingSystem + * + * @return string[]|null + */ + public function getOperatingSystem() + { + return $this->container['operatingSystem']; + } + + /** + * Sets operatingSystem + * + * @param string[]|null $operatingSystem Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. + * + * @return self + */ + public function setOperatingSystem($operatingSystem) + { + $this->container['operatingSystem'] = $operatingSystem; + + return $this; + } + + /** + * Gets browser + * + * @return string[]|null + */ + public function getBrowser() + { + return $this->container['browser']; + } + + /** + * Sets browser + * + * @param string[]|null $browser Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. + * + * @return self + */ + public function setBrowser($browser) + { + $this->container['browser'] = $browser; + + return $this; + } + + /** + * Gets tag + * + * @return string|null + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string|null $tag Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + * + * @return self + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + 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/LiveStream.php b/src/Model/LiveStream.php index 4887a2f..434dcee 100644 --- a/src/Model/LiveStream.php +++ b/src/Model/LiveStream.php @@ -249,7 +249,7 @@ public function getPublic() /** * Sets public * - * @param bool|null $public 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/delivery-analytics/video-privacy-access-management). + * @param bool|null $public 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/delivery/video-privacy-access-management). * * @return self */ @@ -345,7 +345,7 @@ public function getRestreams() /** * Sets restreams * - * @param \ApiVideo\Client\Model\RestreamsResponseObject[] $restreams Returns the list of RTMP restream destinations. + * @param \ApiVideo\Client\Model\RestreamsResponseObject[] $restreams Returns the list of restream destinations. * * @return self */ diff --git a/src/Model/LiveStreamCreationPayload.php b/src/Model/LiveStreamCreationPayload.php index 60709ce..91ed494 100644 --- a/src/Model/LiveStreamCreationPayload.php +++ b/src/Model/LiveStreamCreationPayload.php @@ -160,7 +160,7 @@ public function getPublic() /** * Sets public * - * @param bool|null $public 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/delivery-analytics/video-privacy-access-management). + * @param bool|null $public 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/delivery/video-privacy-access-management). * * @return self */ @@ -208,7 +208,7 @@ public function getRestreams() /** * Sets restreams * - * @param \ApiVideo\Client\Model\RestreamsRequestObject[]|null $restreams 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. + * @param \ApiVideo\Client\Model\RestreamsRequestObject[]|null $restreams Use this parameter to add, edit, or remove `RTMPS` or `RTMP` services where you want to restream a live stream. The list can only contain up to 5 destinations. * * @return self */ diff --git a/src/Model/LiveStreamSession.php b/src/Model/LiveStreamSession.php deleted file mode 100644 index f3e7fa0..0000000 --- a/src/Model/LiveStreamSession.php +++ /dev/null @@ -1,304 +0,0 @@ - '\ApiVideo\Client\Model\LiveStreamSessionSession', - 'location' => '\ApiVideo\Client\Model\LiveStreamSessionLocation', - 'referrer' => '\ApiVideo\Client\Model\LiveStreamSessionReferrer', - 'device' => '\ApiVideo\Client\Model\LiveStreamSessionDevice', - 'os' => '\ApiVideo\Client\Model\VideoSessionOs', - 'client' => '\ApiVideo\Client\Model\LiveStreamSessionClient' - ], - [ - 'session' => null, - 'location' => null, - 'referrer' => null, - 'device' => null, - 'os' => null, - 'client' => null - ], - [ - 'session' => 'session', - 'location' => 'location', - 'referrer' => 'referrer', - 'device' => 'device', - 'os' => 'os', - 'client' => 'client' - ], - [ - 'session' => 'setSession', - 'location' => 'setLocation', - 'referrer' => 'setReferrer', - 'device' => 'setDevice', - 'os' => 'setOs', - 'client' => 'setClient' - ], - [ - 'session' => 'getSession', - 'location' => 'getLocation', - 'referrer' => 'getReferrer', - 'device' => 'getDevice', - 'os' => 'getOs', - 'client' => 'getClient' - ], - [ - 'session' => null, - 'location' => null, - 'referrer' => null, - 'device' => null, - 'os' => null, - 'client' => 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['session'] = isset($data['session']) ? new LiveStreamSessionSession($data['session']) : null; - $this->container['location'] = isset($data['location']) ? new LiveStreamSessionLocation($data['location']) : null; - $this->container['referrer'] = isset($data['referrer']) ? new LiveStreamSessionReferrer($data['referrer']) : null; - $this->container['device'] = isset($data['device']) ? new LiveStreamSessionDevice($data['device']) : null; - $this->container['os'] = isset($data['os']) ? new VideoSessionOs($data['os']) : null; - $this->container['client'] = isset($data['client']) ? new LiveStreamSessionClient($data['client']) : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 session - * - * @return \ApiVideo\Client\Model\LiveStreamSessionSession|null - */ - public function getSession() - { - return $this->container['session']; - } - - /** - * Sets session - * - * @param \ApiVideo\Client\Model\LiveStreamSessionSession|null $session session - * - * @return self - */ - public function setSession($session) - { - $this->container['session'] = $session; - - return $this; - } - - /** - * Gets location - * - * @return \ApiVideo\Client\Model\LiveStreamSessionLocation|null - */ - public function getLocation() - { - return $this->container['location']; - } - - /** - * Sets location - * - * @param \ApiVideo\Client\Model\LiveStreamSessionLocation|null $location location - * - * @return self - */ - public function setLocation($location) - { - $this->container['location'] = $location; - - return $this; - } - - /** - * Gets referrer - * - * @return \ApiVideo\Client\Model\LiveStreamSessionReferrer|null - */ - public function getReferrer() - { - return $this->container['referrer']; - } - - /** - * Sets referrer - * - * @param \ApiVideo\Client\Model\LiveStreamSessionReferrer|null $referrer referrer - * - * @return self - */ - public function setReferrer($referrer) - { - $this->container['referrer'] = $referrer; - - return $this; - } - - /** - * Gets device - * - * @return \ApiVideo\Client\Model\LiveStreamSessionDevice|null - */ - public function getDevice() - { - return $this->container['device']; - } - - /** - * Sets device - * - * @param \ApiVideo\Client\Model\LiveStreamSessionDevice|null $device device - * - * @return self - */ - public function setDevice($device) - { - $this->container['device'] = $device; - - return $this; - } - - /** - * Gets os - * - * @return \ApiVideo\Client\Model\VideoSessionOs|null - */ - public function getOs() - { - return $this->container['os']; - } - - /** - * Sets os - * - * @param \ApiVideo\Client\Model\VideoSessionOs|null $os os - * - * @return self - */ - public function setOs($os) - { - $this->container['os'] = $os; - - return $this; - } - - /** - * Gets client - * - * @return \ApiVideo\Client\Model\LiveStreamSessionClient|null - */ - public function getClient() - { - return $this->container['client']; - } - - /** - * Sets client - * - * @param \ApiVideo\Client\Model\LiveStreamSessionClient|null $client client - * - * @return self - */ - public function setClient($client) - { - $this->container['client'] = $client; - - 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/LiveStreamSessionClient.php b/src/Model/LiveStreamSessionClient.php deleted file mode 100644 index fdca8fb..0000000 --- a/src/Model/LiveStreamSessionClient.php +++ /dev/null @@ -1,212 +0,0 @@ - 'string', - 'version' => 'string', - 'type' => 'string' - ], - [ - 'name' => null, - 'version' => null, - 'type' => null - ], - [ - 'name' => 'name', - 'version' => 'version', - 'type' => 'type' - ], - [ - 'name' => 'setName', - 'version' => 'setVersion', - 'type' => 'setType' - ], - [ - 'name' => 'getName', - 'version' => 'getVersion', - 'type' => 'getType' - ], - [ - 'name' => null, - 'version' => null, - 'type' => 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['name'] = $data['name'] ?? null; - $this->container['version'] = $data['version'] ?? null; - $this->container['type'] = $data['type'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 name - * - * @return string|null - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string|null $name The name of the browser used to view the live stream session. - * - * @return self - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets version - * - * @return string|null - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param string|null $version The version of the browser used to view the live stream session. - * - * @return self - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - return $this; - } - - /** - * Gets type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type The type of client used to view the live stream session. - * - * @return self - */ - public function setType($type) - { - $this->container['type'] = $type; - - 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/LiveStreamSessionDevice.php b/src/Model/LiveStreamSessionDevice.php deleted file mode 100644 index ddc414b..0000000 --- a/src/Model/LiveStreamSessionDevice.php +++ /dev/null @@ -1,212 +0,0 @@ - 'string', - 'vendor' => 'string', - 'model' => 'string' - ], - [ - 'type' => null, - 'vendor' => null, - 'model' => null - ], - [ - 'type' => 'type', - 'vendor' => 'vendor', - 'model' => 'model' - ], - [ - 'type' => 'setType', - 'vendor' => 'setVendor', - 'model' => 'setModel' - ], - [ - 'type' => 'getType', - 'vendor' => 'getVendor', - 'model' => 'getModel' - ], - [ - 'type' => null, - 'vendor' => null, - 'model' => 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['type'] = $data['type'] ?? null; - $this->container['vendor'] = $data['vendor'] ?? null; - $this->container['model'] = $data['model'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type What the type is like desktop, laptop, mobile. - * - * @return self - */ - public function setType($type) - { - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets vendor - * - * @return string|null - */ - public function getVendor() - { - return $this->container['vendor']; - } - - /** - * Sets vendor - * - * @param string|null $vendor If known, what the brand of the device is, like Apple, Dell, etc. - * - * @return self - */ - public function setVendor($vendor) - { - $this->container['vendor'] = $vendor; - - return $this; - } - - /** - * Gets model - * - * @return string|null - */ - public function getModel() - { - return $this->container['model']; - } - - /** - * Sets model - * - * @param string|null $model The specific model of the device, if known. - * - * @return self - */ - public function setModel($model) - { - $this->container['model'] = $model; - - 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/LiveStreamSessionReferrer.php b/src/Model/LiveStreamSessionReferrer.php deleted file mode 100644 index a9c60e2..0000000 --- a/src/Model/LiveStreamSessionReferrer.php +++ /dev/null @@ -1,242 +0,0 @@ - 'string', - 'medium' => 'string', - 'source' => 'string', - 'searchTerm' => 'string' - ], - [ - 'url' => null, - 'medium' => null, - 'source' => null, - 'searchTerm' => null - ], - [ - 'url' => 'url', - 'medium' => 'medium', - 'source' => 'source', - 'searchTerm' => 'searchTerm' - ], - [ - 'url' => 'setUrl', - 'medium' => 'setMedium', - 'source' => 'setSource', - 'searchTerm' => 'setSearchTerm' - ], - [ - 'url' => 'getUrl', - 'medium' => 'getMedium', - 'source' => 'getSource', - 'searchTerm' => 'getSearchTerm' - ], - [ - 'url' => null, - 'medium' => null, - 'source' => null, - 'searchTerm' => 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['url'] = $data['url'] ?? null; - $this->container['medium'] = $data['medium'] ?? null; - $this->container['source'] = $data['source'] ?? null; - $this->container['searchTerm'] = $data['searchTerm'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 url - * - * @return string|null - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string|null $url The website the viewer of the live stream was referred to in order to view the live stream. - * - * @return self - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - - /** - * Gets medium - * - * @return string|null - */ - public function getMedium() - { - return $this->container['medium']; - } - - /** - * Sets medium - * - * @param string|null $medium The type of search that brought the viewer to the live stream. Organic would be they found it on their own, paid would be they found it via an advertisement. - * - * @return self - */ - public function setMedium($medium) - { - $this->container['medium'] = $medium; - - return $this; - } - - /** - * Gets source - * - * @return string|null - */ - public function getSource() - { - return $this->container['source']; - } - - /** - * Sets source - * - * @param string|null $source Where the viewer came from to see the live stream (usually where they searched from). - * - * @return self - */ - public function setSource($source) - { - $this->container['source'] = $source; - - return $this; - } - - /** - * Gets searchTerm - * - * @return string|null - */ - public function getSearchTerm() - { - return $this->container['searchTerm']; - } - - /** - * Sets searchTerm - * - * @param string|null $searchTerm What term they searched for that led them to the live stream. - * - * @return self - */ - public function setSearchTerm($searchTerm) - { - $this->container['searchTerm'] = $searchTerm; - - 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/LiveStreamSessionSession.php b/src/Model/LiveStreamSessionSession.php deleted file mode 100644 index ff77f2b..0000000 --- a/src/Model/LiveStreamSessionSession.php +++ /dev/null @@ -1,211 +0,0 @@ - 'string', - 'loadedAt' => '\DateTime', - 'endedAt' => '\DateTime' - ], - [ - 'sessionId' => null, - 'loadedAt' => 'date-time', - 'endedAt' => 'date-time' - ], - [ - 'sessionId' => 'sessionId', - 'loadedAt' => 'loadedAt', - 'endedAt' => 'endedAt' - ], - [ - 'sessionId' => 'setSessionId', - 'loadedAt' => 'setLoadedAt', - 'endedAt' => 'setEndedAt' - ], - [ - 'sessionId' => 'getSessionId', - 'loadedAt' => 'getLoadedAt', - 'endedAt' => 'getEndedAt' - ], - [ - 'sessionId' => null, - 'loadedAt' => null, - 'endedAt' => 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['sessionId'] = $data['sessionId'] ?? null; - $this->container['loadedAt'] = isset($data['loadedAt']) ? new \DateTime($data['loadedAt']) : null; - $this->container['endedAt'] = isset($data['endedAt']) ? new \DateTime($data['endedAt']) : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 sessionId - * - * @return string|null - */ - public function getSessionId() - { - return $this->container['sessionId']; - } - - /** - * Sets sessionId - * - * @param string|null $sessionId A unique identifier for your session. You can use this to track what happens during a specific session. - * - * @return self - */ - public function setSessionId($sessionId) - { - $this->container['sessionId'] = $sessionId; - - return $this; - } - - /** - * Gets loadedAt - * - * @return \DateTime|null - */ - public function getLoadedAt() - { - return $this->container['loadedAt']; - } - - /** - * Sets loadedAt - * - * @param \DateTime|null $loadedAt When the session started, with the date and time presented in ISO-8601 format. - * - * @return self - */ - public function setLoadedAt($loadedAt) - { - $this->container['loadedAt'] = $loadedAt; - - return $this; - } - - /** - * Gets endedAt - * - * @return \DateTime|null - */ - public function getEndedAt() - { - return $this->container['endedAt']; - } - - /** - * Sets endedAt - * - * @param \DateTime|null $endedAt When the session ended, with the date and time presented in ISO-8601 format. - * - * @return self - */ - public function setEndedAt($endedAt) - { - $this->container['endedAt'] = $endedAt; - - 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/LiveStreamUpdatePayload.php b/src/Model/LiveStreamUpdatePayload.php index 6169e60..f4dbd91 100644 --- a/src/Model/LiveStreamUpdatePayload.php +++ b/src/Model/LiveStreamUpdatePayload.php @@ -157,7 +157,7 @@ public function getPublic() /** * Sets public * - * @param bool|null $public 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/delivery-analytics/video-privacy-access-management). + * @param bool|null $public 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/delivery/video-privacy-access-management). * * @return self */ @@ -205,7 +205,7 @@ public function getRestreams() /** * Sets restreams * - * @param \ApiVideo\Client\Model\RestreamsRequestObject[]|null $restreams 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. + * @param \ApiVideo\Client\Model\RestreamsRequestObject[]|null $restreams Use this parameter to add, edit, or remove `RTMPS` or `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. * * @return self */ diff --git a/src/Model/RestreamsRequestObject.php b/src/Model/RestreamsRequestObject.php index 8a07d8c..f34e400 100644 --- a/src/Model/RestreamsRequestObject.php +++ b/src/Model/RestreamsRequestObject.php @@ -156,7 +156,7 @@ public function getServerUrl() /** * Sets serverUrl * - * @param string $serverUrl Use this parameter to set the RTMP URL of the restream destination. + * @param string $serverUrl Use this parameter to set the `RTMPS` or `RTMP` server URL of the restream destination. * * @return self */ diff --git a/src/Model/RestreamsResponseObject.php b/src/Model/RestreamsResponseObject.php index 4128e75..7963959 100644 --- a/src/Model/RestreamsResponseObject.php +++ b/src/Model/RestreamsResponseObject.php @@ -146,7 +146,7 @@ public function getServerUrl() /** * Sets serverUrl * - * @param string|null $serverUrl Returns the RTMP URL of a restream destination. + * @param string|null $serverUrl Returns the server URL of a restream destination. * * @return self */ diff --git a/src/Model/VideoSessionDevice.php b/src/Model/UnrecognizedRequestUrl.php similarity index 69% rename from src/Model/VideoSessionDevice.php rename to src/Model/UnrecognizedRequestUrl.php index 00e9931..69053ed 100644 --- a/src/Model/VideoSessionDevice.php +++ b/src/Model/UnrecognizedRequestUrl.php @@ -17,49 +17,48 @@ use ApiVideo\Client\ObjectSerializer; /** - * VideoSessionDevice Class Doc Comment + * UnrecognizedRequestUrl Class Doc Comment * * @category Class - * @description What type of device the user is on when in the video session. * @package ApiVideo\Client * @template TKey int|null * @template TValue mixed|null */ -class VideoSessionDevice implements ModelInterface, \JsonSerializable +class UnrecognizedRequestUrl implements ModelInterface, \JsonSerializable { public static function getDefinition(): ModelDefinition { return new ModelDefinition( - 'video-session-device', + 'unrecognized-request-url', [ 'type' => 'string', - 'vendor' => 'string', - 'model' => 'string' + 'title' => 'string', + 'status' => 'int' ], [ 'type' => null, - 'vendor' => null, - 'model' => null + 'title' => null, + 'status' => null ], [ 'type' => 'type', - 'vendor' => 'vendor', - 'model' => 'model' + 'title' => 'title', + 'status' => 'status' ], [ 'type' => 'setType', - 'vendor' => 'setVendor', - 'model' => 'setModel' + 'title' => 'setTitle', + 'status' => 'setStatus' ], [ 'type' => 'getType', - 'vendor' => 'getVendor', - 'model' => 'getModel' + 'title' => 'getTitle', + 'status' => 'getStatus' ], [ 'type' => null, - 'vendor' => null, - 'model' => null + 'title' => null, + 'status' => null ], null ); @@ -82,8 +81,8 @@ public static function getDefinition(): ModelDefinition public function __construct(array $data = null) { $this->container['type'] = $data['type'] ?? null; - $this->container['vendor'] = $data['vendor'] ?? null; - $this->container['model'] = $data['model'] ?? null; + $this->container['title'] = $data['title'] ?? null; + $this->container['status'] = $data['status'] ?? null; } /** @@ -123,7 +122,7 @@ public function getType() /** * Sets type * - * @param string|null $type What the type is like desktop, laptop, mobile. + * @param string|null $type A link to the error documentation. * * @return self */ @@ -135,49 +134,49 @@ public function setType($type) } /** - * Gets vendor + * Gets title * * @return string|null */ - public function getVendor() + public function getTitle() { - return $this->container['vendor']; + return $this->container['title']; } /** - * Sets vendor + * Sets title * - * @param string|null $vendor If known, what the brand of the device is, like Apple, Dell, etc. + * @param string|null $title A description of the error that occurred. * * @return self */ - public function setVendor($vendor) + public function setTitle($title) { - $this->container['vendor'] = $vendor; + $this->container['title'] = $title; return $this; } /** - * Gets model + * Gets status * - * @return string|null + * @return int|null */ - public function getModel() + public function getStatus() { - return $this->container['model']; + return $this->container['status']; } /** - * Sets model + * Sets status * - * @param string|null $model The specific model of the device, if known. + * @param int|null $status The HTTP status code. * * @return self */ - public function setModel($model) + public function setStatus($status) { - $this->container['model'] = $model; + $this->container['status'] = $status; return $this; } diff --git a/src/Model/VideoCreationPayload.php b/src/Model/VideoCreationPayload.php index 43bd0ea..0e87d7c 100644 --- a/src/Model/VideoCreationPayload.php +++ b/src/Model/VideoCreationPayload.php @@ -253,7 +253,7 @@ public function getPublic() /** * Sets public * - * @param bool|null $public Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/delivery-analytics/video-privacy-access-management) + * @param bool|null $public Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/delivery/video-privacy-access-management) * * @return self */ diff --git a/src/Model/VideoSession.php b/src/Model/VideoSession.php deleted file mode 100644 index fb6b838..0000000 --- a/src/Model/VideoSession.php +++ /dev/null @@ -1,304 +0,0 @@ - '\ApiVideo\Client\Model\VideoSessionSession', - 'location' => '\ApiVideo\Client\Model\VideoSessionLocation', - 'referrer' => '\ApiVideo\Client\Model\VideoSessionReferrer', - 'device' => '\ApiVideo\Client\Model\VideoSessionDevice', - 'os' => '\ApiVideo\Client\Model\VideoSessionOs', - 'client' => '\ApiVideo\Client\Model\VideoSessionClient' - ], - [ - 'session' => null, - 'location' => null, - 'referrer' => null, - 'device' => null, - 'os' => null, - 'client' => null - ], - [ - 'session' => 'session', - 'location' => 'location', - 'referrer' => 'referrer', - 'device' => 'device', - 'os' => 'os', - 'client' => 'client' - ], - [ - 'session' => 'setSession', - 'location' => 'setLocation', - 'referrer' => 'setReferrer', - 'device' => 'setDevice', - 'os' => 'setOs', - 'client' => 'setClient' - ], - [ - 'session' => 'getSession', - 'location' => 'getLocation', - 'referrer' => 'getReferrer', - 'device' => 'getDevice', - 'os' => 'getOs', - 'client' => 'getClient' - ], - [ - 'session' => null, - 'location' => null, - 'referrer' => null, - 'device' => null, - 'os' => null, - 'client' => 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['session'] = isset($data['session']) ? new VideoSessionSession($data['session']) : null; - $this->container['location'] = isset($data['location']) ? new VideoSessionLocation($data['location']) : null; - $this->container['referrer'] = isset($data['referrer']) ? new VideoSessionReferrer($data['referrer']) : null; - $this->container['device'] = isset($data['device']) ? new VideoSessionDevice($data['device']) : null; - $this->container['os'] = isset($data['os']) ? new VideoSessionOs($data['os']) : null; - $this->container['client'] = isset($data['client']) ? new VideoSessionClient($data['client']) : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 session - * - * @return \ApiVideo\Client\Model\VideoSessionSession|null - */ - public function getSession() - { - return $this->container['session']; - } - - /** - * Sets session - * - * @param \ApiVideo\Client\Model\VideoSessionSession|null $session session - * - * @return self - */ - public function setSession($session) - { - $this->container['session'] = $session; - - return $this; - } - - /** - * Gets location - * - * @return \ApiVideo\Client\Model\VideoSessionLocation|null - */ - public function getLocation() - { - return $this->container['location']; - } - - /** - * Sets location - * - * @param \ApiVideo\Client\Model\VideoSessionLocation|null $location location - * - * @return self - */ - public function setLocation($location) - { - $this->container['location'] = $location; - - return $this; - } - - /** - * Gets referrer - * - * @return \ApiVideo\Client\Model\VideoSessionReferrer|null - */ - public function getReferrer() - { - return $this->container['referrer']; - } - - /** - * Sets referrer - * - * @param \ApiVideo\Client\Model\VideoSessionReferrer|null $referrer referrer - * - * @return self - */ - public function setReferrer($referrer) - { - $this->container['referrer'] = $referrer; - - return $this; - } - - /** - * Gets device - * - * @return \ApiVideo\Client\Model\VideoSessionDevice|null - */ - public function getDevice() - { - return $this->container['device']; - } - - /** - * Sets device - * - * @param \ApiVideo\Client\Model\VideoSessionDevice|null $device device - * - * @return self - */ - public function setDevice($device) - { - $this->container['device'] = $device; - - return $this; - } - - /** - * Gets os - * - * @return \ApiVideo\Client\Model\VideoSessionOs|null - */ - public function getOs() - { - return $this->container['os']; - } - - /** - * Sets os - * - * @param \ApiVideo\Client\Model\VideoSessionOs|null $os os - * - * @return self - */ - public function setOs($os) - { - $this->container['os'] = $os; - - return $this; - } - - /** - * Gets client - * - * @return \ApiVideo\Client\Model\VideoSessionClient|null - */ - public function getClient() - { - return $this->container['client']; - } - - /** - * Sets client - * - * @param \ApiVideo\Client\Model\VideoSessionClient|null $client client - * - * @return self - */ - public function setClient($client) - { - $this->container['client'] = $client; - - 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/VideoSessionOs.php b/src/Model/VideoSessionOs.php deleted file mode 100644 index ed647c8..0000000 --- a/src/Model/VideoSessionOs.php +++ /dev/null @@ -1,212 +0,0 @@ - 'string', - 'shortname' => 'string', - 'version' => 'string' - ], - [ - 'name' => null, - 'shortname' => null, - 'version' => null - ], - [ - 'name' => 'name', - 'shortname' => 'shortname', - 'version' => 'version' - ], - [ - 'name' => 'setName', - 'shortname' => 'setShortname', - 'version' => 'setVersion' - ], - [ - 'name' => 'getName', - 'shortname' => 'getShortname', - 'version' => 'getVersion' - ], - [ - 'name' => null, - 'shortname' => null, - 'version' => 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['name'] = $data['name'] ?? null; - $this->container['shortname'] = $data['shortname'] ?? null; - $this->container['version'] = $data['version'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 name - * - * @return string|null - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string|null $name The name of the operating system. - * - * @return self - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets shortname - * - * @return string|null - */ - public function getShortname() - { - return $this->container['shortname']; - } - - /** - * Sets shortname - * - * @param string|null $shortname The nickname for the operating system, often representing the version. - * - * @return self - */ - public function setShortname($shortname) - { - $this->container['shortname'] = $shortname; - - return $this; - } - - /** - * Gets version - * - * @return string|null - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param string|null $version The version of the operating system. - * - * @return self - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - 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/VideoSessionReferrer.php b/src/Model/VideoSessionReferrer.php deleted file mode 100644 index c2cd0fa..0000000 --- a/src/Model/VideoSessionReferrer.php +++ /dev/null @@ -1,242 +0,0 @@ - 'string', - 'medium' => 'string', - 'source' => 'string', - 'searchTerm' => 'string' - ], - [ - 'url' => null, - 'medium' => null, - 'source' => null, - 'searchTerm' => null - ], - [ - 'url' => 'url', - 'medium' => 'medium', - 'source' => 'source', - 'searchTerm' => 'searchTerm' - ], - [ - 'url' => 'setUrl', - 'medium' => 'setMedium', - 'source' => 'setSource', - 'searchTerm' => 'setSearchTerm' - ], - [ - 'url' => 'getUrl', - 'medium' => 'getMedium', - 'source' => 'getSource', - 'searchTerm' => 'getSearchTerm' - ], - [ - 'url' => null, - 'medium' => null, - 'source' => null, - 'searchTerm' => 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['url'] = $data['url'] ?? null; - $this->container['medium'] = $data['medium'] ?? null; - $this->container['source'] = $data['source'] ?? null; - $this->container['searchTerm'] = $data['searchTerm'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 url - * - * @return string|null - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string|null $url The link the viewer used to reach the video session. - * - * @return self - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - - /** - * Gets medium - * - * @return string|null - */ - public function getMedium() - { - return $this->container['medium']; - } - - /** - * Sets medium - * - * @param string|null $medium How they arrived at the site, for example organic or paid. Organic meaning they found it themselves and paid meaning they followed a link from an advertisement. - * - * @return self - */ - public function setMedium($medium) - { - $this->container['medium'] = $medium; - - return $this; - } - - /** - * Gets source - * - * @return string|null - */ - public function getSource() - { - return $this->container['source']; - } - - /** - * Sets source - * - * @param string|null $source The source the referrer came from to the video session. For example if they searched through google to find the stream. - * - * @return self - */ - public function setSource($source) - { - $this->container['source'] = $source; - - return $this; - } - - /** - * Gets searchTerm - * - * @return string|null - */ - public function getSearchTerm() - { - return $this->container['searchTerm']; - } - - /** - * Sets searchTerm - * - * @param string|null $searchTerm The search term they typed to arrive at the video session. - * - * @return self - */ - public function setSearchTerm($searchTerm) - { - $this->container['searchTerm'] = $searchTerm; - - 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/VideoSessionSession.php b/src/Model/VideoSessionSession.php deleted file mode 100644 index 9fd984f..0000000 --- a/src/Model/VideoSessionSession.php +++ /dev/null @@ -1,242 +0,0 @@ - 'string', - 'loadedAt' => '\DateTime', - 'endedAt' => '\DateTime', - 'metadata' => '\ApiVideo\Client\Model\Metadata[]' - ], - [ - 'sessionId' => null, - 'loadedAt' => 'date-time', - 'endedAt' => 'date-time', - 'metadata' => null - ], - [ - 'sessionId' => 'sessionId', - 'loadedAt' => 'loadedAt', - 'endedAt' => 'endedAt', - 'metadata' => 'metadata' - ], - [ - 'sessionId' => 'setSessionId', - 'loadedAt' => 'setLoadedAt', - 'endedAt' => 'setEndedAt', - 'metadata' => 'setMetadata' - ], - [ - 'sessionId' => 'getSessionId', - 'loadedAt' => 'getLoadedAt', - 'endedAt' => 'getEndedAt', - 'metadata' => 'getMetadata' - ], - [ - 'sessionId' => null, - 'loadedAt' => null, - 'endedAt' => null, - 'metadata' => 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['sessionId'] = $data['sessionId'] ?? null; - $this->container['loadedAt'] = isset($data['loadedAt']) ? new \DateTime($data['loadedAt']) : null; - $this->container['endedAt'] = isset($data['endedAt']) ? new \DateTime($data['endedAt']) : null; - $this->container['metadata'] = isset($data['metadata']) ? array_map(function(array $value): Metadata { return new Metadata($value); }, $data['metadata']) : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 sessionId - * - * @return string|null - */ - public function getSessionId() - { - return $this->container['sessionId']; - } - - /** - * Sets sessionId - * - * @param string|null $sessionId The unique identifier for the session that you can use to track what happens during it. - * - * @return self - */ - public function setSessionId($sessionId) - { - $this->container['sessionId'] = $sessionId; - - return $this; - } - - /** - * Gets loadedAt - * - * @return \DateTime|null - */ - public function getLoadedAt() - { - return $this->container['loadedAt']; - } - - /** - * Sets loadedAt - * - * @param \DateTime|null $loadedAt When the video session started, presented in ISO-8601 format. - * - * @return self - */ - public function setLoadedAt($loadedAt) - { - $this->container['loadedAt'] = $loadedAt; - - return $this; - } - - /** - * Gets endedAt - * - * @return \DateTime|null - */ - public function getEndedAt() - { - return $this->container['endedAt']; - } - - /** - * Sets endedAt - * - * @param \DateTime|null $endedAt When the video session ended, presented in ISO-8601 format. - * - * @return self - */ - public function setEndedAt($endedAt) - { - $this->container['endedAt'] = $endedAt; - - return $this; - } - - /** - * Gets metadata - * - * @return \ApiVideo\Client\Model\Metadata[]|null - */ - public function getMetadata() - { - return $this->container['metadata']; - } - - /** - * Sets metadata - * - * @param \ApiVideo\Client\Model\Metadata[]|null $metadata A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. You can also just use the pairs as another way to tag and categorize your videos. - * - * @return self - */ - public function setMetadata($metadata) - { - $this->container['metadata'] = $metadata; - - 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 - ); - } -} - -