From cd10e9ac22d4ab1678c7c0786bcf10c0be26f305 Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Wed, 29 May 2024 22:02:33 +0000 Subject: [PATCH] [DO NOT MERGE] Add Watch Data endpoints to OpenAPI spec --- .openapi-generator/FILES | 33 + .../oas_apivideo.yaml-defaut-cli.sha256 | 2 +- README.md | 33 +- docs/AnalyticsAggregatedMetricsResponse.md | 11 + ...alyticsAggregatedMetricsResponseContext.md | 12 + ...gregatedMetricsResponseContextTimeframe.md | 12 + docs/AnalyticsApi.md | 4 +- docs/AnalyticsMetricsBreakdownResponse.md | 12 + ...nalyticsMetricsBreakdownResponseContext.md | 12 + docs/AnalyticsMetricsBreakdownResponseData.md | 11 + docs/AnalyticsMetricsOverTimeResponse.md | 12 + ...AnalyticsMetricsOverTimeResponseContext.md | 12 + docs/AnalyticsMetricsOverTimeResponseData.md | 11 + docs/AnalyticsV20BetaApi.md | 242 ++++++++ docs/UnrecognizedRequestUrl.md | 12 + src/Api/AnalyticsApi.cs | 20 +- src/Api/AnalyticsV20BetaApi.cs | 575 ++++++++++++++++++ src/ApiVideo.cs | 10 + .../AnalyticsAggregatedMetricsResponse.cs | 51 ++ ...alyticsAggregatedMetricsResponseContext.cs | 60 ++ ...gregatedMetricsResponseContextTimeframe.cs | 53 ++ .../AnalyticsMetricsBreakdownResponse.cs | 59 ++ ...nalyticsMetricsBreakdownResponseContext.cs | 60 ++ .../AnalyticsMetricsBreakdownResponseData.cs | 53 ++ src/Model/AnalyticsMetricsOverTimeResponse.cs | 59 ++ ...AnalyticsMetricsOverTimeResponseContext.cs | 60 ++ .../AnalyticsMetricsOverTimeResponseData.cs | 53 ++ src/Model/UnrecognizedRequestUrl.cs | 61 ++ .../getAggregatedMetrics/responses/200.json | 11 + .../getAggregatedMetrics/responses/400-0.json | 7 + .../getAggregatedMetrics/responses/400-1.json | 7 + .../getAggregatedMetrics/responses/404.json | 5 + .../getAggregatedMetrics/responses/429.json | 5 + .../getMetricsBreakdown/responses/200.json | 31 + .../getMetricsBreakdown/responses/400-0.json | 7 + .../getMetricsBreakdown/responses/400-1.json | 7 + .../getMetricsBreakdown/responses/404.json | 5 + .../getMetricsBreakdown/responses/429.json | 5 + .../getMetricsOverTime/responses/200.json | 37 ++ .../getMetricsOverTime/responses/400-0.json | 7 + .../getMetricsOverTime/responses/400-1.json | 7 + .../getMetricsOverTime/responses/404.json | 5 + .../getMetricsOverTime/responses/429.json | 5 + 43 files changed, 1745 insertions(+), 11 deletions(-) create mode 100644 docs/AnalyticsAggregatedMetricsResponse.md create mode 100644 docs/AnalyticsAggregatedMetricsResponseContext.md create mode 100644 docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md create mode 100644 docs/AnalyticsMetricsBreakdownResponse.md create mode 100644 docs/AnalyticsMetricsBreakdownResponseContext.md create mode 100644 docs/AnalyticsMetricsBreakdownResponseData.md create mode 100644 docs/AnalyticsMetricsOverTimeResponse.md create mode 100644 docs/AnalyticsMetricsOverTimeResponseContext.md create mode 100644 docs/AnalyticsMetricsOverTimeResponseData.md create mode 100644 docs/AnalyticsV20BetaApi.md create mode 100644 docs/UnrecognizedRequestUrl.md create mode 100644 src/Api/AnalyticsV20BetaApi.cs create mode 100644 src/Model/AnalyticsAggregatedMetricsResponse.cs create mode 100644 src/Model/AnalyticsAggregatedMetricsResponseContext.cs create mode 100644 src/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.cs create mode 100644 src/Model/AnalyticsMetricsBreakdownResponse.cs create mode 100644 src/Model/AnalyticsMetricsBreakdownResponseContext.cs create mode 100644 src/Model/AnalyticsMetricsBreakdownResponseData.cs create mode 100644 src/Model/AnalyticsMetricsOverTimeResponse.cs create mode 100644 src/Model/AnalyticsMetricsOverTimeResponseContext.cs create mode 100644 src/Model/AnalyticsMetricsOverTimeResponseData.cs create mode 100644 src/Model/UnrecognizedRequestUrl.cs create mode 100644 tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/200.json create mode 100644 tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/400-0.json create mode 100644 tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/400-1.json create mode 100644 tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/404.json create mode 100644 tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/429.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/200.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/400-0.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/400-1.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/404.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/429.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/200.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/400-0.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/400-1.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/404.json create mode 100644 tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/429.json diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 5243e11..2d5410f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -7,10 +7,20 @@ build.sh docs/AccessToken.md docs/AdditionalBadRequestErrors.md docs/AdvancedAuthenticationApi.md +docs/AnalyticsAggregatedMetricsResponse.md +docs/AnalyticsAggregatedMetricsResponseContext.md +docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md docs/AnalyticsApi.md docs/AnalyticsData.md +docs/AnalyticsMetricsBreakdownResponse.md +docs/AnalyticsMetricsBreakdownResponseContext.md +docs/AnalyticsMetricsBreakdownResponseData.md +docs/AnalyticsMetricsOverTimeResponse.md +docs/AnalyticsMetricsOverTimeResponseContext.md +docs/AnalyticsMetricsOverTimeResponseData.md docs/AnalyticsPlays400Error.md docs/AnalyticsPlaysResponse.md +docs/AnalyticsV20BetaApi.md docs/AuthenticatePayload.md docs/BadRequest.md docs/BytesRange.md @@ -54,6 +64,7 @@ docs/RestreamsResponseObject.md docs/TokenCreationPayload.md docs/TokenListResponse.md docs/TooManyRequests.md +docs/UnrecognizedRequestUrl.md docs/UploadToken.md docs/UploadTokensApi.md docs/Video.md @@ -92,6 +103,7 @@ mono_nunit_test.sh post-generate.sh src/ApiVideo.Test/Api/AdvancedAuthenticationApiTests.cs src/ApiVideo.Test/Api/AnalyticsApiTests.cs +src/ApiVideo.Test/Api/AnalyticsV20BetaApiTests.cs src/ApiVideo.Test/Api/CaptionsApiTests.cs src/ApiVideo.Test/Api/ChaptersApiTests.cs src/ApiVideo.Test/Api/LiveStreamsApiTests.cs @@ -103,7 +115,16 @@ src/ApiVideo.Test/Api/WebhooksApiTests.cs src/ApiVideo.Test/ApiVideo.Test.csproj src/ApiVideo.Test/Model/AccessTokenTests.cs src/ApiVideo.Test/Model/AdditionalBadRequestErrorsTests.cs +src/ApiVideo.Test/Model/AnalyticsAggregatedMetricsResponseContextTests.cs +src/ApiVideo.Test/Model/AnalyticsAggregatedMetricsResponseContextTimeframeTests.cs +src/ApiVideo.Test/Model/AnalyticsAggregatedMetricsResponseTests.cs src/ApiVideo.Test/Model/AnalyticsDataTests.cs +src/ApiVideo.Test/Model/AnalyticsMetricsBreakdownResponseContextTests.cs +src/ApiVideo.Test/Model/AnalyticsMetricsBreakdownResponseDataTests.cs +src/ApiVideo.Test/Model/AnalyticsMetricsBreakdownResponseTests.cs +src/ApiVideo.Test/Model/AnalyticsMetricsOverTimeResponseContextTests.cs +src/ApiVideo.Test/Model/AnalyticsMetricsOverTimeResponseDataTests.cs +src/ApiVideo.Test/Model/AnalyticsMetricsOverTimeResponseTests.cs src/ApiVideo.Test/Model/AnalyticsPlays400ErrorTests.cs src/ApiVideo.Test/Model/AnalyticsPlaysResponseTests.cs src/ApiVideo.Test/Model/AuthenticatePayloadTests.cs @@ -144,6 +165,7 @@ src/ApiVideo.Test/Model/RestreamsResponseObjectTests.cs src/ApiVideo.Test/Model/TokenCreationPayloadTests.cs src/ApiVideo.Test/Model/TokenListResponseTests.cs src/ApiVideo.Test/Model/TooManyRequestsTests.cs +src/ApiVideo.Test/Model/UnrecognizedRequestUrlTests.cs src/ApiVideo.Test/Model/UploadTokenTests.cs src/ApiVideo.Test/Model/VideoAssetsTests.cs src/ApiVideo.Test/Model/VideoClipTests.cs @@ -176,6 +198,7 @@ src/ApiVideo.Test/Model/WebhooksListResponseTests.cs src/ApiVideo.Test/packages.config src/ApiVideo/Api/AdvancedAuthenticationApi.cs src/ApiVideo/Api/AnalyticsApi.cs +src/ApiVideo/Api/AnalyticsV20BetaApi.cs src/ApiVideo/Api/CaptionsApi.cs src/ApiVideo/Api/ChaptersApi.cs src/ApiVideo/Api/LiveStreamsApi.cs @@ -195,7 +218,16 @@ src/ApiVideo/Client/EmptyArrayFixTypeConverter.cs src/ApiVideo/Client/NullableStringTypeConverter.cs src/ApiVideo/Model/AccessToken.cs src/ApiVideo/Model/AdditionalBadRequestErrors.cs +src/ApiVideo/Model/AnalyticsAggregatedMetricsResponse.cs +src/ApiVideo/Model/AnalyticsAggregatedMetricsResponseContext.cs +src/ApiVideo/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.cs src/ApiVideo/Model/AnalyticsData.cs +src/ApiVideo/Model/AnalyticsMetricsBreakdownResponse.cs +src/ApiVideo/Model/AnalyticsMetricsBreakdownResponseContext.cs +src/ApiVideo/Model/AnalyticsMetricsBreakdownResponseData.cs +src/ApiVideo/Model/AnalyticsMetricsOverTimeResponse.cs +src/ApiVideo/Model/AnalyticsMetricsOverTimeResponseContext.cs +src/ApiVideo/Model/AnalyticsMetricsOverTimeResponseData.cs src/ApiVideo/Model/AnalyticsPlays400Error.cs src/ApiVideo/Model/AnalyticsPlaysResponse.cs src/ApiVideo/Model/AuthenticatePayload.cs @@ -240,6 +272,7 @@ src/ApiVideo/Model/RestreamsResponseObject.cs src/ApiVideo/Model/TokenCreationPayload.cs src/ApiVideo/Model/TokenListResponse.cs src/ApiVideo/Model/TooManyRequests.cs +src/ApiVideo/Model/UnrecognizedRequestUrl.cs src/ApiVideo/Model/UploadToken.cs src/ApiVideo/Model/Video.cs src/ApiVideo/Model/VideoAssets.cs diff --git a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 index 644fa0c..54fd7b4 100644 --- a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 +++ b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 @@ -1 +1 @@ -d7b342ceb1a4805da9e3d6355384e34c1a99e1300d01cac3ae3218c5738f11f1 \ No newline at end of file +548f424dcead8e1cff88849a19d2f7339012ce69090abf66d12f7f30fa756e5d \ No newline at end of file diff --git a/README.md b/README.md index 79c2e34..3f7f16a 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ - [Documentation](#documentation) - [API Endpoints](#api-endpoints) - [AnalyticsApi](#analyticsapi) + - [AnalyticsV20BetaApi](#analyticsv20betaapi) - [CaptionsApi](#captionsapi) - [ChaptersApi](#chaptersapi) - [LiveStreamsApi](#livestreamsapi) @@ -170,8 +171,26 @@ AnalyticsApi analytics = client.Analytics() Method | HTTP request | Description ------------- | ------------- | ------------- -[**getLiveStreamsPlays**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsApi.md#getLiveStreamsPlays) | **GET** /analytics/live-streams/plays | Get play events for live stream -[**getVideosPlays**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsApi.md#getVideosPlays) | **GET** /analytics/videos/plays | Get play events for video +**(deprecated)** [**getLiveStreamsPlays**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsApi.md#getLiveStreamsPlays) | **GET** /analytics/live-streams/plays | Get play events for live stream +**(deprecated)** [**getVideosPlays**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsApi.md#getVideosPlays) | **GET** /analytics/videos/plays | Get play events for video + + +#### AnalyticsV20BetaApi + + +##### Retrieve an instance of AnalyticsV20BetaApi: +```java +ApiVideoClient apiVideoClient = new ApiVideoClient("YOUR_API_KEY"); +AnalyticsV20BetaApi analyticsV20Beta = client.AnalyticsV20Beta() +``` + +##### Endpoints + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getAggregatedMetrics**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsV20BetaApi.md#getAggregatedMetrics) | **GET** /data/metrics/{metric}/{aggregation} | Retrieve aggregated metrics +[**getMetricsBreakdown**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsV20BetaApi.md#getMetricsBreakdown) | **GET** /data/buckets/{metric}/{breakdown} | Retrieve metrics in a breakdown of dimensions +[**getMetricsOverTime**](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsV20BetaApi.md#getMetricsOverTime) | **GET** /data/timeseries/{metric} | Retrieve metrics over time #### CaptionsApi @@ -343,7 +362,16 @@ Method | HTTP request | Description - [AccessToken](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AccessToken.md) - [AdditionalBadRequestErrors](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AdditionalBadRequestErrors.md) + - [AnalyticsAggregatedMetricsResponse](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsAggregatedMetricsResponse.md) + - [AnalyticsAggregatedMetricsResponseContext](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsAggregatedMetricsResponseContext.md) + - [AnalyticsAggregatedMetricsResponseContextTimeframe](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md) - [AnalyticsData](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsData.md) + - [AnalyticsMetricsBreakdownResponse](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsMetricsBreakdownResponse.md) + - [AnalyticsMetricsBreakdownResponseContext](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsMetricsBreakdownResponseContext.md) + - [AnalyticsMetricsBreakdownResponseData](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsMetricsBreakdownResponseData.md) + - [AnalyticsMetricsOverTimeResponse](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsMetricsOverTimeResponse.md) + - [AnalyticsMetricsOverTimeResponseContext](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsMetricsOverTimeResponseContext.md) + - [AnalyticsMetricsOverTimeResponseData](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsMetricsOverTimeResponseData.md) - [AnalyticsPlays400Error](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsPlays400Error.md) - [AnalyticsPlaysResponse](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AnalyticsPlaysResponse.md) - [AuthenticatePayload](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/AuthenticatePayload.md) @@ -384,6 +412,7 @@ Method | HTTP request | Description - [TokenCreationPayload](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/TokenCreationPayload.md) - [TokenListResponse](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/TokenListResponse.md) - [TooManyRequests](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/TooManyRequests.md) + - [UnrecognizedRequestUrl](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/UnrecognizedRequestUrl.md) - [UploadToken](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/UploadToken.md) - [Video](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/Video.md) - [VideoAssets](https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideoAssets.md) diff --git a/docs/AnalyticsAggregatedMetricsResponse.md b/docs/AnalyticsAggregatedMetricsResponse.md new file mode 100644 index 0000000..44864ec --- /dev/null +++ b/docs/AnalyticsAggregatedMetricsResponse.md @@ -0,0 +1,11 @@ +# ApiVideo.Model.AnalyticsAggregatedMetricsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Context** | [**AnalyticsAggregatedMetricsResponseContext**](AnalyticsAggregatedMetricsResponseContext.md) | | +**Data** | **float** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsAggregatedMetricsResponseContext.md b/docs/AnalyticsAggregatedMetricsResponseContext.md new file mode 100644 index 0000000..cfcfb0d --- /dev/null +++ b/docs/AnalyticsAggregatedMetricsResponseContext.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.AnalyticsAggregatedMetricsResponseContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metric** | **string** | Returns the metric you selected. | [optional] +**Aggregation** | **string** | Returns the aggregation you selected. | [optional] +**Timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md b/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md new file mode 100644 index 0000000..52b4286 --- /dev/null +++ b/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.AnalyticsAggregatedMetricsResponseContextTimeframe +Returns the starting and ending date-times of the period you want analytics for. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | **DateTime** | Returns the starting date-time of the period you want analytics for in ATOM date-time format. | [optional] +**To** | **DateTime** | Returns the starting date-time of the period you want analytics for in ATOM date-time format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsApi.md b/docs/AnalyticsApi.md index 1cb0b8d..cc6aeee 100644 --- a/docs/AnalyticsApi.md +++ b/docs/AnalyticsApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description Get play events for live stream -Retrieve filtered analytics about the number of plays for your live streams in a project. +Retrieve filtered analytics about the number of plays for your live streams in a project. This endpoint will be deprecated with the release of Analytics v2.0. ### Example ```csharp @@ -94,7 +94,7 @@ Name | Type | Description | Notes Get play events for video -Retrieve filtered analytics about the number of plays for your videos in a project. +Retrieve filtered analytics about the number of plays for your videos in a project. This endpoint will be deprecated with the release of Analytics v2.0. ### Example ```csharp diff --git a/docs/AnalyticsMetricsBreakdownResponse.md b/docs/AnalyticsMetricsBreakdownResponse.md new file mode 100644 index 0000000..bdb2767 --- /dev/null +++ b/docs/AnalyticsMetricsBreakdownResponse.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.AnalyticsMetricsBreakdownResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Context** | [**AnalyticsMetricsBreakdownResponseContext**](AnalyticsMetricsBreakdownResponseContext.md) | | +**Data** | [**List<AnalyticsMetricsBreakdownResponseData>**](AnalyticsMetricsBreakdownResponseData.md) | Returns an array of dimensions and their respective metrics. | +**Pagination** | [**Pagination**](Pagination.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsMetricsBreakdownResponseContext.md b/docs/AnalyticsMetricsBreakdownResponseContext.md new file mode 100644 index 0000000..da2d7d9 --- /dev/null +++ b/docs/AnalyticsMetricsBreakdownResponseContext.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.AnalyticsMetricsBreakdownResponseContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metric** | **string** | Returns the metric you selected. | [optional] +**Breakdown** | **string** | Returns the dimension you selected. | [optional] +**Timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsMetricsBreakdownResponseData.md b/docs/AnalyticsMetricsBreakdownResponseData.md new file mode 100644 index 0000000..44f48d3 --- /dev/null +++ b/docs/AnalyticsMetricsBreakdownResponseData.md @@ -0,0 +1,11 @@ +# ApiVideo.Model.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#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsMetricsOverTimeResponse.md b/docs/AnalyticsMetricsOverTimeResponse.md new file mode 100644 index 0000000..0e76ac2 --- /dev/null +++ b/docs/AnalyticsMetricsOverTimeResponse.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.AnalyticsMetricsOverTimeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Context** | [**AnalyticsMetricsOverTimeResponseContext**](AnalyticsMetricsOverTimeResponseContext.md) | | +**Data** | [**List<AnalyticsMetricsOverTimeResponseData>**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps . | +**Pagination** | [**Pagination**](Pagination.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsMetricsOverTimeResponseContext.md b/docs/AnalyticsMetricsOverTimeResponseContext.md new file mode 100644 index 0000000..c44d7e8 --- /dev/null +++ b/docs/AnalyticsMetricsOverTimeResponseContext.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.AnalyticsMetricsOverTimeResponseContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metric** | **string** | Returns the metric you selected. | [optional] +**Interval** | **string** | Returns the interval you selected. | [optional] +**Timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsMetricsOverTimeResponseData.md b/docs/AnalyticsMetricsOverTimeResponseData.md new file mode 100644 index 0000000..6dcb5e5 --- /dev/null +++ b/docs/AnalyticsMetricsOverTimeResponseData.md @@ -0,0 +1,11 @@ +# ApiVideo.Model.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#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AnalyticsV20BetaApi.md b/docs/AnalyticsV20BetaApi.md new file mode 100644 index 0000000..c120f74 --- /dev/null +++ b/docs/AnalyticsV20BetaApi.md @@ -0,0 +1,242 @@ +# ApiVideo.Api.AnalyticsV20BetaApi + +All URIs are relative to *https://ws.api.video* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getAggregatedMetrics**](AnalyticsV20BetaApi.md#getaggregatedmetrics) | **GET** /data/metrics/{metric}/{aggregation} | Retrieve aggregated metrics +[**getMetricsBreakdown**](AnalyticsV20BetaApi.md#getmetricsbreakdown) | **GET** /data/buckets/{metric}/{breakdown} | Retrieve metrics in a breakdown of dimensions +[**getMetricsOverTime**](AnalyticsV20BetaApi.md#getmetricsovertime) | **GET** /data/timeseries/{metric} | Retrieve metrics over time + + + +# **getAggregatedMetrics** +> AnalyticsAggregatedMetricsResponse getAggregatedMetrics (string metric, string aggregation, DateTime? from = null, DateTime? to = null, string filterBy = null) + +Retrieve aggregated metrics + +Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. + +### Example +```csharp +using System.Diagnostics; +using ApiVideo.Client; + +namespace Example +{ + public class getAggregatedMetricsExample + { + public static void Main() + { + var basePath = ApiVideoClient.Client.Environment.SANDBOX; + var apiKey = "YOUR_API_KEY"; + + var apiInstance = new ApiVideoClient(apiKey,basePath); + + var metric = metric_example; // 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. + var aggregation = aggregation_example; // 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. + var from = 2024-02-05T00:00:00+01:00; // 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 365 days ago, and April 1st 2024. - 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) + var to = 2024-02-06T00:00:00+01:00; // 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) + var filterBy = filterBy[continent]=EU&filterBy[country]=FR&filterBy[browser]=Safari&filterBy[browser]=Firefox; // string | 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`. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + var apiAnalyticsV20BetaInstance = apiInstance.AnalyticsV20Beta(); + try + { + // Retrieve aggregated metrics + AnalyticsAggregatedMetricsResponse result = apiAnalyticsV20BetaInstance.getAggregatedMetrics(metric, aggregation, from, to, filterBy); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnalyticsV20BetaApi.getAggregatedMetrics: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +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. | + **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. | + **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 365 days ago, and April 1st 2024. - 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** | **string**| 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`. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. | [optional] + +### Return type + +[**AnalyticsAggregatedMetricsResponse**](AnalyticsAggregatedMetricsResponse.md) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **400** | Bad request error | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **404** | Unrecognized request URL | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **429** | Too Many Requests | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **getMetricsBreakdown** +> AnalyticsMetricsBreakdownResponse getMetricsBreakdown (string metric, string breakdown, DateTime? from = null, DateTime? to = null, string filterBy = null) + +Retrieve metrics in a breakdown of dimensions + +Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. + +### Example +```csharp +using System.Diagnostics; +using ApiVideo.Client; + +namespace Example +{ + public class getMetricsBreakdownExample + { + public static void Main() + { + var basePath = ApiVideoClient.Client.Environment.SANDBOX; + var apiKey = "YOUR_API_KEY"; + + var apiInstance = new ApiVideoClient(apiKey,basePath); + + var metric = metric_example; // 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. + var breakdown = breakdown_example; // 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. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. + var from = 2024-02-05T00:00:00+01:00; // 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 365 days ago, and April 1st 2024. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + var to = 2024-02-06T00:00:00+01:00; // 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) + var filterBy = filterBy[continent]=EU&filterBy[country]=FR&filterBy[browser]=Safari&filterBy[browser]=Firefox; // string | 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + var apiAnalyticsV20BetaInstance = apiInstance.AnalyticsV20Beta(); + try + { + // Retrieve metrics in a breakdown of dimensions + AnalyticsMetricsBreakdownResponse result = apiAnalyticsV20BetaInstance.getMetricsBreakdown(metric, breakdown, from, to, filterBy); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnalyticsV20BetaApi.getMetricsBreakdown: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +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. | + **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. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. | + **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 365 days ago, and April 1st 2024. - 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** | **string**| 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. | [optional] + +### Return type + +[**AnalyticsMetricsBreakdownResponse**](AnalyticsMetricsBreakdownResponse.md) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **400** | Bad request error | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **404** | Unrecognized request URL | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **429** | Too Many Requests | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **getMetricsOverTime** +> AnalyticsMetricsOverTimeResponse getMetricsOverTime (string metric, DateTime? from = null, DateTime? to = null, DateTime? interval = null, string filterBy = null) + +Retrieve metrics over time + +Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred + +### Example +```csharp +using System.Diagnostics; +using ApiVideo.Client; + +namespace Example +{ + public class getMetricsOverTimeExample + { + public static void Main() + { + var basePath = ApiVideoClient.Client.Environment.SANDBOX; + var apiKey = "YOUR_API_KEY"; + + var apiInstance = new ApiVideoClient(apiKey,basePath); + + var metric = metric_example; // 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. + var from = from=2024-02-05T00:00:00+01:00; // 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 365 days ago, and April 1st 2024. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + var to = to=2024-02-06T00:00:00+01:00; // 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) + var interval = to=2024-02-06T00:00:00+01:00; // DateTime? | 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) + var filterBy = filterBy[continent]=EU&filterBy[country]=FR&filterBy[browser]=Safari&filterBy[browser]=Firefox; // string | 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + var apiAnalyticsV20BetaInstance = apiInstance.AnalyticsV20Beta(); + try + { + // Retrieve metrics over time + AnalyticsMetricsOverTimeResponse result = apiAnalyticsV20BetaInstance.getMetricsOverTime(metric, from, to, interval, filterBy); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling AnalyticsV20BetaApi.getMetricsOverTime: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +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. | + **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 365 days ago, and April 1st 2024. - 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** | **DateTime?**| 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** | **string**| 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. | [optional] + +### Return type + +[**AnalyticsMetricsOverTimeResponse**](AnalyticsMetricsOverTimeResponse.md) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **400** | Bad request error | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **404** | Unrecognized request URL | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +| **429** | Too Many Requests | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/UnrecognizedRequestUrl.md b/docs/UnrecognizedRequestUrl.md new file mode 100644 index 0000000..a1817ca --- /dev/null +++ b/docs/UnrecognizedRequestUrl.md @@ -0,0 +1,12 @@ +# ApiVideo.Model.UnrecognizedRequestUrl + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/src/Api/AnalyticsApi.cs b/src/Api/AnalyticsApi.cs index eb16d76..be90e9e 100644 --- a/src/Api/AnalyticsApi.cs +++ b/src/Api/AnalyticsApi.cs @@ -40,7 +40,7 @@ public AnalyticsApi(ApiClient apiClient) } /// - /// Get play events for live stream Retrieve filtered analytics about the number of plays for your live streams in a project. + /// Get play events for live stream Retrieve filtered analytics about the number of plays for your live streams in a project. This endpoint will be deprecated with the release of Analytics v2.0. /// /// Thrown when fails to make API call /// 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. @@ -51,6 +51,7 @@ public AnalyticsApi(ApiClient apiClient) /// Results per page. Allowed values 1-100, default is 25. (optional, default to 25) /// AnalyticsPlaysResponse + [Obsolete] public AnalyticsPlaysResponse getLiveStreamsPlays(DateTime from, string dimension, DateTime? to = default, string filter = default, int? currentPage = default, int? pageSize = default) { ApiResponse localVarResponse = getLiveStreamsPlaysWithHttpInfo(from, dimension, to, filter, currentPage, pageSize); @@ -58,7 +59,7 @@ public AnalyticsPlaysResponse getLiveStreamsPlays(DateTime from, string dimensio } /// - /// Get play events for live stream Retrieve filtered analytics about the number of plays for your live streams in a project. + /// Get play events for live stream Retrieve filtered analytics about the number of plays for your live streams in a project. This endpoint will be deprecated with the release of Analytics v2.0. /// /// Thrown when fails to make API call /// 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. @@ -69,6 +70,7 @@ public AnalyticsPlaysResponse getLiveStreamsPlays(DateTime from, string dimensio /// Results per page. Allowed values 1-100, default is 25. (optional, default to 25) /// ApiResponse of AnalyticsPlaysResponse + [Obsolete] public ApiResponse getLiveStreamsPlaysWithHttpInfo(DateTime from, string dimension, DateTime? to = default, string filter = default, int? currentPage = default, int? pageSize = default) { @@ -130,11 +132,12 @@ public ApiResponse getLiveStreamsPlaysWithHttpInfo(DateT /// - /// Retrieve filtered analytics about the number of plays for your live streams in a project. + /// Retrieve filtered analytics about the number of plays for your live streams in a project. This endpoint will be deprecated with the release of Analytics v2.0. /// /// 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) /// 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) /// APIgetLiveStreamsPlaysRequest + [Obsolete] public APIgetLiveStreamsPlaysRequest getLiveStreamsPlays(DateTime from, string dimension) { return new APIgetLiveStreamsPlaysRequest(this,from, dimension); } @@ -210,6 +213,7 @@ public APIgetLiveStreamsPlaysRequest PageSize(int? pageSize) { /// Execute getLiveStreamsPlays request /// /// AnalyticsPlaysResponse + [Obsolete] public Page execute(){ ApiResponse localVarResp = this.currentApiInstance.getLiveStreamsPlaysWithHttpInfo(from, dimension, to, filter, currentPage, pageSize); return new Page(localVarResp.Data.data, localVarResp.Data.pagination, () => { @@ -231,7 +235,7 @@ private APIgetLiveStreamsPlaysRequest copy() { } } /// - /// Get play events for video Retrieve filtered analytics about the number of plays for your videos in a project. + /// Get play events for video Retrieve filtered analytics about the number of plays for your videos in a project. This endpoint will be deprecated with the release of Analytics v2.0. /// /// Thrown when fails to make API call /// 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. @@ -242,6 +246,7 @@ private APIgetLiveStreamsPlaysRequest copy() { /// Results per page. Allowed values 1-100, default is 25. (optional, default to 25) /// AnalyticsPlaysResponse + [Obsolete] public AnalyticsPlaysResponse getVideosPlays(DateTime from, string dimension, DateTime? to = default, string filter = default, int? currentPage = default, int? pageSize = default) { ApiResponse localVarResponse = getVideosPlaysWithHttpInfo(from, dimension, to, filter, currentPage, pageSize); @@ -249,7 +254,7 @@ public AnalyticsPlaysResponse getVideosPlays(DateTime from, string dimension, Da } /// - /// Get play events for video Retrieve filtered analytics about the number of plays for your videos in a project. + /// Get play events for video Retrieve filtered analytics about the number of plays for your videos in a project. This endpoint will be deprecated with the release of Analytics v2.0. /// /// Thrown when fails to make API call /// 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. @@ -260,6 +265,7 @@ public AnalyticsPlaysResponse getVideosPlays(DateTime from, string dimension, Da /// Results per page. Allowed values 1-100, default is 25. (optional, default to 25) /// ApiResponse of AnalyticsPlaysResponse + [Obsolete] public ApiResponse getVideosPlaysWithHttpInfo(DateTime from, string dimension, DateTime? to = default, string filter = default, int? currentPage = default, int? pageSize = default) { @@ -321,11 +327,12 @@ public ApiResponse getVideosPlaysWithHttpInfo(DateTime f /// - /// Retrieve filtered analytics about the number of plays for your videos in a project. + /// Retrieve filtered analytics about the number of plays for your videos in a project. This endpoint will be deprecated with the release of Analytics v2.0. /// /// 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) /// 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) /// APIgetVideosPlaysRequest + [Obsolete] public APIgetVideosPlaysRequest getVideosPlays(DateTime from, string dimension) { return new APIgetVideosPlaysRequest(this,from, dimension); } @@ -401,6 +408,7 @@ public APIgetVideosPlaysRequest PageSize(int? pageSize) { /// Execute getVideosPlays request /// /// AnalyticsPlaysResponse + [Obsolete] public Page execute(){ ApiResponse localVarResp = this.currentApiInstance.getVideosPlaysWithHttpInfo(from, dimension, to, filter, currentPage, pageSize); return new Page(localVarResp.Data.data, localVarResp.Data.pagination, () => { diff --git a/src/Api/AnalyticsV20BetaApi.cs b/src/Api/AnalyticsV20BetaApi.cs new file mode 100644 index 0000000..41a8032 --- /dev/null +++ b/src/Api/AnalyticsV20BetaApi.cs @@ -0,0 +1,575 @@ +/* + * api.video + * + * api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes. + * + * The version of the OpenAPI document: 1 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading; +using System.IO; +using ApiVideo.Upload; +using RestSharp; +using ApiVideo.Client; +using ApiVideo.Model; + +namespace ApiVideo.Api +{ + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public class AnalyticsV20BetaApi + { + /// + /// Api Client Instance + /// + public ApiClient ApiClient {get; set;} + + /// + /// Initializes a new instance of the class. + /// + /// + public AnalyticsV20BetaApi(ApiClient apiClient) + { + this.ApiClient = apiClient; + } + + /// + /// Retrieve aggregated metrics Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. + /// + /// Thrown when fails to make API call + /// 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. +/// 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. +/// 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 365 days ago, and April 1st 2024. - 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) +/// 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) +/// 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`. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + + /// AnalyticsAggregatedMetricsResponse + public AnalyticsAggregatedMetricsResponse getAggregatedMetrics(string metric, string aggregation, DateTime? from = default, DateTime? to = default, string filterBy = default) + { + ApiResponse localVarResponse = getAggregatedMetricsWithHttpInfo(metric, aggregation, from, to, filterBy); + return localVarResponse.Data; + } + + /// + /// Retrieve aggregated metrics Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. + /// + /// Thrown when fails to make API call + /// 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. +/// 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. +/// 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 365 days ago, and April 1st 2024. - 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) +/// 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) +/// 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`. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + + /// ApiResponse of AnalyticsAggregatedMetricsResponse + public ApiResponse getAggregatedMetricsWithHttpInfo(string metric, string aggregation, DateTime? from = default, DateTime? to = default, string filterBy = default) + { + + + + + + // verify the required parameter 'metric' is set + if (metric == null) + throw new ApiException(400, "Missing required parameter 'metric' when calling AnalyticsV20BetaApi->getAggregatedMetrics"); + // verify the required parameter 'aggregation' is set + if (aggregation == null) + throw new ApiException(400, "Missing required parameter 'aggregation' when calling AnalyticsV20BetaApi->getAggregatedMetrics"); + + + var localVarPath = "/data/metrics/{metric}/{aggregation}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (metric != null) localVarPathParams.Add("metric", this.ApiClient.ParameterToString(metric)); // path parameter + if (aggregation != null) localVarPathParams.Add("aggregation", this.ApiClient.ParameterToString(aggregation)); // path parameter + if (from != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "from", from)); // query parameter + if (to != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "to", to)); // query parameter + if (filterBy != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "filterBy", filterBy)); // query parameter + + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (AnalyticsAggregatedMetricsResponse) this.ApiClient.Deserialize(localVarResponse, typeof(AnalyticsAggregatedMetricsResponse))); + + } + + + /// + /// Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. + /// + /// 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) + /// 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) + /// APIgetAggregatedMetricsRequest + public APIgetAggregatedMetricsRequest getAggregatedMetrics(string metric, string aggregation) { + return new APIgetAggregatedMetricsRequest(this,metric, aggregation); + } + + /// + /// Request getAggregatedMetrics class to get paginated list of items + /// + public class APIgetAggregatedMetricsRequest { + private string metric; + private string aggregation; + private DateTime? from; + private DateTime? to; + private string filterBy; + + private AnalyticsV20BetaApi currentApiInstance; + + /// + /// Class constructor with api instance + /// + /// Instance of the current api + /// 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) + /// 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) + public APIgetAggregatedMetricsRequest(AnalyticsV20BetaApi instance, string metric, string aggregation) { + this.metric = metric; + this.aggregation = aggregation; + this.currentApiInstance = instance; + } + + /// + /// Set from + /// + /// 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 365 days ago, and April 1st 2024. - 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) + /// APIgetAggregatedMetricsRequest + public APIgetAggregatedMetricsRequest From(DateTime? from) { + this.from = from; + return this; + } + + /// + /// Set to + /// + /// 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) + /// APIgetAggregatedMetricsRequest + public APIgetAggregatedMetricsRequest To(DateTime? to) { + this.to = to; + return this; + } + + /// + /// Set filterBy + /// + /// 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`. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + /// APIgetAggregatedMetricsRequest + public APIgetAggregatedMetricsRequest FilterBy(string filterBy) { + this.filterBy = filterBy; + return this; + } + + + + /// + /// Execute getAggregatedMetrics request + /// + /// AnalyticsAggregatedMetricsResponse + public Page<> execute(){ + ApiResponse localVarResp = this.currentApiInstance.getAggregatedMetricsWithHttpInfo(metric, aggregation, from, to, filterBy); + return new Page<>(localVarResp.Data.data, localVarResp.Data.pagination, () => { + try { + return copy().CurrentPage((currentPage == null ? 1 : currentPage) + 1).execute(); + } catch (ApiException e) { + throw new Exception(e.Message); + } + }); + } + + private APIgetAggregatedMetricsRequest copy() { + APIgetAggregatedMetricsRequest copy = new APIgetAggregatedMetricsRequest( this.currentApiInstance, metric, aggregation); + copy.From(from); + copy.To(to); + copy.FilterBy(filterBy); + return copy; + } + } + /// + /// Retrieve metrics in a breakdown of dimensions Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. + /// + /// Thrown when fails to make API call + /// 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. +/// 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. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. +/// 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 365 days ago, and April 1st 2024. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) +/// 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) +/// 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + + /// AnalyticsMetricsBreakdownResponse + public AnalyticsMetricsBreakdownResponse getMetricsBreakdown(string metric, string breakdown, DateTime? from = default, DateTime? to = default, string filterBy = default) + { + ApiResponse localVarResponse = getMetricsBreakdownWithHttpInfo(metric, breakdown, from, to, filterBy); + return localVarResponse.Data; + } + + /// + /// Retrieve metrics in a breakdown of dimensions Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. + /// + /// Thrown when fails to make API call + /// 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. +/// 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. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. +/// 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 365 days ago, and April 1st 2024. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) +/// 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) +/// 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + + /// ApiResponse of AnalyticsMetricsBreakdownResponse + public ApiResponse getMetricsBreakdownWithHttpInfo(string metric, string breakdown, DateTime? from = default, DateTime? to = default, string filterBy = default) + { + + + + + + // verify the required parameter 'metric' is set + if (metric == null) + throw new ApiException(400, "Missing required parameter 'metric' when calling AnalyticsV20BetaApi->getMetricsBreakdown"); + // verify the required parameter 'breakdown' is set + if (breakdown == null) + throw new ApiException(400, "Missing required parameter 'breakdown' when calling AnalyticsV20BetaApi->getMetricsBreakdown"); + + + var localVarPath = "/data/buckets/{metric}/{breakdown}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (metric != null) localVarPathParams.Add("metric", this.ApiClient.ParameterToString(metric)); // path parameter + if (breakdown != null) localVarPathParams.Add("breakdown", this.ApiClient.ParameterToString(breakdown)); // path parameter + if (from != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "from", from)); // query parameter + if (to != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "to", to)); // query parameter + if (filterBy != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "filterBy", filterBy)); // query parameter + + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (AnalyticsMetricsBreakdownResponse) this.ApiClient.Deserialize(localVarResponse, typeof(AnalyticsMetricsBreakdownResponse))); + + } + + + /// + /// Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. + /// + /// 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) + /// 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. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (required) + /// APIgetMetricsBreakdownRequest + public APIgetMetricsBreakdownRequest getMetricsBreakdown(string metric, string breakdown) { + return new APIgetMetricsBreakdownRequest(this,metric, breakdown); + } + + /// + /// Request getMetricsBreakdown class to get paginated list of items + /// + public class APIgetMetricsBreakdownRequest { + private string metric; + private string breakdown; + private DateTime? from; + private DateTime? to; + private string filterBy; + + private AnalyticsV20BetaApi currentApiInstance; + + /// + /// Class constructor with api instance + /// + /// Instance of the current api + /// 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) + /// 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. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (required) + public APIgetMetricsBreakdownRequest(AnalyticsV20BetaApi instance, string metric, string breakdown) { + this.metric = metric; + this.breakdown = breakdown; + this.currentApiInstance = instance; + } + + /// + /// Set from + /// + /// 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 365 days ago, and April 1st 2024. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + /// APIgetMetricsBreakdownRequest + public APIgetMetricsBreakdownRequest From(DateTime? from) { + this.from = from; + return this; + } + + /// + /// Set to + /// + /// 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) + /// APIgetMetricsBreakdownRequest + public APIgetMetricsBreakdownRequest To(DateTime? to) { + this.to = to; + return this; + } + + /// + /// Set filterBy + /// + /// 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + /// APIgetMetricsBreakdownRequest + public APIgetMetricsBreakdownRequest FilterBy(string filterBy) { + this.filterBy = filterBy; + return this; + } + + + + /// + /// Execute getMetricsBreakdown request + /// + /// AnalyticsMetricsBreakdownResponse + public Page execute(){ + ApiResponse localVarResp = this.currentApiInstance.getMetricsBreakdownWithHttpInfo(metric, breakdown, from, to, filterBy); + return new Page(localVarResp.Data.data, localVarResp.Data.pagination, () => { + try { + return copy().CurrentPage((currentPage == null ? 1 : currentPage) + 1).execute(); + } catch (ApiException e) { + throw new Exception(e.Message); + } + }); + } + + private APIgetMetricsBreakdownRequest copy() { + APIgetMetricsBreakdownRequest copy = new APIgetMetricsBreakdownRequest( this.currentApiInstance, metric, breakdown); + copy.From(from); + copy.To(to); + copy.FilterBy(filterBy); + return copy; + } + } + /// + /// Retrieve metrics over time Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred + /// + /// Thrown when fails to make API call + /// 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. +/// 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 365 days ago, and April 1st 2024. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) +/// 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) +/// 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) +/// 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + + /// AnalyticsMetricsOverTimeResponse + public AnalyticsMetricsOverTimeResponse getMetricsOverTime(string metric, DateTime? from = default, DateTime? to = default, DateTime? interval = default, string filterBy = default) + { + ApiResponse localVarResponse = getMetricsOverTimeWithHttpInfo(metric, from, to, interval, filterBy); + return localVarResponse.Data; + } + + /// + /// Retrieve metrics over time Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred + /// + /// Thrown when fails to make API call + /// 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. +/// 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 365 days ago, and April 1st 2024. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) +/// 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) +/// 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) +/// 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + + /// ApiResponse of AnalyticsMetricsOverTimeResponse + public ApiResponse getMetricsOverTimeWithHttpInfo(string metric, DateTime? from = default, DateTime? to = default, DateTime? interval = default, string filterBy = default) + { + + + + + + // verify the required parameter 'metric' is set + if (metric == null) + throw new ApiException(400, "Missing required parameter 'metric' when calling AnalyticsV20BetaApi->getMetricsOverTime"); + + + var localVarPath = "/data/timeseries/{metric}"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + string[] localVarContentTypes = new string[] { + }; + string localVarContentType = ApiClient.SelectHeaderContentType(localVarContentTypes); + localVarHeaderParams.Add("Content-Type", localVarContentType); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = new string[] { + "application/json" + }; + string localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (metric != null) localVarPathParams.Add("metric", this.ApiClient.ParameterToString(metric)); // path parameter + if (from != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "from", from)); // query parameter + if (to != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "to", to)); // query parameter + if (interval != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "interval", interval)); // query parameter + if (filterBy != null) localVarQueryParams.AddRange(this.ApiClient.ParameterToKeyValuePairs("", "filterBy", filterBy)); // query parameter + + + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + (AnalyticsMetricsOverTimeResponse) this.ApiClient.Deserialize(localVarResponse, typeof(AnalyticsMetricsOverTimeResponse))); + + } + + + /// + /// Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred + /// + /// 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) + /// APIgetMetricsOverTimeRequest + public APIgetMetricsOverTimeRequest getMetricsOverTime(string metric) { + return new APIgetMetricsOverTimeRequest(this,metric); + } + + /// + /// Request getMetricsOverTime class to get paginated list of items + /// + public class APIgetMetricsOverTimeRequest { + private string metric; + private DateTime? from; + private DateTime? to; + private DateTime? interval; + private string filterBy; + + private AnalyticsV20BetaApi currentApiInstance; + + /// + /// Class constructor with api instance + /// + /// Instance of the current api + /// 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) + public APIgetMetricsOverTimeRequest(AnalyticsV20BetaApi instance, string metric) { + this.metric = metric; + this.currentApiInstance = instance; + } + + /// + /// Set from + /// + /// 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 365 days ago, and April 1st 2024. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + /// APIgetMetricsOverTimeRequest + public APIgetMetricsOverTimeRequest From(DateTime? from) { + this.from = from; + return this; + } + + /// + /// Set to + /// + /// 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) + /// APIgetMetricsOverTimeRequest + public APIgetMetricsOverTimeRequest To(DateTime? to) { + this.to = to; + return this; + } + + /// + /// Set interval + /// + /// 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) + /// APIgetMetricsOverTimeRequest + public APIgetMetricsOverTimeRequest Interval(DateTime? interval) { + this.interval = interval; + return this; + } + + /// + /// Set filterBy + /// + /// 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. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. 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/). 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/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + /// APIgetMetricsOverTimeRequest + public APIgetMetricsOverTimeRequest FilterBy(string filterBy) { + this.filterBy = filterBy; + return this; + } + + + + /// + /// Execute getMetricsOverTime request + /// + /// AnalyticsMetricsOverTimeResponse + public Page execute(){ + ApiResponse localVarResp = this.currentApiInstance.getMetricsOverTimeWithHttpInfo(metric, from, to, interval, filterBy); + return new Page(localVarResp.Data.data, localVarResp.Data.pagination, () => { + try { + return copy().CurrentPage((currentPage == null ? 1 : currentPage) + 1).execute(); + } catch (ApiException e) { + throw new Exception(e.Message); + } + }); + } + + private APIgetMetricsOverTimeRequest copy() { + APIgetMetricsOverTimeRequest copy = new APIgetMetricsOverTimeRequest( this.currentApiInstance, metric); + copy.From(from); + copy.To(to); + copy.Interval(interval); + copy.FilterBy(filterBy); + return copy; + } + } + + } + +} diff --git a/src/ApiVideo.cs b/src/ApiVideo.cs index 3715f16..ec88a24 100644 --- a/src/ApiVideo.cs +++ b/src/ApiVideo.cs @@ -9,6 +9,7 @@ namespace ApiVideo.Client public class ApiVideoClient { private readonly ApiClient apiClient; private readonly AnalyticsApi analytics; + private readonly AnalyticsV20BetaApi analyticsV20Beta; private readonly CaptionsApi captions; private readonly ChaptersApi chapters; private readonly LiveStreamsApi liveStreams; @@ -65,6 +66,7 @@ public ApiVideoClient(RestClient client) : this(new ApiClient(client)) private ApiVideoClient(ApiClient apiClient) { this.apiClient = apiClient; this.analytics = new AnalyticsApi(this.apiClient); + this.analyticsV20Beta = new AnalyticsV20BetaApi(this.apiClient); this.captions = new CaptionsApi(this.apiClient); this.chapters = new ChaptersApi(this.apiClient); this.liveStreams = new LiveStreamsApi(this.apiClient); @@ -84,6 +86,14 @@ public AnalyticsApi Analytics() { return this.analytics; } + /// + /// Get an AnalyticsV20BetaApi instance + /// + /// AnalyticsV20BetaApi + public AnalyticsV20BetaApi AnalyticsV20Beta() { + return this.analyticsV20Beta; + } + /// /// Get an CaptionsApi instance /// diff --git a/src/Model/AnalyticsAggregatedMetricsResponse.cs b/src/Model/AnalyticsAggregatedMetricsResponse.cs new file mode 100644 index 0000000..286a9d9 --- /dev/null +++ b/src/Model/AnalyticsAggregatedMetricsResponse.cs @@ -0,0 +1,51 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class AnalyticsAggregatedMetricsResponse { + /// + /// Gets or Sets Context + /// + [DataMember(Name="context", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "context")] + public AnalyticsAggregatedMetricsResponseContext context { get; set; } + /// + /// Gets or Sets Data + /// + [DataMember(Name="data", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "data")] + public float data { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsAggregatedMetricsResponse {\n"); + sb.Append(" Context: ").Append(context).Append("\n"); + sb.Append(" Data: ").Append(data).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/AnalyticsAggregatedMetricsResponseContext.cs b/src/Model/AnalyticsAggregatedMetricsResponseContext.cs new file mode 100644 index 0000000..1247cbe --- /dev/null +++ b/src/Model/AnalyticsAggregatedMetricsResponseContext.cs @@ -0,0 +1,60 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class AnalyticsAggregatedMetricsResponseContext { + /// + /// Returns the metric you selected. + /// + /// Returns the metric you selected. + [DataMember(Name="metric", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "metric")] + public string metric { get; set; } + /// + /// Returns the aggregation you selected. + /// + /// Returns the aggregation you selected. + [DataMember(Name="aggregation", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "aggregation")] + public string aggregation { get; set; } + /// + /// Gets or Sets Timeframe + /// + [DataMember(Name="timeframe", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "timeframe")] + public AnalyticsAggregatedMetricsResponseContextTimeframe timeframe { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsAggregatedMetricsResponseContext {\n"); + sb.Append(" Metric: ").Append(metric).Append("\n"); + sb.Append(" Aggregation: ").Append(aggregation).Append("\n"); + sb.Append(" Timeframe: ").Append(timeframe).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.cs b/src/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.cs new file mode 100644 index 0000000..0ee73e0 --- /dev/null +++ b/src/Model/AnalyticsAggregatedMetricsResponseContextTimeframe.cs @@ -0,0 +1,53 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// Returns the starting and ending date-times of the period you want analytics for. + /// + [DataContract] + public class AnalyticsAggregatedMetricsResponseContextTimeframe { + /// + /// Returns the starting date-time of the period you want analytics for in ATOM date-time format. + /// + /// Returns the starting date-time of the period you want analytics for in ATOM date-time format. + [DataMember(Name="from", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "from")] + public DateTime? from { get; set; } + /// + /// Returns the starting date-time of the period you want analytics for in ATOM date-time format. + /// + /// Returns the starting date-time of the period you want analytics for in ATOM date-time format. + [DataMember(Name="to", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "to")] + public DateTime? to { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsAggregatedMetricsResponseContextTimeframe {\n"); + sb.Append(" From: ").Append(from).Append("\n"); + sb.Append(" To: ").Append(to).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/AnalyticsMetricsBreakdownResponse.cs b/src/Model/AnalyticsMetricsBreakdownResponse.cs new file mode 100644 index 0000000..2a10682 --- /dev/null +++ b/src/Model/AnalyticsMetricsBreakdownResponse.cs @@ -0,0 +1,59 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class AnalyticsMetricsBreakdownResponse { + /// + /// Gets or Sets Context + /// + [DataMember(Name="context", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "context")] + public AnalyticsMetricsBreakdownResponseContext context { get; set; } + /// + /// Returns an array of dimensions and their respective metrics. + /// + /// Returns an array of dimensions and their respective metrics. + [DataMember(Name="data", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "data")] + public List data { get; set; } + /// + /// Gets or Sets Pagination + /// + [DataMember(Name="pagination", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "pagination")] + public Pagination pagination { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsMetricsBreakdownResponse {\n"); + sb.Append(" Context: ").Append(context).Append("\n"); + sb.Append(" Data: ").Append(data).Append("\n"); + sb.Append(" Pagination: ").Append(pagination).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/AnalyticsMetricsBreakdownResponseContext.cs b/src/Model/AnalyticsMetricsBreakdownResponseContext.cs new file mode 100644 index 0000000..94d210d --- /dev/null +++ b/src/Model/AnalyticsMetricsBreakdownResponseContext.cs @@ -0,0 +1,60 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class AnalyticsMetricsBreakdownResponseContext { + /// + /// Returns the metric you selected. + /// + /// Returns the metric you selected. + [DataMember(Name="metric", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "metric")] + public string metric { get; set; } + /// + /// Returns the dimension you selected. + /// + /// Returns the dimension you selected. + [DataMember(Name="breakdown", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "breakdown")] + public string breakdown { get; set; } + /// + /// Gets or Sets Timeframe + /// + [DataMember(Name="timeframe", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "timeframe")] + public AnalyticsAggregatedMetricsResponseContextTimeframe timeframe { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsMetricsBreakdownResponseContext {\n"); + sb.Append(" Metric: ").Append(metric).Append("\n"); + sb.Append(" Breakdown: ").Append(breakdown).Append("\n"); + sb.Append(" Timeframe: ").Append(timeframe).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/AnalyticsMetricsBreakdownResponseData.cs b/src/Model/AnalyticsMetricsBreakdownResponseData.cs new file mode 100644 index 0000000..678cb11 --- /dev/null +++ b/src/Model/AnalyticsMetricsBreakdownResponseData.cs @@ -0,0 +1,53 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class AnalyticsMetricsBreakdownResponseData { + /// + /// 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\". + /// + /// 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\". + [DataMember(Name="dimensionValue", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "dimensionValue")] + public string dimensionvalue { get; set; } + /// + /// Returns the data for a specific dimension value. + /// + /// Returns the data for a specific dimension value. + [DataMember(Name="metricValue", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "metricValue")] + public float metricvalue { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsMetricsBreakdownResponseData {\n"); + sb.Append(" DimensionValue: ").Append(dimensionvalue).Append("\n"); + sb.Append(" MetricValue: ").Append(metricvalue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/AnalyticsMetricsOverTimeResponse.cs b/src/Model/AnalyticsMetricsOverTimeResponse.cs new file mode 100644 index 0000000..46f9849 --- /dev/null +++ b/src/Model/AnalyticsMetricsOverTimeResponse.cs @@ -0,0 +1,59 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class AnalyticsMetricsOverTimeResponse { + /// + /// Gets or Sets Context + /// + [DataMember(Name="context", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "context")] + public AnalyticsMetricsOverTimeResponseContext context { get; set; } + /// + /// Returns an array of metrics and the timestamps . + /// + /// Returns an array of metrics and the timestamps . + [DataMember(Name="data", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "data")] + public List data { get; set; } + /// + /// Gets or Sets Pagination + /// + [DataMember(Name="pagination", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "pagination")] + public Pagination pagination { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsMetricsOverTimeResponse {\n"); + sb.Append(" Context: ").Append(context).Append("\n"); + sb.Append(" Data: ").Append(data).Append("\n"); + sb.Append(" Pagination: ").Append(pagination).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/AnalyticsMetricsOverTimeResponseContext.cs b/src/Model/AnalyticsMetricsOverTimeResponseContext.cs new file mode 100644 index 0000000..b7a4a1b --- /dev/null +++ b/src/Model/AnalyticsMetricsOverTimeResponseContext.cs @@ -0,0 +1,60 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class AnalyticsMetricsOverTimeResponseContext { + /// + /// Returns the metric you selected. + /// + /// Returns the metric you selected. + [DataMember(Name="metric", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "metric")] + public string metric { get; set; } + /// + /// Returns the interval you selected. + /// + /// Returns the interval you selected. + [DataMember(Name="interval", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "interval")] + public string interval { get; set; } + /// + /// Gets or Sets Timeframe + /// + [DataMember(Name="timeframe", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "timeframe")] + public AnalyticsAggregatedMetricsResponseContextTimeframe timeframe { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsMetricsOverTimeResponseContext {\n"); + sb.Append(" Metric: ").Append(metric).Append("\n"); + sb.Append(" Interval: ").Append(interval).Append("\n"); + sb.Append(" Timeframe: ").Append(timeframe).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/AnalyticsMetricsOverTimeResponseData.cs b/src/Model/AnalyticsMetricsOverTimeResponseData.cs new file mode 100644 index 0000000..eb05c44 --- /dev/null +++ b/src/Model/AnalyticsMetricsOverTimeResponseData.cs @@ -0,0 +1,53 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class AnalyticsMetricsOverTimeResponseData { + /// + /// 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. + /// + /// 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. + [DataMember(Name="emittedAt", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "emittedAt")] + public string emittedat { get; set; } + /// + /// Returns the data for a specific metric value. + /// + /// Returns the data for a specific metric value. + [DataMember(Name="metricValue", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "metricValue")] + public float metricvalue { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class AnalyticsMetricsOverTimeResponseData {\n"); + sb.Append(" EmittedAt: ").Append(emittedat).Append("\n"); + sb.Append(" MetricValue: ").Append(metricvalue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/src/Model/UnrecognizedRequestUrl.cs b/src/Model/UnrecognizedRequestUrl.cs new file mode 100644 index 0000000..c22eb3f --- /dev/null +++ b/src/Model/UnrecognizedRequestUrl.cs @@ -0,0 +1,61 @@ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace ApiVideo.Model { + + /// + /// + /// + [DataContract] + public class UnrecognizedRequestUrl { + /// + /// A link to the error documentation. + /// + /// A link to the error documentation. + [DataMember(Name="type", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "type")] + public string type { get; set; } + /// + /// A description of the error that occurred. + /// + /// A description of the error that occurred. + [DataMember(Name="title", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "title")] + public string title { get; set; } + /// + /// The HTTP status code. + /// + /// The HTTP status code. + [DataMember(Name="status", EmitDefaultValue=false)] + [JsonProperty(PropertyName = "status")] + public int status { get; set; } + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() { + var sb = new StringBuilder(); + sb.Append("class UnrecognizedRequestUrl {\n"); + sb.Append(" Type: ").Append(type).Append("\n"); + sb.Append(" Title: ").Append(title).Append("\n"); + sb.Append(" Status: ").Append(status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Get the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + +} +} diff --git a/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/200.json b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/200.json new file mode 100644 index 0000000..aad4f98 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/200.json @@ -0,0 +1,11 @@ +{ + "context" : { + "metric" : "impression", + "aggregation" : "count", + "timeframe" : { + "from" : "2024-05-28T11:15:07+00:00", + "to" : "2024-05-29T11:15:07+00:00" + } + }, + "data" : 346.5 +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/400-0.json b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/400-0.json new file mode 100644 index 0000000..4cbfb11 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/400-0.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/invalid-attribute", + "title" : "An attribute is invalid.", + "status" : 400, + "detail" : "This value must be of type string.", + "name" : "metric" +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/400-1.json b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/400-1.json new file mode 100644 index 0000000..061e505 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/400-1.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This field was not expected.", + "name" : "from:2024-05-20T09:15:05+02:00" +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/404.json b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/404.json new file mode 100644 index 0000000..a1ef71d --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/404.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/unrecognized-request-url", + "title" : "Unrecognized request URL.", + "status" : 404 +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/429.json b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/429.json new file mode 100644 index 0000000..d312e2b --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getAggregatedMetrics/responses/429.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/too-many-requests", + "title" : "Too many requests.", + "status" : 429 +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/200.json b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/200.json new file mode 100644 index 0000000..f5cdba3 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/200.json @@ -0,0 +1,31 @@ +{ + "context" : { + "metric" : "play", + "breakdown" : "country", + "timeframe" : { + "from" : "2024-04-28T07:15:05+00:00", + "to" : "2024-05-29T11:25:37+00:00" + } + }, + "data" : [ { + "metricValue" : 7, + "dimensionValue" : "FR" + } ], + "pagination" : { + "currentPage" : 1, + "currentPageItems" : 1, + "pageSize" : 25, + "pagesTotal" : 1, + "itemsTotal" : 1, + "links" : [ { + "rel" : "self", + "uri" : "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25" + }, { + "rel" : "first", + "uri" : "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25" + }, { + "rel" : "last", + "uri" : "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25" + } ] + } +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/400-0.json b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/400-0.json new file mode 100644 index 0000000..4cbfb11 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/400-0.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/invalid-attribute", + "title" : "An attribute is invalid.", + "status" : 400, + "detail" : "This value must be of type string.", + "name" : "metric" +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/400-1.json b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/400-1.json new file mode 100644 index 0000000..061e505 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/400-1.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This field was not expected.", + "name" : "from:2024-05-20T09:15:05+02:00" +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/404.json b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/404.json new file mode 100644 index 0000000..a1ef71d --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/404.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/unrecognized-request-url", + "title" : "Unrecognized request URL.", + "status" : 404 +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/429.json b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/429.json new file mode 100644 index 0000000..d312e2b --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsBreakdown/responses/429.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/too-many-requests", + "title" : "Too many requests.", + "status" : 429 +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/200.json b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/200.json new file mode 100644 index 0000000..b5a6342 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/200.json @@ -0,0 +1,37 @@ +{ + "context" : { + "metric" : "play", + "interval" : "hour", + "timeframe" : { + "from" : "2024-05-28T11:08:39+00:00", + "to" : "2024-05-29T11:08:39+00:00" + } + }, + "data" : [ { + "emittedAt" : "2024-05-29T07:00:00+00:00", + "metricValue" : 2 + }, { + "emittedAt" : "2024-05-29T08:00:00+00:00", + "metricValue" : 1 + }, { + "emittedAt" : "2024-05-29T09:00:00+00:00", + "metricValue" : 1 + } ], + "pagination" : { + "currentPage" : 1, + "currentPageItems" : 3, + "pageSize" : 25, + "pagesTotal" : 1, + "itemsTotal" : 3, + "links" : [ { + "rel" : "self", + "uri" : "/data/timeseries/play?currentPage=1&pageSize=25" + }, { + "rel" : "first", + "uri" : "/data/timeseries/play?currentPage=1&pageSize=25" + }, { + "rel" : "last", + "uri" : "/data/timeseries/play?currentPage=1&pageSize=25" + } ] + } +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/400-0.json b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/400-0.json new file mode 100644 index 0000000..4cbfb11 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/400-0.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/invalid-attribute", + "title" : "An attribute is invalid.", + "status" : 400, + "detail" : "This value must be of type string.", + "name" : "metric" +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/400-1.json b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/400-1.json new file mode 100644 index 0000000..061e505 --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/400-1.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This field was not expected.", + "name" : "from:2024-05-20T09:15:05+02:00" +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/404.json b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/404.json new file mode 100644 index 0000000..a1ef71d --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/404.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/unrecognized-request-url", + "title" : "Unrecognized request URL.", + "status" : 404 +} \ No newline at end of file diff --git a/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/429.json b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/429.json new file mode 100644 index 0000000..d312e2b --- /dev/null +++ b/tests/resources/payloads/analyticsv20beta/getMetricsOverTime/responses/429.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/too-many-requests", + "title" : "Too many requests.", + "status" : 429 +} \ No newline at end of file